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


C# ConfigNode.Save方法代码示例

本文整理汇总了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;
            }
        }
开发者ID:FractalUK,项目名称:KSPAlternativeTechConfigurator,代码行数:27,代码来源:ATCTreeDumper.cs

示例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);
 }
开发者ID:paperclip,项目名称:krpc,代码行数:10,代码来源:ConfigurationStorage.cs

示例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);
 }
开发者ID:602p,项目名称:krpc,代码行数:10,代码来源:ConfigurationStorage.cs

示例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"));
		}
开发者ID:pjwerneck,项目名称:SmartStage,代码行数:7,代码来源:MainWindow.cs

示例5: createSettings

 private ConfigNode createSettings()
 {
     ConfigNode node = new ConfigNode();
     node.AddValue(DEBUG_VALUE, false);
     node.Save(SETTINGS_FILE);
     return node;
 }
开发者ID:N3h3miah,项目名称:OrbitalMaterialScience,代码行数:7,代码来源:NE_Helper.cs

示例6: Save

        public void Save()
        {
            ConfigNode node = new ConfigNode ("KerbalAnimationSuite_Settings");

            node.AddValue ("AllowEditorMusic", AllowEditorMusic.ToString());

            node.Save (Path);
        }
开发者ID:Kerbas-ad-astra,项目名称:KerbalAnimationSuite,代码行数:8,代码来源:KerbalAnimationSettings.cs

示例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");
 }
开发者ID:Kerbas-ad-astra,项目名称:KerbalAnimationSuite,代码行数:9,代码来源:ConfigurationUtils.cs

示例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); }
 }
开发者ID:Kevin-010,项目名称:RemoteTech2,代码行数:10,代码来源:RTSettings.cs

示例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);
        }
开发者ID:linuxgurugamer,项目名称:ContractConfigurator,代码行数:11,代码来源:CutSceneDefinition.cs

示例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.");
        }
开发者ID:Regn752,项目名称:RemoteTechExtended,代码行数:12,代码来源:Settings.cs

示例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); }
 }
开发者ID:icedown,项目名称:RemoteTech,代码行数:15,代码来源:RTSettings.cs

示例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");
        }
开发者ID:panarchist,项目名称:KerbalMechanics,代码行数:12,代码来源:KMSettings.cs

示例13: Save

        public void Save(string file)
        {
            try
            {
                ConfigNode save = new ConfigNode();
                ConfigNode.CreateConfigFromObject(PlanetSettings.Instance, save);
                save.Save(file);
            }
            catch
            {

            }
        }
开发者ID:metaphor05,项目名称:PlanetRandomizer,代码行数:13,代码来源:PlanetSettings.cs

示例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);
        }
开发者ID:Kerbas-ad-astra,项目名称:WaypointManager,代码行数:14,代码来源:CustomWaypoints.cs

示例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);
        }
开发者ID:belug23,项目名称:CactEye-2,代码行数:14,代码来源:CactEyeConfig.cs


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