public override void InitByXml(System.Xml.Linq.XElement xml) { if (xml.Attribute("bitmap") != null) { _bitmap = (Bitmap)LayoutFromFile.Base64StringToObject(xml.Attribute("bitmap").Value); } if (xml.Attribute("osize") != null) { _size = (Size)LayoutFromFile.Base64StringToObject(xml.Attribute("osize").Value); } base.InitByXml(xml); }
/// <summary> /// 通过文件地址构造模板 /// </summary> /// <param name="fname">文件的完整路径</param> public LayoutTemplate(string fname) { if (!File.Exists(fname)) { return; } if (Path.GetExtension(fname).ToLower() != ".gxt") { return; } _name = _text = Path.GetFileNameWithoutExtension(fname); _fullPath = fname; //load layout from .gxt file _layout = LayoutFromFile.LoadFromFile(fname); }
public override void InitByXml(System.Xml.Linq.XElement xml) { if (xml.Attribute("color") != null) { _backColor = (Color)LayoutFromFile.Base64StringToObject(xml.Attribute("color").Value); } if (xml.Attribute("parts") != null) { _parts = (int[])LayoutFromFile.Base64StringToObject(xml.Attribute("parts").Value); } if (xml.Attribute("font") != null) { _font = (Font)LayoutFromFile.Base64StringToObject(xml.Attribute("font").Value); } base.InitByXml(xml); }
public override void InitByXml(System.Xml.Linq.XElement xml) { string att = null; if (xml.Attribute("legenditems") != null) { _legendItems = (LegendItem[])LayoutFromFile.Base64StringToObject(xml.Attribute("legenditems").Value); if (_legendItems != null || _legendItems.Length != 0) { _count = _legendItems.Length; } } if (xml.Attribute("legendtextspan") != null) { att = xml.Attribute("legendtextspan").Value; if (!string.IsNullOrEmpty(att)) { _legendTextSpan = int.Parse(att); } } if (xml.Attribute("legendtextfont") != null) { _legendTextFont = (Font)LayoutFromFile.Base64StringToObject(xml.Attribute("legendtextfont").Value); } if (xml.Attribute("text") != null) { _text = xml.Attribute("text").Value; } if (xml.Attribute("color") != null) { _backColor = (Color)LayoutFromFile.Base64StringToObject(xml.Attribute("color").Value); } if (xml.Attribute("colortablename") != null) { _colorTableName = xml.Attribute("colortablename").Value; } if (xml.Attribute("isshowborder") != null) { _isShowBorder = bool.Parse(xml.Attribute("isshowborder").Value); } if (xml.Attribute("bordercolor") != null) { _borderColor = (Color)LayoutFromFile.Base64StringToObject(xml.Attribute("bordercolor").Value); } base.InitByXml(xml); }
public override void InitByXml(System.Xml.Linq.XElement xml) { if (xml.Attribute("bordercolor") != null) { _borderColor = (Color)LayoutFromFile.Base64StringToObject(xml.Attribute("bordercolor").Value); ReCreateBorderPen(); } if (xml.Attribute("landcolor") != null) { _landColor = (Color)LayoutFromFile.Base64StringToObject(xml.Attribute("landcolor").Value); } if (xml.Attribute("seacolor") != null) { _seaColor = (Color)LayoutFromFile.Base64StringToObject(xml.Attribute("seacolor").Value); } if (xml.Attribute("interestregions") != null) { _interestRegions = (string[])LayoutFromFile.Base64StringToObject(xml.Attribute("interestregions").Value); } if (xml.Attribute("borderwidth") != null) { _borderWidth = int.Parse(xml.Attribute("borderwidth").Value); } if (xml.Attribute("isusedefaultbackgroudlayer") != null) { _isUseDefaultBackgroudLayer = bool.Parse(xml.Attribute("isusedefaultbackgroudlayer").Value); } if (xml.Attribute("backcolor") != null) { _backColor = (Color)LayoutFromFile.Base64StringToObject(xml.Attribute("backcolor").Value); } if (xml.Attribute("isshowborderline") != null) { var att = xml.Attribute("isshowborderline").Value; if (att != null) { _isShowBorderLine = bool.Parse(att); } } if (xml.HasElements) { this._gridXml = xml.Element("GeoGridLayer"); } base.InitByXml(xml); }
public override void InitByXml(System.Xml.Linq.XElement xml) { string att = null; if (xml.Attribute("northarrowlabelstring") != null) { att = xml.Attribute("northarrowlabelstring").Value; if (!String.IsNullOrEmpty(att)) { _NNameString = att; } } if (xml.Attribute("color") != null) { _backColor = (Color)LayoutFromFile.Base64StringToObject(xml.Attribute("color").Value); } base.InitByXml(xml); }
public override void InitByXml(System.Xml.Linq.XElement xml) { string att = null; if (xml.Attribute("angleheader") != null) { att = xml.Attribute("angleheader").Value; if (!String.IsNullOrEmpty(att)) { _angleHeader = float.Parse(att); } } if (xml.Attribute("color") != null) { _backColor = (Color)LayoutFromFile.Base64StringToObject(xml.Attribute("color").Value); } base.InitByXml(xml); }
public override void InitByXml(System.Xml.Linq.XElement xml) { if (xml.Attribute("linewidth") != null) { _lineWid = int.Parse(xml.Attribute("linewidth").Value); } string value = string.Empty; if (xml.Attribute("isshowborder") != null) { value = xml.Attribute("isshowborder").Value; _isShowBorder = StringToBool(value); } if (xml.Attribute("color") != null) { _color = (Color)LayoutFromFile.Base64StringToObject(xml.Attribute("color").Value); _brush = new SolidBrush(_color); } base.InitByXml(xml); }
public override void InitByXml(System.Xml.Linq.XElement xml) { if (xml.Attribute("backcolor") != null) { _backColor = (Color)LayoutFromFile.Base64StringToObject(xml.Attribute("backcolor").Value); } if (xml.Attribute("color") != null) { _fontColor = (Color)LayoutFromFile.Base64StringToObject(xml.Attribute("color").Value); if (!_fontColor.IsEmpty) { _fontBrush.Color = _fontColor; } } if (xml.Attribute("text") != null) { _text = FilterTransstr(xml.Attribute("text").Value); } if (xml.Attribute("font") != null) { _font = (Font)LayoutFromFile.Base64StringToObject(xml.Attribute("font").Value); } if (xml.Attribute("size") != null) { _size = (SizeF)LayoutFromFile.Base64StringToObject(xml.Attribute("size").Value); } if (xml.Attribute("maskcolor") != null) { _maskBrush.Color = (Color)LayoutFromFile.Base64StringToObject(xml.Attribute("maskcolor").Value); } if (xml.Attribute("displaymaskcolor") != null) { _displayMaskColor = bool.Parse(xml.Attribute("displaymaskcolor").Value); } if (xml.Attribute("leanangle") != null) { _leanAngle = float.Parse(xml.Attribute("leanangle").Value); ComputeShearXValue(); } base.InitByXml(xml); }
public override void InitByXml(System.Xml.Linq.XElement xml) { if (xml.Attribute("backcolor") != null) { _backColor = (Color)LayoutFromFile.Base64StringToObject(xml.Attribute("backcolor").Value); _brush = new SolidBrush(_backColor); } if (xml.Attribute("size") != null) { _size = (SizeF)LayoutFromFile.Base64StringToObject(xml.Attribute("size").Value); } if (xml.Attribute("isshowborderline") != null) { var att = xml.Attribute("isshowborderline").Value; if (att != null) { _isShowBorderLine = bool.Parse(att); } } base.InitByXml(xml); }
public override void InitByXml(System.Xml.Linq.XElement xml) { if (xml.Attribute("color") != null) _backColor = (Color)LayoutFromFile.Base64StringToObject(xml.Attribute("color").Value); base.InitByXml(xml); }
public static ILayoutTemplate CreateFrom(string xmlContent) { ILayout layout = LayoutFromFile.LoadFromXml(xmlContent); return(new LayoutTemplate(layout)); }