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


C# IFactory类代码示例

本文整理汇总了C#中IFactory的典型用法代码示例。如果您正苦于以下问题:C# IFactory类的具体用法?C# IFactory怎么用?C# IFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IFactory类属于命名空间,在下文中一共展示了IFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Model

 public Model( ProgramInfoViewModel programInfoVM, 
               InstalledProgramViewModel installedProgramVM,
               IFactory<SemiautomaticSync.Model, SemiautomaticSync.IModelParameters> semiautoSyncModelFactory )
 {
     Initialize( programInfoVM, installedProgramVM, semiautoSyncModelFactory );
     RegisterPropertyChangedEvents();
 }
开发者ID:XElementSoftware,项目名称:CloudSyncHelper,代码行数:7,代码来源:Model.cs

示例2: AddFactory

 /// <summary>
 /// Adds a <see cref="IFactory"/> to the current <see cref="IFactoryStorage"/> object.
 /// </summary>
 /// <param name="serviceInfo">The <see cref="IServiceInfo"/> object that describes the target factory.</param>
 /// <param name="factory">The <see cref="IFactory"/> instance that will create the object instance.</param>
 public virtual void AddFactory(IServiceInfo serviceInfo, IFactory factory)
 {
     lock (_lock)
     {
         _entries[serviceInfo] = factory;
     }
 }
开发者ID:svgorbunov,项目名称:ScrollsModLoader,代码行数:12,代码来源:BaseFactoryStorage.cs

示例3: GeoFactory

 public GeoFactory(
     IFactory<ICoordinates> coordinatesUnityFactory, 
     IFactory<ILocation> locationUnityFactory)
 {
     _coordinatesUnityFactory = coordinatesUnityFactory;
     _locationUnityFactory = locationUnityFactory;
 }
开发者ID:SowaLabs,项目名称:Tweetinvi-obsolete,代码行数:7,代码来源:GeoFactory.cs

示例4: NeuralConnectionDefinition

        public NeuralConnectionDefinition(IFactory<NeuralConnection> connectionFactory, bool isRecurrent)
        {
            Contract.Requires(connectionFactory != null);

            ConnectionFactory = connectionFactory;
            IsRecurrent = isRecurrent;
        }
开发者ID:nagyistoce,项目名称:Neuroflow,代码行数:7,代码来源:NeuralConnectionDefinition.cs

示例5: Initialize

 private static void Initialize()
 {
     _messageFactory = TweetinviContainer.Resolve<IMessageFactory>();
     _messageController = TweetinviContainer.Resolve<IMessageController>();
     _messageGetLatestsReceivedRequestParametersFactory = TweetinviContainer.Resolve<IFactory<IMessageGetLatestsReceivedRequestParameters>>();
     _messageGetLatestsSentRequestParametersFactory = TweetinviContainer.Resolve<IFactory<IMessageGetLatestsSentRequestParameters>>();
 }
开发者ID:Murtaza-libs,项目名称:tweetinvi,代码行数:7,代码来源:Message.cs

示例6: FromIDictionary

        public static IPrimaryModel FromIDictionary(IDictionary source, IFactory factory)
        {
            if (source == null) return null;

            var itypeName = factory.Create<ITypeName>(source,null);
            if (itypeName != null)
            {
                var typeName = itypeName.TypeName;
                if (!IgnoreTypes.Contains(typeName))
                {
                    var model3D = factory.Create<Model3D>(typeName, null);
                    if (model3D != null)
                    {
                        var material = GetMaterial(source, factory);
                        if (material != null)
                        {
                            var geoModel = model3D as GeometryModel3D;
                            if (geoModel != null)
                            {
                                geoModel.Material = material;
                            }
                        }
                        var model3DGroup = new Model3DGroup { Transform = GetTransform(source, factory) };
                        model3DGroup.Children.Add(model3D);
                        return new PrimaryModel { Model3D = model3DGroup };
                    }
                }
            }
            return null;
        }
开发者ID:node-net,项目名称:Node.Net,代码行数:30,代码来源:IPrimaryModelHelper.cs

示例7: EntityService

 public EntityService(
     IFactory factory,
     stagemanagerEntities entities)
 {
     this.factory = factory;
     this.entities = entities;
 }
