当前位置: 首页>>代码示例>>C#>>正文


C# Value.SetValue方法代码示例

本文整理汇总了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;
        }
开发者ID:jiowchern,项目名称:Regulus,代码行数:34,代码来源:SelectStage.cs

示例2:

		Value<int> IPlayer.GetStep()
		{
			var returnValue = new Value<int>();
			
			returnValue.SetValue(StepCal.InitStep());

			return returnValue;
		}
开发者ID:kof1016,项目名称:Cluedo,代码行数:8,代码来源:GameZone.cs

示例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);
     }
 }
开发者ID:kou-yeung,项目名称:Effekseer,代码行数:9,代码来源:IO.cs

示例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();
        }
开发者ID:jiowchern,项目名称:Regulus,代码行数:9,代码来源:RemotingValueResultTest.cs

示例5: CheckMove

		Value<bool> IPlayer.Move(Neighbor.DIRECTION dir)
		{
			var returnValue = new Value<bool>();

			var result = CheckMove(dir);

			returnValue.SetValue(result);

			return result;
		}
开发者ID:kof1016,项目名称:Cluedo,代码行数:10,代码来源:GameZone.cs

示例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;
        }
开发者ID:jiowchern,项目名称:Regulus,代码行数:12,代码来源:FormulaStage.cs

示例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;
        }
开发者ID:jiowchern,项目名称:ItIsNotAGame1-Backend,代码行数:23,代码来源:Verify.cs

示例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;
        }
开发者ID:jiowchern,项目名称:Regulus,代码行数:23,代码来源:Verify.cs

示例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;
		}
开发者ID:kof1016,项目名称:Cluedo,代码行数:15,代码来源:VerifyStage.cs

示例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;
        }
开发者ID:jiowchern,项目名称:Regulus,代码行数:17,代码来源:ZsFishFormulaInitialer.cs

示例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;
        }
开发者ID:jiowchern,项目名称:Regulus,代码行数:17,代码来源:StageLoadFarmData.cs

示例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;
        }
开发者ID:jiowchern,项目名称:Regulus,代码行数:14,代码来源:Server.cs

示例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;
        }
开发者ID:jiowchern,项目名称:Regulus,代码行数:18,代码来源:Server.cs

示例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); };
 }
开发者ID:jiowchern,项目名称:Regulus,代码行数:5,代码来源:OfflineStage.cs

示例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;
 }
开发者ID:jiowchern,项目名称:ItIsNotAGame1-Backend,代码行数:7,代码来源:Server.cs


注:本文中的Value.SetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。