//============================================================ // <T>加载配置信息。</T> // // @param config 配置信息 //============================================================ public void LoadConfig(FXmlNode config) { // 读取顶点索引 if (config.Contains("vertex")) { _vertexIndex.Parse(config.Get("vertex")); } // 读取定点色索引 if (config.Contains("color")) { _colorIndex.Parse(config.Get("color")); } // 读取纹理坐标索引 if (config.Contains("coord")) { _coordIndex.Parse(config.Get("coord")); } // 读取法线索引 if (config.Contains("normal")) { _normalIndex.Parse(config.Get("normal")); } // 读取切线和副法线索引 if (config.Contains("tangent_binormal")) { _tangentBinormalIndex.Parse(config.Get("tangent_binormal")); } }
//============================================================ // <T>加载配置信息。</T> // // @param xconfig 配置信息 //============================================================ public void LoadSingleConfig(FXmlNode xconfig) { // 读取设置 if (xconfig.Contains("translation")) { SFloatVector3 translation = new SFloatVector3(); translation.Parse(xconfig.Get("translation")); tx = translation.X; ty = translation.Y; tz = translation.Z; } if (xconfig.Contains("rotation")) { SFloatVector3 rotation = new SFloatVector3(); rotation.Parse(xconfig.Get("rotation")); rx = rotation.X; ry = rotation.Y; rz = rotation.Z; } if (xconfig.Contains("scale")) { SFloatVector3 scale = new SFloatVector3(); scale.Parse(xconfig.Get("scale")); sx = scale.X; sy = scale.Y; sz = scale.Z; } // 更新数据 Update(); }
//============================================================ // <T>加载配置信息。</T> // // @param xconfig 配置节点 // @param name 名称 //============================================================ public void LoadConfig(FXmlNode xconfig, string name) { // 加载资源 if (xconfig.Contains(name + "_rid")) { _code = xconfig.GetInteger(name + "_rid"); } // 加载对齐 if (xconfig.Contains(name + "_align_cd")) { _alignCd = RUiPictureAlign.Parse(xconfig.Get(name + "_align_cd")); } // 加载位置 if (xconfig.Contains(name + "_location")) { _location.Parse(xconfig.Get(name + "_location")); } // 加载尺寸 if (xconfig.Contains(name + "_size")) { _size.Parse(xconfig.Get(name + "_size")); } // 加载边框 if (xconfig.Contains(name + "_padding")) { _padding.Parse(xconfig.Get(name + "_padding")); } }
//============================================================ // <T>加载配置文件。</T> //============================================================ public void LoadConfig(FXmlNode config) { // 加载基本设置 _tid = config.GetInteger("tid", _tid); _name = config.Get("name", _name); _label = config.Get("label", _label); if (config.Contains("size")) { _size.Parse(config.Get("size")); } if (config.Contains("birth_location")) { _birthLocation.Parse(config.Get("birth_location")); } // 加载层 _layerListNode = config.Find("Layers"); if (null == _layerListNode) { return; } foreach (FXmlNode layerNode in _layerListNode.Nodes) { FDsMapLayer layer = new FDsMapLayer(); layer.Resource.LoadConfig(layerNode); _layers.Push(layer.Resource); } // 加载出生点 _birthListNode = config.Find("Births"); if (null == _birthListNode) { return; } foreach (FXmlNode birthNode in _birthListNode.Nodes) { FDsMapBirth birth = new FDsMapBirth(); birth.Resource.LoadConfig(birthNode); _births.Push(birth.Resource); } }
//============================================================ // <T>加载设置信息。</T> // // @param xconfig 设置节点 // @author TYFNG 20120409 //============================================================ public override void LoadConfig(FXmlNode xconfig) { base.LoadConfig(xconfig); // 读取透明属性 if (xconfig.Contains("option_alpha")) { _optionAlpha = xconfig.GetBoolean("option_alpha"); } if (xconfig.Contains("alpha_cd")) { _optionAlpha = (xconfig.Get("alpha_cd") == "Able"); } // 读取文件属性 if (xconfig.Contains("option_padding")) { _optionPadding = xconfig.GetBoolean("option_padding"); } // 读取品质类型 _qualityCd = xconfig.Get("quality_cd", _qualityCd); // 读取品质调色板 if (xconfig.Contains("quality_palette")) { _qualityPalette = xconfig.GetInteger("quality_palette"); } // 读取品质透明 if (xconfig.Contains("quality_alpha")) { _qualityAlpha = xconfig.GetInteger("quality_alpha"); } }
public void LoadConfig(FXmlNode config) { if (config.Contains("index")) { _index.Parse(config.Get("index")); } if (config.Contains("resource_id")) { _resourceId = config.GetInteger("resource_id"); } }
//============================================================ // <T>从配置节点信息中读取属性。</T> // // @param xconfig 配置节点 //============================================================ public void LoadConfig3(FXmlNode config) { if (config.Contains("cr")) { R = config.GetFloat("cr") / 255; } else if (config.Contains("r")) { R = config.GetFloat("r"); } if (config.Contains("cg")) { G = config.GetFloat("cg") / 255; } else if (config.Contains("g")) { G = config.GetFloat("g"); } if (config.Contains("cb")) { B = config.GetFloat("cb") / 255; } else if (config.Contains("b")) { B = config.GetFloat("b"); } if (config.Contains("ca")) { A = config.GetFloat("ca") / 255; } else if (config.Contains("a")) { A = config.GetFloat("a"); } }
//============================================================ public override void LoadConfig(FXmlNode config) { base.LoadConfig(config); // 读取编号 if (config.Contains("id")) { _id = config.GetInteger("id"); } // 读取唯一编号 if (config.Contains("guid")) { _guid = Guid.Parse(config.Get("guid")); } }
//============================================================ // <T>加载配置信息。</T> // // @param config 配置信息 //============================================================ public void LoadConfig(FXmlNode xconfig) { _name = xconfig.Nvl("name"); _playCd = xconfig.GetInteger("play_cd", _playCd); _frameBegin = xconfig.GetInteger("frame_begin"); _frameEnd = xconfig.GetInteger("frame_end"); if (xconfig.Contains("rate")) { _frameRate = xconfig.GetFloat("rate"); } if (xconfig.Contains("frame_rate")) { _frameRate = xconfig.GetFloat("frame_rate"); } }
public virtual void LoadConfig(FXmlNode config) { if (config.Contains(PTY_TYPE)) { _type = REnum.ToValue <EScheduleConditionType>(config[PTY_TYPE]); } if (config.Contains(PTY_VALID)) { _valid = config.GetBoolean(PTY_VALID); } if (config.Contains(PTY_FILE)) { _fileName = config[PTY_FILE]; } }
//============================================================ // <T>加载配置信息。</T> // // @param xconfig 配置节点 // @param name 名称 //============================================================ public void LoadConfig(FXmlNode xconfig, string name) { if (xconfig.Contains(name + "_color")) { _color = ColorTranslator.FromHtml(xconfig.Get(name + "_color")); } if (xconfig.Contains(name + "_width")) { _width = RInt.Parse(xconfig.Get(name + "_width")); } if (xconfig.Contains(name + "_style_cd")) { _style = RUiLineStyle.Parse(xconfig.Get(name + "_style_cd")); } }
//============================================================ // <T>加载设置信息</T> // // @param xconfig 设置信息 //============================================================ public override void OnLoadConfig(FXmlNode xconfig) { base.OnLoadConfig(xconfig); // 加载配置 _optionVisible = xconfig.GetBoolean("option_visible", _optionVisible); _optionEnable = xconfig.GetBoolean("option_enable", _optionEnable); // 加载属性 if (xconfig.Contains("dock_cd")) { _dockCd = (ERcDock)REnum.ToValue(typeof(ERcDock), xconfig.Get("dock_cd")); } // 加载位置 if (xconfig.Contains("location")) { _location.Parse(xconfig.Get("location")); } // 加载尺寸 if (xconfig.Contains("size")) { _size.Parse(xconfig.Get("size")); } // 加载空白 if (xconfig.Contains("margin")) { _margin.Parse(xconfig.Get("margin")); } if (xconfig.Contains("padding")) { _padding.Parse(xconfig.Get("padding")); } // 加载边框 _borderInner.LoadConfig(xconfig, "border_inner"); _borderOuter.LoadConfig(xconfig, "border_outer"); // 加载前景 _foreColor = xconfig.GetHex("fore_color", _foreColor); _foreResource.LoadConfig(xconfig, "fore"); // 加载后景 _backColor = xconfig.GetHex("back_color", _backColor); _backResource.LoadConfig(xconfig, "back"); // 加载事件 _onClick = xconfig.Get("on_click", null); _onDoubleClick = xconfig.Get("on_double_click", null); _onMouseDown = xconfig.Get("on_mouse_down", null); _onMouseUp = xconfig.Get("on_mouse_up", null); _onMouseEnter = xconfig.Get("on_mouse_enter", null); _onMouseMove = xconfig.Get("on_mouse_move", null); _onMouseLeave = xconfig.Get("on_mouse_leave", null); }
//============================================================ // <T>加载配置信息。</T> // // @param config 配置信息 //============================================================ public void LoadConfig(FXmlNode xconfig) { _optionLoaded = xconfig.GetInteger("option_loaded", EDrFlag.Inherit); _optionSelect = xconfig.GetInteger("option_select", EDrFlag.Inherit); _optionGround = xconfig.GetInteger("option_ground", EDrFlag.Inherit); if (xconfig.Contains("option_merge")) { _optionMergeVertex = xconfig.GetInteger("option_merge"); } if (xconfig.Contains("option_merge_vertex")) { _optionMergeVertex = xconfig.GetInteger("option_merge_vertex"); } _optionMergeMaterial = xconfig.GetInteger("option_merge_material", EDrFlag.Inherit); _optionLightMap = xconfig.GetInteger("option_light_map", EDrFlag.Inherit); //............................................................ //............................................................ // 加载引用列表 FXmlNode xreferences = xconfig.Find("References"); if (null != xreferences) { foreach (FXmlNode xreference in xreferences.Nodes) { if (xreference.IsName("Reference")) { FDrTemplateReference reference = new FDrTemplateReference(); reference.LoadConfig(xreference); _references.Push(reference); } } } //............................................................ // 加载动画列表 FXmlNode xanimation = xconfig.Find("Animation"); if (null != xanimation) { _animation.Model = _model; _animation.LoadConfig(xanimation); } //............................................................ // 材质集合排序 if (!_materials.IsEmpty) { _materials.Sort(_materials.First); } }
//============================================================ // <T>加载设置节点。</T> // // @param xconfig 配置节点 //============================================================ public void LoadConfig(FXmlNode xconfig) { // 加载属性 _name = xconfig.Get("name"); if (xconfig.Contains("color")) { _color = Color.FromArgb(RInt.ParseHex(xconfig.Get("color"))); } _font = xconfig.Get("font", null); _size = xconfig.GetInteger("size", 0); _align = xconfig.Get("align", null); // 加载效果器集合 foreach (FXmlNode xnode in xconfig.Nodes) { if (xnode.IsName("Property")) { FTplStyleProperty property = new FTplStyleProperty(); property.LoadConfig(xnode); _properties.Push(property); } else if (xnode.IsName("Filter")) { string typeName = xnode.Get("type_name"); FTplFilter filter = CreateFilter(typeName); filter.LoadConfig(xnode); _filters.Push(filter); } } }
public override void LoadConfig(FXmlNode config) { _name = config[PTY_NAME]; RString.CheckEmpty(_name, "name"); _value = config[PTY_VALUE]; RString.CheckEmpty(_value, "value"); // Load formator if (config.Contains(PTY_FORMATOR)) { /*string formator = config[PTY_FORMATOR]; * _formator = (IFormator)RClass.CreateInstance(formator); * _formator.LoadConfig(config); * // Load formator value * FFormatorParameters parameters = new FFormatorParameters(); * parameters.RaiseException = true; * parameters.Value = Value; * if (_formator.Format(parameters)) { * _value = RString.Nvl(parameters.Value); * }*/ } // Dump if (_logger.DebugAble) { _logger.Debug(this, "LoadConfig", "Define {0}=[{1}]", _name, _value); } }
//============================================================ // <T>加载设置信息。</T> // // @param xconfig 设置节点 //============================================================ public void LoadConfig(FXmlNode xconfig) { // 读取属性 _isReversed = xconfig.GetBoolean("is_reversed", _isReversed); if (xconfig.Contains("reverse_direction")) { int reverseDirection = xconfig.GetInteger("reverse_direction"); _reverseDirection = IntToDirction(reverseDirection); } _frameDelay = xconfig.GetInteger("frame_delay", _frameDelay); // 读取剪辑集合 FXmlNode xframes = xconfig.Find("Frames"); if (xframes != null) { foreach (FXmlNode xnode in xframes.Nodes) { if (xnode.IsName("Frame")) { int index = xnode.GetInteger("index"); FRsResourceFrame frame = _frames.Get(index, null); if (frame != null) { frame.LoadConfig(xnode); } } } } }
//============================================================ // <T>加载配置信息。</T> // // @param config 配置信息 //============================================================ public void LoadConfig(FXmlNode xconfig) { string typeName = null; if (xconfig.Contains("type")) { typeName = xconfig.Get("type"); } else { typeName = xconfig.Get("type_name"); } _typeCd = EDrTexture.Parse(typeName); _source = xconfig.Nvl("source").Replace('/', '\\'); string sourceTypeName = xconfig.Nvl("source_type"); _sourceTypeCd = EDrTexture.Parse(typeName); _sourceIndex = xconfig.GetInteger("source_index", _sourceIndex); // 获得关联纹理 _texture = RContent3dManager.TextureConsole.Find(Source); if (null == _texture) { _texture = RContent3dManager.TextureConsole.Find(Source); RMoCore.TrackConsole.Write(this, "LoadConfig", "Texture source is not exists. (material={0}, texture={1})", _material.Code, SourceCode); return; } _textureBitmap = _texture.FindByTypeCd(_sourceTypeCd, _sourceIndex); }
public void LoadConfig(FXmlNode config) { if (config.Contains(PTY_VALID)) { _valid = config.GetBoolean(PTY_VALID); } _id = config[PTY_ID]; _text = config[PTY_TEXT]; // Load children if (config.HasNode()) { foreach (FXmlNode node in config.Nodes) { if (node.IsName(FScheduleTasks.NAME)) { // Load task _tasks.LoadConfig(node); } else if (node.IsName(FScheduleConditions.NAME)) { // Load condition _conditions.LoadConfig(node); } else if (node.IsName(FScheduleEvents.NAME)) { // Load event _events.LoadConfig(node); } } } }
//============================================================ // <T>加载配置文件。</T> //============================================================ public void LoadConfig(FXmlNode config) { if (config.Contains("template_id")) { _templateId = RInt.Parse(config.Get("template_id")); } }
//============================================================ // <T>加载配置信息。</T> // // @param config 配置信息 //============================================================ public void LoadConfig(FXmlNode xconfig) { // 读取设置 _id = xconfig.GetInteger("id", 0); _name = xconfig.Get("name", _name); _modelName = xconfig.Nvl("model"); _modelName = _modelName.Replace('/', '\\'); _model = RContent3dManager.ModelConsole.Find(_modelName); if (null == _model) { RMoCore.TrackConsole.Write(this, "LoadConfig", "Model is not exists in tempalte. (template={0}, model={1})", _template.Name, _modelName); return; } _geometryName = xconfig.Nvl("geometry"); _geometry = _model.Mesh.Find(_geometryName); if (null == _geometry) { RMoCore.TrackConsole.Write(this, "LoadConfig", "Model geometry is not exists. (template={0}, model={1}, geometry={2})", _template.Name, _modelName, _geometryName); } else { _optionSelect = _geometry.OptionSelect; _optionGround = _geometry.OptionGround; _optionBoneScale = _geometry.OptionBoneScale; _optionInstnaced = _geometry.OptionInstanced; _instanceCount = _geometry.InstanceCount; _outline.min.Assign(_geometry.OutlineMin); _outline.max.Assign(_geometry.OutlineMax); } _materialName = xconfig.Nvl("material"); _materialName = _materialName.Replace('/', '\\'); _material = RContent3dManager.MaterialConsole.FindGroup(_materialName); if (null == _material) { RMoCore.TrackConsole.Write(this, "LoadConfig", "Material is not exists in tempalte. (template={0}, model={1}, material={2})", _template.Name, _modelName, _materialName); } else { if (!_material.Materials.IsEmpty) { FDrMaterial material = _material.Materials.First; _optionDynamic = material.OptionDynamic; _optionMerge = material.OptionMerge; } } _lightMapName = xconfig.Get("light_map", ""); // 读取选项 if (xconfig.Contains("option_visible")) { _optionVisible = xconfig.GetInteger("option_visible"); } // 读取矩阵 FXmlNode xmatrix = xconfig.Find("Matrix"); if (null != xmatrix) { _matrix.LoadSimpleConfig(xmatrix); } }
public virtual void LoadConfig(FXmlNode config) { // Id if (config.Contains(PTY_ID)) { _id = config[PTY_ID]; } }
//============================================================ // <T>加载配置信息。</T> // // @param xconfig 配置信息 //============================================================ public void LoadConfig(FXmlNode xconfig) { _name = xconfig.Get("name"); if (xconfig.Contains("render_target_size")) { _renderTargetSize.Parse(xconfig.Get("render_target_size")); } }
//============================================================ // <T>加载配置信息。</T> // // @param xconfig 配置节点 // @param name 名称 //============================================================ public void LoadConfig(FXmlNode xconfig, string name) { if (xconfig.Contains(name)) { string value = xconfig.Get(name); Parse(value); } }
public override void LoadConfig(FXmlNode config) { base.LoadConfig(config); if (config.Contains(PTY_MAX_COUNT)) { _maxCount = config.GetInteger(PTY_MAX_COUNT); } }
//============================================================ // <T>加载设置信息。</T> // // @param xconfig 设置节点 //============================================================ public void LoadConfig(FXmlNode config) { // 读取延时 if (config.Contains("delay")) { _delay = config.GetInteger("delay"); } }
//============================================================ // <T>加载配置信息。</T> // // @param xconfig 配置节点 // @param name 名称 //============================================================ public void LoadConfig(FXmlNode xconfig, string name) { if (xconfig.Contains(name + "_font")) { _font = xconfig.Get(name + "_font"); } if (xconfig.Contains(name + "_color")) { _color = ColorTranslator.FromHtml(xconfig.Get(name + "_color")); } if (xconfig.Contains(name + "_size")) { _size = RInt.Parse(xconfig.Get(name + "_size")); } if (xconfig.Contains(name + "_bold")) { _bold = xconfig.GetBoolean(name + "_bold"); } if (xconfig.Contains(name + "_italic")) { _italic = xconfig.GetBoolean(name + "_italic"); } if (xconfig.Contains(name + "_strikeout")) { _strikeout = xconfig.GetBoolean(name + "_strikeout"); } if (xconfig.Contains(name + "_underline")) { _underline = xconfig.GetBoolean(name + "_underline"); } }
//============================================================ // <T>加载配置信息。</T> // // @param xconfig 配置信息 //============================================================ public void LoadOrignConfig(FXmlNode xconfig, string code) { if (xconfig.Contains("base" + code)) { _base = xconfig.GetFloat("base" + code); } if (xconfig.Contains("rate" + code)) { _rate = xconfig.GetFloat("rate" + code); } if (xconfig.Contains("level" + code)) { _level = xconfig.GetFloat("level" + code); } if (xconfig.Contains("range" + code)) { _range = xconfig.GetFloat("range" + code); } }
//============================================================ //// <T>获得预览层集合。</T> ////============================================================ //[Browsable(false)] //public FUiControlLayers PreviewLayers { // get { return _previewLayers; } //} //============================================================ // <T>加载设置信息</T> // // @param xconfig 设置信息 //============================================================ public override void OnLoadConfig(FXmlNode xconfig) { base.OnLoadConfig(xconfig); // 加载设计信息 if (xconfig.Contains("design_layers")) { _designLayers = xconfig.GetBoolean("design_layers"); } if (xconfig.Contains("design_back")) { _designBack = xconfig.GetBoolean("design_back"); } if (xconfig.Contains("design_back_color")) { SColor color = new SColor(); color.ParseHex(xconfig.Get("design_back_color")); _designBackColor = Color.FromArgb(color.A, color.R, color.G, color.B); } }
//============================================================ // <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 override void LoadConfig(FXmlNode config) { base.LoadConfig(config); if (config.Contains(PTY_MIN_LENGTH)) { _minLength = config.GetInteger(PTY_MIN_LENGTH); } if (config.Contains(PTY_MAX_LENGTH)) { _maxLength = config.GetInteger(PTY_MAX_LENGTH); } if (config.Contains(PTY_MIN_EQUALS)) { _minEquals = config.GetBoolean(PTY_MIN_EQUALS); } if (config.Contains(PTY_MAX_EQUALS)) { _maxEquals = config.GetBoolean(PTY_MAX_EQUALS); } _description = config[PTY_DESCRIPTION]; }