开发者ID:eihi,项目名称:StageBeheerder,代码行数:7,代码来源:EntityService.cs

示例8: AutoCreationController

 public AutoCreationController(
     IDispatcherExecute dispatcher,
     CreationViewModel viewModel,
     ITypesManager typesManager,
     SessionConfiguration sessionConfiguration,
     OptionsModel options,
     IFactory<SessionCreator> sessionCreatorFactory,
     IDispatcherExecute execute,
     CommonServices svc)
 {
     _dispatcher = dispatcher;
     _viewModel = viewModel;
     _typesManager = typesManager;
     _sessionConfiguration = sessionConfiguration;
     _options = options;
     _sessionCreatorFactory = sessionCreatorFactory;
     _execute = execute;
     _svc = svc;
     
     _viewModel.CommandCreateMutants = new SmartCommand(CommandOk,
        () => _viewModel.TypesTreeMutate.Assemblies != null && _viewModel.TypesTreeMutate.Assemblies.Count != 0
              && _viewModel.TypesTreeToTest.TestAssemblies != null && _viewModel.TypesTreeToTest.TestAssemblies.Count != 0
              && _viewModel.MutationsTree.MutationPackages.Count != 0)
            .UpdateOnChanged(_viewModel.TypesTreeMutate, _ => _.Assemblies)
            .UpdateOnChanged(_viewModel.TypesTreeToTest, _ => _.TestAssemblies)
            .UpdateOnChanged(_viewModel.MutationsTree, _ => _.MutationPackages);
 }
开发者ID:Refresh06,项目名称:visualmutator,代码行数:27,代码来源:AutoCreationController.cs

示例9: Create

 public object Create(Type targetType, object source,IFactory helper)
 {
     if (source != null)
     {
         if (source.GetType() == typeof(string))
         {
             var key = source.ToString();
             if (cache.ContainsKey(key)) return cache[key];
             if (Assembly != null)
             {
                 var manifestResourceName = GetManifestResourceName(key);
                 if(manifestResourceName != null)
                 {
                     var value = ReadFunction(Assembly.GetManifestResourceStream(manifestResourceName));
                     if(value != null)
                     {
                         cache.Add(key, value);
                         return value;
                     }
                 }
             }
         }
     }
     return null;
 }
开发者ID:node-net,项目名称:Node.Net,代码行数:25,代码来源:ResourceFactory.cs

示例10: Verify

		public void Verify(IFactory factory, string message, params object[] arguments)
		{
			factory.Verify(this.Structures.Count, Is.EqualTo(2), message, arguments);
			factory.Verify(this.Structures[0], message, arguments);
			factory.Verify(this.Structures[1], message, arguments);

            factory.Verify(this.Classes.Count, Is.EqualTo(2), message, arguments);
			factory.Verify(this.Classes[0] as ComplexClass, message, arguments);
			factory.Verify(this.Classes[1], message, arguments);

			factory.Verify(this.Objects.Count, Is.EqualTo(4), message, arguments);
			factory.Verify(this.Objects[0] as ComplexClass, message, arguments);
			factory.Verify(this.Objects[1] as Class, message, arguments);
			factory.Verify((bool)this.Objects[2], message, arguments);
			factory.Verify((DateTime)this.Objects[3], message, arguments);

			factory.Verify(this.Floats.Count, Is.EqualTo(10), message, arguments);
			for (int i = 0; i < 10; i++)
				factory.Verify(this.Floats[i], Is.EqualTo(i + 0.1337f), message, arguments);

			factory.Verify(this.Empty.Count, Is.EqualTo(0), message, arguments);

			factory.Verify(this.Single.Count, Is.EqualTo(1), message, arguments);
			factory.Verify(this.Single[0], Is.EqualTo(1337), message, arguments);

			factory.Verify(this.SingleObject.Count, Is.EqualTo(1), message, arguments);
			factory.Verify(this.SingleObject[0] as Class, message, arguments);
		}
开发者ID:imintsystems,项目名称:Kean,代码行数:28,代码来源:ListExisting.cs

示例11: Property

 public Property(DomPath domPath, bool isNonEmpty, IFactory factory)
 {
     HasHadNonEmptyValue |= isNonEmpty;
     _defaultPropertyDefinitionSet = new Lazy<PropertyDefinitionSet>(CreateDefaultPropertyDefinitionSet);
     _domPath = domPath;
     _factory = factory;
 }
