Пример #1
0
 //============================================================
 // <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");
     }
 }
Пример #2
0
 //============================================================
 // <T>加载设置信息。</T>
 //
 // @param xconfig 设置信息
 //============================================================
 public override void OnLoadConfig(FXmlNode xconfig)
 {
     base.OnLoadConfig(xconfig);
     // 获得属性
     _dataTrue  = xconfig.Get("data_true", _dataTrue);
     _dataFalse = xconfig.Get("data_false", _dataFalse);
 }
Пример #3
0
 //============================================================
 // <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");
     }
 }
Пример #4
0
      //============================================================
      // <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);
         }
      }
Пример #5
0
 //============================================================
 // <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);
         }
     }
 }
Пример #6
0
 //============================================================
 // <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"));
     }
 }
Пример #7
0
 //============================================================
 // <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();
 }
Пример #8
0
        //============================================================
        // <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);
        }
Пример #9
0
 //============================================================
 // <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"));
     }
 }
Пример #10
0
        //============================================================
        // <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);
            }
        }
Пример #11
0
 //============================================================
 // <T>加载配置信息。</T>
 //
 // @param xconfig 配置信息
 //============================================================
 public void LoadOrignConfig(FXmlNode xconfig)
 {
     // 获得属性
     _typeName = xconfig.Get("type");
     _interval = xconfig.GetInteger("tick");
     _rotation.Parse(xconfig.Get("rotation"));
     _rotation.Mul(40);
 }
Пример #12
0
 //============================================================
 // <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"));
     }
 }
Пример #13
0
 //============================================================
 // <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);
 }
Пример #14
0
        //============================================================
        // <T>加载配置文件。</T>
        //============================================================
        public void LoadConfig(FXmlNode config)
        {
            if (config.Contains("cell_count"))
            {
                _cellCount.Parse(config.Get("cell_count"));
            }
            if (config.Contains("cell_size"))
            {
                _cellSize.Parse(config.Get("cell_size"));
            }
            if (config.Contains("type_cd"))
            {
                _typeCd = REnum.ToValue <EMapLayerType>(config.Get("type_cd"));
            }
            if (config.Contains("scroll_cd"))
            {
                _scrollCd = REnum.ToValue <EMapLayerScroll>(config.Get("scroll_cd"));
            }
            if (config.Contains("wrap_cd"))
            {
                _wrapCd = REnum.ToValue <EMapLayerWrap>(config.Get("wrap_cd"));
            }
            if (config.Contains("scroll_speed"))
            {
                _scrollSpeed = config.GetFloat("scroll_speed");
            }
            _tileNode = config.Find("Tiles");
            if (null == _tileNode)
            {
                return;
            }
            // 创建所有格子
            for (int m = 0; m < _cellCount.Height; m++)
            {
                for (int n = 0; n < _cellCount.Width; n++)
                {
                    FMbMapCell cell = new FMbMapCell();
                    cell.Index = new SIntPoint2(n, m);
                    _mapCell.Push(cell);
                }
            }

            // 加载格子资源图片编号
            foreach (FXmlNode cellNode in _tileNode.Nodes)
            {
                FDsMapCell cell = new FDsMapCell();
                cell.Resource.LoadConfig(cellNode);
                SIntPoint2 cellIndex = cell.Resource.Index;
                FMbMapCell c         = FingCellByIndex(cellIndex.X, cellIndex.Y);
                c.ResourceId = cell.Resource.ResourceId;
            }
        }
