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


C# IFactory.Create方法代码示例

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


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

示例1: 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

示例2: Initialize

		public void Initialize(IFactory factory)
		{
			this.Boolean = factory.Create<bool>();
			this.Integer = factory.Create<int>();
			this.Float = factory.Create<float>();
			this.Enumerator = factory.Create<Enumerator>();
			this.String = factory.Create<string>();
		}
开发者ID:imintsystems,项目名称:Kean,代码行数:8,代码来源:Structure.cs

示例3: Initialize

		public virtual void Initialize(IFactory factory)
		{
			this.Boolean = factory.Create<bool>();
			this.Integer = factory.Create<int>();
			this.Float = factory.Create<float>();
			this.Enumerator = factory.Create<Enumerator>();
			this.Structure = factory.Create<Structure>();
		}
开发者ID:imintsystems,项目名称:Kean,代码行数:8,代码来源:Nullable.cs

示例4: Initialize

		public  void Initialize(IFactory factory)
		{
			this.Structures.Add(factory.Create<Structure>()).Add(factory.Create<Structure>());
			this.Classes.Add(factory.Create<ComplexClass>()).Add(factory.Create<Class>());
			this.Objects.Add(factory.Create<ComplexClass>()).Add(factory.Create<Class>()).Add(factory.Create<bool>()).Add(factory.Create<DateTime>());
			this.Floats.Add(0.1337f).Add(1.1337f).Add(2.1337f).Add(3.1337f).Add(4.1337f).Add(5.1337f).Add(6.1337f).Add(7.1337f).Add(8.1337f).Add(9.1337f);
			this.Single.Add(1337);
			this.SingleObject.Add(factory.Create<Class>());
		}
开发者ID:imintsystems,项目名称:Kean,代码行数:9,代码来源:ListExisting.cs

示例5: Initialize

		public virtual void Initialize(IFactory factory)
		{
			this.Structures = new Structure[] { factory.Create<Structure>(), factory.Create<Structure>() };
			this.Classes = new Class[] { factory.Create<ComplexClass>(), factory.Create<Class>() };
			this.Objects = new object[] { factory.Create<ComplexClass>(), factory.Create<Class>(), factory.Create<bool>(), factory.Create<DateTime>() };
			this.Numbers = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
			this.Empty = new int[0];
		}
开发者ID:imintsystems,项目名称:Kean,代码行数:8,代码来源:Array.cs

