Example #1
0
        public void ReadXml(System.Xml.XmlReader reader)
        {
            reader.MoveToContent();
            Url = reader.GetAttribute("Url");
            ServiceName = reader.GetAttribute("ServiceName");

            Boolean isEmptyElement = reader.IsEmptyElement; // (1)
            
            reader.ReadStartElement();
            
            if (!isEmptyElement) // (1)
            {
                HostedServiceProperties = reader.ReadContentAs(typeof(AzureHostedServiceProperties), null) as AzureHostedServiceProperties;

                reader.ReadEndElement();
            }

            isEmptyElement = reader.IsEmptyElement; // (1)

            reader.ReadStartElement();

            if (!isEmptyElement) // (1)
            {
                Deployments = reader.ReadContentAs(typeof(List<AzureDeployment>), null) as List<AzureDeployment>;

                reader.ReadEndElement();
            }
        }
 public ArcIMSFeatureCoordSys(CultureInfo culture, System.Xml.XmlElement featureCoordSysElement)
 {
     this.culture = culture;
     idAttribute = featureCoordSysElement.GetAttribute("id");
     stringAttribute = featureCoordSysElement.GetAttribute("string");
     defined = !String.IsNullOrEmpty(idAttribute) || !String.IsNullOrEmpty(stringAttribute);
 }
		protected override void DeserializeElement(System.Xml.XmlReader reader, bool serializeCollectionKey)
		{
			reader.MoveToContent();

			string name = reader.GetAttribute(NamePropertyName);
			string type = reader.GetAttribute(TypePropertyName);

			if (String.IsNullOrEmpty(name))
				throw new ConfigurationErrorsException("The name attribute is required.", reader);

			if (String.IsNullOrEmpty(type))
				throw new ConfigurationErrorsException("The type attribute is required.", reader);

			Type foundType;

			try
			{
				foundType = BuildManager.GetType(type, true, true);
			}
			catch (Exception exc)
			{
				throw new ConfigurationErrorsException("The type was not able to be found.", exc, reader);
			}

			base[NamePropertyName] = name;
			base[TypePropertyName] = foundType;
		}
Example #4
0
        public List<WebControl> RenderControl(System.Xml.XmlNode xmlControl)
        {
            base.Initialize(xmlControl);

            ASPxDateEdit aspxDateEdit = new ASPxDateEdit
            {
                ID = _PropertyMapper.GetID(),
                NullText = "Ingrese Fecha",
                MinDate =  _PropertyMapper.GetMinDate(),
                MaxDate = _PropertyMapper.GetMaxDate(),
            };

            aspxDateEdit.ValidationSettings.SetFocusOnError = true;
            aspxDateEdit.ValidationSettings.RequiredField.IsRequired = _PropertyMapper.Required();
            aspxDateEdit.ValidationSettings.RequiredField.ErrorText = "Campo Requerido";
            aspxDateEdit.ValidationSettings.ValidationGroup = "InputValidation";

             try
             {
                 if (xmlControl.GetAttribute("CCONTROLASOC") != null)
                 {
                     aspxDateEdit.ValidationSettings.CausesValidation = true;
                     aspxDateEdit.ErrorText = "Error de Rango - Fecha Inicial debe ser menor a Fecha Final";
                     aspxDateEdit.ClientSideEvents.Validation = "function(s,e){e.isValid = CheckDifference(" + _PropertyMapper.GetID() + ", " + xmlControl.GetAttribute("CCONTROLASOC") + "); }";
                 }
             }
             catch (Exception)
            {
            }

                _Controls.Add(aspxDateEdit);

            return _Controls;
        }
Example #5
0
        /// <summary>
        /// Parse the string
        /// </summary>
        public object Parse(System.Xml.XmlReader s, DatatypeR2FormatterParseResult result)
        {
            // Temporary holding value for value
            string tValue = null;
            if (s.GetAttribute("value") != null)
                tValue = s.GetAttribute("value");

            // Parse the CD stuff
            CDFormatter baseFormatter = new CDFormatter();
            baseFormatter.Host = this.Host;
            var retVal = baseFormatter.Parse<PQR>(s, result);

            // Interpret the value
            // If the value was interpreted
            if (!String.IsNullOrEmpty(tValue))
            {
                try
                {
                    retVal.Value = Util.Convert<decimal>(tValue);
                    if (tValue.Contains("."))
                        retVal.Precision = tValue.Length - tValue.IndexOf(".") - 1;
                }
                catch (Exception e)
                {
                    result.Code = ResultCode.Error;
                    result.AddResultDetail(new ResultDetail(ResultDetailType.Error, e.Message, s.ToString(), e));
                }
            }

            // Validate
            new ANYFormatter().Validate(retVal, s.ToString(), result);

            return retVal;
        }
