本文整理汇总了C#中IResolver类的典型用法代码示例。如果您正苦于以下问题:C# IResolver类的具体用法?C# IResolver怎么用?C# IResolver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IResolver类属于命名空间,在下文中一共展示了IResolver类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetInstance
public override object GetInstance(IInstanceFactory factory, IResolver resolver)
{
if (!_threadLocalInstance.IsValueCreated)
_threadLocalInstance.Value = factory.CreateInstance(resolver);
return _threadLocalInstance.Value;
}
开发者ID:thanhvc,项目名称:DynamoIOC,代码行数:7,代码来源:ThreadLocalLifetime.cs
示例2: ModelMetadataProviders
internal ModelMetadataProviders(IResolver<ModelMetadataProvider> resolver = null)
{
_resolver = resolver ?? new SingleServiceResolver<ModelMetadataProvider>(
() => _currentProvider,
new CachedDataAnnotationsModelMetadataProvider(),
"ModelMetadataProviders.Current");
}
开发者ID:haoduotnt,项目名称:aspnetwebstack,代码行数:7,代码来源:ModelMetadataProviders.cs
示例3: DefaultControllerFactory
internal DefaultControllerFactory(IControllerActivator controllerActivator, IResolver<IControllerActivator> activatorResolver, IDependencyResolver dependencyResolver)
{
if (controllerActivator != null)
this._controllerActivator = controllerActivator;
else
this._activatorResolver = activatorResolver ?? (IResolver<IControllerActivator>) new SingleServiceResolver<IControllerActivator>((Func<IControllerActivator>) (() => (IControllerActivator) null), (IControllerActivator) new DefaultControllerFactory.DefaultControllerActivator(dependencyResolver), "DefaultControllerFactory constructor");
}
开发者ID:Rookian,项目名称:Jericho,代码行数:7,代码来源:DefaultControllerFactory.cs
示例4: IndicatorUpdateCoordinator
public IndicatorUpdateCoordinator(ILog log, Repository<IIndicatorConfiguration> indicatorConfigurationRepository, Repository<IIndicatorState> indicatorStateRepository, IResolver resolver)
{
_log = log;
_indicatorConfigurationRepository = indicatorConfigurationRepository;
_indicatorStateRepository = indicatorStateRepository;
_resolver = resolver;
}
开发者ID:MatteS75,项目名称:Qupla,代码行数:7,代码来源:IndicatorUpdateCoordinator.cs
示例5: ControllerBuilder
internal ControllerBuilder(IResolver<IControllerFactory> serviceResolver) {
_serviceResolver = serviceResolver ?? new SingleServiceResolver<IControllerFactory>(
() => _factoryThunk(),
new DefaultControllerFactory { ControllerBuilder = this },
"ControllerBuilder.GetControllerFactory"
);
}
开发者ID:adrianvallejo,项目名称:MVC3_Source,代码行数:7,代码来源:ControllerBuilder.cs
示例6: DispatchToEventSubscribers
public DispatchToEventSubscribers(
ILog log,
IResolver resolver)
{
_log = log;
_resolver = resolver;
}
开发者ID:joaomajesus,项目名称:EventFlow,代码行数:7,代码来源:DispatchToEventSubscribers.cs
示例7: CSSAssetsFileHasher
public CSSAssetsFileHasher(string hashQueryStringKeyName, IResolver fileResolver, IHasher hasher, IPathTranslator pathTranslator)
{
HashQueryStringKeyName = hashQueryStringKeyName;
FileSystemResolver = fileResolver;
Hasher = hasher;
this.pathTranslator = pathTranslator;
}
开发者ID:Worthaboutapig,项目名称:SquishIt,代码行数:7,代码来源:CSSAssetsFileHasher.cs
示例8: ExecuteAsync
public async Task ExecuteAsync(IResolver resolver, CancellationToken cancellationToken)
{
var queryProcessor = resolver.Resolve<IQueryProcessor>();
var updateItineraryService = resolver.Resolve<IUpdateItineraryService>();
var commandBus = resolver.Resolve<ICommandBus>();
var routingService = resolver.Resolve<IRoutingService>();
var cargo = (await queryProcessor.ProcessAsync(new GetCargosQuery(CargoId), cancellationToken).ConfigureAwait(false)).Single();
var updatedItinerary = await updateItineraryService.UpdateItineraryAsync(cargo.Itinerary, cancellationToken).ConfigureAwait(false);
if (cargo.Route.Specification().IsSatisfiedBy(updatedItinerary))
{
await commandBus.PublishAsync(new CargoSetItineraryCommand(cargo.Id, updatedItinerary), cancellationToken).ConfigureAwait(false);
return;
}
var newItineraries = await routingService.CalculateItinerariesAsync(cargo.Route, cancellationToken).ConfigureAwait(false);
var newItinerary = newItineraries.FirstOrDefault();
if (newItinerary == null)
{
// TODO: Tell domain that a new itinerary could not be found
throw DomainError.With("Could not find itinerary");
}
await commandBus.PublishAsync(new CargoSetItineraryCommand(cargo.Id, newItinerary), cancellationToken).ConfigureAwait(false);
}
开发者ID:joaomajesus,项目名称:EventFlow,代码行数:27,代码来源:VerifyCargoItineraryJob.cs
示例9: SelectDatabaseStep
///<summary>
/// Initializes a new instance of <see cref="SelectDatabaseStep"/>.
///</summary>
///<param name="serviceProvider">The service provider to use for service location.</param>
///<param name="sourceModel">The <see cref="ConfigurationSourceModel"/> to update on <see cref="WizardStep.Execute"/></param>
///<param name="validatorFactory">The factory creating new <see cref="Validator"/> instances.</param>
///<param name="elementLookup">The service for locating registered elements.</param>
public SelectDatabaseStep(IServiceProvider serviceProvider,
ConfigurationSourceModel sourceModel,
IResolver<Validator> validatorFactory,
ElementLookup elementLookup
)
: base(serviceProvider, validatorFactory, elementLookup)
{
this.sourceModel = sourceModel;
var name = AddReflectedProperty(wizardData, propertyName);
PropertyList.Add(new AssociatedWizardProperty(serviceProvider,
wizardData,
TypeDescriptor.GetProperties(wizardData)[propertyConnectionString],
validatorFactory,
elementLookup,
name));
PropertyList.Add(new AssociatedWizardProperty(serviceProvider,
wizardData,
TypeDescriptor.GetProperties(wizardData)[propertyProviderName],
validatorFactory,
elementLookup,
name));
SetDefaultDatabase(elementLookup);
}
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:35,代码来源:SelectDatabaseStep.cs
示例10: ServiceProviderAdapter
public ServiceProviderAdapter(IResolver resolver)
{
if (resolver == null)
throw new ArgumentNullException("resolver");
_resolver = resolver;
}
开发者ID:Kingefosa,项目名称:Dynamo.IoC,代码行数:7,代码来源:ServiceProviderAdapter.cs
示例11: BuildManagerViewEngine
internal BuildManagerViewEngine(IViewPageActivator viewPageActivator, IResolver<IViewPageActivator> activatorResolver,
IDependencyResolver dependencyResolver, VirtualPathProvider pathProvider)
{
if (viewPageActivator != null)
{
_viewPageActivator = viewPageActivator;
}
else
{
_activatorResolver = activatorResolver ?? new SingleServiceResolver<IViewPageActivator>(
() => null,
new DefaultViewPageActivator(dependencyResolver),
"BuildManagerViewEngine constructor");
}
if (pathProvider != null)
{
Func<VirtualPathProvider> providerFunc = () => pathProvider;
_fileExistsCache = new FileExistenceCache(providerFunc);
VirtualPathProviderFunc = providerFunc;
}
else
{
if (_sharedFileExistsCache == null)
{
// Startup initialization race is OK providing service remains read-only
_sharedFileExistsCache = new FileExistenceCache(() => HostingEnvironment.VirtualPathProvider);
}
_fileExistsCache = _sharedFileExistsCache;
}
}
开发者ID:tlycken,项目名称:aspnetwebstack,代码行数:32,代码来源:BuildManagerViewEngine.cs
示例12: CreateStartInfo
private ProcessStartInfo CreateStartInfo(Benchmark benchmark, string exeName, string args, string workingDirectory, IResolver resolver)
{
var start = new ProcessStartInfo
{
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true,
CreateNoWindow = true,
WorkingDirectory = workingDirectory
};
var runtime = benchmark.Job.Env.HasValue(EnvMode.RuntimeCharacteristic)
? benchmark.Job.Env.Runtime
: RuntimeInformation.GetCurrentRuntime();
// TODO: use resolver
switch (runtime)
{
case Runtime.Clr:
case Runtime.Core:
start.FileName = exeName;
start.Arguments = args;
break;
case Runtime.Mono:
start.FileName = "mono";
start.Arguments = GetMonoArguments(benchmark.Job, exeName, args, resolver);
break;
default:
throw new NotSupportedException("Runtime = " + runtime);
}
return start;
}
开发者ID:alexandrnikitin,项目名称:BenchmarkDotNet,代码行数:30,代码来源:Executor.cs
示例13: TryGetConstructor
public bool TryGetConstructor(Type type, IResolver resolver, out ConstructorInfo constructor)
{
if (type.IsAbstract)
{
constructor = null;
return false;
}
var rankedConstructors =
type.GetConstructors()
.SelectMany(GetVirtualContructors)
.Where(v => v.CanResolve(resolver))
.GroupBy(v => v.GetScore())
.OrderByDescending(g => g.Key);
var enumerator = rankedConstructors.GetEnumerator();
if (!enumerator.MoveNext())
{
constructor = null;
return false;
}
if (enumerator.Current.Count() > 1)
{
constructor = null;
return false;
}
constructor = enumerator.Current.Single().Constructor;
return true;
}
开发者ID:RockFramework,项目名称:Rock.Core,代码行数:32,代码来源:ResolverConstructorSelector.cs
示例14: Build
/// <summary>
/// generates project.lock.json that tells compiler where to take dlls and source from
/// and builds executable and copies all required dll's
/// </summary>
public BuildResult Build(GenerateResult generateResult, ILogger logger, Benchmark benchmark, IResolver resolver)
{
if (!DotNetCliCommandExecutor.ExecuteCommand(
RestoreCommand,
generateResult.ArtifactsPaths.BuildArtifactsDirectoryPath,
logger,
DefaultTimeout))
{
return BuildResult.Failure(generateResult, new Exception("dotnet restore has failed"));
}
if (!DotNetCliCommandExecutor.ExecuteCommand(
GetBuildCommand(TargetFrameworkMoniker),
generateResult.ArtifactsPaths.BuildArtifactsDirectoryPath,
logger,
DefaultTimeout))
{
// dotnet cli could have succesfully builded the program, but returned 1 as exit code because it had some warnings
// so we need to check whether the exe exists or not, if it does then it is OK
if (File.Exists(generateResult.ArtifactsPaths.ExecutablePath))
{
return BuildResult.Success(generateResult);
}
return BuildResult.Failure(generateResult);
}
return BuildResult.Success(generateResult);
}
开发者ID:alexandrnikitin,项目名称:BenchmarkDotNet,代码行数:33,代码来源:DotNetCliBuilder.cs
示例15: SizesModel
public SizesModel(IResolver resolver, IReadOnlyCollection<ImageInfo> images, string id)
{
this.ServiceName = resolver.ServiceName;
this.Images = images;
this.ServiceId = resolver.ServiceId;
this.Id = id;
}
开发者ID:osapon,项目名称:img.azyobuzi.net,代码行数:7,代码来源:SizesModel.cs
示例16: GetInstance
public object GetInstance(Func<IResolver, object> factory, IResolver resolver)
{
if (!_threadLocalInstance.IsValueCreated)
_threadLocalInstance.Value = factory(resolver);
return _threadLocalInstance.Value;
}
开发者ID:GeorgeR,项目名称:DynamoIOC,代码行数:7,代码来源:ThreadLocalLifetime.cs
示例17: LcdpServer
public LcdpServer(ILcdpPacketSerializer lcdpPacketSerializer, IListener listener, IForwarder forwarder, IResolver resolver)
{
this.lcdpPacketSerializer = lcdpPacketSerializer;
this.listener = listener;
this.forwarder = forwarder;
this.messages = new ConcurrentDictionary<string, LcdpMessage>();
this.ChunkExpirationTimeMilliseconds = 5000;
this.compressors = new Dictionary<byte, ICompressor>();
this.serializers = new Dictionary<byte, ISerializer>();
for(byte b = 0; b < byte.MaxValue; ++b)
{
ICompressor compressor = resolver.Resolve<ICompressor>(b.ToString());
if (compressor != null)
{
compressors[b] = compressor;
}
ISerializer serializer = resolver.Resolve<ISerializer>(b.ToString());
if (serializer != null)
{
serializers[b] = serializer;
}
}
}
开发者ID:DropZone,项目名称:LogC,代码行数:29,代码来源:LcdpServer.cs
示例18: DocumentPicturesCreator
public DocumentPicturesCreator(
IResolver<IDocumentPictureContext> resDocumentPictureContext,
IResolver<IWebApiDocument> resWebApiDocument
)
{
m_resWebApiDocument = resWebApiDocument;
m_resDocumentPictureContext = resDocumentPictureContext;
}
开发者ID:Lebda,项目名称:SciaDesignFormsWeb,代码行数:8,代码来源:DocumentPicturesCreator.cs
示例19: EmdFileParser
public EmdFileParser(
IResolver<IEmdFileStructure> resEmdFileStrcture,
IResolver<IEmdFileMember> resEmdFileMember,
IResolver<IEmdFileSection> resEmdFileSection)
{
m_resEmdFileStrcture = resEmdFileStrcture;
m_resEmdFileMember = resEmdFileMember;
m_resEmdFileSection = resEmdFileSection;
}
开发者ID:Lebda,项目名称:SciaDesignFormsWeb,代码行数:9,代码来源:EmdFileParser.cs
示例20: JobRunner
public JobRunner(
IResolver resolver,
IJobDefinitionService jobDefinitionService,
IJsonSerializer jsonSerializer)
{
_resolver = resolver;
_jobDefinitionService = jobDefinitionService;
_jsonSerializer = jsonSerializer;
}
开发者ID:liemqv,项目名称:EventFlow,代码行数:9,代码来源:JobRunner.cs
注:本文中的IResolver类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论