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; }
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))); }
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); }
public static void Register(IRegistry registry) { if(registry == null) throw new ArgumentNullException("registry"); registry.For<IConfigurationManager>().Singleton().Use<ConfigurationManagerWrapper>(); }
/// <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; }
private void Process(Type type, IRegistry registry) { if (!type.IsAbstract && typeof (IController).IsAssignableFrom(type)) { registry.AddType(type, type); } }
// 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>(); }
internal ObjectCreator(IRegistry registry) { ReturnType = null; IsSingleton = false; _onCreation = null; _registry = registry; }
public TDNetRunnerInstaller(ITestFrameworkManager testFrameworkManager, IRegistry registry, ILogger logger, TDNetPreferenceManager preferenceManager) { this.testFrameworkManager = testFrameworkManager; this.registry = registry; this.logger = logger; this.preferenceManager = preferenceManager; }
public LoggingPermissions(IApplicationConstants appConstants, ITelemetryService telemetryService, IRegistry registry) { _appConstants = appConstants; _telemetryService = telemetryService; _registry = registry; _registryVerbosity = GetLogLevelFromRegistry(); _registryFeedbackSetting = GetFeedbackFromRegistry(); }
private static void AddRegistryInfo(IRegistry registry) { registry.Scan(scanner => { scanner.AssemblyContainingType<Bootstrapper>(); scanner.LookForRegistries(); }); }
public void Init() { registry = RegistrySingleton.Instance; registry.ClearClasses(); classId = registry.AddPrimitiveClass("numeric", DATA_TYPE.NUMERIC); cla = registry.GetClassById(classId); }
/// <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); }
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()); }
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); } }
public void Init() { registry = RegistrySingleton.Instance; registry.ClearClasses(); classId = registry.AddPrimitiveClass("numeric", DATA_TYPE.NUMERIC); cla = registry.GetClassById(classId); cla.AddMethod("method", classId, new List<IArgument>() {registry.CreateArgument(classId) }); }
public bool IsValid(ref IRegistry registry, List<OperandeVariable> variables) { if (_expression == null) { return false; } return _expression.Accept(new ValidatorVisitor(ref registry, variables)); }
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(); }
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); }
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(); }
public void Init() { registry = RegistrySingleton.Instance; registry.ClearClasses(); intId = registry.AddPrimitiveClass("numeric", DATA_TYPE.NUMERIC); intClass = registry.GetClassById(intId); intClass.AddMethod("method", intId, new List<IArgument>() { registry.CreateArgument(intId), registry.CreateArgument(intId) }); intVar = new OperandeVariable(intId, "num"); }
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; }
/// <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); }
private void RegisterDummies(IRegistry registry) { registry.Register<DummyOne>().As<IDummyOne>().WithLifetime(Lifetime.Transient); registry.Register<DummyTwo>().As<IDummyTwo>().WithLifetime(Lifetime.Transient); registry.Register<DummyThree>().As<IDummyThree>().WithLifetime(Lifetime.Transient); registry.Register<DummyFour>().As<IDummyFour>().WithLifetime(Lifetime.Transient); registry.Register<DummyFive>().As<IDummyFive>().WithLifetime(Lifetime.Transient); registry.Register<DummySix>().As<IDummySix>().WithLifetime(Lifetime.Transient); registry.Register<DummySeven>().As<IDummySeven>().WithLifetime(Lifetime.Transient); registry.Register<DummyEight>().As<IDummyEight>().WithLifetime(Lifetime.Transient); registry.Register<DummyNine>().As<IDummyNine>().WithLifetime(Lifetime.Transient); registry.Register<DummyTen>().As<IDummyTen>().WithLifetime(Lifetime.Transient); }
public MediaSession(Call call, IRegistry localRegistry, ICallManagerInternal callManager, IConferenceBridge conferenceBridge) { Helper.GuardNotNull(call); Helper.GuardNotNull(localRegistry); Helper.GuardNotNull(callManager); Helper.GuardNotNull(conferenceBridge); _call = new WeakReference(call); _state = new NoneMediaState(this); _localRegistry = localRegistry; _callManager = callManager; _conferenceBridge = conferenceBridge; }
public static ICoreServices CreateSubstitute(ILoggingPermissions loggingPermissions = null, IFileSystem fs = null, IRegistry registry = null, IProcessServices ps = null) { return new CoreServices( Substitute.For<IApplicationConstants>(), Substitute.For<ITelemetryService>(), loggingPermissions, Substitute.For<ISecurityService>(), Substitute.For<ITaskService>(), UIThreadHelper.Instance, Substitute.For<IActionLog>(), fs ?? Substitute.For<IFileSystem>(), registry ?? Substitute.For<IRegistry>(), ps ?? Substitute.For<IProcessServices>()); }
internal static string CheckMicrosoftRClientInstall(ICoreShell coreShell, IRegistry registry = null) { coreShell.AssertIsOnMainThread(); registry = registry ?? new RegistryImpl(); var rClientPath = SqlRClientInstallation.GetRClientPath(registry); if (!string.IsNullOrEmpty(rClientPath) && AskUserSwitchToRClient(registry)) { // Get R Client path if (MessageButtons.Yes == coreShell.ShowMessage(Resources.Prompt_MsRClientJustInstalled, MessageButtons.YesNo)) { return rClientPath; } } return null; }
private static void RegisterAllInterfaceToClassNameMatchesInCurrentAssembly(IRegistry registry) { registry.Scan(x => { x.TheCallingAssembly(); x.WithDefaultConventions(); }); registry.Scan(x => { x.AssembliesFromApplicationBaseDirectory(); x.With(new FileRetrieverConvention()); }); }
protected override void WithContext() { CloudStorageAccount.DevelopmentStorageAccount.CreateCloudTableClient().DeleteTableIfExist(AzureBackingStore.ConcreteTypeTableName); CloudStorageAccount.DevelopmentStorageAccount.CreateCloudTableClient().DeleteTableIfExist("idxStashEngineStashTypeHierarchy"); CloudStorageAccount.DevelopmentStorageAccount.CreateCloudTableClient().DeleteTableIfExist("rdxStashEngineStashTypeHierarchy"); Subject = new AzureBackingStore(CloudStorageAccount.DevelopmentStorageAccount, new NoConcurrencyProtection()); Registry = new Registry(Subject); var typeHierarchyIndexer = new RegisteredIndexer<Type, string>(new StashTypeHierarchy(), Registry); Registry.RegisteredIndexers.Add(typeHierarchyIndexer); Subject.EnsureIndex(typeHierarchyIndexer); }
private static void ConfigureClass(Type type, IRegistry registry, FireOptions fireOption, DependencyMap dependencyMap) { var inst = new LooseConstructorInstance(context => { var ctorArgs = type .GetGreediestCtor() .GetParameters() .Select(p => context.GetInstance(p.ParameterType)); return Notifiable.MakeForClass(type, fireOption, ctorArgs.ToArray(), new ProxyGenerator(), dependencyMap); }); registry.For(type).Use(inst); }
public ExeInformer(IFileSystem fileSystem, IRegistry registry, ILogger <ExeInformer> log) { _fileSystem = fileSystem; _registry = registry; _log = log; }
/// <summary> /// Add pertinent interfaces and impelementing classes to the registry. /// </summary> public void Configure(IRegistry registry) { registry.Register <Weather.Module>(); }
public ItemParser(IRegistry <ItemType> itemTypeRegistry) { _itemTypeRegistry = itemTypeRegistry; }
protected virtual void Awake() { _registry = new GameRegistry(); ApplicationController.RegisterSceneManager(this); }
public static UTinyType.Reference GetDisplayInfoType(this IRegistry registry) { return(registry.GetType("UTiny.Core2D.DisplayInfo")); }
public TermController(IRegistry registryContext, IMapper mapper) { _registryContext = registryContext; _mapper = mapper; }
public LoggingPermissions(IApplicationConstants appConstants, ITelemetryService telemetryService, IRegistry registry) { _appConstants = appConstants; _telemetryService = telemetryService; _registry = registry; _registryVerbosity = GetLogLevelFromRegistry(); _registryFeedbackSetting = GetFeedbackFromRegistry(); // Default value for CurrentVerbosity should match default value in IRSettings. // https://github.com/Microsoft/RTVS/issues/2705 CurrentVerbosity = LogVerbosity.Normal; }
public override void Parse(XmlDocument document, IRegistry <TerrainType> registry) { var config = new XmlParserConfig <TerrainType>(document, SchemaNamespaces.TerrainType, _terrainTypes, _terrainType, registry, ParseObject); Parse(config); }
public void Configure(IRegistry registry) { registry.Register <Datastores.Module>(); registry.Register <IWeatherDetailRepository, WeatherDetailRepository>(ImplementationScope.Shared); }
public static void Register(IRegistry reg) { }
public PdfArchitectCheck(IRegistry registry, IFile file) { _registry = registry; _file = file; }
/// <summary> /// Initializes a new instance of the <see cref="Vsts" /> class. /// </summary> /// <param name="executor">The executor.</param> /// <param name="parser">The parser.</param> /// <param name="registry">The registry.</param> /// <remarks></remarks> public Vsts(ProcessExecutor executor, IHistoryParser parser, IRegistry registry) : base(parser, executor) { this.registry = registry; this.executor = executor; }
public static UTinyType.Reference GetLifetimeVelocityType(this IRegistry registry) { return(registry.GetType("UTiny.Particles.LifetimeVelocity")); }
public static void Register(IRegistry reg) { reg.Register(new ClassBuilder <Continuation>(reg, Continuation.ToText) .Class); }
protected static IRegistryNode GetRegistryNode(string path, bool createOnNotExist) { IRegistry registry = ServiceRegistration.Get <IRegistry>(); return(registry.GetRegistryNode(path, createOnNotExist)); }
public static UTinyType.Reference GetVector4Type(this IRegistry registry) { return(registry.GetType("UTiny.Math.Vector4")); }
public override void Parse(XmlDocument document, IRegistry <Item> registry) { var config = new XmlParserConfig <Item>(document, SchemaNamespaces.Item, _items, _item, registry, ParseObject); Parse(config); }
public static UTinyType.Reference GetQuaternionType(this IRegistry registry) { return(registry.GetType("UTiny.Math.Quaternion")); }
public static UTinyType.Reference GetMatrix4x4Type(this IRegistry registry) { return(registry.GetType("UTiny.Math.Matrix4x4")); }
public static UTinyModule GetCoreModule(this IRegistry registry) { return(registry?.FindByName <UTinyModule>("UTiny")); }
public MapiClient(IRegistry registryWrap) { _registryWrap = registryWrap; StartInOwnThread = true; }
public static UTinyType.Reference GetParticleEmitterType(this IRegistry registry) { return(registry.GetType("UTiny.Particles.ParticleEmitter")); }
public ConstRefBase(IRegistry reg, IClassBase @class, Id id, object val) : this(reg, @class, id) { reg.AddConst(val); }
public static UTinyType.Reference GetEmitterBoxSourceType(this IRegistry registry) { return(registry.GetType("UTiny.Particles.EmitterBoxSource")); }
public ConstRefBase(IRegistry reg, IClassBase klass, Id id) { _id = id; Registry = reg; Class = klass; }
public static UTinyType.Reference GetEmitterInitialScaleType(this IRegistry registry) { return(registry.GetType("UTiny.Particles.EmitterInitialScale")); }
protected ParserCommon(TLexer lexer, IRegistry reg) : base(reg) { _Current = 0; _Lexer = lexer; }
public WelcomeSettingsHelper(IRegistry registryWrap, IVersionHelper versionHelper) { _registryWrap = registryWrap; _versionHelper = versionHelper; }
public PrinterPortReader(IRegistry registry) { _registry = registry; }
/** * Azure App Service sample for deploying from an Azure Container Registry. * - Create an Azure Container Registry to be used for holding the Docker images * - If a local Docker engine cannot be found, create a Linux virtual machine that will host a Docker engine * to be used for this sample * - Use Docker Java to create a Docker client that will push/pull an image to/from Azure Container Registry * - Pull a test image from the public Docker repo (tomcat:8-jre8) to be used as a sample for pushing/pulling * to/from an Azure Container Registry * - Deploys to a new web app from the Tomcat image */ public static void RunSample(IAzure azure) { string rgName = SdkContext.RandomResourceName("rgACR", 15); string acrName = SdkContext.RandomResourceName("acrsample", 20); string saName = SdkContext.RandomResourceName("sa", 20); string appName = SdkContext.RandomResourceName("webapp", 20); string appUrl = appName + ".azurewebsites.net"; Region region = Region.USWest; string dockerImageName = "tomcat"; string dockerImageTag = "8-jre8"; string dockerContainerName = "tomcat-privates"; try { //============================================================= // Create an Azure Container Registry to store and manage private Docker container images Utilities.Log("Creating an Azure Container Registry"); IRegistry azureRegistry = azure.ContainerRegistries.Define(acrName) .WithRegion(region) .WithNewResourceGroup(rgName) .WithBasicSku() .WithRegistryNameAsAdminUser() .Create(); Utilities.Print(azureRegistry); var acrCredentials = azureRegistry.GetCredentials(); //============================================================= // Create a Docker client that will be used to push/pull images to/from the Azure Container Registry using (DockerClient dockerClient = DockerUtils.CreateDockerClient(azure, rgName, region)) { var pullImgResult = dockerClient.Images.PullImage( new Docker.DotNet.Models.ImagesPullParameters() { Parent = dockerImageName, Tag = dockerImageTag }, new Docker.DotNet.Models.AuthConfig()); Utilities.Log("List Docker images for: " + dockerClient.Configuration.EndpointBaseUri.AbsoluteUri); var listImages = dockerClient.Images.ListImages( new Docker.DotNet.Models.ImagesListParameters() { All = true }); foreach (var img in listImages) { Utilities.Log("\tFound image " + img.RepoTags[0] + " (id:" + img.ID + ")"); } var createContainerResult = dockerClient.Containers.CreateContainer( new Docker.DotNet.Models.CreateContainerParameters() { Name = dockerContainerName, Image = dockerImageName + ":" + dockerImageTag }); Utilities.Log("List Docker containers for: " + dockerClient.Configuration.EndpointBaseUri.AbsoluteUri); var listContainers = dockerClient.Containers.ListContainers( new Docker.DotNet.Models.ContainersListParameters() { All = true }); foreach (var container in listContainers) { Utilities.Log("\tFound container " + container.Names[0] + " (id:" + container.ID + ")"); } //============================================================= // Commit the new container string privateRepoUrl = azureRegistry.LoginServerUrl + "/samples/" + dockerContainerName; Utilities.Log("Commiting image at: " + privateRepoUrl); var commitContainerResult = dockerClient.Miscellaneous.CommitContainerChanges( new Docker.DotNet.Models.CommitContainerChangesParameters() { ContainerID = dockerContainerName, RepositoryName = privateRepoUrl, Tag = "latest" }); //============================================================= // Push the new Docker image to the Azure Container Registry var pushImageResult = dockerClient.Images.PushImage(privateRepoUrl, new Docker.DotNet.Models.ImagePushParameters() { ImageID = privateRepoUrl, Tag = "latest" }, new Docker.DotNet.Models.AuthConfig() { Username = acrCredentials.Username, Password = acrCredentials.AccessKeys[AccessKeyType.Primary], ServerAddress = azureRegistry.LoginServerUrl }); //============================================================ // Create a web app with a new app service plan Utilities.Log("Creating web app " + appName + " in resource group " + rgName + "..."); IWebApp app = azure.WebApps.Define(appName) .WithRegion(Region.USWest) .WithExistingResourceGroup(rgName) .WithNewLinuxPlan(PricingTier.StandardS1) .WithPrivateRegistryImage(privateRepoUrl + ":latest", "http://" + azureRegistry.LoginServerUrl) .WithCredentials(acrCredentials.Username, acrCredentials.AccessKeys[AccessKeyType.Primary]) .WithAppSetting("PORT", "8080") .Create(); Utilities.Log("Created web app " + app.Name); Utilities.Print(app); // warm up Utilities.Log("Warming up " + appUrl + "..."); Utilities.CheckAddress("http://" + appUrl); SdkContext.DelayProvider.Delay(5000); Utilities.Log("CURLing " + appUrl + "..."); Utilities.Log(Utilities.CheckAddress("http://" + appUrl)); } } finally { try { Utilities.Log("Deleting Resource Group: " + rgName); azure.ResourceGroups.BeginDeleteByName(rgName); Utilities.Log("Deleted Resource Group: " + rgName); } catch (Exception) { Utilities.Log("Did not create any resources in Azure. No clean up is necessary"); } } }