Example #6
0
        /// <summary>
        /// Parses an object from stream <paramref name="s"/>
        /// </summary>
        public object Parse(System.Xml.XmlReader s, DatatypeR2FormatterParseResult result)
        {
            // Parse base (ANY) from the stream
            ANYFormatter baseFormatter = new ANYFormatter();

            // Parse BL
            BL retVal = baseFormatter.Parse<BL>(s);

            // Get the value
            if (s.GetAttribute("value") != null)
                try
                {
                    retVal.Value = Util.Convert<Boolean>(s.GetAttribute("value"));
                }
                catch (Exception e)
                {
                    result.Code = ResultCode.Error;
                    result.AddResultDetail(new ResultDetail(ResultDetailType.Error, e.Message, s.ToString(), e));
                }

            // Base formatter
            baseFormatter.Validate(retVal, s.ToString(), result);

            return retVal;
        }
Example #7
0
        /// <summary>
        /// Parse the PQ back into a structure
        /// </summary>
        public object Parse(System.Xml.XmlReader s, DatatypeR2FormatterParseResult result)
        {
            // Create the base formatter
            PDVFormatter baseFormatter = new PDVFormatter();
            baseFormatter.Host = this.Host;

            // Read temporary values
            string tCurrency = String.Empty;
            if(s.GetAttribute("currency") != null)
                tCurrency = s.GetAttribute("currency");

            // Parse PDV content 
            var retVal = baseFormatter.Parse<MO>(s, result);

            // Set PDV content
            retVal.Currency = tCurrency;

            // Validate
            ANYFormatter anyFormatter = new ANYFormatter();
            string pathName = s is XmlStateReader ? (s as XmlStateReader).CurrentPath : s.Name;
            anyFormatter.Validate(retVal as ANY, pathName, result);
            
            // Return instance
            return retVal;
        }
Example #8
0
        /// <summary>
        /// Parse an ADXP from stream <paramref name="s"/>
        /// </summary>
        public override object Parse(System.Xml.XmlReader s, DatatypeFormatterParseResult result)
        {
            
            // Parse CS
            ADXP retVal = base.Parse<ADXP>(s, result);

            // Now parse our data out... 
            if (!s.IsEmptyElement)
            {
                if (s.GetAttribute("code") != null && result.CompatibilityMode == DatatypeFormatterCompatibilityMode.Canadian)
                    retVal.Code = s.GetAttribute("code");
                else if(s.GetAttribute("code") != null)
                    result.AddResultDetail(new UnsupportedDatatypeR1PropertyResultDetail(ResultDetailType.Warning, "code", "ADXP", s.ToString()));

                // Read next for text elemnt
                string sName = s.Name;
                s.Read();
                while (!(s.NodeType == System.Xml.XmlNodeType.EndElement && sName == s.Name))
                {
                    
                    if (s.NodeType == System.Xml.XmlNodeType.Text)
                        retVal.Value = s.Value;
                    s.Read();
                }

            }

            // Validate
            string pathName = s is XmlStateReader ? (s as XmlStateReader).CurrentPath : s.Name;
            base.Validate(retVal, pathName, result);


            return retVal;
        }
Example #9
0
       protected override void HandleStartNode(System.Xml.XmlReader reader)
       {
           m_dataObject.Properties.UniqueId = HandlerSupportUtilities.ParseShapeId(reader.GetAttribute("id"));
           m_dataObject.Properties.ShapeType = reader.GetAttribute("spt", "urn:schemas-microsoft-com:office:office");
           HandlerSupportUtilities.ResolveShapeType(m_dataObject.Properties);
           m_dataObject.CoordinateSpace = reader.GetAttribute("coordsize");
	}