Пример #15
0
 //============================================================
 // <T>加载设置信息</T>
 //
 // @param xconfig 设置信息
 //============================================================
 public override void OnLoadConfig(FXmlNode xconfig)
 {
     base.OnLoadConfig(xconfig);
     // 加载属性
     _dataName      = xconfig.Get("data_name");
     _dataType      = REnum.ToValue <EDataType>(xconfig.Get("data_type"));
     _dataKey       = xconfig.GetBoolean("data_key");
     _dataRequire   = xconfig.GetBoolean("data_require");
     _dataValue     = xconfig.Get("data_value");
     _dataDefault   = xconfig.Get("data_default");
     _dataOrder     = xconfig.Get("data_order");
     _queryAble     = xconfig.GetBoolean("query_able");
     _insertAble    = xconfig.GetBoolean("insert_able");
     _updateAble    = xconfig.GetBoolean("update_able");
     _deleteAble    = xconfig.GetBoolean("delete_able");
     _displaySearch = xconfig.GetBoolean("display_search");
     _displayPicker = xconfig.GetBoolean("display_picker");
     _displayZoom   = xconfig.GetBoolean("display_zoom");
     _editInsert    = xconfig.GetBoolean("edit_insert");
     _editUpdate    = xconfig.GetBoolean("edit_update");
     _editDelete    = xconfig.GetBoolean("edit_delete");
     _validInsert   = xconfig.GetBoolean("valid_insert");
     _validUpdate   = xconfig.GetBoolean("valid_update");
     _validDelete   = xconfig.GetBoolean("valid_delete");
     _searchAble    = xconfig.GetBoolean("search_able");
     _searchValue   = xconfig.Get("search_value");
     _searchTypeCd  = REnum.ToValue <EDataSearch>(xconfig.Get("search_type_cd"));
     _searchLabel   = xconfig.Get("search_label");
 }
Пример #16
0
 //============================================================
 // <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"));
     }
 }
Пример #17
0
 //============================================================
 // <T>加载配置文件。</T>
 //============================================================
 public void LoadConfig(FXmlNode config)
 {
     if (config.Contains("template_id"))
     {
         _templateId = RInt.Parse(config.Get("template_id"));
     }
 }
Пример #18
0
        //============================================================
        // <T>加载设置信息。</T>
        //
        // @param xconfig 设置节点
        //============================================================
        public override void LoadConfig(FXmlNode xconfig)
        {
            base.LoadConfig(xconfig);
            // 读取属性
            _optionAlpha    = xconfig.GetBoolean("option_alpha", _optionAlpha);
            _optionPadding  = xconfig.GetBoolean("option_padding", _optionPadding);
            _qualityCd      = xconfig.Get("quality_cd", _qualityCd);
            _qualityPalette = xconfig.GetInteger("quality_palette", _qualityPalette);
            _qualityAlpha   = xconfig.GetInteger("quality_alpha", _qualityAlpha);
            _frameDelay     = xconfig.GetInteger("frame_delay", _frameDelay);
            // 读取剪辑集合
            FXmlNode xclips = xconfig.Find("Clips");

            if (xclips != null)
            {
                foreach (FXmlNode xnode in xclips.Nodes)
                {
                    if (xnode.IsName("Clip"))
                    {
                        // 检查参数
                        if (!xnode.Contains("direction_cd"))
                        {
                            continue;
                        }
                        // 加载剪辑信息
                        int             directionCd = xnode.GetInteger("direction_cd");
                        FRsResourceClip clip        = _clips[directionCd];
                        if (clip != null)
                        {
                            clip.LoadConfig(xnode);
                        }
                    }
                }
            }
        }
Пример #19
0
 //============================================================
 // <T>加载配置信息。</T>
 //
 // @param xconfig 配置信息
 //============================================================
 public void LoadOrignConfig(FXmlNode xconfig)
 {
     // 读取属性
     _typeName = xconfig.Get("type");
     // 读取节点集合
     foreach (FXmlNode xnode in xconfig.Nodes)
     {
         // 读取阴影
         if (xnode.IsName("Shadow"))
         {
             if (xnode.Contains("mode"))
             {
                 string mode = xnode.Get("mode");
                 if (mode == "auto")
                 {
                     _optionTrack = EDrFlag.Yes;
                 }
             }
             _shadow1.LoadOrignConfig(xnode, "1");
             _shadow2.LoadOrignConfig(xnode, "2");
             _shadow3.LoadOrignConfig(xnode, "3");
         }
         // 读取材质
         if (xnode.IsName("Material"))
         {
             _material.LoadOrignConfig(xnode);
         }
         // 读取相机
         if (xnode.IsName("Camera"))
         {
             _camera.LoadOrignConfig(xnode);
         }
     }
 }
