當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。