本文整理汇总了C#中ITypeFactory类的典型用法代码示例。如果您正苦于以下问题:C# ITypeFactory类的具体用法?C# ITypeFactory怎么用?C# ITypeFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITypeFactory类属于命名空间,在下文中一共展示了ITypeFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: PackagesUIService
public PackagesUIService(IUIVisualizerService uiVisualizerService, ITypeFactory typeFactory)
{
Argument.IsNotNull(() => uiVisualizerService);
Argument.IsNotNull(() => typeFactory);
_uiVisualizerService = uiVisualizerService;
}
示例3: AppendIL
private static void AppendIL(MethodInfo method, StringWriter sw, ITypeFactory typeFactory)
{
var reader = ILReaderFactory.Create(method);
var exceptions = reader.ILProvider.GetExceptionInfos();
var writer = new RichILStringToTextWriter(sw, exceptions);
sw.WriteLine(".method " + method.ToIL());
sw.WriteLine("{");
sw.WriteLine(" .maxstack " + reader.ILProvider.MaxStackSize);
var sig = reader.ILProvider.GetLocalSignature();
var lsp = new LocalsSignatureParser(reader.Resolver, typeFactory);
var locals = default(Type[]);
if (lsp.Parse(sig, out locals) && locals.Length > 0)
{
sw.WriteLine(" .locals init (");
for (var i = 0; i < locals.Length; i++)
{
sw.WriteLine($" [{i}] {locals[i].ToIL()}{(i != locals.Length - 1 ? "," : "")}");
}
sw.WriteLine(" )");
}
sw.WriteLine();
writer.Indent();
reader.Accept(new ReadableILStringVisitor(writer));
writer.Dedent();
sw.WriteLine("}");
}
示例4: CatelWebApiDependencyResolver
public CatelWebApiDependencyResolver(IServiceLocator serviceLocator)
{
Argument.IsNotNull(() => serviceLocator);
_serviceLocator = serviceLocator;
_typeFactory = serviceLocator.ResolveType<ITypeFactory>();
}
示例5: LogViewerViewModel
public LogViewerViewModel(ITypeFactory typeFactory, IDispatcherService dispatcherService, LogViewerLogListener logViewerLogListener)
{
Argument.IsNotNull(() => typeFactory);
Argument.IsNotNull(() => dispatcherService);
Argument.IsNotNull(() => logViewerLogListener);
_typeFactory = typeFactory;
_dispatcherService = dispatcherService;
_logViewerLogListener = logViewerLogListener;
LogListenerType = typeof(LogViewerLogListener);
ShowDebug = true;
ShowInfo = true;
ShowWarning = true;
ShowError = true;
var typeNames = new FastObservableCollection<string>
{
defaultComboBoxItem
};
TypeNames = typeNames;
ResetEntriesCount();
}
示例6: AutoInflatingTypeFactory
public AutoInflatingTypeFactory(ITypeFactory innerTypeFactory,
IInflatableTranslator inflatableTranslator,
Func<ITypeFactory, IXamlLoader> xamlLoaderFactory)
{
this.innerTypeFactory = innerTypeFactory;
this.inflatableTranslator = inflatableTranslator;
this.xamlLoaderFactory = xamlLoaderFactory;
}
示例7: HandlerBase
/// <summary>
/// Initializes a new instance of the <see cref="HandlerBase" /> class.
/// </summary>
/// <param name="serviceType">Type of the service.</param>
/// <param name="tag">The tag.</param>
/// <param name="serviceLocator">The service locator. If <c>null</c>, <see cref="ServiceLocator.Default" /> will be used.</param>
/// <param name="typeFactory">The type factory. If <c>null</c>, <see cref="Catel.IoC.TypeFactory.Default" /> will be used.</param>
/// <param name="targetInstanceToUse">The target instance you want use in proxy instanciation.</param>
public HandlerBase(Type serviceType, object tag = null, IServiceLocator serviceLocator = null, object targetInstanceToUse = null, ITypeFactory typeFactory = null)
{
ServiceType = serviceType;
Tag = tag;
TypeFactory = typeFactory ?? IoC.TypeFactory.Default;
Container = serviceLocator ?? ServiceLocator.Default;
TargetInstanceToUse = targetInstanceToUse;
}
示例8: AvaloniaRuntimeTypeSource
public AvaloniaRuntimeTypeSource(ITypeFactory typeFactory)
{
var namespaceRegistry = new AvaloniaNamespaceRegistry();
var featureProvider = new AvaloniaTypeFeatureProvider();
var typeRepository = new AvaloniaTypeRepository(namespaceRegistry, typeFactory, featureProvider);
inner = new RuntimeTypeSource(typeRepository, namespaceRegistry);
}
示例9: PerspexTypeRepository
public PerspexTypeRepository(IXamlNamespaceRegistry xamlNamespaceRegistry,
ITypeFactory typeFactory,
ITypeFeatureProvider featureProvider,
IPerspexPropertyBinder propertyBinder) : base(xamlNamespaceRegistry, typeFactory, featureProvider)
{
_typeFactory = typeFactory;
_propertyBinder = propertyBinder;
}
示例10: PerspexRuntimeTypeSource
public PerspexRuntimeTypeSource(ITypeFactory typeFactory)
{
var namespaceRegistry = new PerspexNamespaceRegistry();
var featureProvider = new PerspexTypeFeatureProvider();
var typeRepository = new PerspexTypeRepository(namespaceRegistry, typeFactory, featureProvider);
inner = new RuntimeTypeSource(typeRepository, namespaceRegistry);
}
示例11: AdorneredTooltipsManagerFactory
public AdorneredTooltipsManagerFactory(IServiceLocator serviceLocator, ITypeFactory typeFactory)
{
Argument.IsNotNull(() => serviceLocator);
Argument.IsNotNull(() => typeFactory);
_serviceLocator = serviceLocator;
_typeFactory = typeFactory;
}
示例12: CleanWiringContextBuilder
public CleanWiringContextBuilder(ITypeFactory factory)
{
var xamlNamespaceRegistry = CreateXamlNamespaceRegistry();
var typeFactory = factory;
TypeContext = new TypeContext(new XamlTypeRepository(xamlNamespaceRegistry, typeFactory), xamlNamespaceRegistry, typeFactory);
ContentPropertyProvider = new ContentPropertyProvider();
TypeConverterProvider = new TypeConverterProvider();
}
示例13: PackageOperationContextService
public PackageOperationContextService(IPackageOperationNotificationService packageOperationNotificationService, ITypeFactory typeFactory)
{
Argument.IsNotNull(() => packageOperationNotificationService);
Argument.IsNotNull(() => typeFactory);
_packageOperationNotificationService = packageOperationNotificationService;
_typeFactory = typeFactory;
}
示例14: FlyoutService
public FlyoutService(ITypeFactory typeFactory, ICommandManager commandManager)
{
Argument.IsNotNull(() => typeFactory);
Argument.IsNotNull(() => commandManager);
_typeFactory = typeFactory;
_commandManager = commandManager;
}
示例15: PerspexXamlType
public PerspexXamlType(Type type,
IXamlTypeRepository typeRepository,
ITypeFactory typeFactory,
ITypeFeatureProvider featureProvider,
IPerspexPropertyBinder propertyBinder)
: base(type, typeRepository, typeFactory, featureProvider)
{
this.propertyBinder = propertyBinder;
}