当前位置: 首页>>代码示例>>C#>>正文


C# ITypeFactory类代码示例

本文整理汇总了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;
        }
开发者ID:mausch,项目名称:NHWorkbench,代码行数:27,代码来源:BootStrap.cs

示例2: PackagesUIService

        public PackagesUIService(IUIVisualizerService uiVisualizerService, ITypeFactory typeFactory)
        {
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => typeFactory);

            _uiVisualizerService = uiVisualizerService;
        }
开发者ID:strogo,项目名称:Orc.NuGetExplorer,代码行数:7,代码来源:PackagesUIService.cs

示例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("}");
        }
开发者ID:Corillian,项目名称:corefx,代码行数:33,代码来源:ILPrinter.cs

示例4: CatelWebApiDependencyResolver

        public CatelWebApiDependencyResolver(IServiceLocator serviceLocator)
        {
            Argument.IsNotNull(() => serviceLocator);

            _serviceLocator = serviceLocator;
            _typeFactory = serviceLocator.ResolveType<ITypeFactory>();
        }
开发者ID:sk8tz,项目名称:Orc.LicenseManager,代码行数:7,代码来源:CatelWebApiDependencyResolver.cs

示例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();
        }
开发者ID:sk8tz,项目名称:Orc.Controls,代码行数:25,代码来源:LogViewerViewModel.cs

示例6: AutoInflatingTypeFactory

 public AutoInflatingTypeFactory(ITypeFactory innerTypeFactory,
     IInflatableTranslator inflatableTranslator,
     Func<ITypeFactory, IXamlLoader> xamlLoaderFactory)
 {
     this.innerTypeFactory = innerTypeFactory;
     this.inflatableTranslator = inflatableTranslator;
     this.xamlLoaderFactory = xamlLoaderFactory;
 }
开发者ID:rdterner,项目名称:OmniXAML,代码行数:8,代码来源:AutoInflatingTypeFactory.cs

示例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;
 }
开发者ID:JaysonJG,项目名称:Catel,代码行数:16,代码来源:HandlerBase.cs

示例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);
        }
开发者ID:CarlSosaDev,项目名称:Avalonia,代码行数:8,代码来源:AvaloniaRuntimeTypeSource.cs

示例9: PerspexTypeRepository

 public PerspexTypeRepository(IXamlNamespaceRegistry xamlNamespaceRegistry,
     ITypeFactory typeFactory,
     ITypeFeatureProvider featureProvider,
     IPerspexPropertyBinder propertyBinder) : base(xamlNamespaceRegistry, typeFactory, featureProvider)
 {
     _typeFactory = typeFactory;
     _propertyBinder = propertyBinder;
 }
开发者ID:healtech,项目名称:Perspex,代码行数:8,代码来源:PerspexTypeRepository.cs

示例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);
        }
开发者ID:KvanTTT,项目名称:Perspex,代码行数:8,代码来源:PerspexRuntimeTypeSource.cs

示例11: AdorneredTooltipsManagerFactory

        public AdorneredTooltipsManagerFactory(IServiceLocator serviceLocator, ITypeFactory typeFactory)
        {
            Argument.IsNotNull(() => serviceLocator);
            Argument.IsNotNull(() => typeFactory);

            _serviceLocator = serviceLocator;
            _typeFactory = typeFactory;
        }
开发者ID:icygit,项目名称:Orchestra,代码行数:8,代码来源:AdorneredTooltipsManagerFactory.cs

示例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();
 }
开发者ID:danwalmsley,项目名称:OmniXAML,代码行数:8,代码来源:CleanWiringContextBuilder.cs

示例13: PackageOperationContextService

        public PackageOperationContextService(IPackageOperationNotificationService packageOperationNotificationService, ITypeFactory typeFactory)
        {
            Argument.IsNotNull(() => packageOperationNotificationService);
            Argument.IsNotNull(() => typeFactory);

            _packageOperationNotificationService = packageOperationNotificationService;
            _typeFactory = typeFactory;
        }
开发者ID:WildGums,项目名称:Orc.NuGetExplorer,代码行数:8,代码来源:PackageOperationContextService.cs

示例14: FlyoutService

        public FlyoutService(ITypeFactory typeFactory, ICommandManager commandManager)
        {
            Argument.IsNotNull(() => typeFactory);
            Argument.IsNotNull(() => commandManager);

            _typeFactory = typeFactory;
            _commandManager = commandManager;
        }
开发者ID:icygit,项目名称:Orchestra,代码行数:8,代码来源:FlyoutService.cs

示例15: PerspexXamlType

 public PerspexXamlType(Type type,
     IXamlTypeRepository typeRepository,
     ITypeFactory typeFactory,
     ITypeFeatureProvider featureProvider,
     IPerspexPropertyBinder propertyBinder)
     : base(type, typeRepository, typeFactory, featureProvider)
 {
     this.propertyBinder = propertyBinder;
 }
开发者ID:Scellow,项目名称:Perspex,代码行数:9,代码来源:PerspexXamlType.cs


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