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

C# CodeGenerationOptions类代码示例

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

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



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

示例1: SchemaImporter

 internal SchemaImporter(XmlSchemas schemas, CodeGenerationOptions options, CodeDomProvider codeProvider, System.Xml.Serialization.ImportContext context)
 {
     if (!schemas.Contains("http://www.w3.org/2001/XMLSchema"))
     {
         schemas.AddReference(XmlSchemas.XsdSchema);
         schemas.SchemaSet.Add(XmlSchemas.XsdSchema);
     }
     if (!schemas.Contains("http://www.w3.org/XML/1998/namespace"))
     {
         schemas.AddReference(XmlSchemas.XmlSchema);
         schemas.SchemaSet.Add(XmlSchemas.XmlSchema);
     }
     this.schemas = schemas;
     this.options = options;
     this.codeProvider = codeProvider;
     this.context = context;
     this.Schemas.SetCache(this.Context.Cache, this.Context.ShareTypes);
     SchemaImporterExtensionsSection section = System.Configuration.PrivilegedConfigurationManager.GetSection(ConfigurationStrings.SchemaImporterExtensionsSectionPath) as SchemaImporterExtensionsSection;
     if (section != null)
     {
         this.extensions = section.SchemaImporterExtensionsInternal;
     }
     else
     {
         this.extensions = new SchemaImporterExtensionCollection();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:SchemaImporter.cs


示例2: ImportSchemaType

		public override string ImportSchemaType(XmlSchemaType type, XmlSchemaObject context, XmlSchemas schemas, XmlSchemaImporter importer, CodeCompileUnit compileUnit, CodeNamespace mainNamespace, CodeGenerationOptions options, CodeDomProvider codeProvider) {
			if (type == null) {
				return null;
			}

			if (importedTypes[type] != null) {
				mainNamespace.Imports.Add(new CodeNamespaceImport(typeof(DataSet).Namespace));
				compileUnit.ReferencedAssemblies.Add("System.Data.dll");
				return (string)importedTypes[type];
			}
			if (!(context is XmlSchemaElement))
				return null;

			if (type is XmlSchemaComplexType) {
				XmlSchemaComplexType ct = (XmlSchemaComplexType)type;
				if (ct.Particle is XmlSchemaSequence) {
					XmlSchemaObjectCollection items = ((XmlSchemaSequence)ct.Particle).Items;
					if (items.Count == 2 && items[0] is XmlSchemaAny && items[1] is XmlSchemaAny) {
						XmlSchemaAny any0 = (XmlSchemaAny)items[0];
						XmlSchemaAny any1 = (XmlSchemaAny)items[1];
						if (any0.Namespace == XmlSchema.Namespace && any1.Namespace == "urn:schemas-microsoft-com:xml-diffgram-v1") {
							string typeName = typeof(DataTable).FullName;
							importedTypes.Add(type, typeName);
							mainNamespace.Imports.Add(new CodeNamespaceImport(typeof(DataTable).Namespace));
							compileUnit.ReferencedAssemblies.Add("System.Data.dll");
							return typeName;
						}
					}
				}
			}
			return null;
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:32,代码来源:DataTableSchemaImporterExtension.cs


示例3: ImportSchemaType

        //public override string ImportSchemaType(
        //    string name, 
        //    string ns, 
        //    XmlSchemaObject context, 
        //    XmlSchemas schemas, 
        //    XmlSchemaImporter importer,
        //    CodeCompileUnit compileUnit, 
        //    CodeNamespace mainNamespace, 
        //    CodeGenerationOptions options, 
        //    CodeDomProvider codeProvider)
        //{

        //    XmlSchemaSimpleType simpleType = (XmlSchemaSimpleType) schemas.Find(new XmlQualifiedName(name, ns), typeof(XmlSchemaSimpleType));
        //    return ImportSchemaType(
        //        simpleType, 
        //        context, 
        //        schemas, 
        //        importer, 
        //        compileUnit, 
        //        mainNamespace, 
        //        options, 
        //        codeProvider);
        //}

        public override string ImportSchemaType(
            XmlSchemaType type, 
            XmlSchemaObject context, 
            XmlSchemas schemas, 
            XmlSchemaImporter importer,
            CodeCompileUnit compileUnit, 
            CodeNamespace mainNamespace, 
            CodeGenerationOptions options, 
            CodeDomProvider codeProvider)
        {

            XmlSchemaAnnotated annotatedType  = type as XmlSchemaAnnotated;
            if (annotatedType == null)
                return null;

            if (annotatedType.Annotation == null)
                return null;

            // create the comments and add them to the hash table under the namespace of the object
            CreateComments(annotatedType);

            //mainNamespace.Types.

            return null;

        }
开发者ID:nujmail,项目名称:xsd-to-classes,代码行数:50,代码来源:AnnotationTypeExtension.cs


示例4: ImportSchemaType

        public override string ImportSchemaType(
            string name,
            string ns,
            XmlSchemaObject context,
            XmlSchemas schemas,
            XmlSchemaImporter importer,
            CodeCompileUnit compileUnit,
            CodeNamespace mainNamespace,
            CodeGenerationOptions options,
            CodeDomProvider codeProvider)
        {
            if (ns != "http://www.w3.org/2001/XMLSchema")
                return null;

            switch (name)
            {
                case "anyURI":     return "System.Uri"; 
                case "gDay":       return "System.Runtime.Remoting.Metadata.W3cXsd2001.SoapDay";
                case "gMonth":     return "System.Runtime.Remoting.Metadata.W3cXsd2001.SoapMonth";
                case "gMonthDay":  return "System.Runtime.Remoting.Metadata.W3cXsd2001.SoapMonthDay";
                case "gYear":      return "System.Runtime.Remoting.Metadata.W3cXsd2001.SoapYear"; 
                case "gYearMonth": return "System.Runtime.Remoting.Metadata.W3cXsd2001.SoapYearMonth";
                case "duration":   return "System.Runtime.Remoting.Metadata.W3cXsd2001.SoapDuration"; 
                default: return null;
            }
        }
开发者ID:nujmail,项目名称:xsd-to-classes,代码行数:26,代码来源:SoapTypeExtension.cs


示例5: MapCodeGenerator

		public MapCodeGenerator (CodeNamespace codeNamespace, CodeCompileUnit codeCompileUnit, CodeGenerationOptions options)
		{
//			this.codeCompileUnit = codeCompileUnit;
			this.codeNamespace = codeNamespace;
			this.options = options;
			this.identifiers = new CodeIdentifiers ();
		}
开发者ID:carrie901,项目名称:mono,代码行数:7,代码来源:MapCodeGenerator.cs


示例6: ImportSchemaType

        public override string ImportSchemaType(
            string name, 
            string ns,
            XmlSchemaObject context, 
            XmlSchemas schemas,
            XmlSchemaImporter importer,
            CodeCompileUnit compileUnit, 
            CodeNamespace codeNamespace,
            CodeGenerationOptions options, 
            CodeDomProvider codeGenerator)
        {

            if (IsBaseType(name, ns))
            {
                return base.ImportSchemaType(name, ns,
                context, schemas,
                importer,
                compileUnit, codeNamespace,
                options, codeGenerator);
            }

            // Add the Namespace, except the first
            for (int i = 1; i < ImportNamespaces.Length; i++)
            {
                string _Import = ImportNamespaces[i];
                codeNamespace.Imports.Add(new CodeNamespaceImport(_Import));
            }

            return name;
        }
开发者ID:nujmail,项目名称:xsd-to-classes,代码行数:30,代码来源:StripBusinessObjectsSchemaImporterExtension.cs


示例7: SoapCodeExporter

		[MonoTODO]// FIXME: mappings?
		public SoapCodeExporter (CodeNamespace codeNamespace, 
								CodeCompileUnit codeCompileUnit, 
								CodeDomProvider codeProvider, 
								CodeGenerationOptions options, 
								Hashtable mappings)
		{
			codeGenerator = new SoapMapCodeGenerator (codeNamespace, codeCompileUnit, codeProvider, options, mappings);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:9,代码来源:SoapCodeExporter.cs


示例8: XmlCodeExporter

		public XmlCodeExporter (CodeNamespace codeNamespace, 
								CodeCompileUnit codeCompileUnit, 
								CodeGenerationOptions options, 
								Hashtable mappings)
		: this (codeNamespace, codeCompileUnit, null, options, mappings)
		{
			
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:8,代码来源:XmlCodeExporter.cs


示例9: MapCodeGenerator

		public MapCodeGenerator (CodeNamespace codeNamespace, CodeCompileUnit codeCompileUnit, CodeDomProvider codeProvider, CodeGenerationOptions options, Hashtable mappings)
		{
//			this.codeCompileUnit = codeCompileUnit;
			this.codeNamespace = codeNamespace;
			this.options = options;
			this.codeProvider = codeProvider;
			this.identifiers = new CodeIdentifiers ((codeProvider.LanguageOptions & LanguageOptions.CaseInsensitive) == 0);
//			this.mappings = mappings;
		}
开发者ID:Profit0004,项目名称:mono,代码行数:9,代码来源:MapCodeGenerator.cs


示例10: ImportSchemaType

 public override string ImportSchemaType(string name, string xmlNamespace, XmlSchemaObject context, XmlSchemas schemas, XmlSchemaImporter importer, CodeCompileUnit compileUnit, CodeNamespace mainNamespace, CodeGenerationOptions options, CodeDomProvider codeProvider)
 {
     if ((this.m_direct && (context is XmlSchemaElement)) && ((string.CompareOrdinal(this.m_name, name) == 0) && (string.CompareOrdinal(this.m_targetNamespace, xmlNamespace) == 0)))
     {
         compileUnit.ReferencedAssemblies.AddRange(this.m_references);
         mainNamespace.Imports.AddRange(this.m_namespaceImports);
         return this.m_destinationType;
     }
     return null;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:SqlTypesSchemaImporterExtensionHelper.cs


示例11: UglificationOptions

 /// <summary>
 /// Constructs a instance of the uglification options
 /// </summary>
 public UglificationOptions()
 {
     ParsingOptions = new ParsingOptions();
     CompressionOptions = new CompressionOptions();
     ManglingOptions = new ManglingOptions();
     CodeGenerationOptions = new CodeGenerationOptions();
     ScrewIe8 = false;
     KeepFunctionNames = false;
     Severity = 0;
 }
开发者ID:akushnikov,项目名称:bundletransformer,代码行数:13,代码来源:UglificationOptions.cs


示例12: ImportSchemaType

		public override string ImportSchemaType (XmlSchemaType type, XmlSchemaObject context, XmlSchemas schemas, XmlSchemaImporter importer, CodeCompileUnit compileUnit, CodeNamespace mainNamespace, CodeGenerationOptions options, CodeDomProvider codeProvider)
		{
			if (type == null)
				return null;

			var xe = context as XmlSchemaElement;
			if (xe == null)
				return null;

			return null;
		}
开发者ID:Profit0004,项目名称:mono,代码行数:11,代码来源:TypedDataSetSchemaImporterExtension.cs


示例13: ImportSchemaType

		public override string ImportSchemaType (string name, string ns, XmlSchemaObject context, XmlSchemas schemas, XmlSchemaImporter importer, CodeCompileUnit compileUnit, CodeNamespace mainNamespace, CodeGenerationOptions options, CodeDomProvider codeProvider)
		{
			if (ns == "http://monkeywrench.novell.com/") {
				if (name != "ArrayOfString" && name != "ArrayOfInt1") {
					mainNamespace.Imports.Add (new CodeNamespaceImport ("MonkeyWrench.DataClasses"));
					mainNamespace.Imports.Add (new CodeNamespaceImport ("MonkeyWrench.DataClasses.Logic"));
					return name;
				}
			}

			return base.ImportSchemaType (name, ns, context, schemas, importer, compileUnit, mainNamespace, options, codeProvider);
		}
开发者ID:joewstroman,项目名称:monkeywrench,代码行数:12,代码来源:WsdlGenerator.cs


示例14: ImportSchemaType

		public virtual string ImportSchemaType (
			XmlSchemaType type, 
			XmlSchemaObject context, 
			XmlSchemas schemas, 
			XmlSchemaImporter importer, 
			CodeCompileUnit compileUnit, 
			CodeNamespace mainNamespace, 
			CodeGenerationOptions options, 
			CodeDomProvider codeProvider
		)
		{
			return null;
		}
开发者ID:t-ashula,项目名称:mono,代码行数:13,代码来源:SchemaImporterExtension.cs


示例15: ImportAnyElement

		public virtual string ImportAnyElement (
			XmlSchemaAny any, 
			bool mixed, 
			XmlSchemas schemas, 
			XmlSchemaImporter importer, 
			CodeCompileUnit compileUnit, 
			CodeNamespace mainNamespace, 
			CodeGenerationOptions options, 
			CodeDomProvider codeProvider
		)
		{
			return null;
		}
开发者ID:t-ashula,项目名称:mono,代码行数:13,代码来源:SchemaImporterExtension.cs


示例16: Test_Generate_Javascript_To_Console

        public void Test_Generate_Javascript_To_Console()
        {
            var options = new CodeGenerationOptions
            {
                GenerateClasses = false,
                TypeNamePrefix = "TN"
            };

            var serviceModel = FicklefileParserTests.GetTestServiceModel();
            var serviceModelcodeGenerator = ServiceModelCodeGenerator.GetCodeGenerator("javascript", Console.Out, options);

            serviceModelcodeGenerator.Generate(serviceModel);
        }
开发者ID:techpub,项目名称:Fickle,代码行数:13,代码来源:GeneratorTests.cs


示例17: Test_Generate_CSharp_To_Console

        public void Test_Generate_CSharp_To_Console()
        {
            var options = new CodeGenerationOptions
            {
                GenerateClasses = true,
                Namespace = "Io.Fickle.Test.Servicemodel"
            };

            var serviceModel = FicklefileParserTests.GetTestServiceModel();
            var serviceModelcodeGenerator = ServiceModelCodeGenerator.GetCodeGenerator("csharp", TextWriter.Null, options);

            serviceModelcodeGenerator.Generate(serviceModel);
        }
开发者ID:samcook,项目名称:Fickle,代码行数:13,代码来源:GeneratorTests.cs


示例18: ImportSchemaType

 public override string ImportSchemaType(string name, string ns, XmlSchemaObject context, XmlSchemas schemas,
     XmlSchemaImporter importer, CodeCompileUnit compileUnit, CodeNamespace mainNamespace, CodeGenerationOptions options, CodeDomProvider codeProvider)
 {
     if (XmlSchema.Namespace == ns)
     {
         switch (name)
         {
             case "dateTime":
                 string codeTypeName = typeof(DateTimeOffset).FullName;
                 return codeTypeName;
             default: return null;
         }
     }
     else { return null; }
 }
开发者ID:CUAHSI,项目名称:CUAHSI-GenericWOF_vs2013,代码行数:15,代码来源:ImportW3CDateTime.cs


示例19: CodeExporter

 internal CodeExporter(CodeNamespace codeNamespace, CodeCompileUnit codeCompileUnit, CodeDomProvider codeProvider, CodeGenerationOptions options, Hashtable exportedMappings) {
     if (codeNamespace != null)
         CodeGenerator.ValidateIdentifiers(codeNamespace);
     this.codeNamespace = codeNamespace;
     if (codeCompileUnit != null) {
         if (!codeCompileUnit.ReferencedAssemblies.Contains("System.dll"))
             codeCompileUnit.ReferencedAssemblies.Add("System.dll");
         if (!codeCompileUnit.ReferencedAssemblies.Contains("System.Xml.dll"))
             codeCompileUnit.ReferencedAssemblies.Add("System.Xml.dll");
     }
     this.codeCompileUnit = codeCompileUnit;
     this.options = options;
     this.exportedMappings = exportedMappings;
     this.codeProvider = codeProvider;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:15,代码来源:CodeExporter.cs


示例20: Test_Generate_Javascript_Files

        public void Test_Generate_Javascript_Files()
        {
            var options = new CodeGenerationOptions
            {
                GenerateClasses = false,
                TypeNamePrefix = "TN"
            };

            var outputDir = FileSystemManager.Default.ResolveDirectory("./" + new StackTrace().GetFrame(0).GetMethod().Name);
            var serviceModel = FicklefileParserTests.GetTestServiceModel();

            outputDir.Create(true);

            var serviceModelcodeGenerator = ServiceModelCodeGenerator.GetCodeGenerator("javascript", outputDir, options);

            serviceModelcodeGenerator.Generate(serviceModel);
        }
开发者ID:samcook,项目名称:Fickle,代码行数:17,代码来源:GeneratorTests.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# CodeGenerator类代码示例发布时间:2022-05-24
下一篇:
C# CodeGenerationContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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