本文整理汇总了C#中IRegistry类的典型用法代码示例。如果您正苦于以下问题:C# IRegistry类的具体用法?C# IRegistry怎么用?C# IRegistry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IRegistry类属于命名空间,在下文中一共展示了IRegistry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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)));
}
示例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);
}
示例4: Register
public static void Register(IRegistry registry)
{
if(registry == null)
throw new ArgumentNullException("registry");
registry.For<IConfigurationManager>().Singleton().Use<ConfigurationManagerWrapper>();
}
示例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;
}
示例6: Process
private void Process(Type type, IRegistry registry)
{
if (!type.IsAbstract && typeof (IController).IsAssignableFrom(type))
{
registry.AddType(type, type);
}
}
示例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>();
}
示例8: LoggingPermissions
public LoggingPermissions(IApplicationConstants appConstants, ITelemetryService telemetryService, IRegistry registry) {
_appConstants = appConstants;
_telemetryService = telemetryService;
_registry = registry;
_registryVerbosity = GetLogLevelFromRegistry();
_registryFeedbackSetting = GetFeedbackFromRegistry();
}
示例9: AddRegistryInfo
private static void AddRegistryInfo(IRegistry registry)
{
registry.Scan(scanner =>
{
scanner.AssemblyContainingType<Bootstrapper>();
scanner.LookForRegistries();
});
}
示例10: ObjectCreator
internal ObjectCreator(IRegistry registry)
{
ReturnType = null;
IsSingleton = false;
_onCreation = null;
_registry = registry;
}
示例11: TDNetRunnerInstaller
public TDNetRunnerInstaller(ITestFrameworkManager testFrameworkManager, IRegistry registry, ILogger logger,
TDNetPreferenceManager preferenceManager)
{
this.testFrameworkManager = testFrameworkManager;
this.registry = registry;
this.logger = logger;
this.preferenceManager = preferenceManager;
}
示例12: IsValid
public bool IsValid(ref IRegistry registry, List<OperandeVariable> variables)
{
if (_expression == null)
{
return false;
}
return _expression.Accept(new ValidatorVisitor(ref registry, variables));
}
示例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);
}
}
示例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);
}
示例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());
}