BaseFactory

Namespace: Dynamitey
We found 10 examples in language CSharp for this search. You will see 24 fragments of code.

        public IStreamCalculator<IBlockResult> CreateCalculator()
        {
            return baseFactory.CreateCalculator();
        }


        public object Create(Type type)
        {
			if (typeof(Dictionary<object, object>).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))
            {
                return Activator.CreateInstance(type, new IgnoreCaseComparer());
            }

            return BaseFactory.Create(type);
        }


        /// <inheritdoc/>
        protected override ValueTask DisposeAsyncCore(CancellationToken cancellationToken)
            => BaseFactory.DisposeAsync(cancellationToken);


	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int GetDragonBonesData(IntPtr L)
	{
		try
		{
			ToLua.CheckArgsCount(L, 2);
			DragonBones.BaseFactory obj = (DragonBones.BaseFactory)ToLua.CheckObject<DragonBones.BaseFactory>(L, 1);
			string arg0 = ToLua.CheckString(L, 2);
			DragonBones.DragonBonesData o = obj.GetDragonBonesData(arg0);
			ToLua.PushObject(L, o);
			return 1;
		}
		catch (Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int GetAllDragonBonesData(IntPtr L)
	{
		try
		{
			ToLua.CheckArgsCount(L, 1);
			DragonBones.BaseFactory obj = (DragonBones.BaseFactory)ToLua.CheckObject<DragonBones.BaseFactory>(L, 1);
			System.Collections.Generic.Dictionary<string,DragonBones.DragonBonesData> o = obj.GetAllDragonBonesData();
			ToLua.PushSealed(L, o);
			return 1;
		}
		catch (Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int get_autoSearch(IntPtr L)
	{
		object o = null;

		try
		{
			o = ToLua.ToObject(L, 1);
			DragonBones.BaseFactory obj = (DragonBones.BaseFactory)o;
			bool ret = obj.autoSearch;
			LuaDLL.lua_pushboolean(L, ret);
			return 1;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e, o, "attempt to index autoSearch on a nil value");
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int get__dragonBones(IntPtr L)
	{
		object o = null;

		try
		{
			o = ToLua.ToObject(L, 1);
			DragonBones.BaseFactory obj = (DragonBones.BaseFactory)o;
			DragonBones.DragonBones ret = obj._dragonBones;
			ToLua.PushObject(L, ret);
			return 1;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e, o, "attempt to index _dragonBones on a nil value");
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int get_clock(IntPtr L)
	{
		object o = null;

		try
		{
			o = ToLua.ToObject(L, 1);
			DragonBones.BaseFactory obj = (DragonBones.BaseFactory)o;
			DragonBones.WorldClock ret = obj.clock;
			ToLua.PushObject(L, ret);
			return 1;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e, o, "attempt to index clock on a nil value");
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int set_autoSearch(IntPtr L)
	{
		object o = null;

		try
		{
			o = ToLua.ToObject(L, 1);
			DragonBones.BaseFactory obj = (DragonBones.BaseFactory)o;
			bool arg0 = LuaDLL.luaL_checkboolean(L, 2);
			obj.autoSearch = arg0;
			return 0;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e, o, "attempt to index autoSearch on a nil value");
		}
	}


        [Test]
        public void AddFactoryThrowsNoException()
        {
            var cache = new LoadingStepFactoryCache();

            Assert.DoesNotThrow(() =>
            {
                cache.Add(new BaseFactory());
            });
        }

        [Test]
        public void AddSameFactorySecondTimeThrowsException()
        {
            var cache = new LoadingStepFactoryCache();
            cache.Add(new BaseFactory());

            Assert.Throws<ArgumentException>(() =>
            {
                cache.Add(new BaseFactory());
            });
        }

        [Test]
        public void AddBaseFactoryThenAddDerivedFactoryThrowsNoException()
        {
            var cache = new LoadingStepFactoryCache();

            Assert.DoesNotThrow(() =>
            {
                cache.Add(new BaseFactory());
                cache.Add(new DerivedFactory());
            });
        }

        [Test]
        public void AddDerivedFactoryThenAddBaseFactoryThrowsNoException()
        {
            var cache = new LoadingStepFactoryCache();

            Assert.DoesNotThrow(() =>
            {
                cache.Add(new DerivedFactory());
                cache.Add(new BaseFactory());
            });
        }

        [Test]
        public void ContainsNotCachedFactoryReturnsFalse()
        {
            var cache = new LoadingStepFactoryCache();
            var factory = new BaseFactory();
            var result = cache.Contains(factory);

            Assert.IsFalse(result);
        }

        [Test]
        public void ContainsCachedFactoryReturnsTrue()
        {
            var cache = new LoadingStepFactoryCache();
            cache.Add(new BaseFactory());
            var result = cache.Contains(new BaseFactory());

            Assert.IsTrue(result);
        }

    ICommunicationBaseFactory baseFactory = new ProductPrototypeONE();
    baseFactory.InitializeBluetoothCommunication();
    baseFactory.InitializeWiFiCommnucation();
    baseFactory = new ProductPrototypeTWO(BluetoothType.BLE_TYPE, WiFiType.HIGH_BAND);
    baseFactory.InitializeBluetoothCommunication();
    baseFactory.InitializeWiFiCommnucation();


    public IGetsNewTicketModel GetNewTicketModelFactory()
    {
      IGetsNewTicketModel output = baseFactory();

      foreach(var decoratorFactory in decoratorFactories)
      {
        output = decoratorFactory(output);
      }

      return output;
    }

		public override DbConnectionStringBuilder CreateConnectionStringBuilder()
		{
			return BaseFactory.CreateConnectionStringBuilder();
		}
		public override DbDataSourceEnumerator CreateDataSourceEnumerator()
		{
			return BaseFactory.CreateDataSourceEnumerator();
		}
		public override DbDataAdapter CreateDataAdapter()
		{
			return BaseFactory.CreateDataAdapter();
		}
		public override DbParameter CreateParameter()
		{
			return BaseFactory.CreateParameter();
		}


        public void BindData(object obj)
        {
            schedulerStorage.BeginUpdate();
            vUsersInfoBindingSource.DataSource = baseFactory.GetModelList<VUsersInfo>().FindAll(o =>
                o.已删除 == false && o.部门 == "注塑机");
            GetPSDataSource();
            schedulerStorage.RefreshData();
            schedulerStorage.EndUpdate();
        }

        private void schedulerStorage_AppointmentsChanged(object sender, PersistentObjectsEventArgs e)
        {
            baseFactory.ModifyByList<Appointments>(GetAppointmentsList(e.Objects));
            //刷新数据
            baseFactory.DataPageRefresh<Appointments>();
            baseFactory.DataPageRefresh<VAppointments>();
        }


    public IGetsEditTicketModel GetEditTicketModelFactory()
    {
      IGetsEditTicketModel output = baseFactory();

      foreach(var decoratorFactory in decoratorFactories)
      {
        output = decoratorFactory(output);
      }

      return output;
    }

Dynamitey.DynamicObjects.BaseFactory : IDynamicMetaObjectProvider, IEquivalentType

Constructors :

public BaseFactory()

Methods :

public Boolean TryGetMember(GetMemberBinder binder = , Object& result = )
public Boolean TryInvokeMember(InvokeMemberBinder binder = , Object[] args = , Object& result = )
public Boolean TryTypeForName(String binderName = , Type& type = )
public Boolean TrySetMember(SetMemberBinder binder = , Object value = )
public Boolean TryDeleteMember(DeleteMemberBinder binder = )
public Boolean TryConvert(ConvertBinder binder = , Object& result = )
public Boolean TryCreateInstance(CreateInstanceBinder binder = , Object[] args = , Object& result = )
public Boolean TryInvoke(InvokeBinder binder = , Object[] args = , Object& result = )
public Boolean TryBinaryOperation(BinaryOperationBinder binder = , Object arg = , Object& result = )
public Boolean TryUnaryOperation(UnaryOperationBinder binder = , Object& result = )
public Boolean TryGetIndex(GetIndexBinder binder = , Object[] indexes = , Object& result = )
public Boolean TrySetIndex(SetIndexBinder binder = , Object[] indexes = , Object value = )
public Boolean TryDeleteIndex(DeleteIndexBinder binder = , Object[] indexes = )
public IEnumerable<String> GetDynamicMemberNames()
public DynamicMetaObject GetMetaObject(Expression parameter = )
public Type GetType()
public String ToString()
public Boolean Equals(Object obj = )
public Int32 GetHashCode()