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


C# ConfigNode.AddValue方法代码示例

本文整理汇总了C#中ConfigNode.AddValue方法的典型用法代码示例。如果您正苦于以下问题:C# ConfigNode.AddValue方法的具体用法?C# ConfigNode.AddValue怎么用?C# ConfigNode.AddValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ConfigNode的用法示例。


在下文中一共展示了ConfigNode.AddValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Save

        public void Save(ConfigNode node)
        {
            if (node.HasNode("KOLONIZATION"))
            {
                SettingsNode = node.GetNode("KOLONIZATION");
            }
            else
            {
                SettingsNode = node.AddNode("KOLONIZATION");
            }

            foreach (KolonizationEntry r in _LogInfo)
            {
                var rNode = new ConfigNode("KOLONY_ENTRY");
                rNode.AddValue("BodyIndex", r.BodyIndex);
                rNode.AddValue("VesselId", r.VesselId);
                rNode.AddValue("LastUpdate", r.LastUpdate);
                rNode.AddValue("KolonyDate", r.KolonyDate);
                rNode.AddValue("GeologyResearch", r.GeologyResearch);
                rNode.AddValue("BotanyResearch", r.BotanyResearch);
                rNode.AddValue("KolonizationResearch", r.KolonizationResearch);
                rNode.AddValue("Science", r.Science);
                rNode.AddValue("Rep", r.Rep);
                rNode.AddValue("Funds", r.Funds);
                SettingsNode.AddNode(rNode);
            }

            //Reset cache
            KolonizationManager.Instance.ResetCache();
        }
开发者ID:nanathan,项目名称:Kolonization,代码行数:30,代码来源:KolonizationPersistance.cs

示例2: Save

 public void Save(ConfigNode node)
 {
     ConfigNode newNode = new ConfigNode("Resource");
     newNode.AddValue("name", resource.name);
     newNode.AddValue("ratio", ratio);
     node.AddNode(newNode);
 }
开发者ID:RichardDastardly,项目名称:pWingsMerged,代码行数:7,代码来源:WingTankResource.cs

示例3: RealChuteSettings

 /// <summary>
 /// Loads the RealChute_Settings config to memory
 /// </summary>
 public RealChuteSettings()
 {
     ConfigNode node = new ConfigNode(), settings = new ConfigNode("REALCHUTE_SETTINGS");
     Debug.Log("[RealChute]: Loading settings file.");
     if (!File.Exists(RCUtils.settingsURL))
     {
         Debug.LogError("[RealChute]: RealChute_Settings.cfg is missing. Creating new.");
         settings.AddValue("autoArm", this._autoArm);
         settings.AddValue("jokeActivated", this._jokeActivated);
         settings.AddValue("guiResizeUpdates", this._guiResizeUpdates);
         settings.AddValue("mustBeEngineer", this._mustBeEngineer);
         settings.AddValue("engineerLevel", this._engineerLevel);
         node.AddNode(settings);
         node.Save(RCUtils.settingsURL);
     }
     else
     {
         node = ConfigNode.Load(RCUtils.settingsURL);
         bool mustSave = false;
         if (!node.TryGetNode("REALCHUTE_SETTINGS", ref settings)) { SaveSettings(); return; }
         if (!settings.TryGetValue("autoArm", ref this._autoArm)) { mustSave = true; return; }
         if (!settings.TryGetValue("jokeActivated", ref this._jokeActivated)) { mustSave = true; return; }
         if (!settings.TryGetValue("guiResizeUpdates", ref this._guiResizeUpdates)) { mustSave = true; return; }
         if (!settings.TryGetValue("mustBeEngineer", ref this._mustBeEngineer)) { mustSave = true; return; }
         if (!settings.TryGetValue("engineerLevel", ref this._engineerLevel)) { mustSave = true; return; }
         this._presets = settings.GetNodes("PRESET");
         if (mustSave) { SaveSettings(); }
     }
 }
开发者ID:pcwilcox,项目名称:RealChute,代码行数:32,代码来源:RealChuteSettings.cs

示例4: saveMonoOverlay

 protected void saveMonoOverlay(ConfigNode node)
 {
     saveOverlay(node);
     node.AddValue("red", _red);
     node.AddValue("green", _green);
     node.AddValue("blue", _blue);
 }
开发者ID:panteras1000,项目名称:TheWriteStuff,代码行数:7,代码来源:IM_MonoOverlay.cs

