本文整理汇总了C#中Value.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Value.SetValue方法的具体用法?C# Value.SetValue怎么用?C# Value.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Value
的用法示例。
在下文中一共展示了Value.SetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoneEvent
Value<bool> ILevelSelector.Select(int level)
{
if(_Check(level) == false)
{
return false;
}
if(_Querying == false)
{
_Querying = true;
var val = new Value<bool>();
checked
{
_FishStageQueryer.Query(Guid.Empty, (byte)level).OnValue += fish_stage =>
{
if(fish_stage != null)
{
DoneEvent(fish_stage);
val.SetValue(true);
}
else
{
val.SetValue(false);
}
_Querying = false;
};
}
return val;
}
return false;
}
示例2:
Value<int> IPlayer.GetStep()
{
var returnValue = new Value<int>();
returnValue.SetValue(StepCal.InitStep());
return returnValue;
}
示例3: LoadFromElement
public static void LoadFromElement(XmlElement e, Value.Boolean value, bool isClip)
{
var text = e.GetText();
var parsed = false;
if (bool.TryParse(text, out parsed))
{
value.SetValue(parsed);
}
}
示例4: TestRemotingValueResult
public void TestRemotingValueResult()
{
var val = new Value<bool>();
var timer = new Timer(1);
timer.Start();
timer.Elapsed += (object sender, ElapsedEventArgs e) => { val.SetValue(true); };
val.Result();
}
示例5: CheckMove
Value<bool> IPlayer.Move(Neighbor.DIRECTION dir)
{
var returnValue = new Value<bool>();
var result = CheckMove(dir);
returnValue.SetValue(result);
return result;
}
示例6: StageLoadFarmData
Value<IFishStage> IFishStageQueryer.Query(Guid player_id, int farm_id)
{
var val = new Value<IFishStage>();
new StageLoadFarmData(_ExpansionFeature.FormulaFarmRecorder).Load(farm_id).OnValue +=
farm_data =>
{
_QueryZsFishStage(player_id, farm_data).OnValue += data => val.SetValue(data);
};
return val;
}
示例7:
Value<bool> Regulus.Project.ItIsNotAGame1.Data.IVerify.Login(string id, string password)
{
var returnValue = new Value<bool>();
var val = this._Storage.FindAccountByName(id);
val.OnValue += account =>
{
var found = account != null;
if(found && account.IsPassword(password))
{
if(this.OnDoneEvent != null)
{
this.OnDoneEvent(account);
}
returnValue.SetValue(true);
}
else
{
returnValue.SetValue(false);
}
};
return returnValue;
}
示例8: OnDoneEvent
Value<bool> IVerify.Login(string id, string password)
{
var returnValue = new Value<bool>();
var val = _Storage.FindAccountByName(id);
val.OnValue += account =>
{
var found = account != null;
if(found && account.IsPassword(password))
{
if(OnDoneEvent != null)
{
OnDoneEvent(account);
}
returnValue.SetValue(true);
}
else
{
returnValue.SetValue(false);
}
};
return returnValue;
}
示例9:
Value<bool> IVerify.Login(string id, string password)
{
var returnValue = new Value<bool>();
OnDoneEvent?.Invoke(new Account
{
Id = Guid.NewGuid(),
Password = password,
Name = "test"
});
returnValue.SetValue(true);
return returnValue;
}
示例10: Query
public Value<IFishStage> Query(Guid player_id, FishFarmData data)
{
var val = new Value<IFishStage>();
_FormulaPlayerRecorder.Query(player_id).OnValue += record =>
{
val.SetValue(
new ZsFishStage(
player_id,
data,
record,
_FormulaPlayerRecorder,
_FormulaFarmRecorder));
};
return val;
}
示例11: StroageLoad
private Value<FishFarmData> StroageLoad(int farm_id)
{
LogManager.GetCurrentClassLogger().Debug("Init farm data.");
var returnValue = new Value<FishFarmData>();
var val = _FormulaFarmRecorder.Load(farm_id);
val.OnValue += farm_data =>
{
LogManager.GetCurrentClassLogger().Debug("Load Farm Data From Stroage.");
returnValue.SetValue(farm_data);
};
LogManager.GetCurrentClassLogger().Debug("Farm data loading finish.");
return returnValue;
}
示例12: _QueryAllAccount
private Value<Account[]> _QueryAllAccount()
{
_Logger.Info().Message("QueryAllAccount From DB Start.").Write();
var val = new Value<Account[]>();
var result = _Database.FindAll<Account>();
val.SetValue(result.ToArray());
_Logger.Info().Message("QueryAllAccount From DB Finish.").Write();
return val;
}
示例13: _LoadTradeNotes
Value<bool> ITradeNotes.Write(TradeNotes.TradeData trade_data)
{
var val = new Value<bool>();
var tradeNotes = _LoadTradeNotes(trade_data.BuyerId);
if(tradeNotes == null)
{
throw new Exception("請檢查資料庫");
}
var notes = tradeNotes.SingleOrDefault();
notes.TradeDatas.Add(trade_data);
var result = _Database.Update(notes, a => a.Id);
val.SetValue(result);
return val;
}
示例14: _Connect_ConnectedEvent
private void _Connect_ConnectedEvent(string account, int password, Value<bool> result)
{
var connectResult = _Agent.Connect(account, password);
connectResult.OnValue += success => { result.SetValue(success); };
}
示例15: _QueryAllAccount
private Value<Regulus.Project.ItIsNotAGame1.Data.Account[]> _QueryAllAccount()
{
var val = new Value<Regulus.Project.ItIsNotAGame1.Data.Account[]>();
var t = _Database.Find<Regulus.Project.ItIsNotAGame1.Data.Account>(a => true);
t.ContinueWith(list => { val.SetValue(list.Result.ToArray()); });
return val;
}