Example #10
0
        /// <summary>
        /// Load object from XML-file
        /// </summary>
        /// <param name="reader">Load object from XML-stream</param>
        public override void ReadXml(System.Xml.XmlReader reader)
        {
            reader.MoveToContent();
            _width = Int32.Parse(reader.GetAttribute("width"));
            _height = Int32.Parse(reader.GetAttribute("height"));
            Boolean isEmptyElement = reader.IsEmptyElement;

            if (isEmptyElement)
                return;

            reader.ReadStartElement("WallTiles");
            reader.ReadStartElement("walls");
            while ((reader.NodeType != System.Xml.XmlNodeType.EndElement) && (reader.NodeType != System.Xml.XmlNodeType.None))
            {
                while (reader.NodeType == System.Xml.XmlNodeType.Whitespace) reader.Read();
                TileObject temp = new TileObject(_content, _width, _height);
                Backend.WallType _type = Backend.WallType.Normal;
                if (reader.GetAttribute("Type") != null)
                    _type = (Backend.WallType)Enum.Parse(typeof(Backend.WallType), reader.GetAttribute("Type").ToString());
                WallDir _id = (WallDir)Enum.Parse(typeof(WallDir), reader.GetAttribute("Direction").ToString());
                _textures[(int)_type * 100 + (int)_id].Clear();
                _textures[(int)_type * 100 + (int)_id].ReadXml(reader);
            }
            reader.ReadEndElement();

            while ((reader.NodeType != System.Xml.XmlNodeType.EndElement) && (reader.NodeType != System.Xml.XmlNodeType.None))
                reader.Read();
            reader.ReadEndElement();
        }
Example #11
0
            public static ItemLoseEvent CreateFromXml( System.Xml.XmlElement n)
            {
                Events.ItemLoseEvent e = new Events.ItemLoseEvent();

                e.item_id = n.GetAttribute("item_id");
                e.item_ikey = n.GetAttribute("item_ikey");
                return e;
            }
Example #12
0
 public HLARecordField(System.Xml.XmlElement recordFieldElement)
     : base(recordFieldElement)
 {
     DataType = recordFieldElement.GetAttribute("dataType");
     DataTypeNotes = recordFieldElement.GetAttribute("dataTypeNotes");
     Semantics = ReplaceNewLines(recordFieldElement.GetAttribute("semantics"));
     SemanticsNotes = recordFieldElement.GetAttribute("semanticsNotes");
 }
Example #13
0
            public static RegenEvent CreateFromXml( System.Xml.XmlElement n)
            {
                Events.RegenEvent e = new Events.RegenEvent();

                e.name = n.GetAttribute("name");
                e.next = n.GetAttribute("next");
                return e;
            }
Example #14
0
 public override void GetAttributes(System.Xml.XmlElement Element)
 {
     FileName = Element.GetAttribute("file");
     DefaulEncoding = Element.GetAttribute("encoding");
     Append = Element.GetAttribute("append") == true.ToString();
     ChildrenFlow = Element.GetAttribute("ascending") == true.ToString();
     BreakFlow = Element.GetAttribute("break") == true.ToString();
 }
Example #15
0
 public override void ReadXML(System.Xml.XmlReader input)
 {
     var tid = input.GetAttribute("tableid");
     var iid = input.GetAttribute("instanceid");
     this.TableId = tid==null ? 0 : SporeMaster.NameRegistry.Files.toHash( tid );
     this.InstanceId = iid==null ? 0 : SporeMaster.NameRegistry.Files.toHash( iid );
     this.PlaceholderText = input.ReadString();
 }
 public HLAInteractionParameter(System.Xml.XmlElement parameterElement)
     : base(parameterElement)
 {
     this.DataType = parameterElement.GetAttribute("dataType");
     this.DataTypeNotes = parameterElement.GetAttribute("dataTypeNotes");
     this.Semantics = ReplaceNewLines(parameterElement.GetAttribute("semantics"));
     this.SemanticsNotes = parameterElement.GetAttribute("semanticsNotes");
 }
        void IFlickrParsable.Load(System.Xml.XmlReader reader)
        {
            FavoriteThumbnailUrl = reader.GetAttribute("thumb");
            FavoriteUrl = reader.GetAttribute("url");

            Load(reader, true);

            reader.Skip();
        }
Example #18
0
 internal static string GetItemErrorInfo(System.Xml.XmlElement xmlItem)
 {
     string s = "";
     if (xmlItem.HasAttribute("assembly"))
         s = s + xmlItem.GetAttribute("assembly");
     if (xmlItem.HasAttribute("class"))
         s = s + xmlItem.GetAttribute("class");
     return s;
 }
Example #19
0
        public new void ReadXml(System.Xml.XmlReader reader)
        {
            reader.MoveToContent();

            AcceptsItems = reader.GetAttribute(PlaceholderAttributes.AcceptsItems.ToString());
            PlaceholderBehaviour = reader.GetAttribute(PlaceholderAttributes.PlaceholderBehaviour.ToString());

            base.ReadXml(reader);
        }
