本文整理汇总了C#中ITypeFactory.Get方法的典型用法代码示例。如果您正苦于以下问题:C# ITypeFactory.Get方法的具体用法?C# ITypeFactory.Get怎么用?C# ITypeFactory.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITypeFactory
的用法示例。
在下文中一共展示了ITypeFactory.Get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Boot
public static ITypeFactory Boot(string loggerName,Assembly asm)
{
XmlConfigurator.Configure();
container = new UnityContainer();
RegisterKnownTypes(asm);
RegisterKnownTypes(typeof(ITypeFactory).Assembly);
container.RegisterInstance<ITypeFactory>(new TypeFactory(container));
container.RegisterInstance<ILog>(LogManager.GetLogger(loggerName));
container.RegisterInstance<ICommandRouter>(new CommandRouterImpl());
factory = container.Resolve<ITypeFactory>();
factory.Get<ILog>().Info(".=.=.=. " + Assembly.GetExecutingAssembly().GetName().Name + " =.=.=.=");
factory.Get<ILog>().Info("Version:" + Assembly.GetExecutingAssembly().GetName().Version.ToString());
string dataPath = ApplicationEnvironment.Instance.DataPath;
if (!Directory.Exists(dataPath))
{
factory.Get<ILog>().Error("L'applicazione non riesce a creare il percorso dati:" + dataPath);
}
factory.Get<ILog>().Debug("Data path applicazione:"+dataPath);
container.AddExtension(new WireImportExports());
return factory;
}
示例2: Main
static void Main()
{
XmlConfigurator.Configure();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Environment.SetEnvironmentVariable(NHIBERNATE_WORKBENCH_PATH, typeof(Program).Assembly.Location, EnvironmentVariableTarget.User);
factory = BootStrap.Boot(typeof(Program).Assembly.GetName().Name
, typeof(Program).Assembly
);
IPresenter main = factory.Get<MainPresenter>();
AppDomain.CurrentDomain.AssemblyLoad += new AssemblyLoadEventHandler(CurrentDomain_AssemblyLoad);
main.Startup();
}