本文整理汇总了C#中ICodeGenerator类的典型用法代码示例。如果您正苦于以下问题:C# ICodeGenerator类的具体用法?C# ICodeGenerator怎么用?C# ICodeGenerator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICodeGenerator类属于命名空间,在下文中一共展示了ICodeGenerator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TypescriptCodeProvider
public TypescriptCodeProvider()
{
var unity = new UnityContainer();
var startup = new Startup(unity);
startup.Initialize();
_codeGenerator = unity.Resolve<ICodeGenerator>();
}
示例2: Generate
public static void Generate (DataSet dataSet,
CodeNamespace codeNamespace,
ICodeGenerator codeGen)
{
CustomDataClassGenerator.CreateDataSetClasses (
dataSet, codeNamespace, codeGen, null);
}
示例3: MethodVirtualizer
public MethodVirtualizer(IMethodVirtualizerInfoWrapper wrapper, ICodeGenerator codeGenerator)
{
ArgumentUtility.CheckNotNull ("wrapper", wrapper);
ArgumentUtility.CheckNotNull ("codeGenerator", codeGenerator);
_wrapper = wrapper;
_codeGenerator = codeGenerator;
}
示例4: Generate
public static CodeGenFile[] Generate(ICodeGeneratorDataProvider provider, string directory, ICodeGenerator[] codeGenerators)
{
directory = GetSafeDir(directory);
CleanDir(directory);
var generatedFiles = new List<CodeGenFile>();
foreach (var generator in codeGenerators.OfType<IPoolCodeGenerator>()) {
var files = generator.Generate(provider.poolNames);
generatedFiles.AddRange(files);
writeFiles(directory, files);
}
foreach (var generator in codeGenerators.OfType<IComponentCodeGenerator>()) {
var files = generator.Generate(provider.componentInfos);
generatedFiles.AddRange(files);
writeFiles(directory, files);
}
foreach (var generator in codeGenerators.OfType<IBlueprintsCodeGenerator>()) {
var files = generator.Generate(provider.blueprintNames);
generatedFiles.AddRange(files);
writeFiles(directory, files);
}
return generatedFiles.ToArray();
}
示例5: ToSpecifiedRegister
public override void ToSpecifiedRegister(ICodeGenerator g, Register result)
{
string opCode;
string shifter;
int multiplier;
switch(array.ExpressionType) {
case ExpressionType.WordArray:
opCode="LDR";
shifter=",LSL 2";
multiplier=4;
break;
case ExpressionType.ByteArray:
opCode="LDRB";
shifter="";
multiplier=1;
break;
default:
throw new Exception("Can't index an expression of type "+array.ExpressionType);
}
throw new NotImplementedException("NIY");
//
// array.LoadToNewRegister(g, arrayRegister =>
// index.ToRegisterOrImmediate(g,
// indexRegister => g.Emit(OpCodes.TODO, opCode+" "+result+",["+arrayRegister+",+"+indexRegister+shifter+"]"),
// indexImmediate => g.Emit(OpCodes.TODO, opCode+" "+result+",["+arrayRegister+",+#"+indexImmediate*multiplier+"]")));
}
示例6: SchemaBrowserVM
public SchemaBrowserVM(ISchemaBrowserModel iSchemaBrowserModel, ICodeGenerator iCodeGenerator, DbConnectionInfo dbConnectionInfo)
{
model = iSchemaBrowserModel;
codeGenerator = iCodeGenerator;
currentDb = dbConnectionInfo;
GeneratCodeCommand = new DelegateCommand<object>(GeneratCode);
}
示例7: GenerateIdName
// given a variable name, this method will check to see if the
// name is a valid identifier name. if this is not the case, then
// at the moment will replace all the blank space with underscores.
public static string GenerateIdName(string name, ICodeGenerator codeGen) {
if (codeGen.IsValidIdentifier(name)) {
return name;
}
string ret = name.Replace(' ', '_');
if (! codeGen.IsValidIdentifier(ret)) {
ret = "_" + ret;
UnicodeCategory unc;
for (int i = 1; i < ret.Length; i++) {
unc = Char.GetUnicodeCategory(ret[i]);
if (
UnicodeCategory.UppercaseLetter != unc &&
UnicodeCategory.LowercaseLetter != unc &&
UnicodeCategory.TitlecaseLetter != unc &&
UnicodeCategory.ModifierLetter != unc &&
UnicodeCategory.OtherLetter != unc &&
UnicodeCategory.LetterNumber != unc &&
UnicodeCategory.NonSpacingMark != unc &&
UnicodeCategory.SpacingCombiningMark != unc &&
UnicodeCategory.DecimalDigitNumber != unc &&
UnicodeCategory.ConnectorPunctuation != unc
) {
ret = ret.Replace(ret[i], '_');
} // if
} // for
}
return ret;
}
示例8: CommandProxies
public CommandProxies(ITypeDiscoverer typeDiscoverer, ITypeImporter typeImporter, ICodeGenerator codeGenerator, WebConfiguration configuration)
{
_typeDiscoverer = typeDiscoverer;
_typeImporter = typeImporter;
_codeGenerator = codeGenerator;
_configuration = configuration;
}
示例9: ReservationController
public ReservationController(ITwilioMessageRepository repository, IMessageProvider<TwilioMessage> twilioMessageProvider,
IPersonRepository personRepository, ICodeGenerator codeGenerator)
{
_twilioRepository = repository;
_personRepository = personRepository;
_twilioMessageProvider = twilioMessageProvider;
_codeGenerator = codeGenerator;
}
示例10: Initialize
public virtual void Initialize()
{
DependenciesMock = new Mock<ICodeGeneratorDependencies>();
ArgumentsMock = new Mock<ICodeGeneratorGenerateArguments>();
CodeGenerator = new Logics.CodeGenerator(DependenciesMock.Object);
}
示例11: Phase2Parser
public Phase2Parser( TokenizerBase tokenStream,
ICodeGenerator gen )
: base(tokenStream)
{
this.gen = gen;
loops = new Stack();
withs = new Stack();
} // Phase2Parser constructor
示例12: EntityFrameworkMappingGenerator
public EntityFrameworkMappingGenerator(
ICodeGenerator codeGenerator,
IPluginsContainer<IConceptMapping> plugins,
ILogProvider logProvider)
{
_plugins = plugins;
_codeGenerator = codeGenerator;
_performanceLogger = logProvider.GetLogger("Performance");
}
示例13: TemplateParser
// overcome bug in ANTLR 3.2
public TemplateParser(ITokenStream input, RecognizerSharedState state, ICodeGenerator gen, TemplateName enclosingTemplateName)
: base(null, null)
{
this.input = input;
this.state = state;
if (gen != null)
this.gen = gen;
this._enclosingTemplateName = enclosingTemplateName;
}
示例14: CaptchaMiddleware
public CaptchaMiddleware(
RequestDelegate next,
ICodeGenerator codeGenerator,
IGraphicGenerator graphicGenerator)
{
_next = next;
_codeGenerator = codeGenerator;
_graphicGenerator = graphicGenerator;
}
示例15: QueryProxies
public QueryProxies(
ITypeDiscoverer typeDiscoverer,
ICodeGenerator codeGenerator,
WebConfiguration configuration)
{
_typeDiscoverer = typeDiscoverer;
_codeGenerator = codeGenerator;
_configuration = configuration;
}