本文整理汇总了C#中IActivator类的典型用法代码示例。如果您正苦于以下问题:C# IActivator类的具体用法?C# IActivator怎么用?C# IActivator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IActivator类属于命名空间,在下文中一共展示了IActivator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Bootstrapper
public Bootstrapper(IAssemblyLoader assemblyLoader, IModuleLoader moduleLoader, IActivator activator, IModuleImporter moduleImporter)
{
this.assemblyLoader = assemblyLoader;
this.moduleLoader = moduleLoader;
this.activator = activator;
this.moduleImporter = moduleImporter;
}
开发者ID:the-dargon-project,项目名称:ryu,代码行数:7,代码来源:Bootstrapper.cs
示例2: RyuContainer
public RyuContainer(
RyuContainer parent,
IActivator activator
)
: this(parent, activator, new ConcurrentDictionary<Type, RyuType>())
{
}
开发者ID:the-dargon-project,项目名称:ryu,代码行数:7,代码来源:RyuContainer.cs
示例3: Create
// single layer network
public static NeuralNetwork<Vector> Create(IDataSet<Vector, Vector> dataSet, IActivator activator)
{
var workLayer = new FullyConnectedLayer(dataSet.FirstInput.Size, dataSet.FirstOutput.Size, activator);
var outputLayer = new OutputLayer<Vector>();
var layers = new CompositeLayer<Vector, Vector, Vector>(workLayer, outputLayer);
return new NeuralNetwork<Vector>(layers);
}
开发者ID:pxqr,项目名称:nanon,代码行数:8,代码来源:NetworkBuilder.cs
示例4: AppDomainLevelActivator
internal AppDomainLevelActivator(SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
this.m_NextActivator = (IActivator) info.GetValue("m_NextActivator", typeof(IActivator));
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:AppDomainLevelActivator.cs
示例5: DynamicProxyActivator
public DynamicProxyActivator(IMachineContainer container, IProxyBuilder proxyBuilder, IActivator target, ServiceEntry entry)
{
_container = container;
_entry = entry;
_proxyBuilder = proxyBuilder;
_target = target;
_proxyGenerator = new ProxyGenerator(_proxyBuilder);
}
开发者ID:benlovell,项目名称:machine,代码行数:8,代码来源:DynamicProxyActivator.cs
示例6: Bind
public virtual void Bind(IActivator activator)
{
if (_activator != null && activator != null && _activator != activator)
{
throw new InvalidOperationException();
}
_activator = activator;
}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:8,代码来源:TPFieldIndexConsistencyTestCaseBase.cs
示例7: BottleService
public BottleService(IActivator activator, IPackageLog log)
{
_activator = activator;
_log = log;
if(!IsBottleService(activator))
{
throw new ArgumentException("Activator must also implement {0}".ToFormat(typeof(IDeactivator).Name), "activator");
}
}
开发者ID:DarthFubuMVC,项目名称:bottles,代码行数:10,代码来源:BottleService.cs
示例8: SubstituteTypeExpressionVisitor
/// <summary>
/// Initializes a new instance of the <see cref="SubstituteTypeExpressionVisitor"/> class.
/// </summary>
/// <param name="activator">The activator.</param>
public SubstituteTypeExpressionVisitor(IActivator activator)
: this(
activator,
new ISubstituteTypeConstantHandler[]
{
new ListSubstituteTypeConstantHandler(),
new EnumerableQuerySubstituteTypeConstantHandler(),
new DataContextQueryableSubstituteTypeConstantHandler(),
})
{
}
开发者ID:raimu,项目名称:kephas,代码行数:15,代码来源:SubstituteTypeExpressionVisitor.cs
示例9: Init
/// <inheritdoc/>
public virtual void Init(IActivator activator, IKernel kernel, IComponentInfo info, Action<IComponentInfo, object> onDestroying, Action<IComponentContext> onFetch)
{
Guard.NotNull(activator, "activator");
Guard.NotNull(kernel, "kernel");
Guard.NotNull(info, "info");
this.Activator = activator;
this.Kernel = kernel;
this.Info = info;
OnDestroying = onDestroying;
OnFetch = onFetch;
}
开发者ID:netcasewqs,项目名称:nlite,代码行数:12,代码来源:LifestyleManagerAdapter.cs
示例10: Bind
public void Bind(IActivator activator)
{
if (_activator == activator)
{
return;
}
if (activator != null && null != _activator)
{
throw new System.InvalidOperationException();
}
_activator = activator;
}
开发者ID:superyfwy,项目名称:db4o,代码行数:12,代码来源:Pilot.cs
示例11: Bind
public void Bind(IActivator activator)
{
if (this.activator == activator)
{
return;
}
if (activator != null && null != this.activator)
{
throw new InvalidOperationException("Object can only be bound to one activator");
}
this.activator = activator;
}
开发者ID:Galigator,项目名称:db4o,代码行数:12,代码来源:CollectionsExample.cs
示例12: Bind
public virtual void Bind(IActivator activator)
{
if (this._activator == activator)
{
return;
}
if (activator != null && this._activator != null)
{
throw new InvalidOperationException();
}
this._activator = activator;
}
开发者ID:erdincay,项目名称:db4o,代码行数:12,代码来源:ActivatorIsNotStoredTestCase.cs
示例13: Bind
public virtual void Bind(IActivator activator)
{
if (_activator == activator)
{
return;
}
if (_activator != null && activator != null)
{
throw new Exception();
}
_activator = activator;
}
开发者ID:Galigator,项目名称:db4o,代码行数:12,代码来源:OrderByWithComparableTestCase.cs
示例14: AddActivator
public void AddActivator(ServiceEntry entry, IActivator activator)
{
using (RWLock.AsWriter(_lock))
{
if (_cache.ContainsKey(entry))
{
throw new ServiceContainerException("Multiple activators for one entry!");
}
_log.Info("Adding: " + entry + " " + activator);
_cache[entry] = activator;
}
}
开发者ID:abombss,项目名称:machine,代码行数:12,代码来源:ActivatorStore.cs
示例15: DecryptElement
public static XElement DecryptElement(this XElement element, IActivator activator)
{
// If no decryption necessary, return original element.
if (!DoesElementOrDescendentRequireDecryption(element))
{
return element;
}
// Deep copy the element (since we're going to mutate) and put
// it into a document to guarantee it has a parent.
var doc = new XDocument(new XElement(element));
// We remove elements from the document as we decrypt them and perform
// fix-up later. This keeps us from going into an infinite loop in
// the case of a null decryptor (which returns its original input which
// is still marked as 'requires decryption').
var placeholderReplacements = new Dictionary<XElement, XElement>();
while (true)
{
var elementWhichRequiresDecryption = doc.Descendants(XmlConstants.EncryptedSecretElementName).FirstOrDefault();
if (elementWhichRequiresDecryption == null)
{
// All encryption is finished.
break;
}
// Decrypt the clone so that the decryptor doesn't inadvertently modify
// the original document or other data structures. The element we pass to
// the decryptor should be the child of the 'encryptedSecret' element.
var clonedElementWhichRequiresDecryption = new XElement(elementWhichRequiresDecryption);
var innerDoc = new XDocument(clonedElementWhichRequiresDecryption);
string decryptorTypeName = (string)clonedElementWhichRequiresDecryption.Attribute(XmlConstants.DecryptorTypeAttributeName);
var decryptorInstance = activator.CreateInstance<IXmlDecryptor>(decryptorTypeName);
var decryptedElement = decryptorInstance.Decrypt(clonedElementWhichRequiresDecryption.Elements().Single());
// Put a placeholder into the original document so that we can continue our
// search for elements which need to be decrypted.
var newPlaceholder = new XElement("placeholder");
placeholderReplacements[newPlaceholder] = decryptedElement;
elementWhichRequiresDecryption.ReplaceWith(newPlaceholder);
}
// Finally, perform fixup.
Debug.Assert(placeholderReplacements.Count > 0);
foreach (var entry in placeholderReplacements)
{
entry.Key.ReplaceWith(entry.Value);
}
return doc.Root;
}
开发者ID:hishamco,项目名称:DataProtection,代码行数:51,代码来源:XmlEncryptionExtensions.cs
示例16: Bind
public void Bind(IActivator activator)
{
if (activator == _activator)
{
return;
}
if (activator != null && _activator != null)
{
throw new InvalidOperationException();
}
_activator = activator;
}
开发者ID:Galigator,项目名称:db4o,代码行数:14,代码来源:ActivatableElement.cs
示例17: FillSpecialHeader
internal override bool FillSpecialHeader(string key, object value)
{
if (key != null)
{
if (!key.Equals("__ActivationType"))
{
if (!key.Equals("__ContextProperties"))
{
if (!key.Equals("__CallSiteActivationAttributes"))
{
if (!key.Equals("__Activator"))
{
if (!key.Equals("__ActivationTypeName"))
{
return base.FillSpecialHeader(key, value);
}
this._activationTypeName = (string) value;
}
else
{
this._activator = (IActivator) value;
}
}
else
{
this._callSiteActivationAttributes = (object[]) value;
}
}
else
{
this._contextProperties = (IList) value;
}
}
else
{
this._activationType = null;
}
}
return true;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:40,代码来源:ConstructionCall.cs
示例18: Bind
public void Bind(IActivator activator)
{
}
开发者ID:masroore,项目名称:db4o,代码行数:3,代码来源:ActivatedPropertyQueryTestCase.cs
示例19: Activator
public void Activator(IActivator activator)
{
addConfigurableAction(g => g.AddActivator(activator));
}
开发者ID:rytutis,项目名称:bottles,代码行数:4,代码来源:PackageFacility.cs
示例20: ResolvedServiceEntry
public ResolvedServiceEntry(ServiceEntry entry, IActivator activator, IObjectInstances objectInstances)
{
_entry = entry;
_objectInstances = objectInstances;
_activator = activator;
}
开发者ID:benlovell,项目名称:machine,代码行数:6,代码来源:ResolvedServiceEntry.cs
注:本文中的IActivator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论