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


C# Schema.XmlSchemaAnnotation类代码示例

本文整理汇总了C#中System.Xml.Schema.XmlSchemaAnnotation的典型用法代码示例。如果您正苦于以下问题:C# XmlSchemaAnnotation类的具体用法?C# XmlSchemaAnnotation怎么用?C# XmlSchemaAnnotation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: SchemaDocumentation

 public SchemaDocumentation(XmlSchemaAnnotation annotation)
 {
     this.annotation = annotation;
     if (annotation != null) {
         ReadDocumentationFromAnnotation(annotation.Items);
     }
 }
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:7,代码来源:SchemaDocumentation.cs

示例2: ProcessAnnotation

        private static string ProcessAnnotation(XmlSchemaAnnotation schemaAnnotation)
        {
            StringBuilder result = new StringBuilder();
            if (schemaAnnotation == null)
                return result.ToString();

            foreach (XmlSchemaObject schemaObject in schemaAnnotation.Items)
            {
                if (schemaObject is XmlSchemaAppInfo)
                    result.Append(ProcessAppInfo((XmlSchemaAppInfo)schemaObject));
                else if (schemaObject is XmlSchemaDocumentation)
                    result.Append(ProcessDocumentation((XmlSchemaDocumentation)schemaObject));
                else
                    result.AppendLine(string.Format("Unsupported annotation type: {0}", schemaObject));
            }

            return result.ToString();
        }
开发者ID:stephenwelsh,项目名称:msiext,代码行数:18,代码来源:Program.cs