Пример #20
0
 //============================================================
 // <T>加载设置信息。</T>
 //
 // @param xconfig 设置信息
 //============================================================
 public override void OnLoadConfig(FXmlNode xconfig)
 {
     base.OnLoadConfig(xconfig);
     // 读取数据
     _optionHand    = xconfig.GetBoolean("option_hand", _optionHand);
     _validInterval = xconfig.GetInteger("valid_interval", _validInterval);
     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);
     _groundResource.LoadConfig(xconfig, "ground");
     // 读取事件
     _onClickControl = xconfig.Get("on_click_control", _onClickControl);
 }
Пример #21
0
 //============================================================
 // <T>加载配置信息。</T>
 //
 // @param xconfig 配置信息
 //============================================================
 public void LoadConfig(FXmlNode xconfig)
 {
     // 存储属性
     _themeName = xconfig.Get("theme_code", _themeName);
     // 读取子节点
     foreach (FXmlNode xnode in xconfig.Nodes)
     {
         // 读取技术信息
         if (xnode.IsName("Technique"))
         {
             _technique.LoadConfig(xnode);
         }
         // 读取区域信息
         if (xnode.IsName("Region"))
         {
             _region.LoadConfig(xnode);
         }
         // 读取天空信息
         if (xnode.IsName("Sky"))
         {
             _sky.LoadConfig(xnode);
         }
         // 读取地图信息
         if (xnode.IsName("Map"))
         {
             _map.LoadConfig(xnode);
         }
         // 读取区域信息
         if (xnode.IsName("Space"))
         {
             _space.LoadConfig(xnode);
         }
     }
 }
Пример #22
0
 //============================================================
 // <T>加载配置信息。</T>
 //
 // @param xconfig 配置信息
 //============================================================
 public void LoadOrignConfig(FXmlNode xconfig)
 {
     // 获得属性
     _source   = xconfig.Get("src");
     _template = RContent3dManager.TemplateConsole.Find(_source);
     if (null == _template)
     {
         RMoCore.TrackConsole.Write(this, "LoadOrignConfig", "Template is not exists. (scene={0}, template={1})", _scene.Name, _source);
     }
     // 获得节点集合
     foreach (FXmlNode xnode in xconfig.Nodes)
     {
         // 加载矩阵
         if (xnode.IsName("Matrix"))
         {
             _modelMatrix.LoadSingleConfig(xnode);
         }
         // 加载动画集合
         if (xnode.IsName("Movies"))
         {
             foreach (FXmlNode xmovie in xnode.Nodes)
             {
                 if (xmovie.IsName("Movie"))
                 {
                     FDrSceneMovie movie = new FDrSceneMovie();
                     movie.LoadOrignConfig(xmovie);
                     _movies.Push(movie);
                 }
             }
         }
         // 加载材质集合
         if (xnode.IsName("Materials"))
         {
             foreach (FXmlNode xmaterial in xnode.Nodes)
             {
                 if (xmaterial.IsName("Material"))
                 {
                     FDrSceneMaterial material = new FDrSceneMaterial();
                     material.Scene = _scene;
                     material.LoadOrignConfig(xmaterial);
                     _materials.Push(material);
                 }
             }
         }
         // 加载渲染集合
         if (xnode.IsName("Renderables"))
         {
             foreach (FXmlNode xrenderable in xnode.Nodes)
             {
                 if (xrenderable.IsName("Renderables"))
                 {
                     FDrSceneRenderable renderable = new FDrSceneRenderable();
                     renderable.LoadOrignConfig(xrenderable);
                     _renderables.Push(renderable);
                 }
             }
         }
     }
 }
