本文整理汇总了C#中ICodeBuilder.AddReference方法的典型用法代码示例。如果您正苦于以下问题:C# ICodeBuilder.AddReference方法的具体用法?C# ICodeBuilder.AddReference怎么用?C# ICodeBuilder.AddReference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICodeBuilder
的用法示例。
在下文中一共展示了ICodeBuilder.AddReference方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateCode
public void GenerateCode(IConceptInfo conceptInfo, ICodeBuilder codeBuilder)
{
var info = (ModuleExternalReferenceInfo)conceptInfo;
var type = Type.GetType(info.TypeOrAssembly);
if (type != null)
codeBuilder.AddReferencesFromDependency(type);
else
codeBuilder.AddReference(info.TypeOrAssembly);
}
示例2: GenerateCode
public void GenerateCode(IConceptInfo conceptInfo, ICodeBuilder codeBuilder)
{
codeBuilder.InsertCode(CodeSnippet);
codeBuilder.AddReference(CaptionsResourceGenerator.ResourcesAssemblyDllPath);
codeBuilder.AddReferencesFromDependency(typeof(Guid));
codeBuilder.AddReferencesFromDependency(typeof(System.Linq.Enumerable));
codeBuilder.AddReferencesFromDependency(typeof(System.ComponentModel.DefaultValueAttribute)); // using namespace System.ComponentModel
codeBuilder.AddReferencesFromDependency(typeof(System.ComponentModel.DataAnnotations.DisplayAttribute)); // using namespace System.ComponentModel.DataAnnotations
}
示例3: GenerateCode
public void GenerateCode(IConceptInfo conceptInfo, ICodeBuilder codeBuilder)
{
codeBuilder.InsertCode(CodeSnippet);
// global
codeBuilder.AddReferencesFromDependency(typeof(Guid));
codeBuilder.AddReferencesFromDependency(typeof(System.Linq.Enumerable));
codeBuilder.AddReferencesFromDependency(typeof(System.Configuration.ConfigurationElement));
codeBuilder.AddReferencesFromDependency(typeof(System.Diagnostics.Stopwatch));
// registration
codeBuilder.AddReferencesFromDependency(typeof(System.ComponentModel.Composition.ExportAttribute));
codeBuilder.AddReferencesFromDependency(typeof(Autofac.Integration.Wcf.AutofacServiceHostFactory));
// wcf dataservices
codeBuilder.AddReferencesFromDependency(typeof(System.Data.Services.DataServiceException));
codeBuilder.AddReferencesFromDependency(typeof(System.Data.Services.Common.DataServiceEntityAttribute));
codeBuilder.AddReferencesFromDependency(typeof(System.ServiceModel.ServiceContractAttribute));
codeBuilder.AddReferencesFromDependency(typeof(System.ServiceModel.Activation.AspNetCompatibilityRequirementsAttribute));
codeBuilder.AddReferencesFromDependency(typeof(System.ServiceModel.Web.WebServiceHost));
codeBuilder.AddReferencesFromDependency(typeof(System.Uri));
codeBuilder.AddReferencesFromDependency(typeof(System.Web.Routing.RouteTable));
// rhetos
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.IService));
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.Dom.DefaultConcepts.IEntity));
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.Logging.ILogger));
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.Logging.LoggerHelper));
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.OData.DefaultCommands.ODataQueryCommand));
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.Processing.IProcessingEngine));
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.Security.Claim));
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.UserException));
codeBuilder.AddReference(Path.Combine(_rootPath, "ServerDom.dll"));
codeBuilder.AddReference(Path.Combine(_rootPath, "Autofac.dll"));
}
示例4: GenerateCode
public void GenerateCode(IConceptInfo conceptInfo, ICodeBuilder codeBuilder)
{
codeBuilder.InsertCode(CodeSnippet);
codeBuilder.AddReferencesFromDependency(typeof(IServerApplication));
codeBuilder.AddReferencesFromDependency(typeof(ServiceContractAttribute));
codeBuilder.AddReferencesFromDependency(typeof(ICommandInfo));
codeBuilder.AddReferencesFromDependency(typeof(Guid));
codeBuilder.AddReferencesFromDependency(typeof(WebFaultException));
codeBuilder.AddReferencesFromDependency(typeof(System.Linq.Enumerable));
codeBuilder.AddReferencesFromDependency(typeof(System.Net.HttpStatusCode));
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.Utilities.XmlUtility));
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.Web.ErrorServiceBehavior));
codeBuilder.AddReferencesFromDependency(typeof(ILogProvider));
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.Web.JsonErrorServiceBehavior));
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.Dom.IDomainObjectModel));
// registration
codeBuilder.AddReferencesFromDependency(typeof(System.ComponentModel.Composition.ExportAttribute));
codeBuilder.AddReferencesFromDependency(typeof(Autofac.Integration.Wcf.AutofacServiceHostFactory));
// wcf dataservices
codeBuilder.AddReferencesFromDependency(typeof(System.ServiceModel.ServiceContractAttribute));
codeBuilder.AddReferencesFromDependency(typeof(System.ServiceModel.Activation.AspNetCompatibilityRequirementsAttribute));
codeBuilder.AddReferencesFromDependency(typeof(System.ServiceModel.Web.WebServiceHost));
codeBuilder.AddReferencesFromDependency(typeof(System.Uri));
codeBuilder.AddReferencesFromDependency(typeof(System.Web.Routing.RouteTable));
codeBuilder.AddReferencesFromDependency(typeof(System.ServiceModel.Activation.ServiceHostFactory));
codeBuilder.AddReferencesFromDependency(typeof(Route));
codeBuilder.AddReference(Path.Combine(_rootPath, "ServerDom.dll"));
codeBuilder.AddReference(Path.Combine(_rootPath, "Autofac.dll"));
}
示例5: GenerateCode
public void GenerateCode(IConceptInfo conceptInfo, ICodeBuilder codeBuilder)
{
codeBuilder.InsertCode(CodeSnippet);
// Global
codeBuilder.AddReferencesFromDependency(typeof(Guid));
codeBuilder.AddReferencesFromDependency(typeof(System.Linq.Enumerable));
codeBuilder.AddReferencesFromDependency(typeof(System.Configuration.ConfigurationElement));
codeBuilder.AddReferencesFromDependency(typeof(System.Diagnostics.Stopwatch));
codeBuilder.AddReferencesFromDependency(typeof(XmlReader));
// Registration
codeBuilder.AddReferencesFromDependency(typeof(System.ComponentModel.Composition.ExportAttribute));
codeBuilder.AddReferencesFromDependency(typeof(Autofac.Integration.Wcf.AutofacServiceHostFactory));
// WCF Data Services
codeBuilder.AddReferencesFromDependency(typeof(System.ServiceModel.ServiceContractAttribute));
codeBuilder.AddReferencesFromDependency(typeof(System.ServiceModel.Activation.AspNetCompatibilityRequirementsAttribute));
codeBuilder.AddReferencesFromDependency(typeof(System.ServiceModel.Web.WebServiceHost));
codeBuilder.AddReferencesFromDependency(typeof(System.Uri));
codeBuilder.AddReferencesFromDependency(typeof(System.Web.Routing.RouteTable));
codeBuilder.AddReferencesFromDependency(typeof(System.ServiceModel.Activation.ServiceHostFactory));
codeBuilder.AddReferencesFromDependency(typeof(Route));
// Rhetos
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.IService));
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.Dom.DefaultConcepts.IEntity));
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.Logging.ILogger));
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.Logging.LoggerHelper));
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.Processing.IProcessingEngine));
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.Utilities.XmlUtility));
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.XmlSerialization.XmlData));
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.Web.JsonErrorServiceBehavior));
// RestGenerator
codeBuilder.AddReferencesFromDependency(typeof(Rhetos.RestGenerator.Utilities.ServiceUtility));
codeBuilder.AddReference(Path.Combine(_rootPath, "ServerDom.dll"));
codeBuilder.AddReference(Path.Combine(_rootPath, "Autofac.dll"));
}