示例5: RealChuteSettings

 /// <summary>
 /// Loads the RealChute_Settings config to memory
 /// </summary>
 public RealChuteSettings()
 {
     ConfigNode node = new ConfigNode(), settings = new ConfigNode("REALCHUTE_SETTINGS");
     Debug.Log("[RealChute]: Loading settings file.");
     if (!System.IO.File.Exists(RCUtils.settingsURL))
     {
         Debug.LogWarning("[RealChute]: RealChute_Settings.cfg is missing component. Creating new version.");
         settings.AddValue("autoArm", autoArm);
         settings.AddValue("jokeActivated", jokeActivated);
         node.AddNode(settings);
         node.Save(RCUtils.settingsURL);
     }
     else
     {
         node = ConfigNode.Load(RCUtils.settingsURL);
         node.TryGetNode("REALCHUTE_SETTINGS", ref settings);
         bool missing = false;
         if (!settings.TryGetValue("autoArm", ref _autoArm)) { missing = true; }
         if (!settings.TryGetValue("jokeActivated", ref _jokeActivated)) { missing = true; }
         if (missing)
         {
             Debug.LogWarning("[RealChute]: RealChute_Settings.cfg is missing component. Fixing settings file.");
             settings.ClearValues();
             settings.AddValue("autoArm", autoArm);
             settings.AddValue("jokeActivated", jokeActivated);
             node.ClearData();
             node.AddNode(settings);
             node.Save(RCUtils.settingsURL);
         }
     }
 }
开发者ID:vosechu,项目名称:RealChute,代码行数:34,代码来源:RealChuteSettings.cs

示例6: saveText

 public void saveText(ConfigNode node)
 {
     saveMonoOverlay(node);
     node.AddValue("text", _text);
     node.AddValue("fontName", _fontName);
     node.AddValue("fontSize", _fontSize);
 }
开发者ID:panteras1000,项目名称:TheWriteStuff,代码行数:7,代码来源:IM_Text.cs

示例7: Save

 public void Save(ConfigNode node)
 {
     ConfigNode pNode = new ConfigNode("WING_PROPERTY");
     pNode.AddValue(nameof(ID), ID);
     pNode.AddValue(nameof(value), value);
     node.AddNode(pNode);
 }
开发者ID:RichardDastardly,项目名称:pWingsMerged,代码行数:7,代码来源:WingProperty.cs

示例8: saveOverlay

 protected void saveOverlay(ConfigNode node)
 {
     saveImageModifier(node);
     node.AddValue("x", _position.x);
     node.AddValue("y", _position.y);
     node.AddValue("mirror", _mirror);
     node.AddValue("alpha", _alpha);
     node.AddValue("textureAlpha", _textureAlpha);
     node.AddValue("alphaOption", ConfigNode.WriteEnum(_alphaOption));
     node.AddValue("normalScale", _normalScale);
     node.AddValue("normalOption", ConfigNode.WriteEnum(_normalOption));
     node.AddValue("blendMethod", ConfigNode.WriteEnum(_blendMethod));
     node.AddValue("rotation", ConfigNode.WriteEnum(_rotation));
 }
开发者ID:panteras1000,项目名称:TheWriteStuff,代码行数:14,代码来源:IM_Overlay.cs

示例9: HandleSettings

    public void HandleSettings()
    {
        if (!File.Exists<KineTechAnimationModuleLoader>(SETTINGS_FILE_NAME))
        {
            ConfigNode node = new ConfigNode();
            node.AddValue("DumpDocumentationOnStartup", false);
            node.Save(IOUtils.GetFilePathFor(typeof(KineTechAnimationModuleLoader), SETTINGS_FILE_NAME));
        }

        if (File.Exists<KineTechAnimationModuleLoader>(SETTINGS_FILE_NAME))
        {
            ConfigNode node = ConfigNode.Load(
                IOUtils.GetFilePathFor(typeof(KineTechAnimationModuleLoader), SETTINGS_FILE_NAME));

            if(node == null)
                return;

            //Dump Documentation
            if(node.HasValue("DumpDocumentationOnStartup"))
            {
                bool working = false;
                if(bool.TryParse(node.GetValue("DumpDocumentationOnStartup"), out working))
                {
                    GameObject dumperObject = new GameObject("Kine-Tech Animation - ConfigDocumentationGenerator");
                    dumperObject.AddComponent<KConfigDocumentationGenerator>();
                    GameObject.DontDestroyOnLoad(dumperObject);
                }
            }

        }
    }
开发者ID:KineMorto,项目名称:KineTechAnimationLibrary,代码行数:31,代码来源:KineTechAnimationModuleLoader.cs

