Update Project
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3fd0e848e31df144fbbeab59a2c137e2
|
||||
folderAsset: yes
|
||||
timeCreated: 1528637818
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryArgumentsToChoiceBinder<TContract> : FactoryToChoiceBinder<TContract>
|
||||
{
|
||||
public FactoryArgumentsToChoiceBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
// We use generics instead of params object[] so that we preserve type info
|
||||
// So that you can for example pass in a variable that is null and the type info will
|
||||
// still be used to map null on to the correct field
|
||||
public FactoryToChoiceBinder<TContract> WithFactoryArguments<T>(T param)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TContract> WithFactoryArguments<TParam1, TParam2>(TParam1 param1, TParam2 param2)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TContract> WithFactoryArguments<TParam1, TParam2, TParam3>(
|
||||
TParam1 param1, TParam2 param2, TParam3 param3)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TContract> WithFactoryArguments<TParam1, TParam2, TParam3, TParam4>(
|
||||
TParam1 param1, TParam2 param2, TParam3 param3, TParam4 param4)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TContract> WithFactoryArguments<TParam1, TParam2, TParam3, TParam4, TParam5>(
|
||||
TParam1 param1, TParam2 param2, TParam3 param3, TParam4 param4, TParam5 param5)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4, param5);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TContract> WithFactoryArguments<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6>(
|
||||
TParam1 param1, TParam2 param2, TParam3 param3, TParam4 param4, TParam5 param5, TParam6 param6)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4, param5, param6);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TContract> WithFactoryArguments(object[] args)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgList(args);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TContract> WithFactoryArgumentsExplicit(IEnumerable<TypeValuePair> extraArgs)
|
||||
{
|
||||
FactoryBindInfo.Arguments = extraArgs.ToList();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ca3197650e9628a45b99e79b8dea27d9
|
||||
timeCreated: 1528637818
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryArgumentsToChoiceBinder<TParam1, TContract> : FactoryToChoiceBinder<TParam1, TContract>
|
||||
{
|
||||
public FactoryArgumentsToChoiceBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
// We use generics instead of params object[] so that we preserve type info
|
||||
// So that you can for example pass in a variable that is null and the type info will
|
||||
// still be used to map null on to the correct field
|
||||
public FactoryToChoiceBinder<TParam1, TContract> WithFactoryArguments<T>(T param)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2>(TFactoryParam1 param1, TFactoryParam2 param2)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4, TFactoryParam5>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4, TFactoryParam5 param5)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4, param5);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4, TFactoryParam5, TFactoryParam6>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4, TFactoryParam5 param5, TFactoryParam6 param6)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4, param5, param6);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TContract> WithFactoryArguments(object[] args)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgList(args);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TContract> WithFactoryArgumentsExplicit(IEnumerable<TypeValuePair> extraArgs)
|
||||
{
|
||||
FactoryBindInfo.Arguments = extraArgs.ToList();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a37e124df695f644e87579f08ea443f7
|
||||
timeCreated: 1528637818
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryArgumentsToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract> : FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract>
|
||||
{
|
||||
public FactoryArgumentsToChoiceBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
// We use generics instead of params object[] so that we preserve type info
|
||||
// So that you can for example pass in a variable that is null and the type info will
|
||||
// still be used to map null on to the correct field
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract> WithFactoryArguments<T>(T param)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2>(TFactoryParam1 param1, TFactoryParam2 param2)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4, TFactoryParam5>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4, TFactoryParam5 param5)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4, param5);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4, TFactoryParam5, TFactoryParam6>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4, TFactoryParam5 param5, TFactoryParam6 param6)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4, param5, param6);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract> WithFactoryArguments(object[] args)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgList(args);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract> WithFactoryArgumentsExplicit(IEnumerable<TypeValuePair> extraArgs)
|
||||
{
|
||||
FactoryBindInfo.Arguments = extraArgs.ToList();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 614bb4e31afa5154487c94e128e9461a
|
||||
timeCreated: 1528637818
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryArgumentsToChoiceBinder<TParam1, TParam2, TContract> : FactoryToChoiceBinder<TParam1, TParam2, TContract>
|
||||
{
|
||||
public FactoryArgumentsToChoiceBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
// We use generics instead of params object[] so that we preserve type info
|
||||
// So that you can for example pass in a variable that is null and the type info will
|
||||
// still be used to map null on to the correct field
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TContract> WithFactoryArguments<T>(T param)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2>(TFactoryParam1 param1, TFactoryParam2 param2)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4, TFactoryParam5>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4, TFactoryParam5 param5)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4, param5);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4, TFactoryParam5, TFactoryParam6>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4, TFactoryParam5 param5, TFactoryParam6 param6)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4, param5, param6);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TContract> WithFactoryArguments(object[] args)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgList(args);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TContract> WithFactoryArgumentsExplicit(IEnumerable<TypeValuePair> extraArgs)
|
||||
{
|
||||
FactoryBindInfo.Arguments = extraArgs.ToList();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b450191ad6422c4f841a99cdf3d108a
|
||||
timeCreated: 1528637818
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryArgumentsToChoiceBinder<TParam1, TParam2, TParam3, TContract> : FactoryToChoiceBinder<TParam1, TParam2, TParam3, TContract>
|
||||
{
|
||||
public FactoryArgumentsToChoiceBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
// We use generics instead of params object[] so that we preserve type info
|
||||
// So that you can for example pass in a variable that is null and the type info will
|
||||
// still be used to map null on to the correct field
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TContract> WithFactoryArguments<T>(T param)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2>(TFactoryParam1 param1, TFactoryParam2 param2)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4, TFactoryParam5>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4, TFactoryParam5 param5)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4, param5);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4, TFactoryParam5, TFactoryParam6>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4, TFactoryParam5 param5, TFactoryParam6 param6)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4, param5, param6);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TContract> WithFactoryArguments(object[] args)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgList(args);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TContract> WithFactoryArgumentsExplicit(IEnumerable<TypeValuePair> extraArgs)
|
||||
{
|
||||
FactoryBindInfo.Arguments = extraArgs.ToList();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 667d9c959f8ba004f86c8202d637f9ce
|
||||
timeCreated: 1528637818
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryArgumentsToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TContract> : FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TContract>
|
||||
{
|
||||
public FactoryArgumentsToChoiceBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
// We use generics instead of params object[] so that we preserve type info
|
||||
// So that you can for example pass in a variable that is null and the type info will
|
||||
// still be used to map null on to the correct field
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TContract> WithFactoryArguments<T>(T param)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2>(TFactoryParam1 param1, TFactoryParam2 param2)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4, TFactoryParam5>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4, TFactoryParam5 param5)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4, param5);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4, TFactoryParam5, TFactoryParam6>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4, TFactoryParam5 param5, TFactoryParam6 param6)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4, param5, param6);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TContract> WithFactoryArguments(object[] args)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgList(args);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TContract> WithFactoryArgumentsExplicit(IEnumerable<TypeValuePair> extraArgs)
|
||||
{
|
||||
FactoryBindInfo.Arguments = extraArgs.ToList();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce44f168dd48e1442b43a43c925abc47
|
||||
timeCreated: 1528637818
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryArgumentsToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract> : FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract>
|
||||
{
|
||||
public FactoryArgumentsToChoiceBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
// We use generics instead of params object[] so that we preserve type info
|
||||
// So that you can for example pass in a variable that is null and the type info will
|
||||
// still be used to map null on to the correct field
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract> WithFactoryArguments<T>(T param)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2>(TFactoryParam1 param1, TFactoryParam2 param2)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4, TFactoryParam5>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4, TFactoryParam5 param5)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4, param5);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4, TFactoryParam5, TFactoryParam6>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4, TFactoryParam5 param5, TFactoryParam6 param6)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4, param5, param6);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract> WithFactoryArguments(object[] args)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgList(args);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract> WithFactoryArgumentsExplicit(IEnumerable<TypeValuePair> extraArgs)
|
||||
{
|
||||
FactoryBindInfo.Arguments = extraArgs.ToList();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f3c4d5776729d2d4abae523dd6dce595
|
||||
timeCreated: 1528637818
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryArgumentsToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> : FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>
|
||||
{
|
||||
public FactoryArgumentsToChoiceBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
// We use generics instead of params object[] so that we preserve type info
|
||||
// So that you can for example pass in a variable that is null and the type info will
|
||||
// still be used to map null on to the correct field
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> WithFactoryArguments<T>(T param)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2>(TFactoryParam1 param1, TFactoryParam2 param2)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4, TFactoryParam5>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4, TFactoryParam5 param5)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4, param5);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> WithFactoryArguments<TFactoryParam1, TFactoryParam2, TFactoryParam3, TFactoryParam4, TFactoryParam5, TFactoryParam6>(
|
||||
TFactoryParam1 param1, TFactoryParam2 param2, TFactoryParam3 param3, TFactoryParam4 param4, TFactoryParam5 param5, TFactoryParam6 param6)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgListExplicit(param1, param2, param3, param4, param5, param6);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> WithFactoryArguments(object[] args)
|
||||
{
|
||||
FactoryBindInfo.Arguments = InjectUtil.CreateArgList(args);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> WithFactoryArgumentsExplicit(IEnumerable<TypeValuePair> extraArgs)
|
||||
{
|
||||
FactoryBindInfo.Arguments = extraArgs.ToList();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 22836272211e07a459544765e2e7c098
|
||||
timeCreated: 1528637818
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aa754ab1fdfa8714fb6eddd17108e5c6
|
||||
folderAsset: yes
|
||||
timeCreated: 1461708047
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+182
@@ -0,0 +1,182 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
#if !NOT_UNITY3D
|
||||
using UnityEngine;
|
||||
#endif
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryFromBinder<TContract> : FactoryFromBinderBase
|
||||
{
|
||||
public FactoryFromBinder(
|
||||
DiContainer container, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(container, typeof(TContract), bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromResolveGetter<TObj>(Func<TObj, TContract> method)
|
||||
{
|
||||
return FromResolveGetter<TObj>(null, method);
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromResolveGetter<TObj>(
|
||||
object subIdentifier, Func<TObj, TContract> method)
|
||||
{
|
||||
return FromResolveGetter<TObj>(subIdentifier, method, InjectSources.Any);
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromResolveGetter<TObj>(
|
||||
object subIdentifier, Func<TObj, TContract> method, InjectSources source)
|
||||
{
|
||||
FactoryBindInfo.ProviderFunc =
|
||||
(container) => new GetterProvider<TObj, TContract>(subIdentifier, method, container, source, false);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromMethod(Func<DiContainer, TContract> method)
|
||||
{
|
||||
ProviderFunc =
|
||||
(container) => new MethodProviderWithContainer<TContract>(method);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// Shortcut for FromIFactory and also for backwards compatibility
|
||||
public ArgConditionCopyNonLazyBinder FromFactory<TSubFactory>()
|
||||
where TSubFactory : IFactory<TContract>
|
||||
{
|
||||
return this.FromIFactory(x => x.To<TSubFactory>().AsCached());
|
||||
}
|
||||
|
||||
public FactorySubContainerBinder<TContract> FromSubContainerResolve()
|
||||
{
|
||||
return FromSubContainerResolve(null);
|
||||
}
|
||||
|
||||
public FactorySubContainerBinder<TContract> FromSubContainerResolve(object subIdentifier)
|
||||
{
|
||||
return new FactorySubContainerBinder<TContract>(
|
||||
BindContainer, BindInfo, FactoryBindInfo, subIdentifier);
|
||||
}
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
|
||||
public ConditionCopyNonLazyBinder FromComponentInHierarchy(
|
||||
bool includeInactive = true)
|
||||
{
|
||||
BindingUtil.AssertIsInterfaceOrComponent(ContractType);
|
||||
|
||||
return FromMethod(_ =>
|
||||
{
|
||||
var res = BindContainer.Resolve<Context>().GetRootGameObjects()
|
||||
.Select(x => x.GetComponentInChildren<TContract>(includeInactive))
|
||||
.Where(x => x != null).FirstOrDefault();
|
||||
|
||||
Assert.IsNotNull(res,
|
||||
"Could not find component '{0}' through FromComponentInHierarchy factory binding", typeof(TContract));
|
||||
|
||||
return res;
|
||||
});
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// These methods have to be extension methods for the UWP build (with .NET backend) to work correctly
|
||||
// When these are instance methods it takes a really long time then fails with StackOverflowException
|
||||
public static class FactoryFromBinder0Extensions
|
||||
{
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TContract, TMemoryPool>(
|
||||
this FactoryFromBinder<TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<IMemoryPool>
|
||||
where TMemoryPool : MemoryPool<IMemoryPool, TContract>
|
||||
{
|
||||
// Use a random ID so that our provider is the only one that can find it and so it doesn't
|
||||
// conflict with anything else
|
||||
var poolId = Guid.NewGuid();
|
||||
|
||||
// Important to use NoFlush otherwise the binding will be finalized early
|
||||
var binder = fromBinder.BindContainer.BindMemoryPoolCustomInterfaceNoFlush<TContract, TMemoryPool, TMemoryPool>().WithId(poolId);
|
||||
|
||||
// Always make it non lazy by default in case the user sets an InitialSize
|
||||
binder.NonLazy();
|
||||
|
||||
poolBindGenerator(binder);
|
||||
|
||||
fromBinder.ProviderFunc =
|
||||
(container) => { return new PoolableMemoryPoolProvider<TContract, TMemoryPool>(container, poolId); };
|
||||
|
||||
return new ArgConditionCopyNonLazyBinder(fromBinder.BindInfo);
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TContract>(
|
||||
this FactoryFromBinder<TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TContract>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TContract>(
|
||||
this FactoryFromBinder<TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TContract, PoolableMemoryPool<IMemoryPool, TContract>>(poolBindGenerator);
|
||||
}
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
public static ArgConditionCopyNonLazyBinder FromMonoPoolableMemoryPool<TContract>(
|
||||
this FactoryFromBinder<TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : Component, IPoolable<IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromMonoPoolableMemoryPool<TContract>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromMonoPoolableMemoryPool<TContract>(
|
||||
this FactoryFromBinder<TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : Component, IPoolable<IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TContract, MonoPoolableMemoryPool<IMemoryPool, TContract>>(poolBindGenerator);
|
||||
}
|
||||
#endif
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TContract, TMemoryPool>(
|
||||
this FactoryFromBinder<TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<IMemoryPool>
|
||||
where TMemoryPool : MemoryPool<IMemoryPool, TContract>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TContract, TMemoryPool>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromIFactory<TContract>(
|
||||
this FactoryFromBinder<TContract> fromBinder,
|
||||
Action<ConcreteBinderGeneric<IFactory<TContract>>> factoryBindGenerator)
|
||||
{
|
||||
Guid factoryId;
|
||||
factoryBindGenerator(
|
||||
fromBinder.CreateIFactoryBinder<IFactory<TContract>>(out factoryId));
|
||||
|
||||
fromBinder.ProviderFunc =
|
||||
(container) => { return new IFactoryProvider<TContract>(container, factoryId); };
|
||||
|
||||
return new ArgConditionCopyNonLazyBinder(fromBinder.BindInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fd0f7feaafd2cc44da895162de285da7
|
||||
timeCreated: 1461708055
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+140
@@ -0,0 +1,140 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if !NOT_UNITY3D
|
||||
using UnityEngine;
|
||||
#endif
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryFromBinder<TParam1, TContract> : FactoryFromBinderBase
|
||||
{
|
||||
public FactoryFromBinder(
|
||||
DiContainer container, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(container, typeof(TContract), bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromMethod(Func<DiContainer, TParam1, TContract> method)
|
||||
{
|
||||
ProviderFunc =
|
||||
(container) => new MethodProviderWithContainer<TParam1, TContract>(method);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// Shortcut for FromIFactory and also for backwards compatibility
|
||||
public ConditionCopyNonLazyBinder FromFactory<TSubFactory>()
|
||||
where TSubFactory : IFactory<TParam1, TContract>
|
||||
{
|
||||
return this.FromIFactory(x => x.To<TSubFactory>().AsCached());
|
||||
}
|
||||
|
||||
public FactorySubContainerBinder<TParam1, TContract> FromSubContainerResolve()
|
||||
{
|
||||
return FromSubContainerResolve(null);
|
||||
}
|
||||
|
||||
public FactorySubContainerBinder<TParam1, TContract> FromSubContainerResolve(object subIdentifier)
|
||||
{
|
||||
return new FactorySubContainerBinder<TParam1, TContract>(
|
||||
BindContainer, BindInfo, FactoryBindInfo, subIdentifier);
|
||||
}
|
||||
}
|
||||
|
||||
// These methods have to be extension methods for the UWP build (with .NET backend) to work correctly
|
||||
// When these are instance methods it takes a really long time then fails with StackOverflowException
|
||||
public static class FactoryFromBinder1Extensions
|
||||
{
|
||||
public static ArgConditionCopyNonLazyBinder FromIFactory<TParam1, TContract>(
|
||||
this FactoryFromBinder<TParam1, TContract> fromBinder,
|
||||
Action<ConcreteBinderGeneric<IFactory<TParam1, TContract>>> factoryBindGenerator)
|
||||
{
|
||||
Guid factoryId;
|
||||
factoryBindGenerator(
|
||||
fromBinder.CreateIFactoryBinder<IFactory<TParam1, TContract>>(out factoryId));
|
||||
|
||||
fromBinder.ProviderFunc =
|
||||
(container) => { return new IFactoryProvider<TParam1, TContract>(container, factoryId); };
|
||||
|
||||
return new ArgConditionCopyNonLazyBinder(fromBinder.BindInfo);
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TContract>(
|
||||
this FactoryFromBinder<TParam1, TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TContract>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TContract>(
|
||||
this FactoryFromBinder<TParam1, TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TContract, PoolableMemoryPool<TParam1, IMemoryPool, TContract>>(poolBindGenerator);
|
||||
}
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
public static ArgConditionCopyNonLazyBinder FromMonoPoolableMemoryPool<TParam1, TContract>(
|
||||
this FactoryFromBinder<TParam1, TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : Component, IPoolable<TParam1, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromMonoPoolableMemoryPool<TParam1, TContract>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromMonoPoolableMemoryPool<TParam1, TContract>(
|
||||
this FactoryFromBinder<TParam1, TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : Component, IPoolable<TParam1, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TContract, MonoPoolableMemoryPool<TParam1, IMemoryPool, TContract>>(poolBindGenerator);
|
||||
}
|
||||
#endif
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TContract, TMemoryPool>(
|
||||
this FactoryFromBinder<TParam1, TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, IMemoryPool>
|
||||
where TMemoryPool : MemoryPool<TParam1, IMemoryPool, TContract>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TContract, TMemoryPool>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TContract, TMemoryPool>(
|
||||
this FactoryFromBinder<TParam1, TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, IMemoryPool>
|
||||
where TMemoryPool : MemoryPool<TParam1, IMemoryPool, TContract>
|
||||
{
|
||||
// Use a random ID so that our provider is the only one that can find it and so it doesn't
|
||||
// conflict with anything else
|
||||
var poolId = Guid.NewGuid();
|
||||
|
||||
// Important to use NoFlush otherwise the binding will be finalized early
|
||||
var binder = fromBinder.BindContainer.BindMemoryPoolCustomInterfaceNoFlush<TContract, TMemoryPool, TMemoryPool>().WithId(poolId);
|
||||
|
||||
// Always make it non lazy by default in case the user sets an InitialSize
|
||||
binder.NonLazy();
|
||||
|
||||
poolBindGenerator(binder);
|
||||
|
||||
fromBinder.ProviderFunc =
|
||||
(container) => { return new PoolableMemoryPoolProvider<TParam1, TContract, TMemoryPool>(container, poolId); };
|
||||
|
||||
return new ArgConditionCopyNonLazyBinder(fromBinder.BindInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 57ab0b3d05763f14fb530d07a5acd481
|
||||
timeCreated: 1461708050
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
|
||||
#endif
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract>
|
||||
: FactoryFromBinderBase
|
||||
{
|
||||
public FactoryFromBinder(
|
||||
DiContainer container, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(container, typeof(TContract), bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromMethod(
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Func<DiContainer, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract> method)
|
||||
{
|
||||
ProviderFunc =
|
||||
container => new MethodProviderWithContainer<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract>(method);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// Shortcut for FromIFactory and also for backwards compatibility
|
||||
public ConditionCopyNonLazyBinder FromFactory<TSubFactory>()
|
||||
where TSubFactory : IFactory<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract>
|
||||
{
|
||||
return FromIFactory(x => x.To<TSubFactory>().AsCached());
|
||||
}
|
||||
|
||||
public ArgConditionCopyNonLazyBinder FromIFactory(
|
||||
Action<ConcreteBinderGeneric<IFactory<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract>>> factoryBindGenerator)
|
||||
{
|
||||
Guid factoryId;
|
||||
factoryBindGenerator(
|
||||
CreateIFactoryBinder<IFactory<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract>>(out factoryId));
|
||||
|
||||
ProviderFunc =
|
||||
container => { return new IFactoryProvider<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract>(container, factoryId); };
|
||||
|
||||
return new ArgConditionCopyNonLazyBinder(BindInfo);
|
||||
}
|
||||
|
||||
public FactorySubContainerBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract> FromSubContainerResolve()
|
||||
{
|
||||
return FromSubContainerResolve(null);
|
||||
}
|
||||
|
||||
public FactorySubContainerBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract> FromSubContainerResolve(object subIdentifier)
|
||||
{
|
||||
return new FactorySubContainerBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract>(
|
||||
BindContainer, BindInfo, FactoryBindInfo, subIdentifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d835e30b6131d754e892d6f397e9921a
|
||||
timeCreated: 1507270780
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if !NOT_UNITY3D
|
||||
using UnityEngine;
|
||||
#endif
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryFromBinder<TParam1, TParam2, TContract> : FactoryFromBinderBase
|
||||
{
|
||||
public FactoryFromBinder(
|
||||
DiContainer container, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(container, typeof(TContract), bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromMethod(Func<DiContainer, TParam1, TParam2, TContract> method)
|
||||
{
|
||||
ProviderFunc =
|
||||
(container) => new MethodProviderWithContainer<TParam1, TParam2, TContract>(method);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// Shortcut for FromIFactory and also for backwards compatibility
|
||||
public ConditionCopyNonLazyBinder FromFactory<TSubFactory>()
|
||||
where TSubFactory : IFactory<TParam1, TParam2, TContract>
|
||||
{
|
||||
return this.FromIFactory(x => x.To<TSubFactory>().AsCached());
|
||||
}
|
||||
|
||||
public FactorySubContainerBinder<TParam1, TParam2, TContract> FromSubContainerResolve()
|
||||
{
|
||||
return FromSubContainerResolve(null);
|
||||
}
|
||||
|
||||
public FactorySubContainerBinder<TParam1, TParam2, TContract> FromSubContainerResolve(object subIdentifier)
|
||||
{
|
||||
return new FactorySubContainerBinder<TParam1, TParam2, TContract>(
|
||||
BindContainer, BindInfo, FactoryBindInfo, subIdentifier);
|
||||
}
|
||||
}
|
||||
|
||||
// These methods have to be extension methods for the UWP build (with .NET backend) to work correctly
|
||||
// When these are instance methods it takes a really long time then fails with StackOverflowException
|
||||
public static class FactoryFromBinder2Extensions
|
||||
{
|
||||
public static ArgConditionCopyNonLazyBinder FromIFactory<TParam1, TParam2, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TContract> fromBinder,
|
||||
Action<ConcreteBinderGeneric<IFactory<TParam1, TParam2, TContract>>> factoryBindGenerator)
|
||||
{
|
||||
Guid factoryId;
|
||||
factoryBindGenerator(
|
||||
fromBinder.CreateIFactoryBinder<IFactory<TParam1, TParam2, TContract>>(out factoryId));
|
||||
|
||||
fromBinder.ProviderFunc =
|
||||
(container) => { return new IFactoryProvider<TParam1, TParam2, TContract>(container, factoryId); };
|
||||
|
||||
return new ArgConditionCopyNonLazyBinder(fromBinder.BindInfo);
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TParam2, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, TParam2, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TParam2, TContract>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TParam2, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, TParam2, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TParam2, TContract, PoolableMemoryPool<TParam1, TParam2, IMemoryPool, TContract>>(poolBindGenerator);
|
||||
}
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
public static ArgConditionCopyNonLazyBinder FromMonoPoolableMemoryPool<TParam1, TParam2, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : Component, IPoolable<TParam1, TParam2, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromMonoPoolableMemoryPool<TParam1, TParam2, TContract>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromMonoPoolableMemoryPool<TParam1, TParam2, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : Component, IPoolable<TParam1, TParam2, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TParam2, TContract, MonoPoolableMemoryPool<TParam1, TParam2, IMemoryPool, TContract>>(poolBindGenerator);
|
||||
}
|
||||
#endif
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TParam2, TContract, TMemoryPool>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, TParam2, IMemoryPool>
|
||||
where TMemoryPool : MemoryPool<TParam1, TParam2, IMemoryPool, TContract>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TParam2, TContract, TMemoryPool>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TParam2, TContract, TMemoryPool>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, TParam2, IMemoryPool>
|
||||
where TMemoryPool : MemoryPool<TParam1, TParam2, IMemoryPool, TContract>
|
||||
{
|
||||
// Use a random ID so that our provider is the only one that can find it and so it doesn't
|
||||
// conflict with anything else
|
||||
var poolId = Guid.NewGuid();
|
||||
|
||||
// Important to use NoFlush otherwise the binding will be finalized early
|
||||
var binder = fromBinder.BindContainer.BindMemoryPoolCustomInterfaceNoFlush<TContract, TMemoryPool, TMemoryPool>()
|
||||
.WithId(poolId);
|
||||
|
||||
// Always make it non lazy by default in case the user sets an InitialSize
|
||||
binder.NonLazy();
|
||||
|
||||
poolBindGenerator(binder);
|
||||
|
||||
fromBinder.ProviderFunc =
|
||||
(container) => { return new PoolableMemoryPoolProvider<TParam1, TParam2, TContract, TMemoryPool>(container, poolId); };
|
||||
|
||||
return new ArgConditionCopyNonLazyBinder(fromBinder.BindInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a36f88760754c1c498ab3270dfb88b72
|
||||
timeCreated: 1461708052
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if !NOT_UNITY3D
|
||||
using UnityEngine;
|
||||
#endif
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryFromBinder<TParam1, TParam2, TParam3, TContract> : FactoryFromBinderBase
|
||||
{
|
||||
public FactoryFromBinder(
|
||||
DiContainer container, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(container, typeof(TContract), bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromMethod(Func<DiContainer, TParam1, TParam2, TParam3, TContract> method)
|
||||
{
|
||||
ProviderFunc =
|
||||
(container) => new MethodProviderWithContainer<TParam1, TParam2, TParam3, TContract>(method);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// Shortcut for FromIFactory and also for backwards compatibility
|
||||
public ConditionCopyNonLazyBinder FromFactory<TSubFactory>()
|
||||
where TSubFactory : IFactory<TParam1, TParam2, TParam3, TContract>
|
||||
{
|
||||
return this.FromIFactory(x => x.To<TSubFactory>().AsCached());
|
||||
}
|
||||
|
||||
public FactorySubContainerBinder<TParam1, TParam2, TParam3, TContract> FromSubContainerResolve()
|
||||
{
|
||||
return FromSubContainerResolve(null);
|
||||
}
|
||||
|
||||
public FactorySubContainerBinder<TParam1, TParam2, TParam3, TContract> FromSubContainerResolve(object subIdentifier)
|
||||
{
|
||||
return new FactorySubContainerBinder<TParam1, TParam2, TParam3, TContract>(
|
||||
BindContainer, BindInfo, FactoryBindInfo, subIdentifier);
|
||||
}
|
||||
}
|
||||
|
||||
// These methods have to be extension methods for the UWP build (with .NET backend) to work correctly
|
||||
// When these are instance methods it takes a really long time then fails with StackOverflowException
|
||||
public static class FactoryFromBinder3Extensions
|
||||
{
|
||||
public static ArgConditionCopyNonLazyBinder FromIFactory<TParam1, TParam2, TParam3, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TContract> fromBinder,
|
||||
Action<ConcreteBinderGeneric<IFactory<TParam1, TParam2, TParam3, TContract>>> factoryBindGenerator)
|
||||
{
|
||||
Guid factoryId;
|
||||
factoryBindGenerator(
|
||||
fromBinder.CreateIFactoryBinder<IFactory<TParam1, TParam2, TParam3, TContract>>(out factoryId));
|
||||
|
||||
fromBinder.ProviderFunc =
|
||||
(container) => { return new IFactoryProvider<TParam1, TParam2, TParam3, TContract>(container, factoryId); };
|
||||
|
||||
return new ArgConditionCopyNonLazyBinder(fromBinder.BindInfo);
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TParam2, TParam3, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, TParam2, TParam3, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TParam2, TParam3, TContract>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TParam2, TParam3, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, TParam2, TParam3, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TParam2, TParam3, TContract, PoolableMemoryPool<TParam1, TParam2, TParam3, IMemoryPool, TContract>>(poolBindGenerator);
|
||||
}
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
public static ArgConditionCopyNonLazyBinder FromMonoPoolableMemoryPool<TParam1, TParam2, TParam3, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : Component, IPoolable<TParam1, TParam2, TParam3, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromMonoPoolableMemoryPool<TParam1, TParam2, TParam3, TContract>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromMonoPoolableMemoryPool<TParam1, TParam2, TParam3, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : Component, IPoolable<TParam1, TParam2, TParam3, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TParam2, TParam3, TContract, MonoPoolableMemoryPool<TParam1, TParam2, TParam3, IMemoryPool, TContract>>(poolBindGenerator);
|
||||
}
|
||||
#endif
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TParam2, TParam3, TContract, TMemoryPool>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, TParam2, TParam3, IMemoryPool>
|
||||
where TMemoryPool : MemoryPool<TParam1, TParam2, TParam3, IMemoryPool, TContract>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TParam2, TParam3, TContract, TMemoryPool>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TParam2, TParam3, TContract, TMemoryPool>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, TParam2, TParam3, IMemoryPool>
|
||||
where TMemoryPool : MemoryPool<TParam1, TParam2, TParam3, IMemoryPool, TContract>
|
||||
{
|
||||
// Use a random ID so that our provider is the only one that can find it and so it doesn't
|
||||
// conflict with anything else
|
||||
var poolId = Guid.NewGuid();
|
||||
|
||||
// Important to use NoFlush otherwise the binding will be finalized early
|
||||
var binder = fromBinder.BindContainer.BindMemoryPoolCustomInterfaceNoFlush<TContract, TMemoryPool, TMemoryPool>()
|
||||
.WithId(poolId);
|
||||
|
||||
// Always make it non lazy by default in case the user sets an InitialSize
|
||||
binder.NonLazy();
|
||||
|
||||
poolBindGenerator(binder);
|
||||
|
||||
fromBinder.ProviderFunc =
|
||||
(container) => { return new PoolableMemoryPoolProvider<TParam1, TParam2, TParam3, TContract, TMemoryPool>(container, poolId); };
|
||||
|
||||
return new ArgConditionCopyNonLazyBinder(fromBinder.BindInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4eb3a4d5d01c55748b43f48a1da3c7b6
|
||||
timeCreated: 1461708050
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if !NOT_UNITY3D
|
||||
using UnityEngine;
|
||||
#endif
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TContract> : FactoryFromBinderBase
|
||||
{
|
||||
public FactoryFromBinder(
|
||||
DiContainer container, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(container, typeof(TContract), bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromMethod(
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Func<DiContainer, TParam1, TParam2, TParam3, TParam4, TContract> method)
|
||||
{
|
||||
ProviderFunc =
|
||||
(container) => new MethodProviderWithContainer<TParam1, TParam2, TParam3, TParam4, TContract>(method);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// Shortcut for FromIFactory and also for backwards compatibility
|
||||
public ConditionCopyNonLazyBinder FromFactory<TSubFactory>()
|
||||
where TSubFactory : IFactory<TParam1, TParam2, TParam3, TParam4, TContract>
|
||||
{
|
||||
return this.FromIFactory(x => x.To<TSubFactory>().AsCached());
|
||||
}
|
||||
|
||||
public FactorySubContainerBinder<TParam1, TParam2, TParam3, TParam4, TContract> FromSubContainerResolve()
|
||||
{
|
||||
return FromSubContainerResolve(null);
|
||||
}
|
||||
|
||||
public FactorySubContainerBinder<TParam1, TParam2, TParam3, TParam4, TContract> FromSubContainerResolve(object subIdentifier)
|
||||
{
|
||||
return new FactorySubContainerBinder<TParam1, TParam2, TParam3, TParam4, TContract>(
|
||||
BindContainer, BindInfo, FactoryBindInfo, subIdentifier);
|
||||
}
|
||||
}
|
||||
|
||||
// These methods have to be extension methods for the UWP build (with .NET backend) to work correctly
|
||||
// When these are instance methods it takes a really long time then fails with StackOverflowException
|
||||
public static class FactoryFromBinder4Extensions
|
||||
{
|
||||
public static ArgConditionCopyNonLazyBinder FromIFactory<TParam1, TParam2, TParam3, TParam4, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TContract> fromBinder,
|
||||
Action<ConcreteBinderGeneric<IFactory<TParam1, TParam2, TParam3, TParam4, TContract>>> factoryBindGenerator)
|
||||
{
|
||||
Guid factoryId;
|
||||
factoryBindGenerator(
|
||||
fromBinder.CreateIFactoryBinder<IFactory<TParam1, TParam2, TParam3, TParam4, TContract>>(out factoryId));
|
||||
|
||||
fromBinder.ProviderFunc =
|
||||
(container) => { return new IFactoryProvider<TParam1, TParam2, TParam3, TParam4, TContract>(container, factoryId); };
|
||||
|
||||
return new ArgConditionCopyNonLazyBinder(fromBinder.BindInfo);
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, TParam2, TParam3, TParam4, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TContract>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, TParam2, TParam3, TParam4, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TContract, PoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, IMemoryPool, TContract>>(poolBindGenerator);
|
||||
}
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
public static ArgConditionCopyNonLazyBinder FromMonoPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : Component, IPoolable<TParam1, TParam2, TParam3, TParam4, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromMonoPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TContract>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromMonoPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : Component, IPoolable<TParam1, TParam2, TParam3, TParam4, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TContract, MonoPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, IMemoryPool, TContract>>(poolBindGenerator);
|
||||
}
|
||||
#endif
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TContract, TMemoryPool>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, TParam2, TParam3, TParam4, IMemoryPool>
|
||||
where TMemoryPool : MemoryPool<TParam1, TParam2, TParam3, TParam4, IMemoryPool, TContract>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TContract, TMemoryPool>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TContract, TMemoryPool>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, TParam2, TParam3, TParam4, IMemoryPool>
|
||||
where TMemoryPool : MemoryPool<TParam1, TParam2, TParam3, TParam4, IMemoryPool, TContract>
|
||||
{
|
||||
// Use a random ID so that our provider is the only one that can find it and so it doesn't
|
||||
// conflict with anything else
|
||||
var poolId = Guid.NewGuid();
|
||||
|
||||
// Important to use NoFlush otherwise the binding will be finalized early
|
||||
var binder = fromBinder.BindContainer.BindMemoryPoolCustomInterfaceNoFlush<TContract, TMemoryPool, TMemoryPool>()
|
||||
.WithId(poolId);
|
||||
|
||||
// Always make it non lazy by default in case the user sets an InitialSize
|
||||
binder.NonLazy();
|
||||
|
||||
poolBindGenerator(binder);
|
||||
|
||||
fromBinder.ProviderFunc =
|
||||
(container) => { return new PoolableMemoryPoolProvider<TParam1, TParam2, TParam3, TParam4, TContract, TMemoryPool>(container, poolId); };
|
||||
|
||||
return new ArgConditionCopyNonLazyBinder(fromBinder.BindInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e67ee9caa78de914a9c727a607c3d8c0
|
||||
timeCreated: 1461708054
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+146
@@ -0,0 +1,146 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if !NOT_UNITY3D
|
||||
using UnityEngine;
|
||||
#endif
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract>
|
||||
: FactoryFromBinderBase
|
||||
{
|
||||
public FactoryFromBinder(
|
||||
DiContainer container, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(container, typeof(TContract), bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromMethod(
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Func<DiContainer, TParam1, TParam2, TParam3, TParam4, TParam5, TContract> method)
|
||||
{
|
||||
ProviderFunc =
|
||||
(container) => new MethodProviderWithContainer<TParam1, TParam2, TParam3, TParam4, TParam5, TContract>(method);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// Shortcut for FromIFactory and also for backwards compatibility
|
||||
public ConditionCopyNonLazyBinder FromFactory<TSubFactory>()
|
||||
where TSubFactory : IFactory<TParam1, TParam2, TParam3, TParam4, TParam5, TContract>
|
||||
{
|
||||
return this.FromIFactory(x => x.To<TSubFactory>().AsCached());
|
||||
}
|
||||
|
||||
public FactorySubContainerBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract> FromSubContainerResolve()
|
||||
{
|
||||
return FromSubContainerResolve(null);
|
||||
}
|
||||
|
||||
public FactorySubContainerBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract> FromSubContainerResolve(object subIdentifier)
|
||||
{
|
||||
return new FactorySubContainerBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract>(
|
||||
BindContainer, BindInfo, FactoryBindInfo, subIdentifier);
|
||||
}
|
||||
}
|
||||
|
||||
// These methods have to be extension methods for the UWP build (with .NET backend) to work correctly
|
||||
// When these are instance methods it takes a really long time then fails with StackOverflowException
|
||||
public static class FactoryFromBinder5Extensions
|
||||
{
|
||||
public static ArgConditionCopyNonLazyBinder FromIFactory<TParam1, TParam2, TParam3, TParam4, TParam5, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract> fromBinder,
|
||||
Action<ConcreteBinderGeneric<IFactory<TParam1, TParam2, TParam3, TParam4, TParam5, TContract>>> factoryBindGenerator)
|
||||
{
|
||||
Guid factoryId;
|
||||
factoryBindGenerator(
|
||||
fromBinder.CreateIFactoryBinder<IFactory<TParam1, TParam2, TParam3, TParam4, TParam5, TContract>>(out factoryId));
|
||||
|
||||
fromBinder.ProviderFunc =
|
||||
(container) => { return new IFactoryProvider<TParam1, TParam2, TParam3, TParam4, TParam5, TContract>(container, factoryId); };
|
||||
|
||||
return new ArgConditionCopyNonLazyBinder(fromBinder.BindInfo);
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, TParam2, TParam3, TParam4, TParam5, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TContract>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, TParam2, TParam3, TParam4, TParam5, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TContract, PoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, IMemoryPool, TContract>>(poolBindGenerator);
|
||||
}
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
public static ArgConditionCopyNonLazyBinder FromMonoPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : Component, IPoolable<TParam1, TParam2, TParam3, TParam4, TParam5, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromMonoPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TContract>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromMonoPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : Component, IPoolable<TParam1, TParam2, TParam3, TParam4, TParam5, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TContract, MonoPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, IMemoryPool, TContract>>(poolBindGenerator);
|
||||
}
|
||||
#endif
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TContract, TMemoryPool>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, TParam2, TParam3, TParam4, TParam5, IMemoryPool>
|
||||
where TMemoryPool : MemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, IMemoryPool, TContract>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TContract, TMemoryPool>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TContract, TMemoryPool>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, TParam2, TParam3, TParam4, TParam5, IMemoryPool>
|
||||
where TMemoryPool : MemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, IMemoryPool, TContract>
|
||||
{
|
||||
// Use a random ID so that our provider is the only one that can find it and so it doesn't
|
||||
// conflict with anything else
|
||||
var poolId = Guid.NewGuid();
|
||||
|
||||
// Important to use NoFlush otherwise the binding will be finalized early
|
||||
var binder = fromBinder.BindContainer.BindMemoryPoolCustomInterfaceNoFlush<TContract, TMemoryPool, TMemoryPool>()
|
||||
.WithId(poolId);
|
||||
|
||||
// Always make it non lazy by default in case the user sets an InitialSize
|
||||
binder.NonLazy();
|
||||
|
||||
poolBindGenerator(binder);
|
||||
|
||||
fromBinder.ProviderFunc =
|
||||
(container) => { return new PoolableMemoryPoolProvider<TParam1, TParam2, TParam3, TParam4, TParam5, TContract, TMemoryPool>(container, poolId); };
|
||||
|
||||
return new ArgConditionCopyNonLazyBinder(fromBinder.BindInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 901200be3b8d1cc40876aa50a03103b8
|
||||
timeCreated: 1461708052
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if !NOT_UNITY3D
|
||||
using UnityEngine;
|
||||
#endif
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>
|
||||
: FactoryFromBinderBase
|
||||
{
|
||||
public FactoryFromBinder(
|
||||
DiContainer container, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(container, typeof(TContract), bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromMethod(
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Func<DiContainer, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> method)
|
||||
{
|
||||
ProviderFunc =
|
||||
(container) => new MethodProviderWithContainer<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>(method);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// Shortcut for FromIFactory and also for backwards compatibility
|
||||
public ConditionCopyNonLazyBinder FromFactory<TSubFactory>()
|
||||
where TSubFactory : IFactory<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>
|
||||
{
|
||||
return this.FromIFactory(x => x.To<TSubFactory>().AsCached());
|
||||
}
|
||||
|
||||
public FactorySubContainerBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> FromSubContainerResolve()
|
||||
{
|
||||
return FromSubContainerResolve(null);
|
||||
}
|
||||
|
||||
public FactorySubContainerBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> FromSubContainerResolve(object subIdentifier)
|
||||
{
|
||||
return new FactorySubContainerBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>(
|
||||
BindContainer, BindInfo, FactoryBindInfo, subIdentifier);
|
||||
}
|
||||
}
|
||||
|
||||
// These methods have to be extension methods for the UWP build (with .NET backend) to work correctly
|
||||
// When these are instance methods it takes a really long time then fails with StackOverflowException
|
||||
public static class FactoryFromBinder6Extensions
|
||||
{
|
||||
public static ArgConditionCopyNonLazyBinder FromIFactory<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> fromBinder,
|
||||
Action<ConcreteBinderGeneric<IFactory<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>>> factoryBindGenerator)
|
||||
{
|
||||
Guid factoryId;
|
||||
factoryBindGenerator(
|
||||
fromBinder.CreateIFactoryBinder<IFactory<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>>(out factoryId));
|
||||
|
||||
fromBinder.ProviderFunc =
|
||||
(container) => { return new IFactoryProvider<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>(container, factoryId); };
|
||||
|
||||
return new ArgConditionCopyNonLazyBinder(fromBinder.BindInfo);
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract, PoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, IMemoryPool, TContract>>(poolBindGenerator);
|
||||
}
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
public static ArgConditionCopyNonLazyBinder FromMonoPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : Component, IPoolable<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromMonoPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromMonoPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : Component, IPoolable<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, IMemoryPool>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract, MonoPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, IMemoryPool, TContract>>(poolBindGenerator);
|
||||
}
|
||||
#endif
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract, TMemoryPool>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> fromBinder)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, IMemoryPool>
|
||||
where TMemoryPool : MemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, IMemoryPool, TContract>
|
||||
{
|
||||
return fromBinder.FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract, TMemoryPool>(x => {});
|
||||
}
|
||||
|
||||
public static ArgConditionCopyNonLazyBinder FromPoolableMemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract, TMemoryPool>(
|
||||
this FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> fromBinder,
|
||||
Action<MemoryPoolInitialSizeMaxSizeBinder<TContract>> poolBindGenerator)
|
||||
// Unfortunately we have to pass the same contract in again to satisfy the generic
|
||||
// constraints below
|
||||
where TContract : IPoolable<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, IMemoryPool>
|
||||
where TMemoryPool : MemoryPool<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, IMemoryPool, TContract>
|
||||
{
|
||||
Assert.IsEqual(typeof(TContract), typeof(TContract));
|
||||
|
||||
// Use a random ID so that our provider is the only one that can find it and so it doesn't
|
||||
// conflict with anything else
|
||||
var poolId = Guid.NewGuid();
|
||||
|
||||
// Important to use NoFlush otherwise the binding will be finalized early
|
||||
var binder = fromBinder.BindContainer.BindMemoryPoolCustomInterfaceNoFlush<TContract, TMemoryPool, TMemoryPool>()
|
||||
.WithId(poolId);
|
||||
|
||||
// Always make it non lazy by default in case the user sets an InitialSize
|
||||
binder.NonLazy();
|
||||
|
||||
poolBindGenerator(binder);
|
||||
|
||||
fromBinder.ProviderFunc =
|
||||
(container) => { return new PoolableMemoryPoolProvider<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract, TMemoryPool>(container, poolId); };
|
||||
|
||||
return new ArgConditionCopyNonLazyBinder(fromBinder.BindInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b79f4e548e208b1418f013d2fdb0e076
|
||||
timeCreated: 1528529860
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 17d1fc460074cfc419ffecab2a7e97e8
|
||||
folderAsset: yes
|
||||
timeCreated: 1461708047
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
using System;
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactorySubContainerBinder<TContract>
|
||||
: FactorySubContainerBinderBase<TContract>
|
||||
{
|
||||
public FactorySubContainerBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo, object subIdentifier)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo, subIdentifier)
|
||||
{
|
||||
}
|
||||
|
||||
public ScopeConcreteIdArgConditionCopyNonLazyBinder ByMethod(Action<DiContainer> installerMethod)
|
||||
{
|
||||
var subcontainerBindInfo = new SubContainerCreatorBindInfo();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByMethod(
|
||||
container, subcontainerBindInfo, installerMethod), false);
|
||||
|
||||
return new ScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo);
|
||||
}
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewGameObjectMethod(Action<DiContainer> installerMethod)
|
||||
{
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewGameObjectMethod(
|
||||
container, gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabMethod(
|
||||
Func<InjectContext, UnityEngine.Object> prefabGetter, Action<DiContainer> installerMethod)
|
||||
{
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod(
|
||||
container,
|
||||
new PrefabProviderCustom(prefabGetter),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabMethod(
|
||||
UnityEngine.Object prefab, Action<DiContainer> installerMethod)
|
||||
{
|
||||
BindingUtil.AssertIsValidPrefab(prefab);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod(
|
||||
container,
|
||||
new PrefabProvider(prefab),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabResourceMethod(
|
||||
string resourcePath, Action<DiContainer> installerMethod)
|
||||
{
|
||||
BindingUtil.AssertIsValidResourcePath(resourcePath);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod(
|
||||
container,
|
||||
new PrefabProviderResource(resourcePath),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
[System.Obsolete("ByNewPrefab has been renamed to ByNewContextPrefab to avoid confusion with ByNewPrefabInstaller and ByNewPrefabMethod")]
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefab(UnityEngine.Object prefab)
|
||||
{
|
||||
return ByNewContextPrefab(prefab);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewContextPrefab(UnityEngine.Object prefab)
|
||||
{
|
||||
BindingUtil.AssertIsValidPrefab(prefab);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefab(
|
||||
container,
|
||||
new PrefabProvider(prefab),
|
||||
gameObjectInfo), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
[System.Obsolete("ByNewPrefabResource has been renamed to ByNewContextPrefabResource to avoid confusion with ByNewPrefabResourceInstaller and ByNewPrefabResourceMethod")]
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabResource(string resourcePath)
|
||||
{
|
||||
return ByNewContextPrefabResource(resourcePath);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewContextPrefabResource(string resourcePath)
|
||||
{
|
||||
BindingUtil.AssertIsValidResourcePath(resourcePath);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefab(
|
||||
container,
|
||||
new PrefabProviderResource(resourcePath),
|
||||
gameObjectInfo), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3c12d5eb6ac4cc8449986d020ef27e4f
|
||||
timeCreated: 1461708049
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactorySubContainerBinder<TParam1, TContract>
|
||||
: FactorySubContainerBinderWithParams<TContract>
|
||||
{
|
||||
public FactorySubContainerBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo, object subIdentifier)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo, subIdentifier)
|
||||
{
|
||||
}
|
||||
|
||||
public ScopeConcreteIdArgConditionCopyNonLazyBinder ByMethod(Action<DiContainer, TParam1> installerMethod)
|
||||
{
|
||||
var subcontainerBindInfo = new SubContainerCreatorBindInfo();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByMethod<TParam1>(
|
||||
container, subcontainerBindInfo, installerMethod), false);
|
||||
|
||||
return new ScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo);
|
||||
}
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewGameObjectMethod(
|
||||
Action<DiContainer, TParam1> installerMethod)
|
||||
{
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewGameObjectMethod<TParam1>(
|
||||
container, gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabMethod(
|
||||
Func<InjectContext, UnityEngine.Object> prefabGetter, Action<DiContainer, TParam1> installerMethod)
|
||||
{
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1>(
|
||||
container,
|
||||
new PrefabProviderCustom(prefabGetter),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabMethod(
|
||||
UnityEngine.Object prefab, Action<DiContainer, TParam1> installerMethod)
|
||||
{
|
||||
BindingUtil.AssertIsValidPrefab(prefab);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1>(
|
||||
container,
|
||||
new PrefabProvider(prefab),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabResourceMethod(
|
||||
string resourcePath, Action<DiContainer, TParam1> installerMethod)
|
||||
{
|
||||
BindingUtil.AssertIsValidResourcePath(resourcePath);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1>(
|
||||
container,
|
||||
new PrefabProviderResource(resourcePath),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b119fe818c4bae143ab8f9a4f2a1b0fd
|
||||
timeCreated: 1461708053
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
using System;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactorySubContainerBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract>
|
||||
: FactorySubContainerBinderWithParams<TContract>
|
||||
{
|
||||
public FactorySubContainerBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo, object subIdentifier)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo, subIdentifier)
|
||||
{
|
||||
}
|
||||
|
||||
public ScopeConcreteIdArgConditionCopyNonLazyBinder ByMethod(
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Action<DiContainer, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10> installerMethod)
|
||||
{
|
||||
var subcontainerBindInfo = new SubContainerCreatorBindInfo();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByMethod<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10>(
|
||||
container, subcontainerBindInfo, installerMethod), false);
|
||||
|
||||
return new ScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo);
|
||||
}
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewGameObjectMethod(
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Action<DiContainer, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10> installerMethod)
|
||||
{
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewGameObjectMethod<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10>( container,
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabMethod(
|
||||
Func<InjectContext, UnityEngine.Object> prefabGetter,
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Action<DiContainer, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10> installerMethod)
|
||||
{
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10>( container,
|
||||
new PrefabProviderCustom(prefabGetter),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabMethod(
|
||||
UnityEngine.Object prefab,
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Action<DiContainer, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10> installerMethod)
|
||||
{
|
||||
BindingUtil.AssertIsValidPrefab(prefab);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10>( container,
|
||||
new PrefabProvider(prefab),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabResourceMethod(
|
||||
string resourcePath,
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Action<DiContainer, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10> installerMethod)
|
||||
{
|
||||
BindingUtil.AssertIsValidResourcePath(resourcePath);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10>( container,
|
||||
new PrefabProviderResource(resourcePath),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b6136acd174dfc4d9b9d3f2b9e110e4
|
||||
timeCreated: 1507270779
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactorySubContainerBinder<TParam1, TParam2, TContract>
|
||||
: FactorySubContainerBinderWithParams<TContract>
|
||||
{
|
||||
public FactorySubContainerBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo, object subIdentifier)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo, subIdentifier)
|
||||
{
|
||||
}
|
||||
|
||||
public ScopeConcreteIdArgConditionCopyNonLazyBinder ByMethod(Action<DiContainer, TParam1, TParam2> installerMethod)
|
||||
{
|
||||
var subcontainerBindInfo = new SubContainerCreatorBindInfo();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByMethod<TParam1, TParam2>(
|
||||
container, subcontainerBindInfo, installerMethod), false);
|
||||
|
||||
return new ScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo);
|
||||
}
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewGameObjectMethod(
|
||||
Action<DiContainer, TParam1, TParam2> installerMethod)
|
||||
{
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewGameObjectMethod<TParam1, TParam2>(
|
||||
container, gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabMethod(
|
||||
Func<InjectContext, UnityEngine.Object> prefabGetter, Action<DiContainer, TParam1, TParam2> installerMethod)
|
||||
{
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1, TParam2>(
|
||||
container,
|
||||
new PrefabProviderCustom(prefabGetter),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabMethod(
|
||||
UnityEngine.Object prefab, Action<DiContainer, TParam1, TParam2> installerMethod)
|
||||
{
|
||||
BindingUtil.AssertIsValidPrefab(prefab);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1, TParam2>(
|
||||
container,
|
||||
new PrefabProvider(prefab),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabResourceMethod(
|
||||
string resourcePath, Action<DiContainer, TParam1, TParam2> installerMethod)
|
||||
{
|
||||
BindingUtil.AssertIsValidResourcePath(resourcePath);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1, TParam2>(
|
||||
container,
|
||||
new PrefabProviderResource(resourcePath),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f32bdc495dbe204caab18bace045515
|
||||
timeCreated: 1461708050
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactorySubContainerBinder<TParam1, TParam2, TParam3, TContract>
|
||||
: FactorySubContainerBinderWithParams<TContract>
|
||||
{
|
||||
public FactorySubContainerBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo, object subIdentifier)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo, subIdentifier)
|
||||
{
|
||||
}
|
||||
|
||||
public ScopeConcreteIdArgConditionCopyNonLazyBinder ByMethod(Action<DiContainer, TParam1, TParam2, TParam3> installerMethod)
|
||||
{
|
||||
var subcontainerBindInfo = new SubContainerCreatorBindInfo();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByMethod<TParam1, TParam2, TParam3>(
|
||||
container, subcontainerBindInfo, installerMethod), false);
|
||||
|
||||
return new ScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo);
|
||||
}
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewGameObjectMethod(
|
||||
Action<DiContainer, TParam1, TParam2, TParam3> installerMethod)
|
||||
{
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewGameObjectMethod<TParam1, TParam2, TParam3>(
|
||||
container, gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabMethod(
|
||||
Func<InjectContext, UnityEngine.Object> prefabGetter, Action<DiContainer, TParam1, TParam2, TParam3> installerMethod)
|
||||
{
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1, TParam2, TParam3>(
|
||||
container,
|
||||
new PrefabProviderCustom(prefabGetter),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabMethod(
|
||||
UnityEngine.Object prefab, Action<DiContainer, TParam1, TParam2, TParam3> installerMethod)
|
||||
{
|
||||
BindingUtil.AssertIsValidPrefab(prefab);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1, TParam2, TParam3>(
|
||||
container,
|
||||
new PrefabProvider(prefab),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabResourceMethod(
|
||||
string resourcePath, Action<DiContainer, TParam1, TParam2, TParam3> installerMethod)
|
||||
{
|
||||
BindingUtil.AssertIsValidResourcePath(resourcePath);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1, TParam2, TParam3>(
|
||||
container,
|
||||
new PrefabProviderResource(resourcePath),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fdb97e2862ca0a24e8f87c081ea05727
|
||||
timeCreated: 1461708055
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
using System;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactorySubContainerBinder<TParam1, TParam2, TParam3, TParam4, TContract>
|
||||
: FactorySubContainerBinderWithParams<TContract>
|
||||
{
|
||||
public FactorySubContainerBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo, object subIdentifier)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo, subIdentifier)
|
||||
{
|
||||
}
|
||||
|
||||
public ScopeConcreteIdArgConditionCopyNonLazyBinder ByMethod(
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Action<DiContainer, TParam1, TParam2, TParam3, TParam4> installerMethod)
|
||||
{
|
||||
var subcontainerBindInfo = new SubContainerCreatorBindInfo();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByMethod<TParam1, TParam2, TParam3, TParam4>(
|
||||
container, subcontainerBindInfo, installerMethod), false);
|
||||
|
||||
return new ScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo);
|
||||
}
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewGameObjectMethod(
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Action<DiContainer, TParam1, TParam2, TParam3, TParam4> installerMethod)
|
||||
{
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewGameObjectMethod<TParam1, TParam2, TParam3, TParam4>(
|
||||
container, gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabMethod(
|
||||
Func<InjectContext, UnityEngine.Object> prefabGetter,
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Action<DiContainer, TParam1, TParam2, TParam3, TParam4> installerMethod)
|
||||
{
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1, TParam2, TParam3, TParam4>(
|
||||
container,
|
||||
new PrefabProviderCustom(prefabGetter),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabMethod(
|
||||
UnityEngine.Object prefab,
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Action<DiContainer, TParam1, TParam2, TParam3, TParam4> installerMethod)
|
||||
{
|
||||
BindingUtil.AssertIsValidPrefab(prefab);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1, TParam2, TParam3, TParam4>(
|
||||
container,
|
||||
new PrefabProvider(prefab),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabResourceMethod(
|
||||
string resourcePath,
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Action<DiContainer, TParam1, TParam2, TParam3, TParam4> installerMethod)
|
||||
{
|
||||
BindingUtil.AssertIsValidResourcePath(resourcePath);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1, TParam2, TParam3, TParam4>(
|
||||
container,
|
||||
new PrefabProviderResource(resourcePath),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b0f061434819b334289a066ab685ab37
|
||||
timeCreated: 1461708053
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
using System;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactorySubContainerBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract>
|
||||
: FactorySubContainerBinderWithParams<TContract>
|
||||
{
|
||||
public FactorySubContainerBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo, object subIdentifier)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo, subIdentifier)
|
||||
{
|
||||
}
|
||||
|
||||
public ScopeConcreteIdArgConditionCopyNonLazyBinder ByMethod(
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Action<DiContainer, TParam1, TParam2, TParam3, TParam4, TParam5> installerMethod)
|
||||
{
|
||||
var subcontainerBindInfo = new SubContainerCreatorBindInfo();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByMethod<TParam1, TParam2, TParam3, TParam4, TParam5>(
|
||||
container, subcontainerBindInfo, installerMethod), false);
|
||||
|
||||
return new ScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo);
|
||||
}
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewGameObjectMethod(
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Action<DiContainer, TParam1, TParam2, TParam3, TParam4, TParam5> installerMethod)
|
||||
{
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewGameObjectMethod<TParam1, TParam2, TParam3, TParam4, TParam5>(
|
||||
container, gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabMethod(
|
||||
Func<InjectContext, UnityEngine.Object> prefabGetter,
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Action<DiContainer, TParam1, TParam2, TParam3, TParam4, TParam5> installerMethod)
|
||||
{
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1, TParam2, TParam3, TParam4, TParam5>(
|
||||
container,
|
||||
new PrefabProviderCustom(prefabGetter),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabMethod(
|
||||
UnityEngine.Object prefab,
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Action<DiContainer, TParam1, TParam2, TParam3, TParam4, TParam5> installerMethod)
|
||||
{
|
||||
BindingUtil.AssertIsValidPrefab(prefab);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1, TParam2, TParam3, TParam4, TParam5>(
|
||||
container,
|
||||
new PrefabProvider(prefab),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabResourceMethod(
|
||||
string resourcePath,
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Action<DiContainer, TParam1, TParam2, TParam3, TParam4, TParam5> installerMethod)
|
||||
{
|
||||
BindingUtil.AssertIsValidResourcePath(resourcePath);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1, TParam2, TParam3, TParam4, TParam5>(
|
||||
container,
|
||||
new PrefabProviderResource(resourcePath),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e562a021e16d4a2418f6c47de105c64e
|
||||
timeCreated: 1461708054
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
using System;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactorySubContainerBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>
|
||||
: FactorySubContainerBinderWithParams<TContract>
|
||||
{
|
||||
public FactorySubContainerBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo, object subIdentifier)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo, subIdentifier)
|
||||
{
|
||||
}
|
||||
|
||||
public ScopeConcreteIdArgConditionCopyNonLazyBinder ByMethod(
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Action<DiContainer, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6> installerMethod)
|
||||
{
|
||||
var subcontainerBindInfo = new SubContainerCreatorBindInfo();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByMethod<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6>(
|
||||
container, subcontainerBindInfo, installerMethod), false);
|
||||
|
||||
return new ScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo);
|
||||
}
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewGameObjectMethod(
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Action<DiContainer, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6> installerMethod)
|
||||
{
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewGameObjectMethod<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6>(
|
||||
container, gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabMethod(
|
||||
Func<InjectContext, UnityEngine.Object> prefabGetter,
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Action<DiContainer, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6> installerMethod)
|
||||
{
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6>(
|
||||
container,
|
||||
new PrefabProviderCustom(prefabGetter),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabMethod(
|
||||
UnityEngine.Object prefab,
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Action<DiContainer, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6> installerMethod)
|
||||
{
|
||||
BindingUtil.AssertIsValidPrefab(prefab);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6>(
|
||||
container,
|
||||
new PrefabProvider(prefab),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabResourceMethod(
|
||||
string resourcePath,
|
||||
#if !NET_4_6
|
||||
ModestTree.Util.
|
||||
#endif
|
||||
Action<DiContainer, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6> installerMethod)
|
||||
{
|
||||
BindingUtil.AssertIsValidResourcePath(resourcePath);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabMethod<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6>(
|
||||
container,
|
||||
new PrefabProviderResource(resourcePath),
|
||||
gameObjectInfo, installerMethod), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6bc525cf91bd29644ab941902ab4a8d2
|
||||
timeCreated: 1528529860
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+179
@@ -0,0 +1,179 @@
|
||||
using System;
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactorySubContainerBinderBase<TContract>
|
||||
{
|
||||
public FactorySubContainerBinderBase(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo, object subIdentifier)
|
||||
{
|
||||
FactoryBindInfo = factoryBindInfo;
|
||||
SubIdentifier = subIdentifier;
|
||||
BindInfo = bindInfo;
|
||||
BindContainer = bindContainer;
|
||||
|
||||
// Reset so we get errors if we end here
|
||||
factoryBindInfo.ProviderFunc = null;
|
||||
}
|
||||
|
||||
protected DiContainer BindContainer
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
protected FactoryBindInfo FactoryBindInfo
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
protected Func<DiContainer, IProvider> ProviderFunc
|
||||
{
|
||||
get { return FactoryBindInfo.ProviderFunc; }
|
||||
set { FactoryBindInfo.ProviderFunc = value; }
|
||||
}
|
||||
|
||||
protected BindInfo BindInfo
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
protected object SubIdentifier
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
protected Type ContractType
|
||||
{
|
||||
get { return typeof(TContract); }
|
||||
}
|
||||
|
||||
public ScopeConcreteIdArgConditionCopyNonLazyBinder ByInstaller<TInstaller>()
|
||||
where TInstaller : InstallerBase
|
||||
{
|
||||
return ByInstaller(typeof(TInstaller));
|
||||
}
|
||||
|
||||
public ScopeConcreteIdArgConditionCopyNonLazyBinder ByInstaller(Type installerType)
|
||||
{
|
||||
Assert.That(installerType.DerivesFrom<InstallerBase>(),
|
||||
"Invalid installer type given during bind command. Expected type '{0}' to derive from 'Installer<>'", installerType);
|
||||
|
||||
var subcontainerBindInfo = new SubContainerCreatorBindInfo();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByInstaller(
|
||||
container, subcontainerBindInfo, installerType, BindInfo.Arguments), false);
|
||||
|
||||
return new ScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo);
|
||||
}
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewGameObjectInstaller<TInstaller>()
|
||||
where TInstaller : InstallerBase
|
||||
{
|
||||
return ByNewGameObjectInstaller(typeof(TInstaller));
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewGameObjectInstaller(Type installerType)
|
||||
{
|
||||
Assert.That(installerType.DerivesFrom<InstallerBase>(),
|
||||
"Invalid installer type given during bind command. Expected type '{0}' to derive from 'Installer<>'", installerType);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewGameObjectInstaller(
|
||||
container, gameObjectInfo, installerType, BindInfo.Arguments), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabInstaller<TInstaller>(
|
||||
Func<InjectContext, UnityEngine.Object> prefabGetter)
|
||||
where TInstaller : InstallerBase
|
||||
{
|
||||
return ByNewPrefabInstaller(prefabGetter, typeof(TInstaller));
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabInstaller(
|
||||
Func<InjectContext, UnityEngine.Object> prefabGetter, Type installerType)
|
||||
{
|
||||
Assert.That(installerType.DerivesFrom<InstallerBase>(),
|
||||
"Invalid installer type given during bind command. Expected type '{0}' to derive from 'Installer<>'", installerType);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabInstaller(
|
||||
container,
|
||||
new PrefabProviderCustom(prefabGetter),
|
||||
gameObjectInfo, installerType, BindInfo.Arguments), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabInstaller<TInstaller>(
|
||||
UnityEngine.Object prefab)
|
||||
where TInstaller : InstallerBase
|
||||
{
|
||||
return ByNewPrefabInstaller(prefab, typeof(TInstaller));
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabInstaller(
|
||||
UnityEngine.Object prefab, Type installerType)
|
||||
{
|
||||
Assert.That(installerType.DerivesFrom<InstallerBase>(),
|
||||
"Invalid installer type given during bind command. Expected type '{0}' to derive from 'Installer<>'", installerType);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabInstaller(
|
||||
container,
|
||||
new PrefabProvider(prefab),
|
||||
gameObjectInfo, installerType, BindInfo.Arguments), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabResourceInstaller<TInstaller>(
|
||||
string resourcePath)
|
||||
where TInstaller : InstallerBase
|
||||
{
|
||||
return ByNewPrefabResourceInstaller(resourcePath, typeof(TInstaller));
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabResourceInstaller(
|
||||
string resourcePath, Type installerType)
|
||||
{
|
||||
BindingUtil.AssertIsValidResourcePath(resourcePath);
|
||||
Assert.That(installerType.DerivesFrom<InstallerBase>(),
|
||||
"Invalid installer type given during bind command. Expected type '{0}' to derive from 'Installer<>'", installerType);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabInstaller(
|
||||
container,
|
||||
new PrefabProviderResource(resourcePath),
|
||||
gameObjectInfo, installerType, BindInfo.Arguments), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 387c12fd770c48e49bcefe4c0723d511
|
||||
timeCreated: 1461708049
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactorySubContainerBinderWithParams<TContract> : FactorySubContainerBinderBase<TContract>
|
||||
{
|
||||
public FactorySubContainerBinderWithParams(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo, object subIdentifier)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo, subIdentifier)
|
||||
{
|
||||
}
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
|
||||
[System.Obsolete("ByNewPrefab has been renamed to ByNewContextPrefab to avoid confusion with ByNewPrefabInstaller and ByNewPrefabMethod")]
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefab(Type installerType, UnityEngine.Object prefab)
|
||||
{
|
||||
return ByNewContextPrefab(installerType, prefab);
|
||||
}
|
||||
|
||||
[System.Obsolete("ByNewPrefab has been renamed to ByNewContextPrefab to avoid confusion with ByNewPrefabInstaller and ByNewPrefabMethod")]
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefab<TInstaller>(UnityEngine.Object prefab)
|
||||
where TInstaller : IInstaller
|
||||
{
|
||||
return ByNewContextPrefab<TInstaller>(prefab);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewContextPrefab<TInstaller>(UnityEngine.Object prefab)
|
||||
where TInstaller : IInstaller
|
||||
{
|
||||
return ByNewContextPrefab(typeof(TInstaller), prefab);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewContextPrefab(Type installerType, UnityEngine.Object prefab)
|
||||
{
|
||||
BindingUtil.AssertIsValidPrefab(prefab);
|
||||
|
||||
Assert.That(installerType.DerivesFrom<MonoInstaller>(),
|
||||
"Invalid installer type given during bind command. Expected type '{0}' to derive from 'MonoInstaller'", installerType);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabWithParams(
|
||||
installerType,
|
||||
container,
|
||||
new PrefabProvider(prefab),
|
||||
gameObjectInfo), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
[System.Obsolete("ByNewPrefabResource has been renamed to ByNewContextPrefabResource to avoid confusion with ByNewPrefabResourceInstaller and ByNewPrefabResourceMethod")]
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabResource<TInstaller>(string resourcePath)
|
||||
where TInstaller : IInstaller
|
||||
{
|
||||
return ByNewContextPrefabResource<TInstaller>(resourcePath);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewPrefabResource(
|
||||
Type installerType, string resourcePath)
|
||||
{
|
||||
return ByNewContextPrefabResource(installerType, resourcePath);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewContextPrefabResource<TInstaller>(string resourcePath)
|
||||
where TInstaller : IInstaller
|
||||
{
|
||||
return ByNewContextPrefabResource(typeof(TInstaller), resourcePath);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder ByNewContextPrefabResource(
|
||||
Type installerType, string resourcePath)
|
||||
{
|
||||
BindingUtil.AssertIsValidResourcePath(resourcePath);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new SubContainerDependencyProvider(
|
||||
ContractType, SubIdentifier,
|
||||
new SubContainerCreatorByNewPrefabWithParams(
|
||||
installerType,
|
||||
container,
|
||||
new PrefabProviderResource(resourcePath),
|
||||
gameObjectInfo), false);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a002e9dce4e8af54d948529d6beda84b
|
||||
timeCreated: 1461708052
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 97d57d9da80f7414a8fed9f2a04621b8
|
||||
folderAsset: yes
|
||||
timeCreated: 1512304190
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryFromBinderUntyped : FactoryFromBinderBase
|
||||
{
|
||||
public FactoryFromBinderUntyped(
|
||||
DiContainer bindContainer, Type contractType, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, contractType, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
// TODO - add similar methods found in FactoryFromBinder<>
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ed1989ebc010d0746ab301cc5747f5c8
|
||||
timeCreated: 1512304191
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,297 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using ModestTree;
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
using UnityEngine;
|
||||
#endif
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryFromBinderBase : ScopeConcreteIdArgConditionCopyNonLazyBinder
|
||||
{
|
||||
public FactoryFromBinderBase(
|
||||
DiContainer bindContainer, Type contractType, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindInfo)
|
||||
{
|
||||
FactoryBindInfo = factoryBindInfo;
|
||||
BindContainer = bindContainer;
|
||||
ContractType = contractType;
|
||||
factoryBindInfo.ProviderFunc =
|
||||
(container) => new TransientProvider(
|
||||
ContractType, container, BindInfo.Arguments, BindInfo.ContextInfo, BindInfo.ConcreteIdentifier,
|
||||
BindInfo.InstantiatedCallback);
|
||||
}
|
||||
|
||||
// Don't use this
|
||||
internal DiContainer BindContainer
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
protected FactoryBindInfo FactoryBindInfo
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
// Don't use this
|
||||
internal Func<DiContainer, IProvider> ProviderFunc
|
||||
{
|
||||
get { return FactoryBindInfo.ProviderFunc; }
|
||||
set { FactoryBindInfo.ProviderFunc = value; }
|
||||
}
|
||||
|
||||
protected Type ContractType
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public IEnumerable<Type> AllParentTypes
|
||||
{
|
||||
get
|
||||
{
|
||||
yield return ContractType;
|
||||
|
||||
foreach (var type in BindInfo.ToTypes)
|
||||
{
|
||||
yield return type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Note that this isn't necessary to call since it's the default
|
||||
public ConditionCopyNonLazyBinder FromNew()
|
||||
{
|
||||
BindingUtil.AssertIsNotComponent(ContractType);
|
||||
BindingUtil.AssertIsNotAbstract(ContractType);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromResolve()
|
||||
{
|
||||
return FromResolve(null);
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromInstance(object instance)
|
||||
{
|
||||
BindingUtil.AssertInstanceDerivesFromOrEqual(instance, AllParentTypes);
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new InstanceProvider(ContractType, instance, container, null);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromResolve(object subIdentifier)
|
||||
{
|
||||
ProviderFunc =
|
||||
(container) => new ResolveProvider(
|
||||
ContractType, container,
|
||||
subIdentifier, false, InjectSources.Any, false);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// Don't use this
|
||||
internal ConcreteBinderGeneric<T> CreateIFactoryBinder<T>(out Guid factoryId)
|
||||
{
|
||||
// Use a random ID so that our provider is the only one that can find it and so it doesn't
|
||||
// conflict with anything else
|
||||
factoryId = Guid.NewGuid();
|
||||
|
||||
// Very important here that we use NoFlush otherwise the main binding will be finalized early
|
||||
return BindContainer.BindNoFlush<T>().WithId(factoryId);
|
||||
}
|
||||
|
||||
#if !NOT_UNITY3D
|
||||
|
||||
public ConditionCopyNonLazyBinder FromComponentOn(GameObject gameObject)
|
||||
{
|
||||
BindingUtil.AssertIsValidGameObject(gameObject);
|
||||
BindingUtil.AssertIsComponent(ContractType);
|
||||
BindingUtil.AssertIsNotAbstract(ContractType);
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new GetFromGameObjectComponentProvider(
|
||||
ContractType, gameObject, true);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromComponentOn(Func<InjectContext, GameObject> gameObjectGetter)
|
||||
{
|
||||
BindingUtil.AssertIsComponent(ContractType);
|
||||
BindingUtil.AssertIsNotAbstract(ContractType);
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new GetFromGameObjectGetterComponentProvider(
|
||||
ContractType, gameObjectGetter, true);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromComponentOnRoot()
|
||||
{
|
||||
return FromComponentOn(
|
||||
ctx => BindContainer.Resolve<Context>().gameObject);
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromNewComponentOn(GameObject gameObject)
|
||||
{
|
||||
BindingUtil.AssertIsValidGameObject(gameObject);
|
||||
BindingUtil.AssertIsComponent(ContractType);
|
||||
BindingUtil.AssertIsNotAbstract(ContractType);
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new AddToExistingGameObjectComponentProvider(
|
||||
gameObject, container, ContractType,
|
||||
new List<TypeValuePair>(), BindInfo.ConcreteIdentifier, BindInfo.InstantiatedCallback);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromNewComponentOn(
|
||||
Func<InjectContext, GameObject> gameObjectGetter)
|
||||
{
|
||||
BindingUtil.AssertIsComponent(ContractType);
|
||||
BindingUtil.AssertIsNotAbstract(ContractType);
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new AddToExistingGameObjectComponentProviderGetter(
|
||||
gameObjectGetter, container, ContractType,
|
||||
new List<TypeValuePair>(), BindInfo.ConcreteIdentifier, BindInfo.InstantiatedCallback);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder FromNewComponentOnNewGameObject()
|
||||
{
|
||||
BindingUtil.AssertIsComponent(ContractType);
|
||||
BindingUtil.AssertIsNotAbstract(ContractType);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new AddToNewGameObjectComponentProvider(
|
||||
container, ContractType,
|
||||
new List<TypeValuePair>(), gameObjectInfo, BindInfo.ConcreteIdentifier, BindInfo.InstantiatedCallback);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder FromNewComponentOnNewPrefab(UnityEngine.Object prefab)
|
||||
{
|
||||
BindingUtil.AssertIsValidPrefab(prefab);
|
||||
BindingUtil.AssertIsComponent(ContractType);
|
||||
BindingUtil.AssertIsNotAbstract(ContractType);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new InstantiateOnPrefabComponentProvider(
|
||||
ContractType,
|
||||
new PrefabInstantiator(
|
||||
container, gameObjectInfo,
|
||||
ContractType, new [] { ContractType }, new List<TypeValuePair>(),
|
||||
new PrefabProvider(prefab), BindInfo.InstantiatedCallback));
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder FromComponentInNewPrefab(UnityEngine.Object prefab)
|
||||
{
|
||||
BindingUtil.AssertIsValidPrefab(prefab);
|
||||
BindingUtil.AssertIsInterfaceOrComponent(ContractType);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new GetFromPrefabComponentProvider(
|
||||
ContractType,
|
||||
new PrefabInstantiator(
|
||||
container, gameObjectInfo,
|
||||
ContractType, new [] { ContractType }, new List<TypeValuePair>(),
|
||||
new PrefabProvider(prefab),
|
||||
BindInfo.InstantiatedCallback), true);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder FromComponentInNewPrefabResource(string resourcePath)
|
||||
{
|
||||
BindingUtil.AssertIsValidResourcePath(resourcePath);
|
||||
BindingUtil.AssertIsInterfaceOrComponent(ContractType);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new GetFromPrefabComponentProvider(
|
||||
ContractType,
|
||||
new PrefabInstantiator(
|
||||
container, gameObjectInfo,
|
||||
ContractType, new [] { ContractType }, new List<TypeValuePair>(),
|
||||
new PrefabProviderResource(resourcePath), BindInfo.InstantiatedCallback), true);
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder FromNewComponentOnNewPrefabResource(string resourcePath)
|
||||
{
|
||||
BindingUtil.AssertIsValidResourcePath(resourcePath);
|
||||
BindingUtil.AssertIsComponent(ContractType);
|
||||
BindingUtil.AssertIsNotAbstract(ContractType);
|
||||
|
||||
var gameObjectInfo = new GameObjectCreationParameters();
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new InstantiateOnPrefabComponentProvider(
|
||||
ContractType,
|
||||
new PrefabInstantiator(
|
||||
container, gameObjectInfo,
|
||||
ContractType, new [] { ContractType }, new List<TypeValuePair>(),
|
||||
new PrefabProviderResource(resourcePath),
|
||||
BindInfo.InstantiatedCallback));
|
||||
|
||||
return new NameTransformScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo, gameObjectInfo);
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromNewScriptableObjectResource(string resourcePath)
|
||||
{
|
||||
BindingUtil.AssertIsValidResourcePath(resourcePath);
|
||||
BindingUtil.AssertIsInterfaceOrScriptableObject(ContractType);
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new ScriptableObjectResourceProvider(
|
||||
resourcePath, ContractType, container, new List<TypeValuePair>(),
|
||||
true, null, BindInfo.InstantiatedCallback);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromScriptableObjectResource(string resourcePath)
|
||||
{
|
||||
BindingUtil.AssertIsValidResourcePath(resourcePath);
|
||||
BindingUtil.AssertIsInterfaceOrScriptableObject(ContractType);
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new ScriptableObjectResourceProvider(
|
||||
resourcePath, ContractType, container, new List<TypeValuePair>(),
|
||||
false, null, BindInfo.InstantiatedCallback);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public ConditionCopyNonLazyBinder FromResource(string resourcePath)
|
||||
{
|
||||
BindingUtil.AssertDerivesFromUnityObject(ContractType);
|
||||
|
||||
ProviderFunc =
|
||||
(container) => new ResourceProvider(resourcePath, ContractType, true);
|
||||
|
||||
return this;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1cdc9466c4b6c7f4f81675e8f546672f
|
||||
timeCreated: 1461708048
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e1f8d57baff273344a3f10da1e51b772
|
||||
folderAsset: yes
|
||||
timeCreated: 1461708047
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class DecoratorToChoiceFromBinder<TContract>
|
||||
{
|
||||
DiContainer _bindContainer;
|
||||
BindInfo _bindInfo;
|
||||
FactoryBindInfo _factoryBindInfo;
|
||||
|
||||
public DecoratorToChoiceFromBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
{
|
||||
_bindContainer = bindContainer;
|
||||
_bindInfo = bindInfo;
|
||||
_factoryBindInfo = factoryBindInfo;
|
||||
}
|
||||
|
||||
public FactoryFromBinder<TContract, TConcrete> With<TConcrete>()
|
||||
where TConcrete : TContract
|
||||
{
|
||||
_bindInfo.ToChoice = ToChoices.Concrete;
|
||||
_bindInfo.ToTypes.Clear();
|
||||
_bindInfo.ToTypes.Add(typeof(TConcrete));
|
||||
|
||||
return new FactoryFromBinder<TContract, TConcrete>(
|
||||
_bindContainer, _bindInfo, _factoryBindInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e70f91cb77703ce42ae6ad721b89d35c
|
||||
timeCreated: 1528372067
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryToChoiceBinder<TContract> : FactoryFromBinder<TContract>
|
||||
{
|
||||
public FactoryToChoiceBinder(
|
||||
DiContainer container, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(container, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
// Note that this is the default, so not necessary to call
|
||||
public FactoryFromBinder<TContract> ToSelf()
|
||||
{
|
||||
Assert.IsEqual(BindInfo.ToChoice, ToChoices.Self);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryFromBinderUntyped To(Type concreteType)
|
||||
{
|
||||
BindInfo.ToChoice = ToChoices.Concrete;
|
||||
BindInfo.ToTypes.Clear();
|
||||
BindInfo.ToTypes.Add(concreteType);
|
||||
|
||||
return new FactoryFromBinderUntyped(
|
||||
BindContainer, concreteType, BindInfo, FactoryBindInfo);
|
||||
}
|
||||
|
||||
public FactoryFromBinder<TConcrete> To<TConcrete>()
|
||||
where TConcrete : TContract
|
||||
{
|
||||
BindInfo.ToChoice = ToChoices.Concrete;
|
||||
BindInfo.ToTypes.Clear();
|
||||
BindInfo.ToTypes.Add(typeof(TConcrete));
|
||||
|
||||
return new FactoryFromBinder<TConcrete>(BindContainer, BindInfo, FactoryBindInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 98bc5c26f28a00544afe116adee67cc2
|
||||
timeCreated: 1461708052
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryToChoiceBinder<TParam1, TContract> : FactoryFromBinder<TParam1, TContract>
|
||||
{
|
||||
public FactoryToChoiceBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
// Note that this is the default, so not necessary to call
|
||||
public FactoryFromBinder<TParam1, TContract> ToSelf()
|
||||
{
|
||||
Assert.IsEqual(BindInfo.ToChoice, ToChoices.Self);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryFromBinder<TParam1, TConcrete> To<TConcrete>()
|
||||
where TConcrete : TContract
|
||||
{
|
||||
BindInfo.ToChoice = ToChoices.Concrete;
|
||||
BindInfo.ToTypes.Clear();
|
||||
BindInfo.ToTypes.Add(typeof(TConcrete));
|
||||
|
||||
return new FactoryFromBinder<TParam1, TConcrete>(BindContainer, BindInfo, FactoryBindInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 388c17c735861d145903203b31cb190d
|
||||
timeCreated: 1461708049
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract>
|
||||
: FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract>
|
||||
{
|
||||
public FactoryToChoiceBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
// Note that this is the default, so not necessary to call
|
||||
public FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract> ToSelf()
|
||||
{
|
||||
Assert.IsEqual(BindInfo.ToChoice, ToChoices.Self);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TConcrete> To<TConcrete>()
|
||||
where TConcrete : TContract
|
||||
{
|
||||
BindInfo.ToChoice = ToChoices.Concrete;
|
||||
BindInfo.ToTypes.Clear();
|
||||
BindInfo.ToTypes.Add(typeof(TConcrete));
|
||||
|
||||
return new FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TConcrete>(BindContainer, BindInfo, FactoryBindInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4cdcd151f6d139642b7a2a6968c6ebd8
|
||||
timeCreated: 1507270779
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryToChoiceBinder<TParam1, TParam2, TContract> : FactoryFromBinder<TParam1, TParam2, TContract>
|
||||
{
|
||||
public FactoryToChoiceBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
// Note that this is the default, so not necessary to call
|
||||
public FactoryFromBinder<TParam1, TParam2, TContract> ToSelf()
|
||||
{
|
||||
Assert.IsEqual(BindInfo.ToChoice, ToChoices.Self);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryFromBinder<TParam1, TParam2, TConcrete> To<TConcrete>()
|
||||
where TConcrete : TContract
|
||||
{
|
||||
BindInfo.ToChoice = ToChoices.Concrete;
|
||||
BindInfo.ToTypes.Clear();
|
||||
BindInfo.ToTypes.Add(typeof(TConcrete));
|
||||
|
||||
return new FactoryFromBinder<TParam1, TParam2, TConcrete>(BindContainer, BindInfo, FactoryBindInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 59c18bddf62adaf46b1de0564bf02388
|
||||
timeCreated: 1461708050
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryToChoiceBinder<TParam1, TParam2, TParam3, TContract> : FactoryFromBinder<TParam1, TParam2, TParam3, TContract>
|
||||
{
|
||||
public FactoryToChoiceBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
// Note that this is the default, so not necessary to call
|
||||
public FactoryFromBinder<TParam1, TParam2, TParam3, TContract> ToSelf()
|
||||
{
|
||||
Assert.IsEqual(BindInfo.ToChoice, ToChoices.Self);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryFromBinder<TParam1, TParam2, TParam3, TConcrete> To<TConcrete>()
|
||||
where TConcrete : TContract
|
||||
{
|
||||
BindInfo.ToChoice = ToChoices.Concrete;
|
||||
BindInfo.ToTypes.Clear();
|
||||
BindInfo.ToTypes.Add(typeof(TConcrete));
|
||||
|
||||
return new FactoryFromBinder<TParam1, TParam2, TParam3, TConcrete>(BindContainer, BindInfo, FactoryBindInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a71cc77bd306cca459126294c63080b1
|
||||
timeCreated: 1461708052
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TContract> : FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TContract>
|
||||
{
|
||||
public FactoryToChoiceBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
// Note that this is the default, so not necessary to call
|
||||
public FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TContract> ToSelf()
|
||||
{
|
||||
Assert.IsEqual(BindInfo.ToChoice, ToChoices.Self);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TConcrete> To<TConcrete>()
|
||||
where TConcrete : TContract
|
||||
{
|
||||
BindInfo.ToChoice = ToChoices.Concrete;
|
||||
BindInfo.ToTypes.Clear();
|
||||
BindInfo.ToTypes.Add(typeof(TConcrete));
|
||||
|
||||
return new FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TConcrete>(BindContainer, BindInfo, FactoryBindInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fee2c810a2ee8d2489a6a29177b48d82
|
||||
timeCreated: 1461708055
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract>
|
||||
: FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract>
|
||||
{
|
||||
public FactoryToChoiceBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
// Note that this is the default, so not necessary to call
|
||||
public FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract> ToSelf()
|
||||
{
|
||||
Assert.IsEqual(BindInfo.ToChoice, ToChoices.Self);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TConcrete> To<TConcrete>()
|
||||
where TConcrete : TContract
|
||||
{
|
||||
BindInfo.ToChoice = ToChoices.Concrete;
|
||||
BindInfo.ToTypes.Clear();
|
||||
BindInfo.ToTypes.Add(typeof(TConcrete));
|
||||
|
||||
return new FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TConcrete>(BindContainer, BindInfo, FactoryBindInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dc472af8f2bc5bf498b8e85704193aac
|
||||
timeCreated: 1461708054
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>
|
||||
: FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>
|
||||
{
|
||||
public FactoryToChoiceBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
// Note that this is the default, so not necessary to call
|
||||
public FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> ToSelf()
|
||||
{
|
||||
Assert.IsEqual(BindInfo.ToChoice, ToChoices.Self);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TConcrete> To<TConcrete>()
|
||||
where TConcrete : TContract
|
||||
{
|
||||
BindInfo.ToChoice = ToChoices.Concrete;
|
||||
BindInfo.ToTypes.Clear();
|
||||
BindInfo.ToTypes.Add(typeof(TConcrete));
|
||||
|
||||
return new FactoryFromBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TConcrete>(BindContainer, BindInfo, FactoryBindInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c738f3e9159a7e4f8450de246530f96
|
||||
timeCreated: 1528529860
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ad3cf76cc0b1c154e868ae8b570a78b8
|
||||
folderAsset: yes
|
||||
timeCreated: 1484511595
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryToChoiceIdBinder<TContract> : FactoryArgumentsToChoiceBinder<TContract>
|
||||
{
|
||||
public FactoryToChoiceIdBinder(
|
||||
DiContainer container, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(container, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public FactoryArgumentsToChoiceBinder<TContract> WithId(object identifier)
|
||||
{
|
||||
BindInfo.Identifier = identifier;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dca817e151a0eac4480344dcf838b949
|
||||
timeCreated: 1484511596
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryToChoiceIdBinder<TParam1, TContract> : FactoryArgumentsToChoiceBinder<TParam1, TContract>
|
||||
{
|
||||
public FactoryToChoiceIdBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public FactoryArgumentsToChoiceBinder<TParam1, TContract> WithId(object identifier)
|
||||
{
|
||||
BindInfo.Identifier = identifier;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a005e8d2a91ae2647927c047c663d046
|
||||
timeCreated: 1484511596
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryToChoiceIdBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract>
|
||||
: FactoryArgumentsToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract>
|
||||
{
|
||||
public FactoryToChoiceIdBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public FactoryArgumentsToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TContract> WithId(object identifier)
|
||||
{
|
||||
BindInfo.Identifier = identifier;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e0b2700788fac54698446fcfad2b705
|
||||
timeCreated: 1507270779
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryToChoiceIdBinder<TParam1, TParam2, TContract> : FactoryArgumentsToChoiceBinder<TParam1, TParam2, TContract>
|
||||
{
|
||||
public FactoryToChoiceIdBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public FactoryArgumentsToChoiceBinder<TParam1, TParam2, TContract> WithId(object identifier)
|
||||
{
|
||||
BindInfo.Identifier = identifier;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c109e2a5fd72a004e83beae958fa888a
|
||||
timeCreated: 1484511596
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryToChoiceIdBinder<TParam1, TParam2, TParam3, TContract> : FactoryArgumentsToChoiceBinder<TParam1, TParam2, TParam3, TContract>
|
||||
{
|
||||
public FactoryToChoiceIdBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public FactoryArgumentsToChoiceBinder<TParam1, TParam2, TParam3, TContract> WithId(object identifier)
|
||||
{
|
||||
BindInfo.Identifier = identifier;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: be02341a689ce654ab7160ce4eb5ed0e
|
||||
timeCreated: 1484511596
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryToChoiceIdBinder<TParam1, TParam2, TParam3, TParam4, TContract> : FactoryArgumentsToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TContract>
|
||||
{
|
||||
public FactoryToChoiceIdBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public FactoryArgumentsToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TContract> WithId(object identifier)
|
||||
{
|
||||
BindInfo.Identifier = identifier;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e65744c901e080744aada3988bfdf11c
|
||||
timeCreated: 1484511596
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryToChoiceIdBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract>
|
||||
: FactoryArgumentsToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract>
|
||||
{
|
||||
public FactoryToChoiceIdBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public FactoryArgumentsToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TContract> WithId(object identifier)
|
||||
{
|
||||
BindInfo.Identifier = identifier;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 20b01a4cfa147764a9e52134e2a32bb4
|
||||
timeCreated: 1484511595
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class FactoryToChoiceIdBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>
|
||||
: FactoryArgumentsToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract>
|
||||
{
|
||||
public FactoryToChoiceIdBinder(
|
||||
DiContainer bindContainer, BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindContainer, bindInfo, factoryBindInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public FactoryArgumentsToChoiceBinder<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TContract> WithId(object identifier)
|
||||
{
|
||||
BindInfo.Identifier = identifier;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b60ae0cff4748ec43b6cb040b0f3a728
|
||||
timeCreated: 1528529860
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
using System.Linq;
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class PlaceholderFactoryBindingFinalizer<TContract> : ProviderBindingFinalizer
|
||||
{
|
||||
readonly FactoryBindInfo _factoryBindInfo;
|
||||
|
||||
public PlaceholderFactoryBindingFinalizer(
|
||||
BindInfo bindInfo, FactoryBindInfo factoryBindInfo)
|
||||
: base(bindInfo)
|
||||
{
|
||||
// Note that it doesn't derive from PlaceholderFactory<TContract>
|
||||
// when used with To<>, so we can only check IPlaceholderFactory
|
||||
Assert.That(factoryBindInfo.FactoryType.DerivesFrom<IPlaceholderFactory>());
|
||||
|
||||
_factoryBindInfo = factoryBindInfo;
|
||||
}
|
||||
|
||||
protected override void OnFinalizeBinding(DiContainer container)
|
||||
{
|
||||
var provider = _factoryBindInfo.ProviderFunc(container);
|
||||
|
||||
var transientProvider = new TransientProvider(
|
||||
_factoryBindInfo.FactoryType,
|
||||
container,
|
||||
_factoryBindInfo.Arguments.Concat(
|
||||
InjectUtil.CreateArgListExplicit(
|
||||
provider,
|
||||
new InjectContext(container, typeof(TContract)))).ToList(),
|
||||
BindInfo.ContextInfo, BindInfo.ConcreteIdentifier, null);
|
||||
|
||||
IProvider mainProvider;
|
||||
|
||||
if (BindInfo.Scope == ScopeTypes.Unset || BindInfo.Scope == ScopeTypes.Singleton)
|
||||
{
|
||||
mainProvider = BindingUtil.CreateCachedProvider(transientProvider);
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert.IsEqual(BindInfo.Scope, ScopeTypes.Transient);
|
||||
mainProvider = transientProvider;
|
||||
}
|
||||
|
||||
RegisterProviderForAllContracts(container, mainProvider);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2a3880a3063c56747b32995b66a8a1ca
|
||||
timeCreated: 1486691381
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a019116e68c18f342995df14d6fbcf87
|
||||
folderAsset: yes
|
||||
timeCreated: 1484511595
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
using System.Linq;
|
||||
using ModestTree;
|
||||
|
||||
namespace Zenject
|
||||
{
|
||||
[NoReflectionBaking]
|
||||
public class MemoryPoolBindingFinalizer<TContract> : ProviderBindingFinalizer
|
||||
{
|
||||
readonly MemoryPoolBindInfo _poolBindInfo;
|
||||
readonly FactoryBindInfo _factoryBindInfo;
|
||||
|
||||
public MemoryPoolBindingFinalizer(
|
||||
BindInfo bindInfo, FactoryBindInfo factoryBindInfo, MemoryPoolBindInfo poolBindInfo)
|
||||
: base(bindInfo)
|
||||
{
|
||||
// Note that it doesn't derive from MemoryPool<TContract>
|
||||
// when used with To<>, so we can only check IMemoryPoolBase
|
||||
Assert.That(factoryBindInfo.FactoryType.DerivesFrom<IMemoryPool>());
|
||||
|
||||
_factoryBindInfo = factoryBindInfo;
|
||||
_poolBindInfo = poolBindInfo;
|
||||
}
|
||||
|
||||
protected override void OnFinalizeBinding(DiContainer container)
|
||||
{
|
||||
var factory = new FactoryProviderWrapper<TContract>(
|
||||
_factoryBindInfo.ProviderFunc(container), new InjectContext(container, typeof(TContract)));
|
||||
|
||||
var settings = new MemoryPoolSettings(
|
||||
_poolBindInfo.InitialSize, _poolBindInfo.MaxSize, _poolBindInfo.ExpandMethod);
|
||||
|
||||
var transientProvider = new TransientProvider(
|
||||
_factoryBindInfo.FactoryType,
|
||||
container,
|
||||
_factoryBindInfo.Arguments.Concat(
|
||||
InjectUtil.CreateArgListExplicit(factory, settings)).ToList(),
|
||||
BindInfo.ContextInfo, BindInfo.ConcreteIdentifier, null);
|
||||
|
||||
IProvider mainProvider;
|
||||
|
||||
if (BindInfo.Scope == ScopeTypes.Unset || BindInfo.Scope == ScopeTypes.Singleton)
|
||||
{
|
||||
mainProvider = BindingUtil.CreateCachedProvider(transientProvider);
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert.IsEqual(BindInfo.Scope, ScopeTypes.Transient);
|
||||
mainProvider = transientProvider;
|
||||
}
|
||||
|
||||
RegisterProviderForAllContracts(container, mainProvider);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user