Example #1
0
 public XmlInput(ITaskItem[] xmlFile, string xml)
 {
     if ((xmlFile != null) && (xml != null))
     {
         throw new ArgumentException(Microsoft.Build.Shared.ResourceUtilities.FormatResourceString("XslTransform.XmlInput.TooMany", new object[0]));
     }
     if ((xmlFile == null) && (xml == null))
     {
         throw new ArgumentException(Microsoft.Build.Shared.ResourceUtilities.FormatResourceString("XslTransform.XmlInput.TooFew", new object[0]));
     }
     if (xmlFile != null)
     {
         this.xmlMode = XmlModes.XmlFile;
         this.data    = new string[xmlFile.Length];
         for (int i = 0; i < xmlFile.Length; i++)
         {
             this.data[i] = xmlFile[i].ItemSpec;
         }
     }
     else
     {
         this.xmlMode = XmlModes.Xml;
         this.data    = new string[] { xml };
     }
 }
Example #2
0
            /// <summary>
            /// Constructor.
            /// Only one parameter should be non null or will throw ArgumentException.
            /// </summary>
            /// <param name="xmlFile">The path to XML file or null.</param>
            /// <param name="xml">The raw XML.</param>
            public XmlInput(ITaskItem[] xmlFile, string xml)
            {
                if (xmlFile != null && xml != null)
                {
                    throw new ArgumentException(ResourceUtilities.GetResourceString("XslTransform.XmlInput.TooMany"));
                }
                else if (xmlFile == null && xml == null)
                {
                    throw new ArgumentException(ResourceUtilities.GetResourceString("XslTransform.XmlInput.TooFew"));
                }

                if (xmlFile != null)
                {
                    _xmlMode = XmlModes.XmlFile;
                    _data    = new string[xmlFile.Length];
                    for (int i = 0; i < xmlFile.Length; i++)
                    {
                        _data[i] = xmlFile[i].ItemSpec;
                    }
                }
                else
                {
                    _xmlMode = XmlModes.Xml;
                    _data    = new string[] { xml };
                }
            }
Example #3
0
 public XmlInput(ITaskItem xmlInputPath, string xmlContent)
 {
     if ((xmlInputPath != null) && (xmlContent != null))
     {
         throw new ArgumentException(Microsoft.Build.Shared.ResourceUtilities.FormatResourceString("XmlPeek.XmlInput.TooMany", new object[0]));
     }
     if ((xmlInputPath == null) && (xmlContent == null))
     {
         throw new ArgumentException(Microsoft.Build.Shared.ResourceUtilities.FormatResourceString("XmlPeek.XmlInput.TooFew", new object[0]));
     }
     if (xmlInputPath != null)
     {
         this.xmlMode = XmlModes.XmlFile;
         this.data    = xmlInputPath.ItemSpec;
     }
     else
     {
         this.xmlMode = XmlModes.Xml;
         this.data    = xmlContent;
     }
 }
Example #4
0
            /// <summary>
            /// Constructor.
            /// Only one parameter should be non null or will throw ArgumentException.
            /// </summary>
            /// <param name="xmlInputPath">The path to XML file or null.</param>
            /// <param name="xmlContent">The raw XML.</param>
            public XmlInput(ITaskItem xmlInputPath, string xmlContent)
            {
                if (xmlInputPath != null && xmlContent != null)
                {
                    throw new ArgumentException("Only one of XmlContent or XmlInputPaths arguments can be set.");
                }
                else if (xmlInputPath == null && xmlContent == null)
                {
                    throw new ArgumentException("One of XmlContent or XmlInputPaths arguments must be set.");
                }

                if (xmlInputPath != null)
                {
                    _xmlMode = XmlModes.XmlFile;
                    _data    = xmlInputPath.ItemSpec;
                }
                else
                {
                    _xmlMode = XmlModes.Xml;
                    _data    = xmlContent;
                }
            }
Example #5
0
            /// <summary>
            /// Constructor.
            /// Only one parameter should be non null or will throw ArgumentException.
            /// </summary>
            /// <param name="xmlInputPath">The path to XML file or null.</param>
            /// <param name="xmlContent">The raw XML.</param>
            public XmlInput(ITaskItem xmlInputPath, string xmlContent)
            {
                if (xmlInputPath != null && xmlContent != null)
                {
                    throw new ArgumentException(ResourceUtilities.FormatResourceString("XmlPeek.XmlInput.TooMany"));
                }
                else if (xmlInputPath == null && xmlContent == null)
                {
                    throw new ArgumentException(ResourceUtilities.FormatResourceString("XmlPeek.XmlInput.TooFew"));
                }

                if (xmlInputPath != null)
                {
                    _xmlMode = XmlModes.XmlFile;
                    _data    = xmlInputPath.ItemSpec;
                }
                else
                {
                    _xmlMode = XmlModes.Xml;
                    _data    = xmlContent;
                }
            }
