コード例 #1
0
            /// <summary>
            /// Constructer.
            /// Only one parameter should be non null or will throw ArgumentException.
            /// </summary>
            /// <param name="xsltFile">The path to XSLT file or null.</param>
            /// <param name="xslt">The raw to XSLT or null.</param>
            /// <param name="xsltCompiledDll">The path to compiled XSLT file or null.</param>
            public XsltInput(ITaskItem xsltFile, string xslt, ITaskItem xsltCompiledDll, TaskLoggingHelper logTool)
            {
                _log = logTool;
                if ((xsltFile != null && xslt != null) ||
                    (xsltFile != null && xsltCompiledDll != null) ||
                    (xslt != null && xsltCompiledDll != null))
                {
                    throw new ArgumentException(ResourceUtilities.GetResourceString("XslTransform.XsltInput.TooMany"));
                }
                else if (xsltFile == null && xslt == null && xsltCompiledDll == null)
                {
                    throw new ArgumentException(ResourceUtilities.GetResourceString("XslTransform.XsltInput.TooFew"));
                }

                if (xsltFile != null)
                {
                    _xslMode = XslModes.XsltFile;
                    _data    = xsltFile.ItemSpec;
                }
                else if (xslt != null)
                {
                    _xslMode = XslModes.Xslt;
                    _data    = xslt;
                }
                else
                {
                    _xslMode = XslModes.XsltCompiledDll;
                    _data    = xsltCompiledDll.ItemSpec;
                }
            }
コード例 #2
0
 public XsltInput(ITaskItem xsltFile, string xslt, ITaskItem xsltCompiledDll)
 {
     if ((((xsltFile != null) && (xslt != null)) || ((xsltFile != null) && (xsltCompiledDll != null))) || ((xslt != null) && (xsltCompiledDll != null)))
     {
         throw new ArgumentException(Microsoft.Build.Shared.ResourceUtilities.FormatResourceString("XslTransform.XsltInput.TooMany", new object[0]));
     }
     if (((xsltFile == null) && (xslt == null)) && (xsltCompiledDll == null))
     {
         throw new ArgumentException(Microsoft.Build.Shared.ResourceUtilities.FormatResourceString("XslTransform.XsltInput.TooFew", new object[0]));
     }
     if (xsltFile != null)
     {
         this.xslMode = XslModes.XsltFile;
         this.data    = xsltFile.ItemSpec;
     }
     else if (xslt != null)
     {
         this.xslMode = XslModes.Xslt;
         this.data    = xslt;
     }
     else
     {
         this.xslMode = XslModes.XsltCompiledDll;
         this.data    = xsltCompiledDll.ItemSpec;
     }
 }
 public XsltInput(ITaskItem xsltFile, string xslt, ITaskItem xsltCompiledDll)
 {
     if ((((xsltFile != null) && (xslt != null)) || ((xsltFile != null) && (xsltCompiledDll != null))) || ((xslt != null) && (xsltCompiledDll != null)))
     {
         throw new ArgumentException(Microsoft.Build.Shared.ResourceUtilities.FormatResourceString("XslTransform.XsltInput.TooMany", new object[0]));
     }
     if (((xsltFile == null) && (xslt == null)) && (xsltCompiledDll == null))
     {
         throw new ArgumentException(Microsoft.Build.Shared.ResourceUtilities.FormatResourceString("XslTransform.XsltInput.TooFew", new object[0]));
     }
     if (xsltFile != null)
     {
         this.xslMode = XslModes.XsltFile;
         this.data = xsltFile.ItemSpec;
     }
     else if (xslt != null)
     {
         this.xslMode = XslModes.Xslt;
         this.data = xslt;
     }
     else
     {
         this.xslMode = XslModes.XsltCompiledDll;
         this.data = xsltCompiledDll.ItemSpec;
     }
 }
コード例 #4
0
            /// <summary>
            /// Constructer.
            /// Only one parameter should be non null or will throw ArgumentException.
            /// </summary>
            /// <param name="xsltFile">The path to XSLT file or null.</param>
            /// <param name="xslt">The raw to XSLT or null.</param>
            /// <param name="xsltCompiledDll">The path to compiled XSLT file or null.</param>
            public XsltInput(ITaskItem xsltFile, string xslt, ITaskItem xsltCompiledDll, TaskLoggingHelper logTool)
            {
                _log = logTool;
                if ((xsltFile != null && xslt != null) ||
                    (xsltFile != null && xsltCompiledDll != null) ||
                    (xslt != null && xsltCompiledDll != null))
                {
                    throw new ArgumentException(ResourceUtilities.FormatResourceString("XslTransform.XsltInput.TooMany"));
                }
                else if (xsltFile == null && xslt == null && xsltCompiledDll == null)
                {
                    throw new ArgumentException(ResourceUtilities.FormatResourceString("XslTransform.XsltInput.TooFew"));
                }

                if (xsltFile != null)
                {
                    _xslMode = XslModes.XsltFile;
                    _data = xsltFile.ItemSpec;
                }
                else if (xslt != null)
                {
                    _xslMode = XslModes.Xslt;
                    _data = xslt;
                }
                else
                {
                    _xslMode = XslModes.XsltCompiledDll;
                    _data = xsltCompiledDll.ItemSpec;
                }
            }