本文整理汇总了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();
}
示例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;
}
}
示例3: GeoFactory
public GeoFactory(
IFactory<ICoordinates> coordinatesUnityFactory,
IFactory<ILocation> locationUnityFactory)
{
_coordinatesUnityFactory = coordinatesUnityFactory;
_locationUnityFactory = locationUnityFactory;
}
示例4: NeuralConnectionDefinition
public NeuralConnectionDefinition(IFactory<NeuralConnection> connectionFactory, bool isRecurrent)
{
Contract.Requires(connectionFactory != null);
ConnectionFactory = connectionFactory;
IsRecurrent = isRecurrent;
}
示例5: Initialize
private static void Initialize()
{
_messageFactory = TweetinviContainer.Resolve<IMessageFactory>();
_messageController = TweetinviContainer.Resolve<IMessageController>();
_messageGetLatestsReceivedRequestParametersFactory = TweetinviContainer.Resolve<IFactory<IMessageGetLatestsReceivedRequestParameters>>();
_messageGetLatestsSentRequestParametersFactory = TweetinviContainer.Resolve<IFactory<IMessageGetLatestsSentRequestParameters>>();
}
示例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;
}
示例7: EntityService
public EntityService(
IFactory factory,
stagemanagerEntities entities)
{
this.factory = factory;
this.entities = entities;
}
示例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);
}
示例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;
}
示例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);
}
示例11: Property
public Property(DomPath domPath, bool isNonEmpty, IFactory factory)
{
HasHadNonEmptyValue |= isNonEmpty;
_defaultPropertyDefinitionSet = new Lazy<PropertyDefinitionSet>(CreateDefaultPropertyDefinitionSet);
_domPath = domPath;
_factory = factory;
}
示例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;
}
示例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;
}
示例14: Main
// -------------------------------------------------------------------
// Constructor
// -------------------------------------------------------------------
public Main(IFactory factory)
: base(factory)
{
this.factory = factory;
this.config = factory.Resolve<IConfig>();
}
示例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);
}
}