//============================================================ // <T>加载配置信息。</T> // // @param config 配置信息 //============================================================ public void SaveInfoConfig(FXmlNode xconfig) { xconfig.Set("id", _id.ToString()); xconfig.Set("position", _position.ToString()); xconfig.Set("coord_count", CoordUids.Count); xconfig.Set("normal_count", NormalUids.Count); xconfig.Set("binormal_tangent_count", BinormalTangentUids.Count); xconfig.Set("normal_fix", normalFix); }
//============================================================ public virtual void SaveConfig(FXmlNode config) { // 设置名称 config.Set("name", _name); // 设置标签 config.Set("label", _label); // 设置索引 config.Set("display_index", _displayIndex); }
//============================================================ // <T>加载配置信息。</T> // // @param config 配置信息 //============================================================ public void SaveInfoConfig(FXmlNode xconfig) { xconfig.Set("id", Index); xconfig.Set("vertex", _vertexIndex.ToString()); xconfig.Set("color", _colorIndex.ToString()); xconfig.Set("coord", _coordIndex.ToString()); xconfig.Set("normal", _normalIndex.ToString()); xconfig.Set("tangent_binormal", _tangentBinormalIndex.ToString()); }
//============================================================ public void ExportConfig(FXmlNode config) { // 输出顶点列表 FXmlNode positionNode = config.CreateNode("VertexIndex"); positionNode.Set("v1", _adjustVertexIndex.V1); positionNode.Set("v2", _adjustVertexIndex.V2); positionNode.Set("v3", _adjustVertexIndex.V3); }
//============================================================ public virtual void LoadConfig(FXmlNode xconfig) { //var c:int = px.nodeCount; //for(var n:int = 0; n < c; n++){ // var xp:FXmlNode = px.node(n); // if(xp.isName("Pass")){ // } //} }
private void BuildRootNode(FXmlNode config) { _source.AppendLine(" public class " + _className + "{"); if (config.HasNode) { BuildNodeSource(config, null); _source.AppendLine(" }"); } }
//============================================================ // <T>存储设置节点。</T> // // @param xconfig 配置节点 //============================================================ public void SaveConfig(FXmlNode xconfig) { xconfig.Set("name", _name); // 保存样式集合 foreach (INamePair <FTplThemeStyle> pair in _styles) { pair.Value.SaveConfig(xconfig.CreateNode("Style")); } }
//============================================================ public void SaveConfig(FXmlNode config) { foreach (INamePair <FDrMaterialGroup> pair in _names) { FXmlNode materialNode = config.CreateNode("Material"); pair.Value.SaveConfig(materialNode); } config.SortByAttribute("name"); }
static RValidator() { FXmlNode config = _resource.Config.Find(FValidatorConfigs.TAG); if (config != null) { _configs.LoadConfig(config); } }
//============================================================ // <T>存储设置节点。</T> // // @param xconfig 配置节点 //============================================================ public override void SaveConfig(FXmlNode xconfig) { base.SaveConfig(xconfig); foreach (FTplStyle style in _styles) { FXmlNode xnode = xconfig.CreateNode("Style"); style.SaveConfig(xnode); } }
//============================================================ // <T>加载设置信息。</T> // // @param xconfig 设置信息 //============================================================ public override void OnLoadConfig(FXmlNode xconfig) { base.OnLoadConfig(xconfig); // 读取数据 _minimumValue = xconfig.GetFloat("minimum_value", _minimumValue); _maximumValue = xconfig.GetFloat("maximum_value", _maximumValue); _currentValue = xconfig.GetFloat("current_value", _currentValue); _changeSmall = xconfig.GetFloat("change_small", _changeSmall); }
//============================================================ // <T>存储设置节点。</T> // // @param xconfig 配置节点 //============================================================ public override void SaveConfig(FXmlNode xconfig) { base.SaveConfig(xconfig); foreach (FTplConstant constant in _constants) { FXmlNode xnode = xconfig.CreateNode("Constant"); constant.SaveConfig(xnode); } }
//============================================================ // <T>将方法的返回值作为单独的节点附加到方法节点下面。</T> // // @param nodeMethod 需要附加上的方法节点 //============================================================ public void MethodReturnNode(FXmlNode nodeMethod) { if (MethodType != "" && MethodType != "void") { FXmlNode returnNode = new FXmlNode("Return"); returnNode.Set("type", MethodType); nodeMethod.Push(returnNode); } }
//============================================================ public void SaveConfigFile(string fileName) { FXmlDocument xdoc = new FXmlDocument(); FXmlNode xroot = xdoc.Root; SaveConfig(xroot.CreateNode("Map")); xdoc.SaveFile(fileName); _logger.Debug(this, "SaveConfigFile", "Save map config success. (file_name={0})", fileName); }
//============================================================ // <T>加载配置信息。</T> // // @param xconfig 配置信息 //============================================================ public void LoadConfig(FXmlNode xconfig) { // 读取属性 _name = xconfig.Nvl("name"); _label = String.Empty; // 读取设置 LoadConfigInfo(xconfig); // 读取高度 FXmlNode xheight = xconfig.Find("Height"); if (null != xheight) { //_optionHeight = xconfig.GetInteger("option_height", _optionHeight); _heightDepth = xheight.GetFloat("depth"); } // 读取表面 FXmlNode xsurface = xconfig.Find("Surface"); if (null != xsurface) { _surfaceRate = xsurface.GetFloat("rate"); _surfaceReflect = xsurface.GetFloat("reflect"); _surfaceBright = xsurface.GetFloat("bright"); _surfaceBrightLevel = xsurface.GetFloat("bright_level"); _surfaceCoarse = xsurface.GetFloat("coarse"); _surfaceCoarseLevel = xsurface.GetFloat("coarse_level"); _surfaceMerge = xsurface.GetFloat("merge"); _surfacePower = xsurface.GetFloat("power"); } if (!RString.IsEmpty(_name)) { _material = RContent3dManager.MaterialConsole.FindDefault(_scene.ThemeName, _name); if (null == _material) { RMoCore.TrackConsole.Write(this, "LoadConfig", "Scene material is not exists. (scene={0}, material={1})", _scene.Code, Code); } else { _label = _material.Group.Label; _transformName = _material.TransformName; _optionLight = _material.OptionLight; _optionMerge = _material.OptionMerge; _optionSort = _material.OptionSort; _sortLevel = _material.SortLevel; _optionAlpha = _material.OptionAlpha; _optionDepth = _material.OptionDepth; _optionCompare = _material.OptionCompare; _optionDouble = _material.OptionDouble; _optionShadow = _material.OptionShadow; _optionShadowSelf = _material.OptionShadowSelf; _optionDynamic = _material.OptionDynamic; _optionTransmittance = _material.OptionTransmittance; _optionOpacity = _material.OptionOpacity; } } }
//============================================================ // <T>加载设置信息。</T> // // @param xconfig 设置信息 //============================================================ public override void OnLoadConfig(FXmlNode xconfig) { base.OnLoadConfig(xconfig); if (xconfig.Contains("text_align_cd")) { _textAlignCd = (ERcTextAlign)REnum.ToValue(typeof(ERcTextAlign), xconfig.Get("text_align_cd")); } _font.LoadConfig(xconfig, "font"); _text = xconfig.Get("text", _text); }
public FAsmOpCode CreateCode(FXmlNode config) { string name = config[FAsmOpCode.PTY_NAME]; string clazz = "DSCSVImpMO.Core.Window.Context.Asm.Code.FAsm" + name; FAsmOpCode code = (FAsmOpCode)Activator.CreateInstance(Type.GetType(clazz)); code.LoadConfig(config); Push(code); return(code); }
//============================================================ // <T>存储设置信息。</T> // // @param xconfig 设置信息 //============================================================ public override void OnSaveConfig(FXmlNode xconfig) { // 保存处理 base.OnSaveConfig(xconfig); // 保存数据 xconfig.SetNvl("minimum_value", _minimumValue); xconfig.SetNvl("maximum_value", _maximumValue); xconfig.SetNvl("current_value", _currentValue); xconfig.SetNvl("change_small", _changeSmall); }
//============================================================ public override void SaveConfig(FXmlNode config) { base.SaveConfig(config); // 设置类型 config.Set("type", _typeName); // 设置编号 config.Set("id", _id); // 设置唯一编号 config.Set("guid", _guid.ToString()); }
//============================================================ public override void LoadConfig(FXmlNode config) { _name = config[PTY_NAME]; RString.CheckEmpty(_name, PTY_NAME); _linkAssembly = Assembly.Load(_name); if (_logger.DebugAble) { _logger.Debug(this, "LoadConfig", "Include reference {0}", _linkAssembly); } }
//============================================================ public SIntRectangle GetRect(string key) { FXmlNode config = _config.Find(key); if (config != null) { return(new SIntRectangle(config)); } return(null); }
//============================================================ // <T>加载配置信息。</T> // // @param xconfig 配置节点 // @param name 名称 //============================================================ public void SaveConfig(FXmlNode xconfig, string name) { // 保存有效性 xconfig.SetNvl(name + "_valid", _valid); // 保存颜色 if (!IsEmpty()) { xconfig.SetNvl(name, ToString16()); } }
//============================================================ // <T>加载设置信息。</T> // // @param xconfig 设置信息 //============================================================ public override void OnLoadConfig(FXmlNode xconfig) { base.OnLoadConfig(xconfig); _designItemCount = xconfig.GetInteger("design_item_count", 1); _spreadCd = (ERcSpread)REnum.ToValue(typeof(ERcSpread), xconfig.Get("spread_cd", "None")); _horizontalCount = xconfig.GetInteger("horizontal_count", 1); _horizontalSpace = xconfig.GetInteger("horizontal_space", 0); _verticalCount = xconfig.GetInteger("vertical_count", 1); _verticalSpace = xconfig.GetInteger("vertical_space", 0); _initialCount = xconfig.GetInteger("initial_count", 0); }
//============================================================ // <T>加载设置文件。</T> //============================================================ public void LoadConfigFile(string fileName) { FXmlDocument xdoc = new FXmlDocument(fileName); FXmlNode xroot = xdoc.Root; FXmlNode xtexture = xroot.Find("Texture"); if (null != xtexture) { LoadConfig(xtexture); } }
//============================================================ public void LoadConfigFile(string fileName) { FXmlDocument xdoc = new FXmlDocument(fileName); FXmlNode xroot = xdoc.Root; FXmlNode xmap = xroot.Find("Map"); if (null != xmap) { LoadConfig(xmap); } }
//============================================================ // <T>加载配置信息。</T> // // @param xconfig 配置节点 // @param name 名称 //============================================================ public void LoadConfig(FXmlNode xconfig, string name) { // 加载左边线 _left.LoadConfig(xconfig, name + "_left"); // 加载上边线 _top.LoadConfig(xconfig, name + "_top"); // 加载右边线 _right.LoadConfig(xconfig, name + "_right"); // 加载下边线 _bottom.LoadConfig(xconfig, name + "_bottom"); }
//============================================================ // <T>存储配置信息。</T> // // @param config 配置信息 //============================================================ public override void SaveConfig(FXmlNode config) { // 设置信息 config.Set("name", _name); config.Set("label", _label); // 存储位图列表 foreach (FDrTextureBitmap bitmap in _bitmaps) { bitmap.SaveConfig(config.CreateNode("Bitmap")); } }
public void SaveConfig(FXmlNode config) { // Save events if (!IsEmpty()) { foreach (FScheduleEvent scheduleEvent in this) { scheduleEvent.SaveConfig(config.CreateNode(FScheduleEvent.NAME)); } } }
//============================================================ // <T>加载设置文件。</T> //============================================================ public void LoadConfigFile(string fileName) { FXmlDocument xdoc = new FXmlDocument(fileName); FXmlNode xroot = xdoc.Root; FXmlNode xmaterial = xroot.Find("Theme"); if (xmaterial != null) { LoadConfig(xmaterial); } }
public void SaveConfig(FXmlNode config) { // Save tasks if (!IsEmpty()) { foreach (FScheduleTask task in this) { task.SaveConfig(config.CreateNode(FScheduleTask.NAME)); } } }