本文整理汇总了C#中IRegistry类的典型用法代码示例。如果您正苦于以下问题:C# IRegistry类的具体用法?C# IRegistry怎么用?C# IRegistry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IRegistry类属于命名空间,在下文中一共展示了IRegistry类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetMicrosoftRClientInfo
public static IRInterpreterInfo GetMicrosoftRClientInfo(IRegistry registry = null, IFileSystem fileSystem = null) {
registry = registry ?? new RegistryImpl();
fileSystem = fileSystem ?? new FileSystem();
// If yes, check 32-bit registry for R engine installed by the R Server.
// TODO: remove this when MRS starts writing 64-bit keys.
if (IsMRCInstalledInSql(registry)) {
using (IRegistryKey hklm = registry.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32)) {
try {
using (var key = hklm.OpenSubKey(@"SOFTWARE\R-core\R64")) {
foreach (var keyName in key.GetSubKeyNames()) {
using (var rsKey = key.OpenSubKey(keyName)) {
try {
var path = (string)rsKey?.GetValue("InstallPath");
if (!string.IsNullOrEmpty(path) && path.Contains(_rServer)) {
var info = new RInterpreterInfo(string.Empty, path);
if (info.VerifyInstallation(new SupportedRVersionRange(), fileSystem)) {
return new RInterpreterInfo(Invariant($"Microsoft R Client (SQL) {info.Version.Major}.{info.Version.Minor}.{info.Version.Build}"), info.InstallPath);
}
}
} catch (Exception) { }
}
}
}
} catch (Exception) { }
}
}
return null;
}
开发者ID:Microsoft,项目名称:RTVS,代码行数:30,代码来源:SqlRClientInstallation.cs
示例2: UpdatePluginList
public void UpdatePluginList(IRegistry registry)
{
PluginDescriptors = new List<IPluginDescriptor>(registry.Plugins);
PluginDescriptors.Sort((l, r) => l.PluginId.CompareTo(r.PluginId));
OnStructureChanged(new TreePathEventArgs(new TreePath(root)));
}
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:7,代码来源:PluginTreeModel.cs
示例3: SetupExtensibility
private static void SetupExtensibility(IRegistry registry)
{
var dynamicProxy = new CastleDynamicProxyProvider();
var aopRepository = new AspectRepository(dynamicProxy);
var dllPlugins =
(from key in ConfigurationManager.AppSettings.AllKeys
where key.StartsWith("PluginsPath", StringComparison.OrdinalIgnoreCase)
let path = ConfigurationManager.AppSettings[key]
let pathRelative = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, path)
let chosenPath = Directory.Exists(pathRelative) ? pathRelative : path
select chosenPath)
.ToList();
registry.RegisterInstance(new PluginsConfiguration { Directories = dllPlugins });
registry.Register<SystemInitialization>();
registry.Register<IObjectFactory, DryIocObjectFactory>(Reuse.Singleton);
registry.Register<IExtensibilityProvider, DryIocMefProvider>(Reuse.Singleton);
registry.Register(typeof(IPluginRepository<>), typeof(PluginRepository<>), Reuse.Singleton);
registry.RegisterInstance<IAspectRegistrator>(aopRepository);
registry.RegisterInstance<IAspectComposer>(aopRepository);
//registry.RegisterInstance<IInterceptorRegistrator>(aopRepository);
registry.RegisterInstance<IMixinProvider>(dynamicProxy);
registry.RegisterInstance<IDynamicProxyProvider>(dynamicProxy);
}
开发者ID:nutrija,项目名称:revenj,代码行数:26,代码来源:DryIocConfiguration.cs
示例4: Register
public static void Register(IRegistry registry)
{
if(registry == null)
throw new ArgumentNullException("registry");
registry.For<IConfigurationManager>().Singleton().Use<ConfigurationManagerWrapper>();
}
开发者ID:HansKindberg-Net,项目名称:HansKindberg,代码行数:7,代码来源:Registry.cs
示例5: RegistryResourceLocator
/// <summary>
/// Creates a resource locator based on a registry.
/// </summary>
/// <param name="registry">The registry.</param>
/// <exception cref="ArgumentNullException">Thrown if <paramref name="registry"/> is null.</exception>
public RegistryResourceLocator(IRegistry registry)
{
if (registry == null)
throw new ArgumentNullException("registry");
this.registry = registry;
}
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:12,代码来源:RegistryResourceLocator.cs
示例6: Process
private void Process(Type type, IRegistry registry)
{
if (!type.IsAbstract && typeof (IController).IsAssignableFrom(type))
{
registry.AddType(type, type);
}
}
开发者ID:DerAlbertCom,项目名称:ApereaFramework,代码行数:7,代码来源:ControllerRegistryConvention.cs
示例7: NKCellRecord
// protected internal constructors...
/// <summary>
/// Initializes a new instance of the <see cref="NKCellRecord" /> class.
/// <remarks>Represents a Key Node Record</remarks>
/// </summary>
protected internal NKCellRecord(int recordSize, long relativeOffset, IRegistry registryHive)
{
RelativeOffset = relativeOffset;
_registryHive = registryHive;
_rawBytesLength = recordSize;
ValueOffsets = new List<ulong>();
}
开发者ID:seandiviney,项目名称:Registry,代码行数:13,代码来源:NKCellRecord.cs
示例8: LoggingPermissions
public LoggingPermissions(IApplicationConstants appConstants, ITelemetryService telemetryService, IRegistry registry) {
_appConstants = appConstants;
_telemetryService = telemetryService;
_registry = registry;
_registryVerbosity = GetLogLevelFromRegistry();
_registryFeedbackSetting = GetFeedbackFromRegistry();
}
开发者ID:Microsoft,项目名称:RTVS,代码行数:8,代码来源:LoggingPermissions.cs
示例9: AddRegistryInfo
private static void AddRegistryInfo(IRegistry registry)
{
registry.Scan(scanner =>
{
scanner.AssemblyContainingType<Bootstrapper>();
scanner.LookForRegistries();
});
}
开发者ID:kirolosgerges,项目名称:Blog,代码行数:8,代码来源:Bootstrapper.cs
示例10: ObjectCreator
internal ObjectCreator(IRegistry registry)
{
ReturnType = null;
IsSingleton = false;
_onCreation = null;
_registry = registry;
}
开发者ID:Pondidum,项目名称:Seivad,代码行数:8,代码来源:ObjectCreator.cs
示例11: TDNetRunnerInstaller
public TDNetRunnerInstaller(ITestFrameworkManager testFrameworkManager, IRegistry registry, ILogger logger,
TDNetPreferenceManager preferenceManager)
{
this.testFrameworkManager = testFrameworkManager;
this.registry = registry;
this.logger = logger;
this.preferenceManager = preferenceManager;
}
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:8,代码来源:TDNetRunnerInstaller.cs
示例12: IsValid
public bool IsValid(ref IRegistry registry, List<OperandeVariable> variables)
{
if (_expression == null)
{
return false;
}
return _expression.Accept(new ValidatorVisitor(ref registry, variables));
}
开发者ID:AdrienEtienne,项目名称:script-builder,代码行数:9,代码来源:ExpressionInstruction.cs
示例13: ApplyCatalogToRegistry
private static void ApplyCatalogToRegistry(IProgressMonitor progressMonitor,
IPluginCatalog pluginCatalog, IRegistry registry)
{
using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(45))
{
subProgressMonitor.BeginTask(Resources.UpdatePluginFolderCommand_Applying_catalog_to_registry, 100);
pluginCatalog.ApplyTo(registry);
}
}
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:9,代码来源:UpdatePluginFolderCommand.cs
示例14: AddRegistry
/// <summary>
/// Adds the registry to the builder.
/// </summary>
/// <param name="registry">The registry to be added to the builder.</param>
/// <remarks>
/// Registry instances must be applied to a new container in the order that they are added for deterministic behavior.
/// </remarks>
public void AddRegistry(IRegistry registry)
{
if (null == registry)
{
throw new ArgumentNullException("registry");
}
_registries.Add(registry);
}
开发者ID:wade,项目名称:Speedioc,代码行数:16,代码来源:GeneratedContainerBulider.cs
示例15: RegisterIoC
internal static void RegisterIoC(IRegistry registry)
{
registry.Register<ICodeLocationRepository>(new CodeLocationRepository());
registry.Register<IApiDataRepository>(new ApiDataRepository());
registry.Register<IJobRepository>(new JobRepository());
registry.Register<IWorkerRepository>(new WorkerRepository());
registry.Register<IFileRepository>(new FileRepository());
registry.Register<IRepositoryController>(new RepositoryController());
}
开发者ID:codeimpossible,项目名称:proggr,代码行数:9,代码来源:Startup.IoC.cs
示例16: RegisterStandard
private static void RegisterStandard(IRegistry registry)
{
registry.Register<Singleton1>().As<ISingleton1>().WithLifetime(Lifetime.Container).PreCreateInstance();
registry.Register<Transient1>().As<ITransient1>().WithLifetime(Lifetime.Transient);
registry.Register<Combined1>().As<ICombined1>().WithLifetime(Lifetime.Transient)
.UsingConstructor()
.WithResolvedParameter<ISingleton1>()
.WithResolvedParameter<ITransient1>()
.AsLastParameter();
}
开发者ID:CodeDux,项目名称:IocPerformance,代码行数:10,代码来源:SpeediocContainerAdapter.cs
示例17: Setup
public void Setup()
{
//RhinoMocks.Logger = new TextWriterExpectationLogger(Console.Out);
mocks = new MockRepository();
registry = mocks.DynamicMock<IRegistry>();
fileSystem = mocks.DynamicMock<IFilesSystem>();
task = new AddTnsName(registry, fileSystem);
task.BuildEngine = new MockBuild();
}
开发者ID:464884492,项目名称:msbuildtasks,代码行数:10,代码来源:AddTnsNameTest.cs
示例18: RegisterComplex
private void RegisterComplex(IRegistry registry)
{
registry.Register<SubObjectOne>().As<ISubObjectOne>().WithLifetime(Lifetime.Transient);
registry.Register<SubObjectTwo>().As<ISubObjectTwo>().WithLifetime(Lifetime.Transient);
registry.Register<SubObjectThree>().As<ISubObjectThree>().WithLifetime(Lifetime.Transient);
registry.Register<FirstService>().As<IFirstService>().WithLifetime(Lifetime.Container).PreCreateInstance();
registry.Register<SecondService>().As<ISecondService>().WithLifetime(Lifetime.Container).PreCreateInstance();
registry.Register<ThirdService>().As<IThirdService>().WithLifetime(Lifetime.Container).PreCreateInstance();
registry.Register<Complex>().As<IComplex>().WithLifetime(Lifetime.Transient);
}
开发者ID:vvs0205,项目名称:IocPerformance,代码行数:10,代码来源:SpeediocContainerAdapter.cs
示例19: DefaultImManager
public DefaultImManager(IRegistry localRegistry, IIMApiProvider imApi,
ICallApiProvider callApi, IEventsProvider eventsProvider)
{
Helper.GuardNotNull(localRegistry);
Helper.GuardNotNull(imApi);
Helper.GuardNotNull(callApi);
Helper.GuardNotNull(eventsProvider);
_imApi = imApi;
_callApi = callApi;
_eventsProvider = eventsProvider;
_localRegistry = localRegistry;
}
开发者ID:percramer,项目名称:pjsip4net,代码行数:12,代码来源:DefaultImManager.cs
示例20: ApplyTo
/// <inheritodc />
public void ApplyTo(IRegistry registry)
{
if (registry == null)
throw new ArgumentNullException("registry");
var topologicallySortedPlugins = TopologicalSortByDependencies(plugins);
IList<IPluginDescriptor> pluginDescriptors = RegisterPlugins(registry,
topologicallySortedPlugins);
RegisterServices(registry, topologicallySortedPlugins, pluginDescriptors);
RegisterComponents(registry, topologicallySortedPlugins, pluginDescriptors);
}
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:13,代码来源:PluginCatalog.cs
注:本文中的IRegistry类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论