當前位置: 首頁>>代碼示例>>C#>>正文


C# Linq.XTypedElement類代碼示例

本文整理匯總了C#中Xml.Schema.Linq.XTypedElement的典型用法代碼示例。如果您正苦於以下問題:C# XTypedElement類的具體用法?C# XTypedElement怎麽用?C# XTypedElement使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


XTypedElement類屬於Xml.Schema.Linq命名空間,在下文中一共展示了XTypedElement類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SetUnionValue

        protected void SetUnionValue(object value,
                                    string propertyName,
                                    XTypedElement container,
                                    SimpleTypeValidator typeDef)
        {
            SetUnionCatchAll(value, propertyName, this, null, typeDef, SchemaOrigin.Text);

        }
開發者ID:pusp,項目名稱:o2platform,代碼行數:8,代碼來源:XObjectsSimpleType.cs

示例2: WriteSchemaLocation

	    /**
	     * Writes the schema location(s) to the XML Document
	     * @param doc the XML document to write the schema location(s) to
	     * @param schemaVersion the version of the schema to write in
	     * @param namespaceUri the URI of the namespace to write
	     */
	    public void WriteSchemaLocation(XTypedElement doc, string[] namespaceUri) 
        {
		    if(namespaceUri == null) 
			    return;

		    SdmxSchema schemaVersion;
		    StringBuilder schemaLocation = new StringBuilder();

		    string concat = "";
		    foreach (string currentNamespaceUri in namespaceUri) 
            {
			    schemaVersion = SdmxConstants.GetSchemaVersion(currentNamespaceUri);
			    //Base location of schema for version e.g. http://www.sss.sss/schema/
			    string schemaBaseLocation = GetSchemaLocation(schemaVersion);
			    string schemaName = SdmxConstants.GetSchemaName(currentNamespaceUri);
			    schemaLocation.Append(concat+currentNamespaceUri + " " + concat+schemaBaseLocation+schemaName);
			    concat = "\r\n";// System.getProperty("line.separator");
		    }

            doc.Untyped.SetAttributeValue(XName.Get("http://www.w3.org/2001/XMLSchema-instance","schemaLocation"),schemaLocation.ToString());
	    }
開發者ID:alcardac,項目名稱:SDMXRI_WS_OF,代碼行數:27,代碼來源:SchemaLocationWriter.cs

示例3: WriteSchemaLocation

	    protected void WriteSchemaLocation(XTypedElement doc, SdmxSchemaEnumType schemaVersion) 
        {
		    if (schemaLocationWriter != null)
            {
                List<string> schemaUri = new List<string>();
			    switch(schemaVersion) 
                {
			        case SdmxSchemaEnumType.VersionOne :  
                        schemaUri.Add(SdmxConstants.MessageNs10);
			            break;
			        case SdmxSchemaEnumType.VersionTwo:  
                        schemaUri.Add(SdmxConstants.MessageNs20);
			            break;
			        case SdmxSchemaEnumType.VersionTwoPointOne :  
                        schemaUri.Add(SdmxConstants.MessageNs21);
			            break;
			        default : 
                        throw new SdmxNotImplementedException(ExceptionCode.Unsupported, "Schema Version " + schemaVersion);
			    }
			    schemaLocationWriter.WriteSchemaLocation(doc, schemaUri.ToArray());
		    }
	    }
開發者ID:alcardac,項目名稱:SDMXRI_WS_OF,代碼行數:22,代碼來源:XmlObjectBuilder.cs

示例4: SetUnionElement

 protected void SetUnionElement(
     object value,
     string propertyName,
     XTypedElement container,
     XName itemXName,
     SimpleTypeValidator typeDef)
 {
     SetUnionCatchAll(
         value,
         propertyName,
         container,
         itemXName,
         typeDef,
         SchemaOrigin.Element);
 }
開發者ID:dipdapdop,項目名稱:linqtoxsd,代碼行數:15,代碼來源:XObjectsSimpleType.cs

