• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Linq.XTypedElement类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# XmlBooster.XmlBBaseVisitor类代码示例发布时间:2022-05-26
下一篇:
C# Linq.ContentModelEntity类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap