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


C# Configuration.SetValue方法代码示例

本文整理汇总了C#中Configuration.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Configuration.SetValue方法的具体用法?C# Configuration.SetValue怎么用?C# Configuration.SetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Configuration的用法示例。


在下文中一共展示了Configuration.SetValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PopulateConfig

		protected void PopulateConfig(Configuration cf)
		{
			IDictionaryEnumerator en = _values.GetEnumerator();
			while (en.MoveNext())
			{
				cf.SetValue((string) en.Key, en.Value);
			}
		}
开发者ID:ststeiger,项目名称:SyslogServer,代码行数:8,代码来源:ConfigurationTest.cs

示例2: FormBattleShip

        public FormBattleShip()
        {
            Configuration.Initialize(Environment.CurrentDirectory + "\\..");

            configuration = Configuration.Global;
            configuration.SetValue("mbc_match_rounds", "1");

            InitializeComponent();

            shipButtons[0] = button5Ship;
            shipButtons[0].ShipPiece = ShipPiece.Carrier;
            shipButtons[1] = button4Ship;
            shipButtons[1].ShipPiece = ShipPiece.Battleship;
            shipButtons[2] = button3Ship1;
            shipButtons[2].ShipPiece = ShipPiece.Cruiser;
            shipButtons[3] = button3Ship2;
            shipButtons[3].ShipPiece = ShipPiece.Sub;
            shipButtons[4] = button2Ship;
            shipButtons[4].ShipPiece = ShipPiece.Destroyer;

            showStats();

            NewMatch();
        }
开发者ID:aiclub,项目名称:Mohawk_Battleship,代码行数:24,代码来源:FormBattleship.cs

示例3: Init

        private void Init(Configuration conf, params ControllerInformation[] controllersToLoad)
        {
            this.conf = conf;
            //Get the game info from the Configuration.
            //Expecting an exception to be thrown here if a controller isn't compatible with the configured game mode.
            info = new CMatchInfo(conf, controllersToLoad);

            //Create and register the controllers to load.
            GenerateControllers(controllersToLoad);
            RegisterControllers();
            FormOpponents();

            //Configuration setting for the number of rounds this Match will perform.
            roundList = new List<Round>();
            targetRounds = conf.GetValue<int>("mbc_match_rounds");
            roundIteration = -1;
            inProgress = true;

            //Make a thread for this Match.
            runningThread = new Thread(PlayLoop);
            sleepHandle = new AutoResetEvent(false);
            isRunning = false;
            delay = 0;

            //Configuration setting for round playing behaviour, given a number of rounds.
            switch (conf.GetValue<string>("mbc_match_rounds_mode"))
            {
                case "all":
                    roundPlay = PlayMode.AllRounds;
                    break;

                case "first to":
                    roundPlay = PlayMode.FirstTo;
                    break;

                default:
                    conf.SetValue("mbc_match_rounds_mode", "all");
                    break;
            }
        }
开发者ID:J0RD1E,项目名称:Mohawk_Battleship,代码行数:40,代码来源:Match.cs


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