Example #20
0
 void IFlickrParsable.Load(System.Xml.XmlReader reader)
 {
     // To parse: <member nsid="123456@N01" username="foo" iconserver="1" iconfarm="1" membertype="2"/>
     MemberId = reader.GetAttribute("nsid");
     UserName = reader.GetAttribute("username");
     IconServer = reader.GetAttribute("iconserver");
     IconFarm = reader.GetAttribute("iconfarm");
     MemberType = UtilityMethods.ParseIdToMemberType(reader.GetAttribute("membertype"));
 }
Example #21
0
            public static UpdateEvent CreateFromXml( System.Xml.XmlElement n)
            {
                Events.UpdateEvent e = new Events.UpdateEvent();

                e.type = n.GetAttribute("type");
                e.ikey = n.GetAttribute("ikey");
                e.val = n.GetAttribute("value");

                return e;
            }
Example #22
0
 public TowerData(System.Xml.XPath.XPathNavigator xml) 
 {
     Price = float.Parse(xml.GetAttribute("Price", ""));
     Name = xml.GetAttribute("Name", "");
     
     ShutdownHeat = float.Parse(xml.GetAttribute("ShutdownHeat", ""));
     HeatDecay = float.Parse(xml.GetAttribute("HeatDecay", ""));
     
     XAML = xml.InnerXml;
 }
Example #23
0
        /// <summary>
        /// Parse the object
        /// </summary>
        public override object Parse(System.Xml.XmlReader s, DatatypeFormatterParseResult result)
        {
            // Parse base (ANY) from the stream

            // Parse ED
            ST retVal = base.Parse<ST>(s, result);

            // Now parse our data out... Attributes
            if (s.GetAttribute("mediaType") != null && s.GetAttribute("mediaType") != "text/plain")
                result.AddResultDetail(new FixedValueMisMatchedResultDetail(s.GetAttribute("mediaType"), "text/plain", String.Format("{0}/@mediaType", s.ToString())));
            if (s.GetAttribute("language") != null)
                retVal.Language = s.GetAttribute("language");

            // Elements and inner data
            #region Elements
            string innerData = "";
            if (!s.IsEmptyElement)
            {
                // Exit markers
                int sDepth = s.Depth;
                string sName = s.Name;

                s.Read();
                // Read until exit condition is fulfilled
                while (!(s.NodeType == System.Xml.XmlNodeType.EndElement && s.Depth == sDepth && s.Name == sName))
                {
                    string oldName = s.Name; // Name
                    try
                    {

                        if (s.NodeType == System.Xml.XmlNodeType.Text ||
                            s.NodeType == System.Xml.XmlNodeType.CDATA)
                            innerData += s.Value;
                    }
                    catch (MessageValidationException e)
                    {
                        result.AddResultDetail(new MARC.Everest.Connectors.ResultDetail(MARC.Everest.Connectors.ResultDetailType.Error, e.Message, s.ToString(), e));
                    }
                    finally
                    {
                        if (s.Name == oldName) s.Read();
                    }
                }
            }
            else
                innerData = s.Value;
            #endregion

            retVal.Value = innerData;

            // Validate
            base.Validate(retVal, s.ToString(), result);

            return retVal;
        }
Example #24
0
        /// <summary>
        /// Parse an object instance from <paramref name="s"/>
        /// </summary>
        public virtual object Parse(System.Xml.XmlReader s, DatatypeR2FormatterParseResult result)
        {
            // Parse the base attributes
            ANYFormatter baseFormatter = new ANYFormatter();
            baseFormatter.Host = this.Host;
            baseFormatter.GenericArguments = this.GenericArguments;
            EN retVal = baseFormatter.Parse<EN>(s);

            // Use
            if (s.GetAttribute("use") != null)
                retVal.Use = Util.Convert<SET<CS<EntityNameUse>>>(s.GetAttribute("use"));

            // Process the parts
            #region Elements
            if (!s.IsEmptyElement)
            {

                int sDepth = s.Depth;
                string sName = s.Name;
                s.Read();

                // string Name
                while (!(s.NodeType == System.Xml.XmlNodeType.EndElement && s.Depth == sDepth && s.Name == sName))
                {
                    string oldName = s.Name; // Name
                    try
                    {
                        // Numerator
                        if (s.LocalName == "part")
                        {
                            var parseResult = Host.Parse(s, typeof(ENXP));
                            result.Code = parseResult.Code;
                            result.AddResultDetail(parseResult.Details);
                            retVal.Part.Add(parseResult.Structure as ENXP);
                        }
                        else if (s.NodeType == System.Xml.XmlNodeType.Element)
                            result.AddResultDetail(new NotImplementedElementResultDetail(ResultDetailType.Warning, s.LocalName, s.NamespaceURI, s.ToString(), null));
                    }
                    catch (MessageValidationException e)
                    {
                        result.AddResultDetail(new ResultDetail(MARC.Everest.Connectors.ResultDetailType.Error, e.Message, e));
                    }
                    finally
                    {
                        if (s.Name == oldName) s.Read();
                    }
                }
            }
            #endregion

            // Validate
            baseFormatter.Validate(retVal, s.ToString(), result);
            return retVal;
        }
