本文整理汇总了C#中System.ConfigNode.Save方法的典型用法代码示例。如果您正苦于以下问题:C# ConfigNode.Save方法的具体用法?C# ConfigNode.Save怎么用?C# ConfigNode.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.ConfigNode
的用法示例。
在下文中一共展示了ConfigNode.Save方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DumpCurrentTreeToFile
static public void DumpCurrentTreeToFile( string sFileName, string sTreeName )
{
// only attempt to dump if the current game mode has a tech tree, and the tech tree is present
if ( HighLogic.CurrentGame != null && ( HighLogic.CurrentGame.Mode == Game.Modes.CAREER || HighLogic.CurrentGame.Mode == Game.Modes.SCIENCE_SANDBOX )
&& AssetBase.RnDTechTree != null && AssetBase.RnDTechTree.GetTreeNodes() != null )
{
ConfigNode fileConfigNode = new ConfigNode();
ConfigNode treeConfigNode = new ConfigNode( "TECH_TREE" );
treeConfigNode.AddValue( "name", sTreeName );
AddAllTechNodesToTreeNode( treeConfigNode );
AddPlanetScienceValuesToTreeNode( treeConfigNode );
fileConfigNode.AddNode( treeConfigNode );
fileConfigNode.Save( KSPUtil.ApplicationRootPath.Replace( "\\", "/" ) + "GameData/ATC/" + sFileName,
"Config file representing the stock tech tree\r\n" +
"// WARNING: This file should not be edited directly, but rather should either be altered using ModuleManager commands within your own .cfg files OR\r\n" +
"// a new tree .cfg should be created which settings.cfg can then be set to point to." );
m_bHasTreeAlreadyBeenDumped = true;
}
}
示例2: Save
/// <summary>
/// Save settings to the underlying storage
/// </summary>
public void Save ()
{
ConfigNode node = AsConfigNode;
var clsNode = new ConfigNode (nodeName);
clsNode.AddNode (node);
clsNode.Save (path);
}
示例3: Save
/// <summary>
/// Save settings to the underlying storage
/// </summary>
public void Save()
{
ConfigNode node = AsConfigNode;
var clsNode = new ConfigNode (GetType ().Name);
clsNode.AddNode (node);
clsNode.Save (filePath);
}
示例4: Save
public void Save()
{
ConfigNode settings = new ConfigNode("SmartStage");
settings.AddValue("autoUpdateStaging", autoUpdateStaging);
settings.AddValue("showInFlight", plugin.showInFlight);
settings.Save(KSP.IO.IOUtils.GetFilePathFor(typeof(MainWindow), "settings.cfg"));
}
示例5: createSettings
private ConfigNode createSettings()
{
ConfigNode node = new ConfigNode();
node.AddValue(DEBUG_VALUE, false);
node.Save(SETTINGS_FILE);
return node;
}
示例6: Save
public void Save()
{
ConfigNode node = new ConfigNode ("KerbalAnimationSuite_Settings");
node.AddValue ("AllowEditorMusic", AllowEditorMusic.ToString());
node.Save (Path);
}
示例7: SaveAnimationNames
public static void SaveAnimationNames(string url)
{
ConfigNode node = new ConfigNode ();
foreach (var name in KerbalAnimationSuite.Instance.AnimationNames)
{
node.AddValue (name.Key, name.Value);
}
node.Save (KSPUtil.ApplicationRootPath + "GameData/" + url + ".dat");
}
示例8: Save
public void Save()
{
try
{
ConfigNode save = new ConfigNode();
ConfigNode.CreateConfigFromObject(this, 0, save);
save.Save(File);
}
catch (Exception e) { RTLog.Notify("An error occurred while attempting to save: " + e.Message); }
}
示例9: Save
public void Save(string fileURL)
{
ConfigNode configNode = new ConfigNode("CUTSCENE_DEFINITION");
string fullPath = string.Join(Path.DirectorySeparatorChar.ToString(), new string[] {
KSPUtil.ApplicationRootPath, "GameData", fileURL });
OnSave(configNode);
configNode.Save(fullPath);
}
示例10: Save
public void Save()
{
ConfigNode root = new ConfigNode();
ConfigNode rt = new ConfigNode("REMOTE_TECH");
root.AddNode(rt);
mCore.Network.Save(rt);
mCore.Gui.Save(rt);
mCore.Renderer.Save(rt);
root.Save("RemoteTech.cfg", " RemoteTech2 configuration file.");
}
示例11: Save
/// <summary>
/// Saves the current RTSettings object to the RemoteTech_Settings.cfg
/// </summary>
public void Save()
{
try
{
ConfigNode details = new ConfigNode("RemoteTechSettings");
ConfigNode.CreateConfigFromObject(this, 0, details);
ConfigNode save = new ConfigNode();
save.AddNode(details);
save.Save(File);
}
catch (Exception e) { RTLog.Notify("An error occurred while attempting to save: " + e.Message); }
}
示例12: SaveSettings
public void SaveSettings()
{
ConfigNode settings = new ConfigNode("SETTINGS");
settings.AddValue("stopTimeWarpOnFailure", stopTimeWarpOnFailure);
settings.AddValue("alertMessageOnFailure", alertMessageOnFailure);
settings.AddValue("highlightFailedPart", highlightFailedPart);
ConfigNode root = new ConfigNode();
root.AddNode(settings);
root.Save("GameData/KerbalMechanics/Settings.cfg");
}
示例13: Save
public void Save(string file)
{
try
{
ConfigNode save = new ConfigNode();
ConfigNode.CreateConfigFromObject(PlanetSettings.Instance, save);
save.Save(file);
}
catch
{
}
}
示例14: DoExport
public static void DoExport()
{
ConfigNode configNode = new ConfigNode("CUSTOM_WAYPOINTS");
ScenarioCustomWaypoints.Instance.OnSave(configNode);
configNode.Save(CustomWaypointsFileName,
"Waypoint Manager Custom Waypoints File\r\n" +
"//\r\n" +
"// This file contains an extract of Waypoint Manager custom waypoints.");
int count = configNode.nodes.Count;
ScreenMessages.PostScreenMessage("Exported " + count + " waypoint" + (count != 1 ? "s" : "") + " to " + CustomWaypointsFileName,
6.0f, ScreenMessageStyle.UPPER_CENTER);
}
示例15: ApplySettings
public static void ApplySettings()
{
Debug.Log("CactEye 2: Settings saved to " + ConfigFilePath);
ConfigNode Settings = new ConfigNode();
ConfigNode CactEye2 = Settings.AddNode("CactEye2");
CactEye2.AddValue("DebugMode", DebugMode);
Debug.Log("CactEye 2: DebugMode = " + DebugMode.ToString());
CactEye2.AddValue("SunDamage", SunDamage);
Debug.Log("CactEye 2: SunDamage = " + SunDamage.ToString());
CactEye2.AddValue("GyroDecay", GyroDecay);
Debug.Log("CactEye 2: GyroDecay = " + GyroDecay.ToString());
Settings.Save(ConfigFilePath);
}