示例3: ImportEnum

        static WebServiceEnumData ImportEnum(string typeName, string typeNamespace, XmlQualifiedName typeQualifiedName, XmlSchemaSimpleTypeRestriction restriction, XmlSchemaAnnotation annotation) {
            // CheckIfEnum has already checked if baseType of restriction is string 
            XmlQualifiedName baseTypeName = ImportActualType(annotation, new XmlQualifiedName("int", XmlSchema.Namespace), typeQualifiedName);
            Type baseEnumType = _nameToType[baseTypeName];
            bool isULong = (baseEnumType == typeof(ulong));
            List<string> enumNames = new List<string>();
            List<long> enumValues = new List<long>();
            foreach (XmlSchemaFacet facet in restriction.Facets) {
                XmlSchemaEnumerationFacet enumFacet = facet as XmlSchemaEnumerationFacet;
                Debug.Assert(enumFacet != null);
                Debug.Assert(enumFacet.Value != null);

                string valueInnerText = GetInnerText(typeQualifiedName, ImportAnnotation(enumFacet.Annotation, EnumerationValueAnnotationName));
                long value;
                if (valueInnerText == null) {
                    // ASP .NET AJAX doesn't honor the Flags nature of Flags enums
                    // If it were to, we would assign Math.Pow(2, nameValues.Count) for Flags enums instead.
                    value = enumNames.Count;
                }
                else {
                    if (isULong) {
                        value = (long)ulong.Parse(valueInnerText, NumberFormatInfo.InvariantInfo);
                    }
                    else {
                        value = long.Parse(valueInnerText, NumberFormatInfo.InvariantInfo);
                    }
                }

                enumNames.Add(enumFacet.Value);
                enumValues.Add(value);
            }

            return new WebServiceEnumData(typeName, typeNamespace, enumNames.ToArray(), enumValues.ToArray(), isULong);
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:34,代码来源:WebServiceTypeData.cs

示例4: Write5_XmlSchemaAnnotation

 void Write5_XmlSchemaAnnotation(XmlSchemaAnnotation o) {
     if ((object)o == null) return;
     WriteStartElement("annotation");
     
     WriteAttribute(@"id", @"", ((System.String)[email protected]));
     WriteAttributes((XmlAttribute[])[email protected], o);
     System.Xml.Schema.XmlSchemaObjectCollection a = (System.Xml.Schema.XmlSchemaObjectCollection)[email protected];
     if (a != null) {
         for (int ia = 0; ia < a.Count; ia++) {
             XmlSchemaObject ai = (XmlSchemaObject)a[ia];
             if (ai is XmlSchemaAppInfo) {
                 Write7_XmlSchemaAppInfo((XmlSchemaAppInfo)ai);
             }
             else if (ai is XmlSchemaDocumentation) {
                 Write6_XmlSchemaDocumentation((XmlSchemaDocumentation)ai);
             }
         }
     }
     WriteEndElement();
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:20,代码来源:SchemaObjectWriter.cs

示例5: AddAnnotation

 internal override void AddAnnotation(XmlSchemaAnnotation annotation)
 {
     this.annotation = annotation;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:4,代码来源:XmlSchemaInclude.cs

示例6: AddXmlnsAnnotation

 private void AddXmlnsAnnotation(XmlSchemaComplexType type, string xmlnsMemberName)
 {
     XmlSchemaAnnotation annotation = new XmlSchemaAnnotation();
     XmlSchemaAppInfo item = new XmlSchemaAppInfo();
     XmlDocument document = new XmlDocument();
     XmlElement element = document.CreateElement("keepNamespaceDeclarations");
     if (xmlnsMemberName != null)
     {
         element.InsertBefore(document.CreateTextNode(xmlnsMemberName), null);
     }
     item.Markup = new XmlNode[] { element };
     annotation.Items.Add(item);
     type.Annotation = annotation;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:14,代码来源:XmlSchemaExporter.cs

示例7: HandleAnnotations

		private void HandleAnnotations (XmlSchemaAnnotation an, bool nested)
		{
			foreach (XmlSchemaObject content in an.Items) {
				XmlSchemaAppInfo ai = content as XmlSchemaAppInfo;
				if (ai != null) {
					foreach (XmlNode n in ai.Markup) {
						XmlElement el = n as XmlElement;
						if (el != null && el.LocalName == "Relationship" && el.NamespaceURI == XmlConstants.MsdataNamespace)
							HandleRelationshipAnnotation (el, nested);
					}
				}
			}
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:13,代码来源:XmlSchemaDataImporter.cs

示例8: GetDocumentation

		static string GetDocumentation(XmlSchemaAnnotation annotation)
		{
			return new SchemaDocumentation(annotation).ToString();
		}
开发者ID:Netring,项目名称:SharpDevelop,代码行数:4,代码来源:XmlSchemaCompletion.cs

示例9: GetMarkup

 static string GetMarkup(XmlSchemaAnnotation ann, string filter, string language)
 {
     StringBuilder sb = new StringBuilder();
     foreach (XmlSchemaObject o in ann.Items) {
         // for xs:documentation nodes
         if (o is XmlSchemaDocumentation) {
             XmlSchemaDocumentation d = (XmlSchemaDocumentation)o;
             if (string.IsNullOrEmpty(language) || d.Language == language)
             {
                 XmlNode[] ma = d.Markup;
                 if (ma != null)
                 {
                     // if we only have the xs:documentation node (no markup)...
                     foreach (XmlNode n in ma)
                     {
                         if (!string.IsNullOrEmpty(filter))
                         {
                             if (string.Compare(filter, n.LocalName, StringComparison.InvariantCultureIgnoreCase) == 0)
                             {
                                 sb.Append(n.InnerText);
                             }
                         }
                         else
                         {
                             sb.Append(n.InnerText);
                         }
                     }
                 }
             }
         }
     }
     return sb.ToString();
 }
开发者ID:dbremner,项目名称:xmlnotepad,代码行数:33,代码来源:SchemaCache.cs

示例10: GetDocumentation

		/// <summary>
		/// Gets the documentation from the annotation element.
		/// </summary>
		/// <remarks>
		/// All documentation elements are added.  All text nodes inside
		/// the documentation element are added.
		/// </remarks>
		string GetDocumentation(XmlSchemaAnnotation annotation)
		{
			string documentation = String.Empty;
			
			if (annotation != null) {
				StringBuilder documentationBuilder = new StringBuilder();
				foreach (XmlSchemaObject schemaObject in annotation.Items) {
					XmlSchemaDocumentation schemaDocumentation = schemaObject as XmlSchemaDocumentation;
					if (schemaDocumentation != null) {
						foreach (XmlNode node in schemaDocumentation.Markup) {
							XmlText textNode = node as XmlText;
							if (textNode != null) {
								if (textNode.Data != null) {
									if (textNode.Data.Length > 0) {
										documentationBuilder.Append(textNode.Data);
									}
								}
							}
						}
					}
				}
				
				documentation = documentationBuilder.ToString();
			}
			
			return documentation;
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:34,代码来源:XmlSchemaCompletionData.cs

示例11: AddElement

		/// <summary>
		/// Adds an element completion data to the collection if it does not 
		/// already exist.
		/// </summary>
		void AddElement(XmlCompletionDataCollection data, string name, string prefix, XmlSchemaAnnotation annotation)
		{
			// Get any annotation documentation.
			string documentation = GetDocumentation(annotation);
			
			AddElement(data, name, prefix, documentation);
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:11,代码来源:XmlSchemaCompletionData.cs

示例12: AddAttributeValue

		/// <summary>
		/// Adds an attribute value to the completion data collection.
		/// </summary>
		void AddAttributeValue(XmlCompletionDataCollection data, string valueText, XmlSchemaAnnotation annotation)
		{
			string documentation = GetDocumentation(annotation);
			XmlCompletionData completionData = new XmlCompletionData(valueText, documentation, XmlCompletionData.DataType.XmlAttributeValue);
			data.Add(completionData);
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:9,代码来源:XmlSchemaCompletionData.cs

示例13: setAnnotation

 private void setAnnotation( AbstractDef def,
                             XmlSchemaAnnotation annotation )
 {
     if ( annotation != null ) {
         string desc = string.Empty;
         foreach ( XmlSchemaObject o in annotation.Items ) {
             XmlSchemaDocumentation description = o as XmlSchemaDocumentation;
             if ( description != null ) {
                 foreach ( XmlNode node in description.Markup ) {
                     desc += node.OuterXml;
                 }
             }
             else {
                 XmlSchemaAppInfo appinfo = o as XmlSchemaAppInfo;
                 if ( o != null ) {
                     def.SetFlags( appinfo.Markup[0].InnerText );
                 }
             }
         }
         def.Desc = desc;
     }
 }
开发者ID:rafidzal,项目名称:OpenADK-csharp,代码行数:22,代码来源:SifSchema.cs

示例14: GetDescription

        /// <summary>
        /// Get the description from an xml schema object.
        /// </summary>
        /// <param name="annotation">The xml schema object.</param>
        /// <returns>The description of the object.</returns>
        private static string GetDescription(XmlSchemaAnnotation annotation)
        {
            StringBuilder documentation = new StringBuilder();

            // retrieve the documentation nodes
            foreach (XmlSchemaObject obj in annotation.Items)
            {
                XmlSchemaDocumentation doc = obj as XmlSchemaDocumentation;

                if (doc != null)
                {
                    foreach (XmlNode node in doc.Markup)
                    {
                        if (node is XmlText)
                        {
                            documentation.Append(((XmlText)node).OuterXml);
                        }
                        else if (node is XmlElement)
                        {
                            documentation.Append(((XmlElement)node).OuterXml);
                        }
                    }
                }
            }

            documentation.Replace("\t", String.Empty);
            documentation.Replace(String.Concat(Environment.NewLine, Environment.NewLine), "<br/><br/>");
            documentation.Replace(Environment.NewLine, " ");
            return htmlPrefix.Replace(documentation.ToString(), String.Empty);
        }
开发者ID:Jeremiahf,项目名称:wix3,代码行数:35,代码来源:XmlSchemaCompiler.cs

示例15: Check

		public virtual void Check (ConformanceCheckContext ctx, XmlSchemaAnnotation value) {}
开发者ID:nobled,项目名称:mono,代码行数:1,代码来源:ConformanceChecker.cs


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