本文整理汇总了C#中Nini.Config.IniConfigSource.ReplaceKeyValues方法的典型用法代码示例。如果您正苦于以下问题:C# IniConfigSource.ReplaceKeyValues方法的具体用法?C# IniConfigSource.ReplaceKeyValues怎么用?C# IniConfigSource.ReplaceKeyValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nini.Config.IniConfigSource
的用法示例。
在下文中一共展示了IniConfigSource.ReplaceKeyValues方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Checkversions
//After Asyn download complete, we proceed to parse the required version by Mooege in VersionInfo.cs.
private void Checkversions(Object sender, DownloadStringCompletedEventArgs e)
{
try
{
if (File.Exists(Diablo3UserPathSelection.Text))
{
String parseVersion = e.Result;
FileVersionInfo d3Version = FileVersionInfo.GetVersionInfo(Diablo3UserPathSelection.Text);
Int32 ParsePointer = parseVersion.IndexOf("RequiredPatchVersion = ");
String MooegeVersion = parseVersion.Substring(ParsePointer + 23, 4); //Gets required version by Mooege
MooegeSupportedVersion = MooegeVersion; //Public String to display over D3 path validation.
int CurrentD3VersionSupported = Convert.ToInt32(MooegeVersion);
int LocalD3Version = d3Version.FilePrivatePart;
//DISABLED MATCHING CLIENT VERSIONS FOR NOW.
if (LocalD3Version == CurrentD3VersionSupported || LocalD3Version != CurrentD3VersionSupported)
{
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Found the correct Mooege supported version of Diablo III [" + CurrentD3VersionSupported + "]");
Console.ForegroundColor = ConsoleColor.White;
PlayDiabloButton.Invoke(new Action(() =>
{
PlayDiabloButton.Enabled = true;
}
));
CopyMPQButton.Invoke(new Action(() =>
{
CopyMPQButton.Enabled = true;
}
));
}
//If the versions missmatch:
/*else if (LocalD3Version != CurrentD3VersionSupported)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Wrong client version FOUND!");
Console.ForegroundColor = ConsoleColor.White;
MessageBox.Show("You need Diablo III Client version [" + MooegeSupportedVersion + "] in order to play over Mooege.\nPlease Update.", "Warning",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
PlayDiabloButton.Invoke(new Action(() =>
{
PlayDiabloButton.Enabled = false;
}
));
CopyMPQButton.Invoke(new Action(() =>
{
CopyMPQButton.Enabled = false;
}
));
}*/
}
else //If the user, once a Diablo 3 client path saved, deletes the Folder or moves it to another place, we go back to blank values over Diablo 3 path.
{
IConfigSource madcowIni = new IniConfigSource(Program.madcowINI);
madcowIni.Configs["DiabloPath"].Set("D3Path", "MODIFY");
madcowIni.Configs["DiabloPath"].Set("MPQpath", "");
madcowIni.ReplaceKeyValues();
madcowIni.Save();
MessageBox.Show("Could not find Diablo III.exe, please select the proper path again.", "Warning",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
Diablo3UserPathSelection.Invoke(new Action(() => { this.Diablo3UserPathSelection.Text = "Please Select your Diablo III path."; }));
PlayDiabloButton.Invoke(new Action(() => { PlayDiabloButton.Enabled = false; }));
CopyMPQButton.Invoke(new Action(() => { CopyMPQButton.Enabled = false; }));
}
}
catch
{
Console.WriteLine("[ERROR] Internet connection failed or GitHub site is down!");
}
}