示例5: SetUnionCatchAll

        private void SetUnionCatchAll(
            object value,
            string propertyName,
            XTypedElement container,
            XName itemXName,
            SimpleTypeValidator typeDef,
            SchemaOrigin origin)
        {
            UnionSimpleTypeValidator unionDef =
                typeDef as UnionSimpleTypeValidator;

            Debug.Assert(unionDef != null);

            SimpleTypeValidator matchingType = null;
            object typedValue;
            Exception e = unionDef.TryParseValue(
                value,
                XTypedServices.NameTable,
                new XNamespaceResolver(container.GetUntyped()),
                out matchingType,
                out typedValue);

            if (e != null)
            {
                throw new LinqToXsdException(propertyName, e.Message);
            }
            else
            {
                if (matchingType is ListSimpleTypeValidator)
                {
                    ListSimpleTypeValidator listType = matchingType as ListSimpleTypeValidator;
                    switch (origin)
                    {
                        case SchemaOrigin.Element:
                            SetListElement(itemXName, value, listType.ItemType.DataType);
                            break;
                        case SchemaOrigin.Text:
                            SetListValue(value, listType.ItemType.DataType);
                            break;
                        case SchemaOrigin.Attribute:
                            SetListAttribute(itemXName, value, listType.ItemType.DataType);
                            break;
                        default:
                            break;
                    }

                }
                else
                {
                    switch (origin)
                    {
                        case SchemaOrigin.Element: SetElement(itemXName, value, matchingType.DataType); break;
                        case SchemaOrigin.Text: SetValue(value, matchingType.DataType); break;
                        case SchemaOrigin.Attribute: SetAttribute(itemXName, value, matchingType.DataType); break;
                        default: break;
                    }
                }
            }
        }
開發者ID:dipdapdop,項目名稱:linqtoxsd,代碼行數:59,代碼來源:XObjectsSimpleType.cs

示例6: AddElementInPosition

        internal void AddElementInPosition(XName name, XElement parentElement, bool addToExisting, XTypedElement xObj) {
            NamedContentModelEntity namedEntity = GetNamedEntity(name);
            if (namedEntity == null) {
                // See http://linqtoxsd.codeplex.com/WorkItem/View.aspx?WorkItemId=3542
                throw new LinqToXsdException(
                    "Name does not belong in content model. Cannot set value for child " +
                    name.LocalName);
            }
            EditAction editAction = EditAction.None;
            XElement elementMarker = FindElementPosition(namedEntity, parentElement, addToExisting, out editAction);

            XElement newElement = XTypedServices.GetXElement(xObj, name);
            Debug.Assert(xObj != null);
            
            switch (editAction) {
                case EditAction.Append:
                    parentElement.Add(newElement);
                break;
                
                case EditAction.Update:
                    elementMarker.AddBeforeSelf(newElement);
                    elementMarker.Remove();
                break;
                
                case EditAction.AddBefore:
                    elementMarker.AddBeforeSelf(newElement);
                break;
            }
        }
開發者ID:alcardac,項目名稱:SDMXRI_WS_OF,代碼行數:29,代碼來源:ContentModel.cs

示例7: XRootNamespace

 public XRootNamespace(EntityContainer root)
 {
     _xDocument = new XDocument(root.Untyped);
       _rootObject = root;
 }
開發者ID:mattfrerichs,項目名稱:Templates,代碼行數:5,代碼來源:XRootNamespace.cs

示例8: XRoot

 public XRoot(global::https.www.veracode.com.schema.reports.export.Item1.Item0.detailedreport root) {
     this.doc = new XDocument(root.Untyped);
     this.rootObject = root;
 }
開發者ID:CallMeSteve,項目名稱:O2.Platform.Scripts,代碼行數:4,代碼來源:detailedreport.cs

示例9: XRootNamespace

 public XRootNamespace(template root)
 {
     this.doc = new XDocument(root.Untyped);
     this.rootObject = root;
 }
開發者ID:nickvane,項目名稱:vela,代碼行數:5,代碼來源:LinqToXsdSource.cs

示例10: XRoot

 public XRoot(global::schemas.openehr.org.v1.template root)
 {
     this.doc = new XDocument(root.Untyped);
     this.rootObject = root;
 }
開發者ID:nickvane,項目名稱:vela,代碼行數:5,代碼來源:LinqToXsdSource.cs

示例11: XRootNamespace

 public XRootNamespace(sqlinsert root)
 {
     this.doc = new XDocument(root.Untyped);
     this.rootObject = root;
 }
開發者ID:timiles,項目名稱:NhCodeFirst,代碼行數:5,代碼來源:nhibernate-mapping.cs

示例12: XRootNamespace

 public XRootNamespace(animateColor root)
 {
     this.doc=new XDocument(root.Untyped);
     this.rootObject=root;
 }
開發者ID:mcartoixa,項目名稱:GeoSIK,代碼行數:5,代碼來源:_Language.cs

示例13: XRootNamespace

 public XRootNamespace(detailedreport root) {
     this.doc = new XDocument(root.Untyped);
     this.rootObject = root;
 }
開發者ID:CallMeSteve,項目名稱:O2.Platform.Scripts,代碼行數:4,代碼來源:detailedreport.cs


注:本文中的Xml.Schema.Linq.XTypedElement類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。