Example #6
0
			/// <summary>
			/// Constructor.
			/// Only one parameter should be non null or will throw ArgumentException.
			/// </summary>
			/// <param name="xmlInputPath">The path to XML file or null.</param>
			/// <param name="xmlContent">The raw XML.</param>
			public XmlInput (ITaskItem xmlInputPath, string xmlContent)
			{
				if (xmlInputPath != null && xmlContent != null) {
					throw new ArgumentException ("Only one of XmlContent or XmlInputPaths arguments can be set.");
				} else if (xmlInputPath == null && xmlContent == null) {
					throw new ArgumentException ("One of XmlContent or XmlInputPaths arguments must be set.");
				}

				if (xmlInputPath != null) {
					_xmlMode = XmlModes.XmlFile;
					_data = xmlInputPath.ItemSpec;
				} else {
					_xmlMode = XmlModes.Xml;
					_data = xmlContent;
				}
			}
Example #7
0
            /// <summary>
            /// Constructor.
            /// Only one parameter should be non null or will throw ArgumentException.
            /// </summary>
            /// <param name="xmlInputPath">The path to XML file or null.</param>
            /// <param name="xmlContent">The raw XML.</param>
            public XmlInput(ITaskItem xmlInputPath, string xmlContent)
            {
                if (xmlInputPath != null && xmlContent != null)
                {
                    throw new ArgumentException(ResourceUtilities.FormatResourceString("XmlPeek.XmlInput.TooMany"));
                }
                else if (xmlInputPath == null && xmlContent == null)
                {
                    throw new ArgumentException(ResourceUtilities.FormatResourceString("XmlPeek.XmlInput.TooFew"));
                }

                if (xmlInputPath != null)
                {
                    _xmlMode = XmlModes.XmlFile;
                    _data = xmlInputPath.ItemSpec;
                }
                else
                {
                    _xmlMode = XmlModes.Xml;
                    _data = xmlContent;
                }
            }
 public XmlInput(ITaskItem[] xmlFile, string xml)
 {
     if ((xmlFile != null) && (xml != null))
     {
         throw new ArgumentException(Microsoft.Build.Shared.ResourceUtilities.FormatResourceString("XslTransform.XmlInput.TooMany", new object[0]));
     }
     if ((xmlFile == null) && (xml == null))
     {
         throw new ArgumentException(Microsoft.Build.Shared.ResourceUtilities.FormatResourceString("XslTransform.XmlInput.TooFew", new object[0]));
     }
     if (xmlFile != null)
     {
         this.xmlMode = XmlModes.XmlFile;
         this.data = new string[xmlFile.Length];
         for (int i = 0; i < xmlFile.Length; i++)
         {
             this.data[i] = xmlFile[i].ItemSpec;
         }
     }
     else
     {
         this.xmlMode = XmlModes.Xml;
         this.data = new string[] { xml };
     }
 }
 public XmlInput(ITaskItem xmlInputPath, string xmlContent)
 {
     if ((xmlInputPath != null) && (xmlContent != null))
     {
         throw new ArgumentException(Microsoft.Build.Shared.ResourceUtilities.FormatResourceString("XmlPeek.XmlInput.TooMany", new object[0]));
     }
     if ((xmlInputPath == null) && (xmlContent == null))
     {
         throw new ArgumentException(Microsoft.Build.Shared.ResourceUtilities.FormatResourceString("XmlPeek.XmlInput.TooFew", new object[0]));
     }
     if (xmlInputPath != null)
     {
         this.xmlMode = XmlModes.XmlFile;
         this.data = xmlInputPath.ItemSpec;
     }
     else
     {
         this.xmlMode = XmlModes.Xml;
         this.data = xmlContent;
     }
 }
Example #10
0
            /// <summary>
            /// Constructor.
            /// Only one parameter should be non null or will throw ArgumentException.
            /// </summary>
            /// <param name="xmlFile">The path to XML file or null.</param>
            /// <param name="xml">The raw XML.</param>
            public XmlInput(ITaskItem[] xmlFile, string xml)
            {
                if (xmlFile != null && xml != null)
                {
                    throw new ArgumentException(ResourceUtilities.FormatResourceString("XslTransform.XmlInput.TooMany"));
                }
                else if (xmlFile == null && xml == null)
                {
                    throw new ArgumentException(ResourceUtilities.FormatResourceString("XslTransform.XmlInput.TooFew"));
                }

                if (xmlFile != null)
                {
                    _xmlMode = XmlModes.XmlFile;
                    _data = new string[xmlFile.Length];
                    for (int i = 0; i < xmlFile.Length; i++)
                    {
                        _data[i] = xmlFile[i].ItemSpec;
                    }
                }
                else
                {
                    _xmlMode = XmlModes.Xml;
                    _data = new string[] { xml };
                }
            }