示例6: Initialize

		public  void Initialize(IFactory factory)
		{
			this.Structures = new Collection.List<Structure>(factory.Create<Structure>(), factory.Create<Structure>());
			this.Classes = new Collection.List<Class>(factory.Create<ComplexClass>(), factory.Create<Class>());
			this.Objects = new Collection.List<object>(factory.Create<ComplexClass>(), factory.Create<Class>(), factory.Create<bool>(), factory.Create<DateTime>());
			this.Numbers = new Collection.List<int>(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
			this.Floats.Add(0.1337f).Add(1.1337f).Add(2.1337f).Add(3.1337f).Add(4.1337f).Add(5.1337f).Add(6.1337f).Add(7.1337f).Add(8.1337f).Add(9.1337f);
			this.Empty = new Collection.List<int>();
			this.Single = new Collection.List<int>();
			this.Single.Add(1337);
			this.SingleObject = new Collection.List<object>(factory.Create<Class>());
		}
开发者ID:imintsystems,项目名称:Kean,代码行数:12,代码来源:List.cs

示例7: Initialize

		public  void Initialize(IFactory factory)
		{
			this.Structures = new Collection.Dictionary<int, Structure>(Kean.KeyValue.Create(0, factory.Create<Structure>()), Kean.KeyValue.Create(1, factory.Create<Structure>()));
			this.Classes = new Collection.Dictionary<int, Class>(Kean.KeyValue.Create(0, (Class)factory.Create<ComplexClass>()), Kean.KeyValue.Create(1, factory.Create<Class>()));
			this.Objects = new Collection.Dictionary<string, object>(Kean.KeyValue.Create("complex", (object)factory.Create<ComplexClass>()), Kean.KeyValue.Create("class", (object)factory.Create<Class>()), Kean.KeyValue.Create("boolean", (object)factory.Create<bool>()), Kean.KeyValue.Create("time", (object)factory.Create<DateTime>()));
			this.Numbers = new Collection.Dictionary<string, int>();
			for (int i = 0; i < 10; i++)
				this.Numbers[this.keys[i]] = i;
			this.Empty = new Collection.Dictionary<string, int>();
		}
开发者ID:imintsystems,项目名称:Kean,代码行数:10,代码来源:Dictionary.cs

示例8: GetTransform

 private static Transform3D GetTransform(IDictionary source, IFactory factory)
 {
     IScale iscale = factory.Create<IScale>(source,null);
     if (iscale != null)
     {
         return new ScaleTransform3D { ScaleX = iscale.Scale.X, ScaleY = iscale.Scale.Y, ScaleZ = iscale.Scale.Z };
     }
     return null;
 }
开发者ID:node-net,项目名称:Node.Net,代码行数:9,代码来源:IPrimaryModelHelper.cs

示例9: GetMaterial

        private static Material GetMaterial(IDictionary source, IFactory factory)
        {

            if (factory != null)
            {
                return factory.Create<Material>(source,null);
            }
            return null;
        }
开发者ID:node-net,项目名称:Node.Net,代码行数:9,代码来源:IPrimaryModelHelper.cs

示例10: FromString

 public static Material FromString(string source, IFactory factory)
 {
     if (factory != null)
     {
         var icolor = factory.Create<IColor>(source,null);
         if (icolor != null) return new DiffuseMaterial { Brush = new SolidColorBrush(icolor.Color) };
     }
     return null;
 }
开发者ID:node-net,项目名称:Node.Net,代码行数:9,代码来源:MaterialHelper.cs

示例11: WidgetContainerViewModel

        public WidgetContainerViewModel(IWidgetContainer widgetContainer, IFactory<IWidget, IWidgetViewModel> factory)
        {
            this.WidgetViewModels = new ObservableCollection<IWidgetViewModel>();
            foreach (var w in widgetContainer.Widgets)
                this.WidgetViewModels.Add(factory.Create(w));

            //Write to console to see widgets
            foreach (var wvm in this.WidgetViewModels)
                Console.WriteLine(wvm);
        }
开发者ID:jigamiller,项目名称:unitymappingfactory,代码行数:10,代码来源:WidgetContainerViewModel.cs

示例12: GetPrimaryModel3D

 private static Model3D GetPrimaryModel3D(IDictionary source, IFactory factory)
 {
     IPrimaryModel primaryModel = null;
     if (factory != null)
     {
         primaryModel = factory.Create<IPrimaryModel>(source,null);
     }
     if (primaryModel != null) return primaryModel.Model3D;
     return null;
 }
开发者ID:node-net,项目名称:Node.Net,代码行数:10,代码来源:Model3DHelper.cs

示例13: FromIDictionary

 public static Visual3D FromIDictionary(IDictionary source, IFactory factory)
 {
     if (source == null) return null;
     var model3D = factory.Create<Model3D>(source, null);
     if (model3D != null)
     {
         return new ModelVisual3D { Content = model3D };
     }
     return null;
 }
开发者ID:node-net,项目名称:Node.Net,代码行数:10,代码来源:Visual3DFactory.cs

示例14: GetModel3D

        private static Model3D GetModel3D(string typeName, IFactory factory)
        {

            if (factory != null)
            {
                return factory.Create<Model3D>(typeName,null);
            }

            return null;
        }
开发者ID:node-net,项目名称:Node.Net,代码行数:10,代码来源:IPrimaryModelHelper.cs

示例15: ServiceStub

 public ServiceStub(string queueName, IFactory<IMessageStuffer> stufferFactory, IFactory<IMessagePicker> messagePickerFactory, IIExtensionBoundToStubLifecycleFactory extensionsFactory)
 {
     _stufferFactory = stufferFactory;
     _messagePickerFactory = messagePickerFactory;
     _extensionsFactory = extensionsFactory;
     Queue = queueName;
     MessageStuffer = _stufferFactory.Create();
     MessagePicker = _messagePickerFactory.Create();
     Sequences = new List<IMessageSequence>();
     Extensions = _extensionsFactory.Resolve();
 }
开发者ID:ToshB,项目名称:nservicestub,代码行数:11,代码来源:ServiceStub.cs


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