当前位置: 首页>>代码示例>>C#>>正文


C# IXmlLineInfo.HasLineInfo方法代码示例

本文整理汇总了C#中IXmlLineInfo.HasLineInfo方法的典型用法代码示例。如果您正苦于以下问题:C# IXmlLineInfo.HasLineInfo方法的具体用法?C# IXmlLineInfo.HasLineInfo怎么用?C# IXmlLineInfo.HasLineInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IXmlLineInfo的用法示例。


在下文中一共展示了IXmlLineInfo.HasLineInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateParseException

      protected virtual Exception CreateParseException(IXmlLineInfo lineInfo, string format, params object[] args) {

         if (lineInfo != null && lineInfo.HasLineInfo())
            return new HttpParseException(String.Format(CultureInfo.InvariantCulture, format, args), null, this.VirtualPath, null, lineInfo.LineNumber);
         else
            return new HttpParseException(String.Format(CultureInfo.InvariantCulture, format, args));
      }
开发者ID:nuxleus,项目名称:Nuxleus,代码行数:7,代码来源:BaseParser.cs

示例2: SetLineInfo

 private void SetLineInfo(IXmlLineInfo lineInfo, SearchResult searchResult)
 {
     if(lineInfo.HasLineInfo())
     {
         searchResult.LineNumber = lineInfo.LineNumber;
         searchResult.LinePosition = lineInfo.LinePosition;
     }
 }
开发者ID:uli-weltersbach,项目名称:XPathInformation,代码行数:8,代码来源:SearchResultFactory.cs

示例3: Attribute

        public Attribute(string name, IXmlLineInfo lineInfo)
        {
            this.name = name;

            _hasLineInfo = lineInfo.HasLineInfo();
            _lineNumber = lineInfo.LineNumber;
            _linePosition = lineInfo.LinePosition;
        }
开发者ID:datanowllc,项目名称:twintsam,代码行数:8,代码来源:Attribute.cs

示例4: BuildMessage

		static string BuildMessage (string message, IXmlLineInfo li, string sourceUri)
		{
			if (li != null && li.HasLineInfo ()) {
				message = String.Format ("{0}. Location: {1} ({2}, {3}).", message, sourceUri, li.LineNumber, li.LinePosition);
			}
			else if (sourceUri != null)
				message = String.Format ("{0}. Location: {1}", message, sourceUri);
			return message;
		}
开发者ID:Profit0004,项目名称:mono,代码行数:9,代码来源:XmlQueryException.cs

示例5: ParseErrorEventArgs

 protected internal ParseErrorEventArgs(string message, IXmlLineInfo lineInfo)
 {
     this._message = message;
     if (lineInfo != null) {
         this._hasLineInfo = lineInfo.HasLineInfo();
         this._lineNumber = lineInfo.LineNumber;
         this._linePosition = lineInfo.LinePosition;
     }
 }
开发者ID:datanowllc,项目名称:twintsam,代码行数:9,代码来源:ParseErrorEventArgs.cs

示例6: FormatMessage

		internal static string FormatMessage (string message,
			IXmlLineInfo lineInfo)
		{
			NvdlElementBase source = lineInfo as NvdlElementBase;
			XmlReader reader = lineInfo as XmlReader;
			if (source != null && source.HasLineInfo ())
				return String.Format ("{0}. {1} ({2},{3})",
					message, source.SourceUri,
					source.LineNumber, source.LinePosition);
			else if (lineInfo != null && lineInfo.HasLineInfo ())
				return String.Format ("{0}. {3}({1},{2})",
					message,
					lineInfo.LineNumber,
					lineInfo.LinePosition,
					reader != null ? reader.BaseURI + ' ' : String.Empty);
			else
				return message;
		}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:18,代码来源:NvdlException.cs

示例7: SetIdentityField

		// Return false if there is already the same key.
		public bool SetIdentityField (object identity, bool isXsiNil, XsdAnySimpleType type, int depth, IXmlLineInfo li)
		{
			FieldFoundDepth = depth;
			Identity = identity;
			IsXsiNil = isXsiNil;
			FieldFound |= isXsiNil;
			FieldType = type;
			Consuming = false;
			Consumed = true;
			if (li != null && li.HasLineInfo ()) {
				FieldHasLineInfo = true;
				FieldLineNumber = li.LineNumber;
				FieldLinePosition = li.LinePosition;
			}

			if (!(this.entry.OwnerSequence.SourceSchemaIdentity is XmlSchemaKeyref)) {
				for (int i = 0; i < entry.OwnerSequence.FinishedEntries.Count; i++) {
					XsdKeyEntry other = (XsdKeyEntry) entry.OwnerSequence.FinishedEntries [i];
					if (this.entry.CompareIdentity (other))
						return false;
				}
			}

			return true;
		}
开发者ID:nobled,项目名称:mono,代码行数:26,代码来源:XsdIdentityState.cs