示例10: OnSave

 protected override void OnSave(ConfigNode node)
 {
     foreach (string field in matchFields)
     {
         node.AddValue("FIELD", field);
     }
 }
开发者ID:Kerbas-ad-astra,项目名称:TarsierSpaceTechnology,代码行数:7,代码来源:TSTScienceParam.cs

示例11: DataBody

 public DataBody(ConfigNode body, string type)
 {
     this.name = body.name;
     this.type = type;
     if (!body.TryGetValue("currentError", ref currentError))
     {
         currentError = 1d;
         body.AddValue("currentError", currentError.ToString("0.00000"));
     }
 }
开发者ID:CYBUTEK,项目名称:KRES,代码行数:10,代码来源:DataBody.cs

示例12: RealChuteSettings

        /// <summary>
        /// Loads the RealChute_Settings config to memory
        /// </summary>
        public RealChuteSettings()
        {
            ConfigNode node = new ConfigNode(), settings = new ConfigNode("REALCHUTE_SETTINGS");
            Debug.Log("[RealChute]: Loading settings file.");
            if (!File.Exists(RCUtils.settingsURL))
            {
                Debug.LogWarning("[RealChute]: RealChute_Settings.cfg is missing. Creating new.");
                settings.AddValue("autoArm", autoArm);
                settings.AddValue("jokeActivated", jokeActivated);
                settings.AddValue("hideIcon", hideIcon);
                node.AddNode(settings);
                node.Save(RCUtils.settingsURL);
            }
            else
            {
                node = ConfigNode.Load(RCUtils.settingsURL);
                if (!node.TryGetNode("REALCHUTE_SETTINGS", ref settings)) { goto missing; }
                if (!settings.TryGetValue("autoArm", ref _autoArm)) { goto missing; }
                if (!settings.TryGetValue("jokeActivated", ref _jokeActivated)) { goto missing; }
                if (settings.TryGetValue("hideIcon", ref _hideIcon)) { goto missing; }
                return;

                missing:
                {
                    Debug.LogWarning("[RealChute]: RealChute_Settings.cfg is missing component. Fixing settings file.");
                    settings.ClearValues();
                    settings.AddValue("autoArm", autoArm);
                    settings.AddValue("jokeActivated", jokeActivated);
                    settings.AddValue("hideIcon", hideIcon);
                    node.ClearData();
                    node.AddNode(settings);
                    node.Save(RCUtils.settingsURL);
                }
            }
        }
开发者ID:kevin-ye,项目名称:RealChute,代码行数:38,代码来源:RealChuteSettings.cs

示例13: Save

        public void Save(ConfigNode node)
        {
            if (node.HasNode("PLANETARY_LOGISTICS"))
            {
                SettingsNode = node.GetNode("PLANETARY_LOGISTICS");
            }
            else
            {
                SettingsNode = node.AddNode("PLANETARY_LOGISTICS");
            }

            foreach (PlanetaryLogisticsEntry r in _LogInfo)
            {
                var rNode = new ConfigNode("LOGISTICS_ENTRY");
                rNode.AddValue("BodyIndex", r.BodyIndex);
                rNode.AddValue("ResourceName", r.ResourceName);
                rNode.AddValue("StoredQuantity", r.StoredQuantity);
                SettingsNode.AddNode(rNode);
            }

            //Reset cache
            PlanetaryLogisticsManager.Instance.ResetCache();
        }
开发者ID:nanathan,项目名称:Kolonization,代码行数:23,代码来源:PlanetaryLogisticsPersistance.cs

示例14: Awake

        public void Awake()
        {
            EvaDebug.DebugLog("Loaded AddonAddModule.");

            ConfigNode EVA = new ConfigNode("MODULE");
            EVA.AddValue("name", "EvaModule");

            try
            {
              PartLoader.getPartInfoByName("kerbalEVA").partPrefab.AddModule(EVA);
            }
            catch { 
			
			}

			EVA = new ConfigNode("MODULE");
            EVA.AddValue("name", "EvaModule");

			try {
				PartLoader.getPartInfoByName("kerbalEVAfemale").partPrefab.AddModule(EVA);
			} catch {

			}
       	}
开发者ID:MarijnStevens,项目名称:EvaFollower,代码行数:24,代码来源:EvaAddonAddModule.cs

示例15: OnSave

 protected override void OnSave(ConfigNode node)
 {
     node.AddValue ("AsteroidVesselID", AsteroidVesselID);
 }
开发者ID:ve2dmn,项目名称:AsteroidScanner,代码行数:4,代码来源:AsteroidRedirectParameters.cs


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