开发者ID:sethkontny,项目名称:CSharpinator,代码行数:7,代码来源:Property.cs

示例12: SetupApplication

        public static IApplication SetupApplication(MockRepository repository, IFactory<IView> viewFactory, IFactory<ICommand> cmdFactory)
        {
            var app = new VIMApplication();
            var container = repository.StrictMock<IContainer>();
            var elementFactory = repository.StrictMock<IFactory<IBrowseElement>>();
            var list = new LinkedList<IBrowseElement>();

            var keyGen = new KeyCommandGenerator(cmdFactory);
            keyGen.InitializeKeysToCommands();
            container.Expect(a => a.Get<IKeyCommandGenerator>()).Return(keyGen);
            container.Expect(a => a.Get<IFactory<IBrowseElement>>()).Return(elementFactory);
            elementFactory.Expect(a => a.Create("Command Stack")).Return(new CreateBrowseElement{DisplayName = "Command Stack"});
            elementFactory.Expect(a => a.Create("Files")).Return(new CreateBrowseElement{DisplayName = "Files"});
            elementFactory.Expect(a => a.Create("Audio")).Return(new CreateBrowseElement{DisplayName = "Audio"});
            elementFactory.Expect(a => a.Create("Movies")).Return(new CreateBrowseElement{DisplayName = "Movies"});
            elementFactory.Expect(a => a.Create("Objects")).Return(new CreateBrowseElement{DisplayName = "Objects"});
            elementFactory.Expect(a => a.Create("Notes")).Return(new CreateBrowseElement{DisplayName = "Notes"});
            container.Expect(a => a.Get<ILinkedList<IBrowseElement>>()).Return(list);
            container.Expect(a => a.Get<IBrowser>(list)).Return(new LinkedListBrowser(app, list));
            container.Expect(a => a.Get<IFactory<IView>>()).Return(viewFactory);
            repository.ReplayAll();

            app.Initialize(container);

            return app;
        }
开发者ID:mcwatt77,项目名称:vimcontrols,代码行数:26,代码来源:Concepts.cs

示例13: DoubleArray2DFromIList

 public static double[,] DoubleArray2DFromIList(IList list, IFactory factory)
 {
     var dim0 = list.Count;
     var dim1 = 0;
     foreach(var item in list)
     {
         var sublist = item as IList;
         if(sublist != null)
         {
             if (dim1 < sublist.Count) dim1 = sublist.Count;
         }
     }
     double[,] result = new double[dim0, dim1];
     for(int i = 0; i < list.Count; ++i)
     {
         for(int j = 0; j < dim1; ++j)
         {
             var value = 0.0;
             var sublist = list[i] as IList;
             if(sublist != null)
             {
                 if (sublist.Count > j) value = Convert.ToDouble(sublist[j]);
             }
             result[i, j] = value;
         }
     }
     return result;
 }
开发者ID:node-net,项目名称:Node.Net,代码行数:28,代码来源:ArrayHelper.cs

示例14: Main

        // -------------------------------------------------------------------
        // Constructor
        // -------------------------------------------------------------------
        public Main(IFactory factory)
            : base(factory)
        {
            this.factory = factory;

            this.config = factory.Resolve<IConfig>();
        }
开发者ID:Craiel,项目名称:CarbonProjects,代码行数:10,代码来源:Main.cs

示例15: Load

 /// <summary>
 ///     Loads the CSV Extent out of the settings and stores the extent Uri
 /// </summary>
 /// <param name="extent">The uri being used for an extent</param>
 /// <param name="factory">Factory being used to create a new instance</param>
 /// <param name="path">Path being used to load the extent</param>
 /// <param name="settings">Settings to load the extent</param>
 /// <returns>The loaded extent</returns>
 public void Load(IUriExtent extent, IFactory factory, string path, CSVSettings settings)
 {
     using (var fileStream = new FileStream(path, FileMode.Open))
     {
         Load(extent, factory, fileStream, settings);
     }
 }
开发者ID:mbrenn,项目名称:datenmeister-new,代码行数:15,代码来源:CSVDataProvider.cs


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