Пример #23
0
        //============================================================
        // <T>加载配置信息。</T>
        //
        // @param config 配置信息
        //============================================================
        public void LoadConfig(FXmlNode xconfig)
        {
            // 加载编号
            _id = xconfig.GetInteger("id");
            // 加载名称
            _name = xconfig.Get("name");
            // 加载层数
            _layerCount = xconfig.GetInteger("layer_count");
            // 加载尺寸
            _size.Parse(xconfig.Get("size"));
            // 加载切割尺寸
            _range.Parse(xconfig.Get("range"));
            // 加载深度
            _deep = xconfig.GetFloat("deep");

            _incise = RInt.Parse(xconfig.GetFloat("deep"));
            //............................................................
            // 加载高度纹理
            FXmlNode xheight = xconfig.Find("Height");

            if (null != xheight)
            {
                _textureHeight = xheight.Get("source");
            }
            // 加载颜色纹理
            FXmlNode xcolor = xconfig.Find("Color");

            if (null != xcolor)
            {
                _textureColor = xcolor.Get("source");
            }
            //............................................................
            // 加载层信息
            FXmlNode xlayers = xconfig.Find("Layers");

            if (null != xlayers)
            {
                foreach (FXmlNode xlayer in xlayers.Nodes)
                {
                    FDrMapLayer layer = new FDrMapLayer();
                    layer.Index = _layers.Count;
                    layer.LoadConfig(xlayer);
                    _layers.Push(layer);
                }
            }
        }
Пример #24
0
        //============================================================
        // <T>加载设置信息。</T>
        //
        // @param xconfig 配置信息
        //============================================================
        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);
            // 读取属性
            _tick = xconfig.GetInteger("tick", _tick);
        }
Пример #25
0
        //============================================================
        // <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");
            _source     = _source.Replace('/', '\\');
            _sourceType = xconfig.Nvl("source_type");
        }
Пример #26
0
 //============================================================
 // <T>加载配置信息。</T>
 //
 // @param xconfig 配置节点
 // @param name 名称
 //============================================================
 public void LoadConfig(FXmlNode xconfig, string name)
 {
     if (xconfig.Contains(name))
     {
         string value = xconfig.Get(name);
         Parse(value);
     }
 }
Пример #27
0
        //============================================================
        // <T>执行复制命令。<T>
        //============================================================
        public void SaveCopy()
        {
            int count = lvwCopy.CheckedItems.Count;

            if (0 != count)
            {
                FXmlDocument xmldoc = new FXmlDocument();
                for (int i = 0; i < count; i++)
                {
                    ListViewItem listViewItem = lvwCopy.Items[i];
                    FXmlNode     node         = listViewItem.Tag as FXmlNode;
                    string       from         = node.Get("from");
                    string       target       = node.Get("target");
                    xmldoc.LoadFile(from);
                    xmldoc.SaveFile(target);
                }
            }
        }
Пример #28
0
 public void LoadConfig(FXmlNode config)
 {
     if (config.Contains("index"))
     {
         _index.Parse(config.Get("index"));
     }
     if (config.Contains("resource_id"))
     {
         _resourceId = config.GetInteger("resource_id");
     }
 }
Пример #29
0
 //============================================================
 // <T>执行模版分页导出。<T>
 //============================================================
 public void SaveTemplate()
 {
     using (FXlsDocument xlsDoc = new FXlsDocument()) {
         int itemCount = lvwTemplate.CheckedItems.Count;
         for (int i = 0; i < itemCount; i++)
         {
             ListViewItem template = lvwTemplate.Items[i];
             FXmlNode     node     = template.Tag as FXmlNode;
             if (template.Checked)
             {
                 string source = node.Get("source");
                 string tag    = node.Get("tag");
                 string target = node.Get("target");
                 string name   = node.Get("name");
                 xlsDoc.LoadFile(_templateSource + source);
                 xlsDoc.SaveXmlPath((_templateTarget + target), tag);
             }
         }
     }
 }
Пример #30
0
 //============================================================
 // <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);
 }