Example #25
0
        /// <summary>
        /// Parse an object from <paramref name="s"/>
        /// </summary>
        public override object Parse(System.Xml.XmlReader s, DatatypeR2FormatterParseResult result)
        {
            // Validate flavor
            if (String.IsNullOrEmpty(s.GetAttribute("flavorId")) ||
                s.GetAttribute("flavorId") != "EN.ON")
                result.AddResultDetail(new FixedValueMisMatchedResultDetail(s.GetAttribute("flavorId"), "EN.ON", s.ToString()));

            var retVal = base.Parse(s, result);
            (retVal as IAny).Flavor = "EN.ON";
            return retVal;
        }
Example #26
0
        /// <summary>
        /// Reads Xml when the <see cref="Point">Point</see> is to be deserialized 
        /// from a stream.</summary>
        /// <param name="reader">The stream from which the object will be deserialized.</param>
        void IXmlSerializable.ReadXml(System.Xml.XmlReader reader)
        {
            string x = reader.GetAttribute("X");
            string y = reader.GetAttribute("Y");

            if (x.Length > 0)
                _x = int.Parse(x);

            if (y.Length > 0)
                _y = int.Parse(y);
        }
Example #27
0
 protected override void HandleStartNode(System.Xml.XmlReader reader)
 {
     m_dataObject.Properties.UniqueId = HandlerSupportUtilities.ParseShapeId(reader.GetAttribute("id"));
     m_dataObject.Properties.ShapeType = HandlerSupportUtilities.ParseShapeType(reader.GetAttribute("type"));
     m_dataObject.Properties.StyleDescription = reader.GetAttribute("style");
     m_dataObject.Properties.WrapCoords = reader.GetAttribute("wrapcoords");
     HandlerSupportUtilities.ResolveShapeType(m_dataObject.Properties);
     HandlerSupportUtilities.ResolveShapeStyleString(m_dataObject.Properties.StyleDescription, m_dataObject.Properties);
     ResolveWrappingType();
     FormatWrapCoords();
 }
Example #28
0
        protected override void HandleStartNode(System.Xml.XmlReader reader)
        {
            m_dataObject.Properties.UniqueId = HandlerSupportUtilities.ParseShapeId(reader.GetAttribute("id"));
            m_dataObject.Properties.StyleDescription = reader.GetAttribute("style");
            HandleEditasAttr(reader.GetAttribute("editas"));
            string coordOrigin = reader.GetAttribute("coordorigin");
            string coordSize = reader.GetAttribute("coordsize");

            HandlerSupportUtilities.ResolveCoordinates(coordOrigin, coordSize, m_dataObject.Properties);
            HandlerSupportUtilities.ResolveShapeStyleString(m_dataObject.Properties.StyleDescription, m_dataObject.Properties);
        }
Example #29
0
        public override object Parse(System.Xml.XmlReader s, DatatypeFormatterParseResult result)
        {
            BL retVal = base.Parse<BL>(s, result);

            // Now parse our data out... Attributes
            if (s.GetAttribute("value") != null)
                retVal.Value = XmlConvert.ToBoolean(s.GetAttribute("value"));

            base.Validate(retVal, s.ToString(), result);
            return retVal;
        }
Example #30
0
        protected override void ReadAttributes(System.Xml.XmlReader reader)
        {
            Font = reader.GetAttribute("font");
            string wasListNum = reader.GetAttribute("wasListNum");
            if (wasListNum != null)
                WasListNumber = Boolean.Parse(wasListNum);

		    WasField = ReadOptionalBoolAttriute(reader, "wasField");
            string rtl = reader.GetAttribute("rtl");
            if (rtl != null)
                RTL = Boolean.Parse(rtl);
        }