示例8: ProcessMatch

		// In this method, attributes are ignored.
		// It might throw Exception.
		public void ProcessMatch (bool isAttribute, ArrayList qnameStack, object sender, XmlNameTable nameTable, string sourceUri, object schemaType, NSResolver nsResolver, IXmlLineInfo li, int depth, string attrName, string attrNS, object attrValue, bool isXsiNil, ArrayList currentKeyFieldConsumers)
		{
			for (int i = 0; i < KeyFields.Count; i++) {
				XsdKeyEntryField keyField = KeyFields [i];
				XsdIdentityPath path = keyField.Matches (isAttribute, sender, nameTable, qnameStack, sourceUri, schemaType, nsResolver, li, depth, attrName, attrNS, attrValue);
				if (path == null)
					continue;

				if (keyField.FieldFound) {
					// HACK: This is not logical by nature. Attributes never be cosuming,
					// so I used it as a temporary mark to sign it is *just* validated now.
					if (!keyField.Consuming)
						throw new ValException ("Two or more matching field was found.",
							sender, sourceUri, this.OwnerSequence.SourceSchemaIdentity, null);
					else
						keyField.Consuming = false;
				}
				if (keyField.Consumed) 
					continue;

				if (isXsiNil && !keyField.SetIdentityField (Guid.Empty, true, XsdAnySimpleType.Instance, depth, li))
					throw new ValException ("Two or more identical field was found.", sender, sourceUri, OwnerSequence.SourceSchemaIdentity, null);
				XmlSchemaComplexType ct = schemaType as XmlSchemaComplexType;
				if (ct != null && 
					(ct.ContentType == XmlSchemaContentType.Empty || ct.ContentType == XmlSchemaContentType.ElementOnly) && 
					schemaType != XmlSchemaComplexType.AnyType)
					throw new ValException ("Specified schema type is complex type, which is not allowed for identity constraints.", sender, sourceUri, OwnerSequence.SourceSchemaIdentity, null);
				keyField.FieldFound = true;
				keyField.FieldFoundPath = path;
				keyField.FieldFoundDepth = depth;
				keyField.Consuming = true;
				if (li != null && li.HasLineInfo ()) {
					keyField.FieldHasLineInfo = true;
					keyField.FieldLineNumber = li.LineNumber;
					keyField.FieldLinePosition = li.LinePosition;
				}
				currentKeyFieldConsumers.Add (keyField);
			}
		}
开发者ID:nobled,项目名称:mono,代码行数:41,代码来源:XsdIdentityState.cs

示例9: Init

		private void Init (XsdKeyTable keyseq, int depth, IXmlLineInfo li)
		{
			OwnerSequence = keyseq;
			KeyFields = new XsdKeyEntryFieldCollection ();
			for (int i = 0; i < keyseq.Selector.Fields.Length; i++)
				KeyFields.Add (new XsdKeyEntryField (this, keyseq.Selector.Fields [i]));
			StartDepth = depth;
			if (li != null) {
				if (li.HasLineInfo ()) {
					this.SelectorHasLineInfo = true;
					this.SelectorLineNumber = li.LineNumber;
					this.SelectorLinePosition = li.LinePosition;
				}
			}
		}
开发者ID:nobled,项目名称:mono,代码行数:15,代码来源:XsdIdentityState.cs

示例10: XamlXmlNodeInfo

		public XamlXmlNodeInfo (XamlNodeType nodeType, object nodeValue, IXmlLineInfo lineInfo)
		{
			NodeType = nodeType;
			NodeValue = nodeValue;
			if (lineInfo != null && lineInfo.HasLineInfo ()) {
				HasLineInfo = true;
				LineNumber = lineInfo.LineNumber;
				LinePosition = lineInfo.LinePosition;
			} else {
				HasLineInfo = false;
				LineNumber = 0;
				LinePosition = 0;
			}
		}
开发者ID:gitter-badger,项目名称:Portable.Xaml,代码行数:14,代码来源:XamlXmlReader.cs

示例11: LineInfo

 internal LineInfo(IXmlLineInfo lineInfo)
 {
     m_hasLineInfo = lineInfo.HasLineInfo();
     m_lineNumber = lineInfo.LineNumber;
     m_linePosition = lineInfo.LinePosition;
 }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:6,代码来源:LineInfo.cs

示例12: VerifyLineInfo

 private void VerifyLineInfo(IXmlLineInfo l1, IXmlLineInfo l2, string uri)
 {
     TestLog.Equals(l1.HasLineInfo(), l2.HasLineInfo(), "HasLineInfo ::: " + uri);
     TestLog.Equals(l1.LineNumber, l2.LineNumber, "LineNumber ::: " + uri);
     TestLog.Equals(l1.LinePosition, l2.LinePosition, "LinePosition ::: " + uri);
 }
开发者ID:johnhhm,项目名称:corefx,代码行数:6,代码来源:IXmlLineInfo.cs

示例13: SetLineNumbers

 /// <summary>
 /// Takes one of the xml line number so the numbers are now zero
 /// based instead of one based.
 /// </summary>
 /// <remarks>A namespace query (e.g. //namespace::*) will return
 /// a line info of -1, -1 for the xml namespace. Which looks like
 /// a bug in the XPathDocument class.</remarks>
 void SetLineNumbers(IXmlLineInfo lineInfo)
 {
     if (lineInfo.HasLineInfo() && lineInfo.LineNumber > 0) {
         lineNumber = lineInfo.LineNumber - 1;
         linePosition = lineInfo.LinePosition - 1;
     }
 }
开发者ID:BackupTheBerlios,项目名称:nantgui,代码行数:14,代码来源:XPathNodeMatch.cs

示例14: Proceed

 void Proceed(IXmlLineInfo li)
 {
     if (li == null || !li.HasLineInfo ())
         return;
     tw.ProceedTo (li.LineNumber, li.LinePosition);
 }
开发者ID:yudhitech,项目名称:xamarin-android,代码行数:6,代码来源:LinePreservedXmlWriter.cs

示例15: FormatMessage

		static string FormatMessage(string message, IXmlLineInfo xmlinfo)
		{
			if (xmlinfo == null || !xmlinfo.HasLineInfo())
				return message;
			return string.Format("Position {0}:{1}. {2}", xmlinfo.LineNumber, xmlinfo.LinePosition, message);
		}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:6,代码来源:XamlParseException.cs


注:本文中的IXmlLineInfo.HasLineInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。