本文整理汇总了C#中IniFile.Write方法的典型用法代码示例。如果您正苦于以下问题:C# IniFile.Write方法的具体用法?C# IniFile.Write怎么用?C# IniFile.Write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IniFile
的用法示例。
在下文中一共展示了IniFile.Write方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: New
public static void New()
{
if (new FileInfo(Path).Exists){
return;
}
ConfigurationFile = new IniFile(Path);
ConfigurationFile.Write("Activation", Keys.O.ToString(), "Controls");
ConfigurationFile.Write("Deactivation", Keys.I.ToString(), "Controls");
ConfigurationFile.Write("RadiusIncrease", Keys.Add.ToString(), "Controls");
ConfigurationFile.Write("RadiusDecrease", Keys.Subtract.ToString(), "Controls");
}
示例2: IniFile
private void bSでレスボックスを閉じるToolStripMenuItem_Click(object sender, EventArgs e)
{
settings.CloseResBoxOnBackSpace = !settings.CloseResBoxOnBackSpace;
IniFile iniFile = new IniFile(GetCurrentDirectory() + "\\PeerstPlayer.ini");
iniFile.Write("Player", "CloseResBoxOnBackSpace", settings.CloseResBoxOnBackSpace.ToString());
}
示例3: toolStripTextBoxScale_KeyDown
/// <summary>
/// デフォルト:拡大率 入力
/// </summary>
private void toolStripTextBoxScale_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Return)
{
IniFile iniFile = new IniFile(GetCurrentDirectory() + "\\PeerstPlayer.ini");
iniFile.Write("Player", "Scale", toolStripTextBoxScale.Text);
contextMenuStripWMP.Close();
}
}
示例4: AddMap
/// <summary>
/// Adds a new map to the database and server.
/// </summary>
/// <param name="mapid">The new map id.</param>
/// <returns>Returns true if the map was added.</returns>
public static bool AddMap(ushort mapid)
{
string name = "UnknownMap" + ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next();
Maps.Map map = new ProjectX_V3_Game.Maps.Map(mapid, name);
Enums.MapTypeFlags flag = Enums.MapTypeFlags.Normal;
if (!map.Flags.TryAdd((ulong)flag, flag))
return false;
map.MapType = Enums.MapType.Normal;
IniFile ini = new IniFile(Database.ServerDatabase.DatabaseLocation + "\\MapInfo\\" + mapid + ".ini", "MapInfo");
ini.Write<ushort>("ID", mapid);
ini.WriteString("Name", name);
ini.WriteString("MapType", "Normal");
ini.SetSection("Flags");
ini.Write<int>("Count", 1);
ini.WriteString("0", "Normal");
return Core.Kernel.Maps.TryAddAndDismiss(mapid, name, map);
}
示例5: CreateNPC
/// <summary>
/// Creates a new npc and spawns it.
/// </summary>
/// <param name="id">The id of the npc.</param>
/// <param name="name">The name of the npc.</param>
/// <param name="location">The location of the npc.</param>
/// <param name="mesh">The mesh of the npc.</param>
/// <param name="avatar">The avatar of the npc.</param>
/// <param name="npctype">The type of the npc.</param>
/// <param name="flag">The flat of the npc.</param>
public static void CreateNPC(uint id, string name, Maps.MapPoint location, ushort mesh, byte avatar, Enums.NPCType npctype = Enums.NPCType.Normal, ushort flag = 2)
{
Entities.NPC npc = new ProjectX_V3_Game.Entities.NPC();
npc.EntityUID = id;
npc.Mesh = (ushort)(mesh * 10);
npc.Flag = flag;
npc.Name = name;
npc.X = location.X;
npc.Y = location.Y;
npc.NPCType = npctype;
npc.Avatar = avatar;
if (!location.Map.EnterMap(npc))
{
return;
}
if (Core.Kernel.NPCs.TryAdd(npc.EntityUID, npc))
{
IniFile npcini = new IniFile(ServerDatabase.DatabaseLocation + "\\NPCInfo\\" + id + ".ini", "Info");
npcini.WriteString("Name", name);
npcini.WriteString("Type", npctype.ToString());
npcini.Write<ushort>("MapID", location.MapID);
npcini.Write<ushort>("X", location.X);
npcini.Write<ushort>("Y", location.Y);
npcini.Write<ushort>("Flag", flag);
npcini.Write<ushort>("Mesh", mesh);
npcini.Write<byte>("Avatar", avatar);
npc.Screen.UpdateScreen(null);
}
}
示例6: toolStripTextBoxScreenMagnetDockDist_KeyDown
/// <summary>
/// スクリーン吸着範囲
/// </summary>
private void toolStripTextBoxScreenMagnetDockDist_KeyDown(object sender, KeyEventArgs e)
{
try
{
if (e.KeyCode == Keys.Return)
{
IniFile iniFile = new IniFile(GetCurrentDirectory() + "\\PeerstPlayer.ini");
iniFile.Write("Player", "ScreenMagnetDockDist", toolStripTextBoxScreenMagnetDockDist.Text);
settings.ScreenMagnetDockDist = int.Parse(toolStripTextBoxScreenMagnetDockDist.Text);
contextMenuStripWMP.Close();
}
}
catch
{
}
}
示例7: FontDialog
/// <summary>
/// 設定->フォント->フォント
/// </summary>
private void フォントToolStripMenuItem1_Click(object sender, EventArgs e)
{
FontDialog fd = new FontDialog();
fd.Font = new Font(labelDetail.Font.Name, labelDetail.Font.Size);
fd.ShowDialog();
// iniに書きだし
IniFile iniFile = new IniFile(GetCurrentDirectory() + "\\PeerstPlayer.ini");
iniFile.Write("Player", "FontSize", fd.Font.Size.ToString());
iniFile.Write("Player", "FontName", fd.Font.Name);
// 適応
SetFont(fd.Font.Name, fd.Font.Size);
}
示例8: SetAdvancedConfig
private void SetAdvancedConfig()
{
string iniFolfder = GlobalVar.GetIniFolder();
IniFile fallout4ini = new IniFile(iniFolfder + "Fallout4.ini");
IniFile fallout4pref = new IniFile(iniFolfder + "Fallout4Prefs.ini");
for (int i = 0; i < AdvancedSettings.Tables[0].Rows.Count; i++)
{
if (AdvancedSettings.Tables[0].Rows[i][5].ToString() == "true")
{
if (AdvancedSettings.Tables[0].Rows[i][6].ToString() == "false" || !string.IsNullOrWhiteSpace(AdvancedSettings.Tables[0].Rows[i][6].ToString()))
{
if (!string.IsNullOrWhiteSpace(AdvancedSettings.Tables[0].Rows[i][2].ToString()))
{
fallout4ini.Write(AdvancedSettings.Tables[0].Rows[i][1].ToString(), AdvancedSettings.Tables[0].Rows[i][2].ToString(), AdvancedSettings.Tables[0].Rows[i][0].ToString());
}
else
{
fallout4ini.Write(AdvancedSettings.Tables[0].Rows[i][1].ToString(), AdvancedSettings.Tables[0].Rows[i][4].ToString(), AdvancedSettings.Tables[0].Rows[i][0].ToString());
}
}
}
}
for(int i = 0; i< UserPrefs.Tables[0].Rows.Count; i++)
{
//5 = include
if (UserPrefs.Tables[0].Rows[i][5].ToString() == "true")
{
//6 = depricated
if (UserPrefs.Tables[0].Rows[i][6].ToString() == "false" || !string.IsNullOrWhiteSpace(UserPrefs.Tables[0].Rows[i][6].ToString()))
{
//1 = Key name,0 = Section,3 = Custom Value,4 = default value
if (!string.IsNullOrWhiteSpace(UserPrefs.Tables[0].Rows[i][2].ToString()))
{
fallout4pref.Write(UserPrefs.Tables[0].Rows[i][1].ToString(), UserPrefs.Tables[0].Rows[i][2].ToString(), UserPrefs.Tables[0].Rows[i][0].ToString());
if (UserPrefs.Tables[0].Rows[i][1].ToString() == "fVal2") {
Console.WriteToConsole("fval === "+ UserPrefs.Tables[0].Rows[i][2].ToString()); }
}
else
{
fallout4pref.Write(UserPrefs.Tables[0].Rows[i][1].ToString(), UserPrefs.Tables[0].Rows[i][4].ToString(), UserPrefs.Tables[0].Rows[i][0].ToString());
if (UserPrefs.Tables[0].Rows[i][1].ToString() == "fVal2") {
Console.WriteToConsole("fval DEF === " + UserPrefs.Tables[0].Rows[i][2].ToString()); }
}
}
}
}
if (File.Exists("./FO4Alternativelauncher/Fallout4IniDatabase.xml"))
{
File.Delete("./FO4Alternativelauncher/Fallout4IniDatabase.xml");
// DataSet adv = dataGridMainDatabase.ItemsSource as DataSet;
AdvancedSettings.WriteXml("./FO4Alternativelauncher/Fallout4IniDatabase.xml");
}
else
{
MessageBox.Show("Setting Database missing");
}
if (File.Exists("./FO4Alternativelauncher/Fallout4PrefDatabase.xml"))
{
File.Delete("./FO4Alternativelauncher/Fallout4PrefDatabase.xml");
// DataSet pref = dataGridPref.ItemsSource as DataSet;
UserPrefs.WriteXml("./FO4Alternativelauncher/Fallout4PrefDatabase.xml");
}
else
{
MessageBox.Show("Preference Database missing");
}
}
示例9: MainForm_FormClosing
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
// フォーム非表示 → 終了処理をユーザに速く見せる.
Visible = false;
// 停止
wmp.Ctlcontrols.stop();
// INI用
IniFile iniFile = new IniFile(GetCurrentDirectory() + "\\PeerstPlayer.ini");
// 位置を保存
if (settings.SaveLocationOnClose)
{
iniFile.Write("Player", "X", Left.ToString());
iniFile.Write("Player", "Y", Top.ToString());
}
// サイズを保存
if (settings.SaveSizeOnClose)
{
if (WindowState != FormWindowState.Maximized)
{
iniFile.Write("Player", "Width", Width.ToString());
iniFile.Write("Player", "Height", Height.ToString());
}
else
{
Size frame = Size - ClientSize;
int height = 0;
height += (panelResBox.Visible ? panelResBox.Height : 0);
height += (panelStatusLabel.Visible ? panelStatusLabel.Height : 0);
iniFile.Write("Player", "Width", (PanelWMPSize.Width + frame.Width).ToString());
iniFile.Write("Player", "Height", (PanelWMPSize.Height + height).ToString());
}
}
// ボリュームを保存
if (settings.SaveVolumeOnClose)
{
iniFile.Write("Player", "Volume", wmp.Volume.ToString());
}
if (settings.RlayCutOnClose)
{
// リレーを切断
pecaManager.DisconnectRelay();
}
if (settings.CloseViewerOnClose)
{
// ビューワを終了
try
{
if (ThreadViewerProcess != null)
{
ThreadViewerProcess.CloseMainWindow();
}
}
catch
{
}
}
}
示例10: ColorDialog
/// <summary>
/// 設定->フォント->色
/// </summary>
private void 色ToolStripMenuItem_Click(object sender, EventArgs e)
{
// カラーダイアログを表示
ColorDialog cd = new ColorDialog();
cd.Color = labelDetail.ForeColor;
cd.ShowDialog();
// iniに書きだし
IniFile iniFile = new IniFile(GetCurrentDirectory() + "\\PeerstPlayer.ini");
iniFile.Write("Player", "FontColorR", cd.Color.R.ToString());
iniFile.Write("Player", "FontColorG", cd.Color.G.ToString());
iniFile.Write("Player", "FontColorB", cd.Color.B.ToString());
// 適応
labelDetail.ForeColor = Color.FromArgb(255, cd.Color);
labelDuration.ForeColor = Color.FromArgb(255, cd.Color);
labelVolume.ForeColor = Color.FromArgb(255, cd.Color);
}
示例11: LoadIniFile
public static void LoadIniFile()
{
var appIniFile = new IniFile();
#region Dir Path
AppInfoStrc.DirOfApplication = Environment.CurrentDirectory;
AppInfoStrc.DirOfSchedule = appIniFile.Read("DirOfSchedule", "PATH");
if (AppInfoStrc.DirOfSchedule == "")
{
appIniFile.Write("DirOfSchedule", InitValue.InitDirOfSchedule, "PATH");
AppInfoStrc.DirOfSchedule = InitValue.InitDirOfSchedule;
}
AppInfoStrc.DirOfLog = appIniFile.Read("DirOfLog", "PATH");
if (AppInfoStrc.DirOfLog == "")
{
appIniFile.Write("DirOfLog", InitValue.InitDirOfLog, "PATH");
AppInfoStrc.DirOfLog = InitValue.InitDirOfLog;
}
AppInfoStrc.DirOfContents = appIniFile.Read("DirOfContents", "PATH");
if (AppInfoStrc.DirOfContents == "")
{
appIniFile.Write("DirOfContents", InitValue.DirOfContents, "PATH");
AppInfoStrc.DirOfContents = InitValue.DirOfContents;
}
#endregion
#region Server connectoion Info
AppInfoStrc.UrlOfServer = appIniFile.Read("UrlOfServer", "SERVER");
if (AppInfoStrc.UrlOfServer == "")
{
appIniFile.Write("UrlOfServer", InitValue.InitUrlOfServer, "SERVER");
AppInfoStrc.UrlOfServer = InitValue.InitUrlOfServer;
}
AppInfoStrc.ExtentionOfServer = appIniFile.Read("ExtentionOfServer", "SERVER");
if (AppInfoStrc.ExtentionOfServer == "")
{
appIniFile.Write("ExtentionOfServer", InitValue.InitExtensionOfServer, "SERVER");
AppInfoStrc.ExtentionOfServer = InitValue.InitExtensionOfServer;
}
AppInfoStrc.PortOfServer = appIniFile.Read("PortOfServer", "SERVER");
if (AppInfoStrc.PortOfServer == "")
{
appIniFile.Write("PortOfServer", InitValue.InitPortOfServer, "SERVER");
AppInfoStrc.PortOfServer = InitValue.InitPortOfServer;
}
#endregion
#region Player Info
AppInfoStrc.PlayerId = appIniFile.Read("PlayerID", "PLAYER");
if (AppInfoStrc.PlayerId == "")
{
appIniFile.Write("PlayerID", "", "PLAYER");
}
#endregion
}
示例12: saveToolStripMenuItem_Click
private void saveToolStripMenuItem_Click( object sender, EventArgs e )
{
var prefsConfigFile = new IniFile( PrefsConfigFile );
var configFile = new IniFile( ConfigFile );
#region Visuals
var visuDof = VisualsDoF.Checked ? "1" : "0";
var visuLf = VisualsLensflare.Checked ? "1" : "0";
var visuGore = VisualsGore.Checked ? "1" : "0";
var visuBlood = VisualsScreenBlood.Checked ? "1" : "0";
var visuRadBlur = VisualsRadialBlur.Checked ? "1" : "0";
prefsConfigFile.Write( "Imagespace", "bDoDepthOfField", visuDof );
prefsConfigFile.Write( "Imagespace", "bLensFlare", visuLf );
configFile.Write( "General", "bDisableAllGore", visuGore );
configFile.Write( "ScreenSplatter", "bBloodSplatterEnabled", visuBlood );
configFile.Write( "ImageSpace", "bDoRadialBlur", visuRadBlur );
var visWatObj = VisualWaterObjects.Checked ? "1" : "0";
var visWatLand = VisualWaterLand.Checked ? "1" : "0";
var visWatSky = VisualWaterSky.Checked ? "1" : "0";
var visWatTre = VisualWaterTree.Checked ? "1" : "0";
configFile.Write( "Water", "bReflectLODObjects", visWatObj );
configFile.Write( "Water", "bReflectLODLand", visWatLand );
configFile.Write( "Water", "bReflectSky", visWatSky );
configFile.Write( "Water", "bReflectLODTrees", visWatTre );
// FOV
configFile.Write( "Display", "fDefaultWorldFOV", hudFovThird.Text );
configFile.Write( "Interface", "fDefaultWorldFOV", hudFovThird.Text );
prefsConfigFile.Write( "Display", "fDefaultWorldFOV", hudFovThird.Text );
configFile.Write( "Display", "fDefault1stPersonFOV", hudFovFirst.Text );
configFile.Write( "Interface", "fDefault1stPersonFOV", hudFovFirst.Text );
prefsConfigFile.Write( "Display", "fDefault1stPersonFOV", hudFovFirst.Text );
prefsConfigFile.Write( "General", "fDefaultFOV", hudFovFirst.Text );
#endregion
#region Audio
prefsConfigFile.Write( "AudioMenu", "fAudioMasterVolume", ( (double)AudioMasterTrackbar.Value / 100 ).ToString( CultureInfo.CurrentCulture ) );
prefsConfigFile.Write( "AudioMenu", "fVal0", ( (double)AudioVal0TrackBar.Value / 100 ).ToString( CultureInfo.CurrentCulture ) );
prefsConfigFile.Write( "AudioMenu", "fVal1", ( (double)AudioVal1TrackBar.Value / 100 ).ToString( CultureInfo.CurrentCulture ) );
prefsConfigFile.Write( "AudioMenu", "fVal2", ( (double)AudioVal2TrackBar.Value / 100 ).ToString( CultureInfo.CurrentCulture ) );
prefsConfigFile.Write( "AudioMenu", "fVal3", ( (double)AudioVal3TrackBar.Value / 100 ).ToString( CultureInfo.CurrentCulture ) );
prefsConfigFile.Write( "AudioMenu", "fVal4", ( (double)AudioVal4TrackBar.Value / 100 ).ToString( CultureInfo.CurrentCulture ) );
prefsConfigFile.Write( "AudioMenu", "fVal5", ( (double)AudioVal5TrackBar.Value / 100 ).ToString( CultureInfo.CurrentCulture ) );
prefsConfigFile.Write( "AudioMenu", "fVal6", ( (double)AudioVal6TrackBar.Value / 100 ).ToString( CultureInfo.CurrentCulture ) );
prefsConfigFile.Write( "AudioMenu", "fVal7", ( (double)AudioVal7TrackBar.Value / 100 ).ToString( CultureInfo.CurrentCulture ) );
#endregion
#region Saving
prefsConfigFile.Write( "SaveGame", "fAutosaveEveryXMins", SavingAutoSaveTextBox.Text );
var saPaused = SavingQuickPause.Checked ? "1" : "0";
var saTravel = SavingQuickTravel.Checked ? "1" : "0";
var saWaiting = SavingQuickWaiting.Checked ? "1" : "0";
var saSleeping = SavingQuickSleeping.Checked ? "1" : "0";
prefsConfigFile.Write( "MAIN", "bSaveOnPause", saPaused );
prefsConfigFile.Write( "MAIN", "bSaveOnTravel", saTravel );
prefsConfigFile.Write( "MAIN", "bSaveOnWait", saWaiting );
prefsConfigFile.Write( "MAIN", "bSaveOnRest", saSleeping );
#endregion
#region HUD
prefsConfigFile.Write( "MAIN", "fHUDOpacity", Math.Round( Convert.ToDouble( HUDOpacityTrackBar.Value ) / 100, 4 ).ToString( CultureInfo.CurrentCulture ) );
prefsConfigFile.Write( "Interface", "iHUDColorR", Math.Round( Convert.ToDouble( hudColorRedTrackBar.Value ), 4 ).ToString( CultureInfo.CurrentCulture ) );
prefsConfigFile.Write( "Interface", "iHUDColorG", Math.Round( Convert.ToDouble( hudColorGreenTrackBar.Value ), 4 ).ToString( CultureInfo.CurrentCulture ) );
prefsConfigFile.Write( "Interface", "iHUDColorB", Math.Round( Convert.ToDouble( hudColorBlueTrackBar.Value ), 4 ).ToString( CultureInfo.CurrentCulture ) );
var hudHair = hudCrosshair.Checked ? "1" : "0";
var hudDiaSubs = hudDialogSubs.Checked ? "1" : "0";
var hudDiaCam = hudDialogCam.Checked ? "1" : "0";
var hudGenSubs = hudGeneralSubs.Checked ? "1" : "0";
var hudGps = hudCompass.Checked ? "1" : "0";
prefsConfigFile.Write( "MAIN", "bCrosshairEnabled", hudHair );
prefsConfigFile.Write( "Interface", "bDialogueSubtitles", hudDiaSubs );
prefsConfigFile.Write( "Interface", "bDialogueCameraEnable", hudDiaCam );
prefsConfigFile.Write( "Interface", "bGeneralSubtitles", hudGenSubs );
prefsConfigFile.Write( "Interface", "bShowCompass", hudGps );
var hudShowQuest = hudQuestMarkShow.Checked ? "1" : "0";
var hudShowFloatingQuest = hudQuestFloatingShow.Checked ? "1" : "0";
prefsConfigFile.Write( "GamePlay", "bShowQuestMarkers", hudShowQuest );
prefsConfigFile.Write( "GamePlay", "bShowFloatingQuestMarkers", hudShowFloatingQuest );
#endregion
#region Pip-Boy
if(PipBoyColorRedTextBox.Value != 0) {
prefsConfigFile.Write( "Pipboy", "fPipboyEffectColorR", Math.Round( Convert.ToDouble( PipBoyColorRedTextBox.Value.ToString( "#.####" ) ) / 255, 4 ) );
} else {
prefsConfigFile.Write( "Pipboy", "fPipboyEffectColorR", "0" );
}
if(PipBoyColorGreenTextBox.Value != 0) {
prefsConfigFile.Write( "Pipboy", "fPipboyEffectColorG", Math.Round( Convert.ToDouble( PipBoyColorGreenTextBox.Value.ToString( "#.####" ) ) / 255, 4 ) );
} else {
prefsConfigFile.Write( "Pipboy", "fPipboyEffectColorG", "0" );
}
if(PipBoyColorBlueTextBox.Value != 0) {
prefsConfigFile.Write( "Pipboy", "fPipboyEffectColorB", Math.Round( Convert.ToDouble( PipBoyColorBlueTextBox.Value.ToString( "#.####" ) ) / 255, 4 ) );
} else {
prefsConfigFile.Write( "Pipboy", "fPipboyEffectColorB", "0" );
}
#endregion
#region VATS
#region Color
if(VATSColorR.Value != 0) {
prefsConfigFile.Write( "VATS", "fModMenuEffectColorR",
Math.Round( Convert.ToDouble( VATSColorR.Value.ToString( "#.####" ) ) / 255, 4 ) );
} else {
prefsConfigFile.Write( "VATS", "fModMenuEffectColorR", "0" );
}
if(VATSColorG.Value != 0) {
//.........这里部分代码省略.........
示例13: SetLoginOrCreate
/// <summary>
/// Sets the login info of the character or creates the base character file if first time logging in.
/// </summary>
/// <param name="client">The client.</param>
/// <param name="Account">The account.</param>
/// <param name="DatabaseUID">The database UID.</param>
/// <param name="EntityUID">The entity UID.</param>
public static void SetLoginOrCreate(SocketClient client, string Account, int DatabaseUID, uint EntityUID)
{
IniFile characterfile = new IniFile(DatabaseLocation + "\\Characters\\" + DatabaseUID + ".ini", "Character");
if (!characterfile.Exists())
characterfile.Write<bool>("New", true);
characterfile.WriteString("Account", Account);
characterfile.Write<uint>("LastEntityUID", EntityUID);
}
示例14: WriteIniFile
/// <summary>
/// Iniを書きだす
/// </summary>
private void WriteIniFile()
{
IniFile iniFile = new IniFile(GetCurrentDirectory() + "\\PeerstPlayer.ini");
// 一度書き込み
// レスボックス
iniFile.Write("Player", "ResBox", panelResBox.Visible.ToString());
// ステータスラベル
iniFile.Write("Player", "StatusLabel", panelStatusLabel.Visible.ToString());
// フレーム
iniFile.Write("Player", "Frame", Frame.ToString());
// 最前列表示
iniFile.Write("Player", "TopMost", TopMost.ToString());
// アスペクト比
iniFile.Write("Player", "AspectRate", settings.AspectRate.ToString());
// レスボックスの操作方法
iniFile.Write("Player", "ResBoxType", settings.ResBoxType.ToString());
// レスボックスを自動表示
iniFile.Write("Player", "ResBoxAutoVisible", settings.ResBoxAutoVisible.ToString());
// 終了時にリレーを終了
iniFile.Write("Player", "RlayCutOnClose", settings.RlayCutOnClose.ToString());
// 書き込み後にレスボックスを閉じる
iniFile.Write("Player", "CloseResBoxOnWrite", settings.CloseResBoxOnWrite.ToString());
// スクリーン吸着を使うか
iniFile.Write("Player", "UseScreenMagnet", settings.UseScreenMagnet.ToString());
// 終了時に一緒にビューワも終了するか
iniFile.Write("Player", "CloseViewerOnClose", settings.CloseViewerOnClose.ToString());
// クリックした時にレスボックスを閉じるか
iniFile.Write("Player", "ClickToResBoxClose", settings.ClickToResBoxClose.ToString());
// 終了時に位置を保存するか
iniFile.Write("Player", "SaveLocationOnClose", settings.SaveLocationOnClose.ToString());
// 終了時にボリュームを保存するか
iniFile.Write("Player", "SaveVolumeOnClose", settings.SaveVolumeOnClose.ToString());
// 終了時にサイズを保存するか
iniFile.Write("Player", "SaveSizeOnClose", settings.SaveSizeOnClose.ToString());
// フォント名
iniFile.Write("Player", "FontName", labelDetail.Font.Name);
// フォント色
iniFile.Write("Player", "FontColorR", labelDetail.ForeColor.R.ToString());
iniFile.Write("Player", "FontColorG", labelDetail.ForeColor.G.ToString());
iniFile.Write("Player", "FontColorB", labelDetail.ForeColor.B.ToString());
}
示例15: WriteFallout4PrefIni
public void WriteFallout4PrefIni(string s = "none")
{
string iniFolfder = GetIniFolder();
if (s == "none")
{
IniFile fallout4ini = new IniFile(iniFolfder + "Fallout4.ini");
IniFile fallout4pref = new IniFile(iniFolfder + "Fallout4Prefs.ini");
for (int i = 0; i < AllFalloutSettings.Count; i++)
{
if (AllFalloutSettings[i].pref)
{
fallout4pref.Write(AllFalloutSettings[i].VarName, AllFalloutSettings[i].VarValue, AllFalloutSettings[i].Section);
}
else
{
fallout4ini.Write(AllFalloutSettings[i].VarName, AllFalloutSettings[i].VarValue, AllFalloutSettings[i].Section);
}
}
}
else
{
if (!Directory.Exists("./Profiles/"))
{
Directory.CreateDirectory("./Profiles/");
}
XmlWriter xl = XmlWriter.Create(s, new XmlWriterSettings { Indent = true });
XmlSerializer file = new XmlSerializer(typeof(List<AppSettingFormat>), "test");
file.Serialize(xl, AllFalloutSettings);
xl.Dispose();
}
}