本文整理汇总了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);
}
}
示例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();
}
示例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;
}
}