Exemplo n.º 1
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);
                }
            }
        }
Exemplo n.º 2
0
        public object Clone()
        {
            ChartValue clone = (ChartValue)this.MemberwiseClone();

            return(clone);
        }