Esempio n. 1
0
        public static SimplePolygonSymbol ReadFrom(ArcXmlReader reader)
        {
            try
            {
                SimplePolygonSymbol simplePolygonSymbol = new SimplePolygonSymbol();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "antialiasing": simplePolygonSymbol.Antialiasing = Convert.ToBoolean(value); break;

                            case "boundary": simplePolygonSymbol.Boundary = Convert.ToBoolean(value); break;

                            case "boundarycaptype": simplePolygonSymbol.BoundaryCapType = (CapType)ArcXmlEnumConverter.ToEnum(typeof(CapType), value); break;

                            case "boundarycolor": simplePolygonSymbol.BoundaryColor = Color.FromArgb(simplePolygonSymbol.BoundaryColor.A, ColorConverter.ToColor(value)); break;

                            case "boundaryjointype": simplePolygonSymbol.BoundaryJoinType = (JoinType)ArcXmlEnumConverter.ToEnum(typeof(JoinType), value); break;

                            case "boundarytype": simplePolygonSymbol.BoundaryType = (LineType)ArcXmlEnumConverter.ToEnum(typeof(LineType), value); break;

                            case "boundarywidth": simplePolygonSymbol.BoundaryWidth = Convert.ToInt32(value); break;

                            case "fillcolor": simplePolygonSymbol.FillColor = Color.FromArgb(simplePolygonSymbol.FillColor.A, ColorConverter.ToColor(value)); break;

                            case "fillinterval": simplePolygonSymbol.FillInterval = Convert.ToInt32(value); break;

                            case "filltype": simplePolygonSymbol.FillType = (FillType)ArcXmlEnumConverter.ToEnum(typeof(FillType), value); break;

                            case "overlap": simplePolygonSymbol.Overlap = Convert.ToBoolean(value); break;

                            case "transparency": simplePolygonSymbol.Transparency = Convert.ToDouble(value); break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(simplePolygonSymbol);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 2
0
        public static ShieldSymbol ReadFrom(ArcXmlReader reader)
        {
            try
            {
                ShieldSymbol shieldSymbol = new ShieldSymbol();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "antialiasing": shieldSymbol.Antialiasing = Convert.ToBoolean(value); break;

                            case "bottomcolor": shieldSymbol.BottomColor = ColorConverter.ToColor(value); break;

                            case "font": shieldSymbol.Font = value; break;

                            case "fontcolor": shieldSymbol.FontColor = ColorConverter.ToColor(value); break;

                            case "fontsize": shieldSymbol.FontSize = Convert.ToInt32(value); break;

                            case "fontstyle": shieldSymbol.FontStyle = (FontStyle)ArcXmlEnumConverter.ToEnum(typeof(FontStyle), value); break;

                            case "labelmode": shieldSymbol.LabelMode = (ShieldLabelMode)ArcXmlEnumConverter.ToEnum(typeof(ShieldLabelMode), value); break;

                            case "middlecolor": shieldSymbol.MiddleColor = ColorConverter.ToColor(value); break;

                            case "minsize": shieldSymbol.MinSize = Convert.ToInt32(value); break;

                            case "shadow": shieldSymbol.Shadow = ColorConverter.ToColor(value); break;

                            case "topcolor": shieldSymbol.TopColor = ColorConverter.ToColor(value); break;

                            case "transparency": shieldSymbol.Transparency = Convert.ToDouble(value); break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(shieldSymbol);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 3
0
        public static ChartSymbol ReadFrom(ArcXmlReader reader)
        {
            try
            {
                ChartSymbol chartSymbol = new ChartSymbol();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "antialiasing": chartSymbol.Antialiasing = Convert.ToBoolean(value); break;

                            case "maxsize": chartSymbol.MaxSize = Convert.ToInt32(value); break;

                            case "maxvalue": chartSymbol.MaxValue = Convert.ToInt32(value); break;

                            case "minsize": chartSymbol.MinSize = Convert.ToInt32(value); break;

                            case "minvalue": chartSymbol.MinValue = Convert.ToInt32(value); break;

                            case "mode": chartSymbol.Mode = (ChartSymbolMode)ArcXmlEnumConverter.ToEnum(typeof(ChartSymbolMode), value); break;

                            case "outline": chartSymbol.Outline = ColorConverter.ToColor(value); break;

                            case "shadow": chartSymbol.Shadow = ColorConverter.ToColor(value); break;

                            case "size": chartSymbol.Size = Convert.ToInt32(value); break;

                            case "sizefield": chartSymbol.SizeField = value; break;

                            case "transparency": chartSymbol.Transparency = Convert.ToDouble(value); break;

                            case "width": chartSymbol.Width = Convert.ToInt32(value); break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(chartSymbol);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 4
0
        public static ValueMapRenderer ReadFrom(ArcXmlReader reader)
        {
            try
            {
                ValueMapRenderer valueMapRenderer = new ValueMapRenderer();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "lookupfield": valueMapRenderer.LookupField = value; break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                if (!reader.IsEmptyElement)
                {
                    reader.Read();

                    while (!(reader.NodeType == XmlNodeType.EndElement && reader.Name == XmlName))
                    {
                        if (reader.NodeType == XmlNodeType.Element)
                        {
                            switch (reader.Name)
                            {
                            case Exact.XmlName: valueMapRenderer.Classifications.Add(Exact.ReadFrom(reader)); break;

                            case Other.XmlName: valueMapRenderer.Classifications.Add(Other.ReadFrom(reader)); break;

                            case Range.XmlName: valueMapRenderer.Classifications.Add(Range.ReadFrom(reader)); break;
                            }
                        }

                        reader.Read();
                    }
                }

                return(valueMapRenderer);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 5
0
        public static DataFrameInfo ReadFrom(ArcXmlReader reader)
        {
            try
            {
                DataFrameInfo dataFrameInfo = new DataFrameInfo();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "default": dataFrameInfo.Default = Convert.ToBoolean(value); break;

                            case "name": dataFrameInfo.Name = value; break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                if (!reader.IsEmptyElement)
                {
                    reader.Read();

                    while (!(reader.NodeType == XmlNodeType.EndElement && reader.Name == XmlName))
                    {
                        if (reader.NodeType == XmlNodeType.Element)
                        {
                            switch (reader.Name)
                            {
                            case Properties.XmlName: dataFrameInfo.Properties = Properties.ReadFrom(reader); break;

                            case LayerInfo.XmlName: dataFrameInfo.LayerInfos.Add(LayerInfo.ReadFrom(reader)); break;
                            }
                        }

                        reader.Read();
                    }
                }

                return(dataFrameInfo);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 6
0
        public static CallOutMarkerSymbol ReadFrom(ArcXmlReader reader)
        {
            try
            {
                CallOutMarkerSymbol callOutMarkerSymbol = new CallOutMarkerSymbol();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "antialiasing": callOutMarkerSymbol.Antialiasing = Convert.ToBoolean(value); break;

                            case "backcolor": callOutMarkerSymbol.BackColor = ColorConverter.ToColor(value); break;

                            case "boundarycolor": callOutMarkerSymbol.BoundaryColor = ColorConverter.ToColor(value); break;

                            case "font": callOutMarkerSymbol.Font = value; break;

                            case "fontcolor": callOutMarkerSymbol.FontColor = ColorConverter.ToColor(value); break;

                            case "fontsize": callOutMarkerSymbol.FontSize = Convert.ToInt32(value); break;

                            case "fontstyle": callOutMarkerSymbol.FontStyle = (FontStyle)ArcXmlEnumConverter.ToEnum(typeof(FontStyle), value); break;

                            case "glowing": callOutMarkerSymbol.Glowing = ColorConverter.ToColor(value); break;

                            case "interval": callOutMarkerSymbol.Interval = Convert.ToInt32(value); break;

                            case "outline": callOutMarkerSymbol.Outline = ColorConverter.ToColor(value); break;

                            case "shadow": callOutMarkerSymbol.Shadow = ColorConverter.ToColor(value); break;

                            case "transparency": callOutMarkerSymbol.Transparency = Convert.ToDouble(value); break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(callOutMarkerSymbol);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 7
0
        public static Error ReadFrom(ArcXmlReader reader)
        {
            try
            {
                Error error = new Error();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "machine": error.Machine = value; break;

                            case "processid": error.ProcessID = Convert.ToInt32(value); break;

                            case "threadid": error.ThreadID = Convert.ToInt32(value); break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                if (!reader.IsEmptyElement)
                {
                    reader.Read();

                    while (!(reader.NodeType == XmlNodeType.EndElement && reader.Name == XmlName))
                    {
                        if (reader.NodeType == XmlNodeType.Text)
                        {
                            error.Text = reader.Value;
                        }

                        reader.Read();
                    }
                }

                return(error);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 8
0
        public static Bands ReadFrom(ArcXmlReader reader)
        {
            try
            {
                Bands bands = new Bands();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "rasterid": bands.RasterID = value; break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                if (!reader.IsEmptyElement)
                {
                    reader.Read();

                    while (!(reader.NodeType == XmlNodeType.EndElement && reader.Name == XmlName))
                    {
                        if (reader.NodeType == XmlNodeType.Element)
                        {
                            switch (reader.Name)
                            {
                            case Band.XmlName: bands.Add(Band.ReadFrom(reader)); break;
                            }
                        }

                        reader.Read();
                    }
                }

                return(bands);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 9
0
		public static LayoutInfo ReadFrom(ArcXmlReader reader)
		{
			try
			{
				LayoutInfo layoutInfo = new LayoutInfo();

				if (reader.HasAttributes)
				{
					while (reader.MoveToNextAttribute())
					{
						string value = reader.ReadContentAsString();

						if (value.Length > 0)
						{
							switch (reader.Name)
							{
								case "pageunits": layoutInfo.PageUnits = (PageUnits)ArcXmlEnumConverter.ToEnum(typeof(PageUnits), value); break;
							}
						}
					}

					reader.MoveToElement();
				}

				if (!reader.IsEmptyElement)
				{
					reader.Read();

					while (!(reader.NodeType == XmlNodeType.EndElement && reader.Name == XmlName))
					{
						if (reader.NodeType == XmlNodeType.Element)
						{
							switch (reader.Name)
							{
                case "ENVELOPE": layoutInfo.Envelope = EnvelopeSerializer.ReadFrom(reader); break;
              }
						}

						reader.Read();
					}
				}

				return layoutInfo;
			}
			catch (Exception ex)
			{
				if (ex is ArcXmlException)
				{
					throw ex;
				}
				else
				{
					throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
				}
			}
		}
Esempio n. 10
0
        public static Extension ReadFrom(ArcXmlReader reader)
        {
            try
            {
                Extension extension = new Extension();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "type": extension.Type = (ExtensionType)ArcXmlEnumConverter.ToEnum(typeof(ExtensionType), value); break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                if (!reader.IsEmptyElement)
                {
                    reader.Read();

                    while (!(reader.NodeType == XmlNodeType.EndElement && reader.Name == XmlName))
                    {
                        if (reader.NodeType == XmlNodeType.Element)
                        {
                            switch (reader.Name)
                            {
                            case GcStyle.XmlName: extension.GcStyle = GcStyle.ReadFrom(reader); break;
                            }
                        }

                        reader.Read();
                    }
                }

                return(extension);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 11
0
        public static FieldValue ReadFrom(ArcXmlReader reader)
        {
            try
            {
                FieldValue fieldValue = new FieldValue();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "valuestring": fieldValue.ValueString = value; break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                if (!reader.IsEmptyElement)
                {
                    reader.Read();

                    while (!(reader.NodeType == XmlNodeType.EndElement && reader.Name == XmlName))
                    {
                        if (reader.NodeType == XmlNodeType.Element)
                        {
                            switch (reader.Name)
                            {
                            case "POINT": fieldValue.Point = (IPoint)GeometrySerializer.ReadFrom(reader); break;
                            }
                        }

                        reader.Read();
                    }
                }

                return(fieldValue);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 12
0
		public static TocGroup ReadFrom(ArcXmlReader reader)
		{
			try
			{
				TocGroup tocGroup = new TocGroup();

				if (reader.HasAttributes)
				{
					while (reader.MoveToNextAttribute())
					{
						string value = reader.ReadContentAsString();

						if (value.Length > 0)
						{
							switch (reader.Name)
							{
								case "heading": tocGroup.Heading = value; break;
							}
						}
					}

					reader.MoveToElement();
				}

				if (!reader.IsEmptyElement)
				{
					reader.Read();

					while (!(reader.NodeType == XmlNodeType.EndElement && reader.Name == XmlName))
					{
						if (reader.NodeType == XmlNodeType.Element)
						{
							switch (reader.Name)
							{
								case TocClass.XmlName: tocGroup.Add(TocClass.ReadFrom(reader)); break;
							}
						}

						reader.Read();
					}
				}

				return tocGroup;
			}
			catch (Exception ex)
			{
				if (ex is ArcXmlException)
				{
					throw ex;
				}
				else
				{
					throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
				}
			}
		}
Esempio n. 13
0
        public static SimpleMarkerSymbol ReadFrom(ArcXmlReader reader)
        {
            try
            {
                SimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbol();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "antialiasing": simpleMarkerSymbol.Antialiasing = Convert.ToBoolean(value); break;

                            case "color": simpleMarkerSymbol.Color = ColorConverter.ToColor(value); break;

                            case "outline": simpleMarkerSymbol.Outline = ColorConverter.ToColor(value); break;

                            case "overlap": simpleMarkerSymbol.Overlap = Convert.ToBoolean(value); break;

                            case "shadow": simpleMarkerSymbol.Shadow = ColorConverter.ToColor(value); break;

                            case "transparency": simpleMarkerSymbol.Transparency = Convert.ToDouble(value); break;

                            case "type": simpleMarkerSymbol.Type = (MarkerType)ArcXmlEnumConverter.ToEnum(typeof(MarkerType), value); break;

                            case "usecentroid": simpleMarkerSymbol.UseCentroid = Convert.ToBoolean(value); break;

                            case "width": simpleMarkerSymbol.Width = Convert.ToInt32(value); break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(simpleMarkerSymbol);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 14
0
        public static Envelope ReadFrom(ArcXmlReader reader)
        {
            try
            {
                double minx = Double.NaN;
                double miny = Double.NaN;
                double maxx = Double.NaN;
                double maxy = Double.NaN;

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "minx": minx = Convert.ToDouble(value); break;

                            case "miny": miny = Convert.ToDouble(value); break;

                            case "maxx": maxx = Convert.ToDouble(value); break;

                            case "maxy": maxy = Convert.ToDouble(value); break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                if (Double.IsNaN(minx) || Double.IsNaN(minx) || Double.IsNaN(minx) || Double.IsNaN(minx))
                {
                    return(new Envelope());
                }
                else
                {
                    return(new Envelope(new Coordinate(minx, miny), new Coordinate(maxx, maxy)));
                }
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException("Could not read ENVELOPE element.", ex);
                }
            }
        }
Esempio n. 15
0
        public static HashLineSymbol ReadFrom(ArcXmlReader reader)
        {
            try
            {
                HashLineSymbol hashLineSymbol = new HashLineSymbol();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "antialiasing": hashLineSymbol.Antialiasing = Convert.ToBoolean(value); break;

                            case "color": hashLineSymbol.Color = ColorConverter.ToColor(value); break;

                            case "interval": hashLineSymbol.Interval = Convert.ToInt32(value); break;

                            case "linethickness": hashLineSymbol.LineThickness = Convert.ToInt32(value); break;

                            case "tickthickness": hashLineSymbol.TickThickness = Convert.ToInt32(value); break;

                            case "overlap": hashLineSymbol.Overlap = Convert.ToBoolean(value); break;

                            case "transparency": hashLineSymbol.Transparency = Convert.ToDouble(value); break;

                            case "type": hashLineSymbol.Type = (HashLineType)ArcXmlEnumConverter.ToEnum(typeof(HashLineType), value); break;

                            case "width": hashLineSymbol.Width = Convert.ToInt32(value); break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(hashLineSymbol);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 16
0
        public static Query ReadFrom(ArcXmlReader reader)
        {
            try
            {
                Query query = new Query();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "accuracy": query.Accuracy = Convert.ToDouble(value); break;

                            case "featurelimit": query.FeatureLimit = Convert.ToInt32(value); break;

                            case "joinexpression": query.JoinExpression = value; break;

                            case "jointables": query.JoinTables = value; break;

                            case "subfields": query.Subfields = value; break;

                            case "where": query.Where = value; break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(query);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 17
0
        public static GradientFillSymbol ReadFrom(ArcXmlReader reader)
        {
            try
            {
                GradientFillSymbol gradientFillSymbol = new GradientFillSymbol();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "antialiasing": gradientFillSymbol.Antialiasing = Convert.ToBoolean(value); break;

                            case "finishcolor": gradientFillSymbol.FinishColor = ColorConverter.ToColor(value); break;

                            case "overlap": gradientFillSymbol.Overlap = Convert.ToBoolean(value); break;

                            case "startcolor": gradientFillSymbol.StartColor = ColorConverter.ToColor(value); break;

                            case "transparency": gradientFillSymbol.Transparency = Convert.ToDouble(value); break;

                            case "type": gradientFillSymbol.Type = (GradientFillType)ArcXmlEnumConverter.ToEnum(typeof(GradientFillType), value); break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(gradientFillSymbol);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 18
0
        public static ImageSize ReadFrom(ArcXmlReader reader)
        {
            try
            {
                ImageSize imageSize = new ImageSize();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "height": imageSize.Height = Convert.ToInt32(value); break;

                            case "width": imageSize.Width = Convert.ToInt32(value); break;

                            case "dpi": imageSize.Dpi = Convert.ToInt32(value); break;

                            case "printheight": imageSize.PrintHeight = Convert.ToInt32(value); break;

                            case "printwidth": imageSize.PrintWidth = Convert.ToInt32(value); break;

                            case "scalesymbols": imageSize.ScaleSymbols = Convert.ToBoolean(value); break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(imageSize);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 19
0
        public static RasterRange ReadFrom(ArcXmlReader reader)
        {
            try
            {
                RasterRange rasterRange = new RasterRange();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "color": rasterRange.Color = ColorConverter.ToColor(value); break;

                            case "equality": rasterRange.Equality = (RangeEquality)ArcXmlEnumConverter.ToEnum(typeof(RangeEquality), value); break;

                            case "label": rasterRange.Label = value; break;

                            case "lower": rasterRange.Lower = Convert.ToDouble(value); break;

                            case "transparency": rasterRange.Transparency = Convert.ToDouble(value); break;

                            case "upper": rasterRange.Upper = Convert.ToDouble(value); break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(rasterRange);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 20
0
        public static ChartValue ReadFrom(ArcXmlReader reader)
        {
            try
            {
                ChartValue chartValue = new ChartValue();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "color": chartValue.Color = ColorConverter.ToColor(value); break;

                            case "lookupfield": chartValue.LookUpField = value; break;

                            case "lower": chartValue.Lower = Convert.ToInt32(value); break;

                            case "upper": chartValue.Upper = Convert.ToInt32(value); break;

                            case "value": chartValue.Value = Convert.ToInt32(value); break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(chartValue);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 21
0
        public static GcInput ReadFrom(ArcXmlReader reader)
        {
            try
            {
                GcInput gcInput = new GcInput();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "description": gcInput.Description = value; break;

                            case "id": gcInput.ID = value; break;

                            case "label": gcInput.Label = value; break;

                            case "type": gcInput.Type = value; break;

                            case "width": gcInput.Width = Convert.ToInt32(value); break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(gcInput);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException("Could not read " + XmlName + " element.", ex);
                }
            }
        }
Esempio n. 22
0
        public static RasterFillSymbol ReadFrom(ArcXmlReader reader)
        {
            try
            {
                RasterFillSymbol rasterFillSymbol = new RasterFillSymbol();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "antialiasing": rasterFillSymbol.Antialiasing = Convert.ToBoolean(value); break;

                            case "image": rasterFillSymbol.Image = value; break;

                            case "overlap": rasterFillSymbol.Overlap = Convert.ToBoolean(value); break;

                            case "transparency": rasterFillSymbol.Transparency = Convert.ToDouble(value); break;

                            case "url": rasterFillSymbol.Url = value; break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(rasterFillSymbol);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 23
0
        public static Output ReadFrom(ArcXmlReader reader)
        {
            try
            {
                Output output = new Output();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "file": output.File = value; break;

                            case "height": output.Height = Convert.ToInt32(value); break;

                            case "url": output.Url = value; break;

                            case "width": output.Width = Convert.ToInt32(value); break;

                            case "type": output.Type = (ImageType)ArcXmlEnumConverter.ToEnum(typeof(ImageType), value); break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(output);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 24
0
        public static Separators ReadFrom(ArcXmlReader reader)
        {
            try
            {
                Separators separators = new Separators();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "cs":
                                separators.CoordinateSeparator = value[0];
                                reader.CoordinateSeparator     = new char[] { separators.CoordinateSeparator };
                                break;

                            case "ts":
                                separators.TupleSeparator = value[0];
                                reader.TupleSeparator     = new char[] { separators.TupleSeparator };
                                break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(separators);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 25
0
        public static RasterExact ReadFrom(ArcXmlReader reader)
        {
            try
            {
                RasterExact rasterExact = new RasterExact();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "color": rasterExact.Color = ColorConverter.ToColor(value); break;

                            case "label": rasterExact.Label = value; break;

                            case "transparency": rasterExact.Transparency = Convert.ToDouble(value); break;

                            case "value": rasterExact.Value = value; break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(rasterExact);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 26
0
        public static Capabilities ReadFrom(ArcXmlReader reader)
        {
            try
            {
                Capabilities capabilities = new Capabilities();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "disabledtypes": capabilities.DisabledTypes = value; break;

                            case "forbidden": capabilities.Forbidden = value; break;

                            case "returngeometry": capabilities.ReturnGeometry = (ReturnGeometry)ArcXmlEnumConverter.ToEnum(typeof(ReturnGeometry), value); break;

                            case "servertype": capabilities.ServerType = value; break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(capabilities);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 27
0
        public static Locale ReadFrom(ArcXmlReader reader)
        {
            try
            {
                Locale locale = new Locale();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "language": locale.Language = value; break;

                            case "country": locale.Country = value; break;

                            case "variant": locale.Variant = value; break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(locale);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 28
0
        public static Layer ReadFrom(ArcXmlReader reader)
        {
            try
            {
                Layer layer = new Layer();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "featurecount": layer.FeatureCount = Convert.ToInt32(value); break;

                            case "id": layer.ID = value; break;

                            case "name": layer.Name = value; break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(layer);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Esempio n. 29
0
        protected static CoordSys ReadFrom(ArcXmlReader reader, CoordSys coordSys, string xmlName)
        {
            try
            {
                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "id": coordSys.ID = value; break;

                            case "string": coordSys.String = value; break;

                            case "datumtransformid": coordSys.DatumTransformID = value; break;

                            case "datumtransformstring": coordSys.DatumTransformString = value; break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(coordSys);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", xmlName), ex);
                }
            }
        }
Esempio n. 30
0
        public static FeatureCount ReadFrom(ArcXmlReader reader)
        {
            try
            {
                FeatureCount featureCount = new FeatureCount();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "count": featureCount.Count = Convert.ToInt32(value); break;

                            case "hasmore": featureCount.HasMore = Convert.ToBoolean(value); break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(featureCount);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }