public GetFromVCSCommand(EnvironmentSettings settings, string remotePath, string localPath, string comment, string workingDir)
 {
     this.remotePath = remotePath;
     this.localPath = localPath;
     this.comment = comment;
     this.workingDir = workingDir;
     this.settings = settings;
 }
 public GetInstallDNXScriptComamnd(EnvironmentSettings settings, DNXSettings dnxsettings) :
     base(
         settings,
         Path.Combine(settings.RemoteSettingsPath, "dnxInstall.sh"),
         settings.WorkingDir,
         "get installation script",
         settings.WorkingDir)
 {
 }
 public InstallPackageCommand(EnvironmentSettings settings, CoreClrProject project)
     : this(settings) {
     this.settings = settings;
     pathToPackage = string.Format(
         @"{0}\bin\{1}\{2}",
         project.LocalPath,
         project.BuildConfiguration,
         project.NugetPackageName);
 }
        public void HaveTestEnvironmentWhenTestEnvironmentIsAdded()
        {
            var source = new TestSettingSource();
            var envs = new EnvironmentSettings(new SettingsManager(new SecureSettingsManager(source)));
            var env = new EnvironmentSetting("test", "test", "test", "test");
            envs.AddEnvironment(env);

            Assert.IsTrue(envs.Any(e => e.Name == env.Name));
        }
 public GetProductConfigCommand(EnvironmentSettings settings) :
     base(settings, 
         Path.Combine(settings.RemoteSettingsPath,"Product.xml"), 
         settings.WorkingDir, 
         "Get Product.xml", 
         settings.WorkingDir)
 {
     productConfig = settings.ProductConfig;
 }
 public GetNugetConfigCommand(EnvironmentSettings settings, DNXSettings dnxsettings) :
     base(
         settings,
         string.Format("$/{0}/NetCore/NuGet.Config", settings.BranchVersion),
         PlatformPathsCorrector.Inst.Correct(@"NetCore\", Platform.Windows),
         "get nuget.config",
         settings.WorkingDir)
 {
     workingDir = settings.WorkingDir;
 }
        public void BeAbleToRemoveTestEnvironmentAfterTestEnvironmentIsAdded()
        {
            var source = new TestSettingSource();
            var envs = new EnvironmentSettings(new SettingsManager(new SecureSettingsManager(source)));
            var env = new EnvironmentSetting("test", "test", "test", "test");
            envs.AddEnvironment(env);
            envs.RemoveEnvironment(env);

            Assert.IsFalse(envs.Any(e => e.Name == env.Name));
        }
 public CollectArtifactsCommand(EnvironmentSettings settings, ProjectsInfo info, string destFolder, string buildFramework)
 {
     
     this.settings = settings;
     this.info = info;
     if (!string.IsNullOrEmpty(buildFramework))
         this.destFolder = string.Format(@"{0}\{1}", destFolder, buildFramework);
     else
         this.destFolder = destFolder;
 }
 public CollectArtifactsCommand(EnvironmentSettings settings, ProjectsInfo info, string destFolder, string runtime, string buildFramework)
 {
     
     this.settings = settings;
     this.info = info;
     if (!string.IsNullOrEmpty(buildFramework) && !string.IsNullOrEmpty(runtime))
         this.destFolder = PlatformPathsCorrector.Inst.Correct(string.Format(@"{0}\{1}\{2}", destFolder, runtime, buildFramework), Platform.Windows);
     else
         this.destFolder = destFolder;
 }
Example #10
0
        public void IsValid_Throws_IfPostBuildScriptPath_IsNotPresent()
        {
            // Arrange
            var environmentSettings = new EnvironmentSettings();

            environmentSettings.PostBuildScriptPath = Path.Combine(_tempDirRoot, Guid.NewGuid().ToString());
            var sourceDir = CreateNewDir();
            var provider  = CreateProvider(sourceDir);

            // Act
            var exception = Assert.Throws <InvalidUsageException>(() => provider.IsValid(environmentSettings));

            // Assert
            Assert.Equal(
                $"Post-build script file '{environmentSettings.PostBuildScriptPath}' does not exist.",
                exception.Message);
        }
Example #11
0
        public void Execute(AddReferenceCommandInput input, EnvironmentSettings settings, IFileSystem fileSystem, DeploymentSettings deploymentSettings)
        {
            string bottleText = "bottle:{0}".ToFormat(input.Bottle);


            var hostPath = deploymentSettings.GetHost(input.Recipe, input.Host);

            Console.WriteLine("Analyzing the host file at " + input.Host);
            fileSystem.AlterFlatFile(hostPath, list =>
            {
                list.Fill(bottleText);
                list.Sort();

                Console.WriteLine("Contents of file " + hostPath);
                list.Each(x => Console.WriteLine("  " + x));
            });
        }
        public void GenerateSampleApplicationSettings()
        {
            var settings = new EnvironmentSettings();

            settings.couchbaseServers = new List <CouchbaseServer>();
            settings.couchbaseServers.Add(new CouchbaseServer()
            {
                id             = "default",
                uri            = "couchbase://127.0.0.1",
                bucketName     = "couch",
                bucketPassword = "******"
            });

            settings.primaryCouchbaseServer = "default";

            settings.sqlServers = new List <SQLServer>();
            settings.sqlServers.Add(new SQLServer()
            {
                id = "default",
                connectionString = "Server=localhost;"
            });

            settings.primarySqlServer = "default";

            settings.contentStorages = new List <StorageLocation>();
            settings.contentStorages.Add(
                new StorageLocation()
            {
                id   = "default",
                path = "D:\\_contents"
            });

            settings.primaryContentStorage = "default";

            settings.applicationStorages = new List <StorageLocation>();
            settings.applicationStorages.Add(
                new StorageLocation()
            {
                id   = "default",
                path = "D:\\_webs"
            });

            settings.primaryApplicationStorage = "default";

            string serialized = Newtonsoft.Json.JsonConvert.SerializeObject(settings, Newtonsoft.Json.Formatting.Indented);
        }
Example #13
0
        public void UpdateMaterial(Material material, EnvironmentSettings environmentSettings)
        {
            if (Settings == null)
            {
                return;
            }
            if (material == null)
            {
                return;
            }
            try
            {
                bool globalSnow = Settings.GetBooleanPropertyValue("GlobalSnow");

                if (globalSnow)
                {
                    material.SetFloat("_Snow_Amount", environmentSettings.SnowAmount * 2f);
                }
                else
                {
                    float snowAmount = Settings.GetFloatPropertyValue("SnowAmount");
                    material.SetFloat("_Snow_Amount", snowAmount * 2f);
                }

                material.SetFloat("_CullFarStart", 10000);

                material.SetFloat("_SnowColorBrightness", Settings.GetFloatPropertyValue("SnowColorBrightness"));

                material.SetColor("_HealthyColor", Settings.GetColorPropertyValue("HealthyColorTint"));
                material.SetColor("_DryColor", Settings.GetColorPropertyValue("DryColorTint"));

                material.SetFloat("_ColorNoiseSpread", Settings.GetFloatPropertyValue("ColorNoiseSpread"));
                material.SetFloat("_Cutoff", Settings.GetFloatPropertyValue("AlphaCutoff"));

                material.SetFloat("_InitialBend", Settings.GetFloatPropertyValue("InitialBend"));
                material.SetFloat("_Stiffness", Settings.GetFloatPropertyValue("Stiffness"));
                material.SetFloat("_Drag", Settings.GetFloatPropertyValue("Drag"));
                material.SetFloat("_ShiverDrag", Settings.GetFloatPropertyValue("ShiverDrag"));
                material.SetFloat("_ShiverDirectionality", Settings.GetFloatPropertyValue("ShiverDirectionality"));
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
Example #14
0
        /* setting value to null will delete the entry */
        WindLightSettings ISimulationDataEnvSettingsStorageInterface.this[UUID regionID]
        {
            get
            {
                WindLightSettings settings;
                if (!EnvironmentSettings.TryGetValue(regionID, out settings))
                {
                    throw new KeyNotFoundException();
                }
                return(settings);
            }
            set
            {
                using (var conn = new MySqlConnection(m_ConnectionString))
                {
                    conn.Open();
                    if (value == null)
                    {
#if DEBUG
                        m_Log.DebugFormat("Removing environment settings for {0}", regionID.ToString());
#endif
                        using (var cmd = new MySqlCommand("DELETE FROM environmentsettings WHERE RegionID = @regionid", conn))
                        {
                            cmd.Parameters.AddParameter("@regionid", regionID);
                            cmd.ExecuteNonQuery();
                        }
                    }
                    else
                    {
#if DEBUG
                        m_Log.DebugFormat("Storing new environment settings for {0}", regionID.ToString());
#endif
                        var param = new Dictionary <string, object>
                        {
                            ["RegionID"] = regionID
                        };
                        using (var ms = new MemoryStream())
                        {
                            value.Serialize(ms, regionID);
                            param["EnvironmentSettings"] = ms.ToArray();
                        }
                        conn.ReplaceInto("environmentsettings", param);
                    }
                }
            }
        }
Example #15
0
        public void UpdateMaterial(Material material, EnvironmentSettings environmentSettings)
        {
            if (Settings == null)
            {
                return;
            }

            material.SetFloat("_BaseSmoothness", Settings.GetFloatPropertyValue("BaseSmoothness"));
            material.SetFloat("_BaseAOIntensity", Settings.GetFloatPropertyValue("BaseAOIntensity"));
            material.SetColor("_BaseColor", Settings.GetColorPropertyValue("BaseColor"));

            material.SetFloat("_TopIntensity", Settings.GetFloatPropertyValue("TopIntensity"));
            material.SetFloat("_TopOffset", Settings.GetFloatPropertyValue("TopOffset"));
            material.SetFloat("_TopContrast", Settings.GetFloatPropertyValue("TopContrast"));
            material.SetFloat("_TopNormalIntensity", Settings.GetFloatPropertyValue("TopNormalIntensity"));
            material.SetColor("_TopColor", Settings.GetColorPropertyValue("TopColor"));
        }
Example #16
0
        public static HostManifest ReadFrom(string fileName, EnvironmentSettings environment)
        {
            var parser = new SettingsParser(fileName, environment.Overrides.ToDictionary());

            new FileSystem().ReadTextFile(fileName, parser.ParseText);

            var hostName = Path.GetFileNameWithoutExtension(fileName);
            var host     = new HostManifest(hostName);


            var settings = parser.Settings;

            host.RegisterSettings(settings);
            host.RegisterBottles(parser.References);

            return(host);
        }
Example #17
0
        public BotCompiler(BotMeta botMeta, string botDir, ILogger compileLogger, EnvironmentSettings environmentSettings)
        {
            _botMeta            = botMeta;
            _botDir             = botDir;
            this._compileLogger = compileLogger;

            switch (botMeta.BotType)
            {
            case BotMeta.BotTypes.JavaScript:
                _compiler = new JavaScriptCompiler(botMeta, botDir, compileLogger, environmentSettings);
                break;

            case BotMeta.BotTypes.Java:
                _compiler = new JavaCompiler(botMeta, botDir, compileLogger, environmentSettings);
                break;

            case BotMeta.BotTypes.Julia:
                _compiler = new JuliaCompiler(botMeta, botDir, compileLogger, environmentSettings);
                break;

            case BotMeta.BotTypes.Python2:
            case BotMeta.BotTypes.Python3:
                _compiler = new PythonCompiler(botMeta, botDir, compileLogger, environmentSettings);
                break;

            case BotMeta.BotTypes.Golang:
                _compiler = new GolangCompiler(botMeta, botDir, compileLogger, environmentSettings);
                break;

            case BotMeta.BotTypes.Rust:
                _compiler = new RustCompiler(botMeta, botDir, compileLogger, environmentSettings);
                break;

            case BotMeta.BotTypes.FSharp:
                throw new ArgumentException("F# is not supported (No sample bot submitted)");

            case BotMeta.BotTypes.CPlusPlus:
                _compiler = new DotNetCompiler(botMeta, botDir, compileLogger, environmentSettings);
                break;

            default:
                _compiler = new DotNetCompiler(botMeta, botDir, compileLogger, environmentSettings);
                break;
            }
        }
Example #18
0
        public UserControllerTests()
        {
            _loggerMock = new Mock <ILogger <UserController> >();
            EnvironmentSettings envSettings = new EnvironmentSettings()
            {
                BaseUrl = "http://localhost:3000/", JwtSecret = "DoNotUseMeInProduction", Environment = "Development"
            };

            _envSettingsMock = new Mock <IOptions <EnvironmentSettings> >();
            _envSettingsMock.Setup(x => x.Value).Returns(envSettings);
            LdapSettings ldapSettings = new LdapSettings()
            {
                BaseDN = "5", HostName = "4", Port = "123", SecureSocketLayer = "false"
            };

            _ldapSettings = new Mock <IOptions <LdapSettings> >();
            _ldapSettings.Setup(x => x.Value).Returns(ldapSettings);
        }
 public Step(
     ScenarioContext scenarioContext,
     FeatureContext featureContext,
     HttpHelper httphelper,
     EnvironmentSettings settings,
     HttpResponseHelper assertHelper,
     SqlHelper sqlhelper,
     CosmosHelper cosmosHelper)
 {
     _scenarioContext = scenarioContext;
     _featureContext  = featureContext;
     _settings        = settings;
     _httpHelper      = httphelper;
     _assertionHelper = assertHelper;
     _sqlHelper       = sqlhelper;
     _cosmosHelper    = cosmosHelper;
     _touchPointId    = _settings.TestEndpoint01;
 }
Example #20
0
        private static CloudBornWorkerConfiguration CreateConfiguration(ICodePackageActivationContext activationContext)
        {
            var configurationPackage = activationContext.GetConfigurationPackageObject("Config");

            ConfigurationSection serviceEnvironmentSection = configurationPackage.Settings.Sections["ServiceEnvironment"];
            string dataCenter = serviceEnvironmentSection.Parameters["DataCenterName"].Value;
            string environmentSettingsResourceName  = serviceEnvironmentSection.Parameters["EnvironmentSettingsResourceName"].Value;
            EnvironmentSettings environmentSettings = EnvironmentSettingsLoader.Load(environmentSettingsResourceName);

            ConfigurationSection workerSection         = configurationPackage.Settings.Sections["CloudBornWorker"];
            TimeSpan             monitoringJobInterval = TimeSpan.FromMinutes(double.Parse(workerSection.Parameters["MonitoringJobIntervalInMinutes"].Value, CultureInfo.InvariantCulture));
            string externalPrincipals = environmentSettings.MonitoringAllowedExternalPrincipals;

            return(new CloudBornWorkerConfiguration(
                       dataCenter,
                       monitoringJobInterval,
                       externalPrincipals));
        }
        public void UpdateMaterial(Material material, EnvironmentSettings environmentSettings)
        {
            if (Settings == null)
            {
                return;
            }

            material.SetFloat("_AmbientOcclusion", Settings.GetFloatPropertyValue("AmbientOcclusion"));

            material.SetFloat("_TransmissionAmount", Settings.GetFloatPropertyValue("TranslucencyAmount"));
            material.SetFloat("_TransmissionSize", Settings.GetFloatPropertyValue("TranslucencySize"));

            material.SetFloat("_MaxWindStrength", Settings.GetFloatPropertyValue("WindInfluence"));
            material.SetFloat("_GlobalWindMotion", Settings.GetFloatPropertyValue("GlobalWindMotion"));
            material.SetFloat("_LeafFlutter", Settings.GetFloatPropertyValue("LeafFlutter"));
            material.SetFloat("_WindSwinging", Settings.GetFloatPropertyValue("WindSwinging"));
            material.SetFloat("_WindAmplitudeMultiplier", Settings.GetFloatPropertyValue("WindAmplitude"));
        }
Example #22
0
        public void UpdateMaterial(Material material, EnvironmentSettings environmentSettings)
        {
            if (Settings == null)
            {
                return;
            }
            material.SetColor("_Color", Settings.GetColorPropertyValue("TintColor1"));
            material.SetColor("_ColorB", Settings.GetColorPropertyValue("TintColor2"));
            material.SetFloat("_Cutoff", Settings.GetFloatPropertyValue("AlphaCutoff"));

            material.SetFloat("_RandomDarkening", Settings.GetFloatPropertyValue("RandomDarkening"));
            material.SetFloat("_RootAmbient", Settings.GetFloatPropertyValue("RootAmbient"));

            Vector4 colorScale = material.GetVector("_AG_ColorNoiseArea");

            colorScale = new Vector4(colorScale.x, Settings.GetFloatPropertyValue("TintAreaScale"), colorScale.z, colorScale.w);
            material.SetVector("_AG_ColorNoiseArea", colorScale);
        }
Example #23
0
        public static void InitializeScenario()
        {
            // write any initialization which you want to apply once for every scenario

            var _settings = new EnvironmentSettings();

            Threaded <Session>
            .With <LocalEnvironment>()
            .NavigateTo <HomePage>(_settings.BaseUrl);

            ScenarioContext.Current.AddOrUpdate(typeof(Cleaner).FullName, new Cleaner());

            //AFSession
            //    .With(TestRunHooks.Bootstrapper)
            //    .NavigateToPageInSettings<AuthorizationPage>();

            // ScenarioContext.Current.AddOrUpdate(typeof(Cleaner).FullName, new Cleaner());
        }
Example #24
0
        public void RestartCommand_FormsCorrectApplicationRequest_WhenApplicationRunsUnderNetCoreAndSettingsPickedFromEnvironment()
        {
            IApplicationClient applicationClient = Substitute.For <IApplicationClient>();
            var environmentSettings = new EnvironmentSettings {
                Login      = "******",
                Password   = "******",
                IsNetCore  = true,
                Maintainer = "Test",
                Uri        = "http://test.domain.com"
            };
            RestartCommand restartCommand = new RestartCommand(applicationClient, environmentSettings);
            var            options        = Substitute.For <RestartOptions>();

            restartCommand.Execute(options);
            applicationClient.Received(1).ExecutePostRequest(
                environmentSettings.Uri + "/ServiceModel/AppInstallerService.svc/RestartApp",
                "{}", Timeout.Infinite);
        }
Example #25
0
 public static Container Initialize(EnvironmentSettings envSettings)
 {
     return(new Container(
                _ =>
     {
         _.For <IBuilding>().Use <Building>();
         _.For <RobotFactory>().Use <RobotSpiderFactory>();
         _.For <IRobotLogger>().Use <RobotSpiderLogger>();
         _.For <IInstructionParser>().Use <InstructionParser>();
         _.For <IUpdateLocationStrategy>().Use <UpdateLocationStrategy>();
         _.For <MovementFactory>().Use <MovementStrategyFactory>();
         _.For <IMovementStrategy>().Use <SpiderMovementStrategy>();
         _.For <ISettings>().Use <Settings>();
         _.For <CompositeSpecification <GridSize> >().Use <GridSizeSpecification>();
         _.For <CompositeSpecification <Point> >().Use <InitialLocationSpecification>();
         _.For <CompositeSpecification <string> >().Use <InstructionSetSpecification>().Ctor <IList <char> >().Is(GetValidCharacters());
     }));
 }
Example #26
0
        public void UpdateMaterial(Material material, EnvironmentSettings environmentSettings)
        {
            if (Settings == null)
            {
                return;
            }
            Color foliageHueVariation = Settings.GetColorPropertyValue("FoliageHue");
            Color barkHueVariation    = Settings.GetColorPropertyValue("BarkHue");
            Color foliageTintColor    = Settings.GetColorPropertyValue("FoliageTintColor");
            Color barkTintColor       = Settings.GetColorPropertyValue("BarkTintColor");
            bool  replaceShader       = Settings.GetBooleanPropertyValue("ReplaceShader");


            if (material.HasProperty("_Cutoff"))
            {
                material.SetFloat("_Cutoff", material.GetFloat("_Cutoff"));
            }

            if (HasKeyword(material, "GEOM_TYPE_BRANCH"))
            {
                material.SetColor("_HueVariation", barkHueVariation);
                material.SetColor("_Color", barkTintColor);
            }
            else
            {
                material.SetColor("_HueVariation", foliageHueVariation);
                material.SetColor("_Color", foliageTintColor);
            }

            if (replaceShader)
            {
                if (material.shader.name == "Nature/SpeedTree")
                {
                    material.shader = Shader.Find("AwesomeTechnologies/VS_SpeedTree");
                }
            }
            //else
            //{
            //    if (material.shader.name != "Nature/SpeedTree")
            //    {
            //        material.shader = Shader.Find("Nature/SpeedTree");
            //    }
            //}
        }
Example #27
0
        public override async Task RunCommand(object sender)
        {
            var engine  = (IAutomationEngineInstance)sender;
            var vTaskId = (Guid)await v_TaskId.EvaluateCode(engine);

            var vAwaitCompletion = (bool)await v_AwaitCompletion.EvaluateCode(engine);

            string vUsername;
            string vPassword;

            var environmentSettings = new EnvironmentSettings();

            environmentSettings.Load();
            AuthMethods authMethods = new AuthMethods();

            authMethods.Initialize(environmentSettings.ServerType, environmentSettings.OrganizationName, environmentSettings.ServerUrl, environmentSettings.Username, environmentSettings.Password);

            if (environmentSettings.ServerType == "Local")
            {
                throw new Exception("Documents commands cannot be used with local Server");
            }
            else
            {
                vUsername = environmentSettings.Username;
                vPassword = environmentSettings.Password;
            }

            var            userInfo  = authMethods.GetDocumentsAuthToken(vUsername, vPassword);
            DocumentStatus docStatus = DocumentMethods.GetDocumentStatus(userInfo, vTaskId);

            if (vAwaitCompletion)
            {
                int vTimeout = (int)await v_Timeout.EvaluateCode(engine);

                docStatus = DocumentMethods.AwaitProcessing(userInfo, vTaskId, vTimeout);
            }

            docStatus.Status.SetVariableValue(engine, v_OutputUserVariableName);
            docStatus.IsDocumentCompleted.SetVariableValue(engine, v_OutputUserVariableName1);
            docStatus.HasError.SetVariableValue(engine, v_OutputUserVariableName2);
            docStatus.IsCurrentlyProcessing.SetVariableValue(engine, v_OutputUserVariableName3);
            docStatus.IsSuccessful.SetVariableValue(engine, v_OutputUserVariableName4);
        }
Example #28
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();

            services.AddHttpClient();

            services.AddHttpClient <IWeatherDataRepository, WeatherDataRepository>();

            services.AddTransient <IPlaylistRepository, PlaylistRepository>();

            services.AddMediatR(typeof(GetPlaylistForCityQuery).GetTypeInfo().Assembly);
            services.AddTransient(typeof(IPipelineBehavior <,>), typeof(RequestValidationBehavior <,>));
            services.AddSingleton <IClock>(SystemClock.Instance);

            services.AddTransient <EnvironmentSettings>(s =>
            {
                EnvironmentSettings settings = new EnvironmentSettings();

                var builder = new ConfigurationBuilder()
                              .AddJsonFile("appSettings.json", optional: true)
                              .AddEnvironmentVariables();
                var config = builder.Build();

                ConfigurationBinder.Bind(config, settings);

                services.Configure <EnvironmentSettings>(options => Configuration.GetSection("EnviromentSettings").Bind(options));

                return(settings);
            });

            services.AddDbContext <IngaiaInterviewDbContext>(options =>
                                                             options.UseNpgsql(ConvertUrlConnectionString(Configuration.GetValue <string>("DATABASE_URL"))));

            services.AddMvc(options => options.Filters.Add(typeof(ExceptionsFilterAttribute)))
            .AddFluentValidation(fv => fv.RegisterValidatorsFromAssemblyContaining <GetPlaylistForCityQueryValidator>());

            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new OpenApiInfo {
                    Title = "Ingaia Interview", Version = "v1"
                });
            });
        }
Example #29
0
        private void OnClick_NugetFeedManager(object sender, RoutedEventArgs e)
        {
            string appDataPath        = new EnvironmentSettings().GetEnvironmentVariablePath();
            string appSettingsDirPath = Directory.GetParent(appDataPath).FullName;

            var appSettings      = new ApplicationSettings().GetOrCreateApplicationSettings(appSettingsDirPath);
            var packageSourcesDT = appSettings.ClientSettings.PackageSourceDT;

            NugetFeedManager nugetFeedManager = new NugetFeedManager(packageSourcesDT);

            nugetFeedManager.Owner = this;
            nugetFeedManager.ShowDialog();

            if (nugetFeedManager.isDataUpdated)
            {
                appSettings.ClientSettings.PackageSourceDT = nugetFeedManager.GetPackageSourcesData();
                appSettings.Save(appSettings, appSettingsDirPath);
            }
        }
Example #30
0
        /// <summary>
        ///   Sets up the configuration based on arguments passed in, config file, and environment
        /// </summary>
        /// <param name="args">The arguments.</param>
        /// <param name="config">The configuration.</param>
        /// <param name="container">The container.</param>
        /// <param name="license">The license.</param>
        /// <param name="notifyWarnLoggingAction">Notify warn logging action</param>
        public static void set_up_configuration(IList <string> args, ChocolateyConfiguration config, Container container, ChocolateyLicense license, Action <string> notifyWarnLoggingAction)
        {
            var fileSystem         = container.GetInstance <IFileSystem>();
            var xmlService         = container.GetInstance <IXmlService>();
            var configFileSettings = get_config_file_settings(fileSystem, xmlService);

            // must be done prior to setting the file configuration
            add_or_remove_licensed_source(license, configFileSettings);
            set_file_configuration(config, configFileSettings, fileSystem, notifyWarnLoggingAction);
            ConfigurationOptions.reset_options();
            set_global_options(args, config, container);
            set_environment_options(config);
            EnvironmentSettings.set_environment_variables(config);
            // must be done last for overrides
            set_licensed_options(config, license, configFileSettings);
            // save all changes if there are any
            set_config_file_settings(configFileSettings, xmlService, config);
            set_hash_provider(config, container);
        }
Example #31
0
 public void UpdateSysSetting(SysSettingsOptions opts, EnvironmentSettings settings = null)
 {
     try {
         string requestData = string.Empty;
         if (opts.Type.Contains("Text"))
         {
             //Enclosed opts.Value in "", otherwise update fails for all text settings
             requestData = "{\"isPersonal\":false,\"sysSettingsValues\":{" + string.Format("\"{0}\":\"{1}\"", opts.Code, opts.Value) + "}}";
         }
         else
         {
             requestData = "{\"isPersonal\":false,\"sysSettingsValues\":{" + string.Format("\"{0}\":{1}", opts.Code, opts.Value) + "}}";
         }
         ApplicationClient.ExecutePostRequest(PostSysSettingsValuesUrl, requestData);
         Console.WriteLine("SysSettings with code: {0} updated.", opts.Code);
     } catch {
         Console.WriteLine("SysSettings with code: {0} is not updated.", opts.Code);
     }
 }
        public void AnalysisResultGetTest()
        {
            var commonResults = new CommonInputParameterViewModel
            {
                FileName = Path.Combine(EnvironmentSettings.GetInstance().DataUploadPath, CsvFileName)
            };

            var analysisParameters = new OutputParametersViewModel()
            {
                CommonResults = commonResults,

                NightWatchmanResults = new NightWatchmanAnalysisResultsViewModel(),
                ShoppingResults      = new ShoppingAnalysisViewModel()
            };

            var result = new SavingsAnalysisController().AnalysisResults(analysisParameters) as ViewResult;

            Assert.AreEqual(Path.Combine(EnvironmentSettings.GetInstance().DataUploadPath, CsvFileName), result.ViewBag.SelectedFile);
        }
        public void UpdateMaterial(Material material, EnvironmentSettings environmentSettings)
        {
            if (Settings == null)
            {
                return;
            }
            float GlobalWindInfluence = Settings.GetFloatPropertyValue("MtreeGlobalWindInfluence");

            material.SetFloat("_GlobalWindInfluence", GlobalWindInfluence);
            float aoStrength = Settings.GetFloatPropertyValue("AmbientOcclusion");

            material.SetFloat("_OcclusionStrength", aoStrength);

            if (material.shader.name == "Mtree/Bark")
            {
                Color barkTintColor = Settings.GetColorPropertyValue("BarkTintColor");
                material.SetColor("_Color", barkTintColor);
            }
            if (material.shader.name == "Mtree/Leafs")
            {
                Color foliageTintColor = Settings.GetColorPropertyValue("FoliageTintColor");
                material.SetColor("_Color", foliageTintColor);

                float foliageCutoff = Settings.GetFloatPropertyValue("MtreeCutoff");
                material.SetFloat("_Cutoff", foliageCutoff);

                float translucentStrength = Settings.GetFloatPropertyValue("TranslucentStrength");
                material.SetFloat("_Translucency", translucentStrength);

                float TransNormalDistortion = Settings.GetFloatPropertyValue("TransnormalDistortion");
                material.SetFloat("_TransNormalDistortion", TransNormalDistortion);

                float TransScattering = Settings.GetFloatPropertyValue("TransScattering");
                material.SetFloat("_TransScattering", TransScattering);

                Color translucentColor = Settings.GetColorPropertyValue("TranslucentColor");
                material.SetColor("_TranslucencyTint", translucentColor);

                float GlobalWindTurbulence = Settings.GetFloatPropertyValue("MtreeGlobalWindTurbulence");
                material.SetFloat("_GlobalTurbulenceInfluence", GlobalWindTurbulence);
            }
        }
Example #34
0
        public DriverSession(IDecoratedWebDriver webDriver, EnvironmentSettings environmentSettings, ILogger logger, IControlSettings controlSettings)
        {
            if (webDriver == null)
            {
                throw new System.ArgumentNullException(nameof(webDriver));
            }
            if (environmentSettings == null)
            {
                throw new System.ArgumentNullException(nameof(environmentSettings));
            }
            if (controlSettings == null)
            {
                throw new System.ArgumentNullException(nameof(controlSettings));
            }

            WebDriver           = webDriver;
            EnvironmentSettings = environmentSettings;
            ControlSettings     = controlSettings;
            Waiter = new Waiter(webDriver, logger, controlSettings);
        }
Example #35
0
        /// <summary>
        ///   Sets up the configuration based on arguments passed in, config file, and environment
        /// </summary>
        /// <param name="args">The arguments.</param>
        /// <param name="config">The configuration.</param>
        /// <param name="container">The container.</param>
        /// <param name="license">The license.</param>
        /// <param name="notifyWarnLoggingAction">Notify warn logging action</param>
        /// <returns>false if command line argument was incorrect, true if succeeded</returns>
        public static bool set_up_configuration(IList <string> args, ChocolateyConfiguration config, Container container, Action <string> notifyWarnLoggingAction)
        {
            var fileSystem         = container.GetInstance <IFileSystem>();
            var xmlService         = container.GetInstance <IXmlService>();
            var configFileSettings = get_config_file_settings(fileSystem, xmlService);

            set_file_configuration(config, configFileSettings, fileSystem, notifyWarnLoggingAction);
            ChocolateyOptionSet.Instance.Clear();
            if (ChocolateyOptionSet.Instance.Parse(args, new ChocolateyMainCommand(), config))
            {
                return(false);
            }

            set_environment_options(config);
            EnvironmentSettings.set_environment_variables(config);
            // save all changes if there are any
            set_config_file_settings(configFileSettings, xmlService, config);
            set_hash_provider(config, container);
            return(true);
        }
 public void UpdateMaterial(Material material, EnvironmentSettings environmentSettings)
 {
     if (Settings == null)
     {
         return;
     }
     if (material.shader.name == "Mtree/Bark")
     {
         Color barkTintColor = Settings.GetColorPropertyValue("BarkTintColor");
         material.SetColor("_Color", barkTintColor);
     }
     if (material.shader.name == "Mtree/Leafs")
     {
         Color foliageTintColor         = Settings.GetColorPropertyValue("FoliageTintColor");
         Color foliageTranslucencyColor = Settings.GetColorPropertyValue("FoliageTranslucencyColor");
         material.SetColor("_Color", foliageTintColor);
         material.SetColor("_TranslucencyColor", foliageTranslucencyColor);
         material.SetFloat("_Cutoff", material.GetFloat("_Cutoff"));
     }
 }
Example #37
0
        public static UserInfo RefreshToken(IAutomationEngineInstance engine)
        {
            var sessionVariablesDict = engine.EngineContext.SessionVariables;

            UserInfo userInfo = (UserInfo)sessionVariablesDict["UserInfo"];

            sessionVariablesDict.Remove("UserInfo");

            //use refresh token and get new auth/refresh tokens
            var environmentSettings = new EnvironmentSettings();

            environmentSettings.Load();
            AuthMethods authMethods = new AuthMethods();

            authMethods.Initialize(environmentSettings.ServerType, environmentSettings.OrganizationName, environmentSettings.ServerUrl, environmentSettings.Username, environmentSettings.Password, environmentSettings.AgentId);

            authMethods.RefreshToken(userInfo);

            return(userInfo);
        }
Example #38
0
        public static async Task <IAppSettings> CreateAsync()
        {
            IAppSettings settings = default;
            await Task.Run(() =>
            {
                if (SettingsFactory.IsDocker)
                {
                    settings = new EnvironmentSettings();
                }
                else
                {
                    LocalSettings localSettings = new LocalSettings();
                    localSettings.LoadSettings();

                    settings = localSettings;
                }
            });

            return(settings);
        }
Example #39
0
        public void ConfigRenderTests()
        {
            var Config          = new Configuration();
            var DefaultSettings = new EnvironmentSettings();

            DefaultSettings.Environment = "Default";
            DefaultSettings.Settings.Add("Key1", "Value1");
            DefaultSettings.Settings.Add("Key2", 2);
            DefaultSettings.Settings.Add("Key3", 3.1);
            DefaultSettings.Settings.Add("Key4", false);
            DefaultSettings.Settings.Add("Key5", DateTime.Now);
            Config.DefaultSettings = DefaultSettings;
            var DevSettings = new EnvironmentSettings();

            DevSettings.Environment = "Local";
            DevSettings.Host.Add("NSWIN10VM");
            DevSettings.Host.Add("*localhost:*");
            DevSettings.Settings.Add("Key1", "LOCALValue1");
            DevSettings.Settings.Add("Key2", 102);
            Config.Environments.Add(DevSettings.Environment, DevSettings);
            var ProdSettings = new EnvironmentSettings();

            ProdSettings.Environment = "Prod";
            ProdSettings.Host.Add("Ezprod.com");
            ProdSettings.Settings.Add("Key1", "PRODValue1");
            ProdSettings.Settings.Add("Key2", 902);
            ProdSettings.Settings.Add("Key5", DateTime.Now.AddDays(10));
            Config.Environments.Add(ProdSettings.Environment, ProdSettings);
            var json = JsonConvert.SerializeObject(
                Config
                , Newtonsoft.Json.Formatting.Indented);
            var newConfig = JsonConvert.DeserializeObject <Configuration>(json);

            Assert.IsTrue(Config["Key1"].Equals("Value1"), "Key should have equaled Val1");
            Config.Url = "http://localhost:50000";
            Assert.IsTrue(Config["Key1"].Equals("LOCALValue1"), "Key should have equaled LOCALValue1");
            Config.HostName = "SIM-SVR03";
            Assert.IsTrue(Config["Key1"].Equals("PRODValue1"), "Key should have equaled PRODValue1");
            Config.HostName = "NSWIN10VM";
            Assert.IsTrue(Config["Key1"].Equals("LOCALValue1"), "Key should have equaled LOCALValue1");
        }
 public InstallDNXCommand(EnvironmentSettings settings, DNXSettings dnxsettings)
 {
     this.settings = settings;
     this.dnxsettings = dnxsettings;
 }
 public void Setup() {
     envSettings = new EnvironmentSettings();
     ProjectsInfo productInfo = new ProjectsInfo(new System.Xml.XmlDocument(), null);
     factory = new CommandFactory(envSettings, productInfo);
 }
 InstallPackageCommand(EnvironmentSettings settings) {
     this.settings = settings;
 }
        public DownloadDNVMCommand(EnvironmentSettings settings)

        {
            this.settings = settings;
        }
Example #44
0
 private Settings(AuthSettings auth, EnvironmentSettings environment)
 {
     Auth = auth;
     Environment = environment;
 }
 public InstallPackageCommand(EnvironmentSettings settings, string pathToPackage)
     : this(settings) {
     this.settings = settings;
     this.pathToPackage = pathToPackage;
 }
 public InstallPackageCommand(EnvironmentSettings settings, CoreClrProject project)
 {
     this.settings = settings;
     this.project = project;
 }
Example #47
0
 public BuildCommand(EnvironmentSettings settings, CoreClrProject project)
 {
     this.settings = settings;
     this.project = project;
 }
 public GetFromVCSCommand(EnvironmentSettings settings, string remotePath, string workingDir) :
     this(settings, remotePath, string.Empty, string.Empty, workingDir)
 { }