public static void AddEnvironmentalReading(Source source, DateTime timestamp, float reading, EnvironmentType type) { lock (_lock) { _entities.AddNewEnvironmentLog(timestamp, (int)source, reading, (int)type); } }
/// <summary> /// The base constructor to create a report request /// </summary> /// <param name="merchantID">The merchant id</param> /// <param name="merchantKey">The merchant key</param> /// <param name="environment">The Environment</param> public ReportRequestBase(long merchantID, string merchantKey, EnvironmentType environment) { _MerchantID = merchantID.ToString(); _MerchantKey = merchantKey; _Environment = environment; }
public override IEnumerable<Module> GetModules(EnvironmentType environmentType) { yield return new AutofacWebTypesModule(); yield return new InProcObjectStorageModule(); yield return new LoggingModule(); }
public string GetEnvironmentBasedValue(string property, EnvironmentType env) { try { return this.OfType<EnvironmentDependentValue>().Single(cs => cs.Property == property && cs.Environment == env).Value; } catch (Exception e) { throw new ConfigurationErrorsException(String.Format("Unable to get configuration property '{0}' from environment based variable for {1} platform", property, env.ToString()), e); } }
public static AzureTestCredentials GetCredentialsForEnvironmentType(EnvironmentType type) { AzureTestCredentials[] environments = TestManager.GetAllCredentials().ToArray(); for (int i = 0; i < environments.Length; i++) { if (environments[i].EnvironmentType == type) { return environments[i]; } } return null; }
public void setEnvironment(string env) { switch (env) { case "barrier": envType = EnvironmentType.Barrier; tileColor = new Color(42f / 255f, 42f / 255f, 42f / 255f, 1f); isAccessible = false; break; case "stone": envType = EnvironmentType.Plains; tileColor = new Color(195f / 255f, 5f / 255f, 55f / 255f, 1f); isAccessible = true; //tileStatus = "Stoned #420"; break; case "grass": envType = EnvironmentType.Grass; tileColor = new Color(144f / 255f, 219f / 255f, 31f / 255f, 1.0f); isAccessible = true; tileStatus = "Normal"; break; case "plains": envType = EnvironmentType.Plains; tileColor = new Color(210f / 255f, 170f / 255f, 40f / 255f, 1f); isAccessible = true; tileStatus = "Poison"; break; case "tallgrass": envType = EnvironmentType.TallGrass; tileColor = new Color(27f / 255f, 183 / 255f, 21 / 255f, 1f); isAccessible = true; tileStatus = "tallgrass"; break; case "swamp": envType = EnvironmentType.Swamp; tileColor = new Color(52f / 255f, 125f / 255f, 13f / 255f, 1f); isAccessible = true; tileStatus = "Poison"; break; case "forest": envType = EnvironmentType.Forest; tileColor = new Color(122f / 255f, 86f / 255f, 54f / 255f, 1f); isAccessible = true; tileStatus = "Normal"; break; } }
/// <summary> /// This method is called by the <see cref="GCheckoutButton"/> class and /// initializes a new instance of the /// <see cref="CheckoutShoppingCartRequest"/> class. /// </summary> /// <param name="MerchantID">The Google Checkout merchant ID assigned /// to a particular merchant.</param> /// <param name="MerchantKey">The Google Checkout merchant key assigned /// to a particular merchant.</param> /// <param name="Env">The environment where a request is being executed. /// Valid values for this parameter are "Sandbox" and "Production".</param> /// <param name="Currency">The currency associated with prices in a /// Checkout API request. At this time, the only supported currency value /// is "USD", which corresponds to U.S. dollars.</param> /// <param name="CartExpirationMinutes"> /// The length of time, in minutes, after which the shopping cart will /// expire if it has not been submitted. A value of <b>0</b> indicates /// the cart does not expire. /// </param> public CheckoutShoppingCartRequest(string MerchantID, string MerchantKey, EnvironmentType Env, string Currency, int CartExpirationMinutes) { _MerchantID = MerchantID; _MerchantKey = MerchantKey; _Environment = Env; _Items = new ArrayList(); _TaxTables = new AutoGen.TaxTables(); _TaxTables.defaulttaxtable = new AutoGen.DefaultTaxTable(); _TaxTables.defaulttaxtable.taxrules = new AutoGen.DefaultTaxRule[0]; _ShippingMethods = new AutoGen.MerchantCheckoutFlowSupportShippingmethods(); _ShippingMethods.Items = new Object[0]; _Currency = Currency; if (CartExpirationMinutes > 0) { SetExpirationMinutesFromNow(CartExpirationMinutes); } }
public static EnvironmentConfig WithDefaultsForEnvironmentType( this EnvironmentConfig config, EnvironmentType environmentType) { switch (environmentType) { case EnvironmentType.Development: config.ForDevelopment(); break; case EnvironmentType.Test: case EnvironmentType.Production: config.Add( "Administration", DefaultLogicalInstanceName, Environment.MachineName); break; } return config; }
// =========================================================================================================== /// <summary> /// Initializes the deployer based on the specified arguments /// </summary> /// <param name="WorkingDirectory">The working directory on which to map the deployer</param> /// <param name="Environment">The type of environment on which the deployer is executed</param> /// <param name="Credential">The credential that must be used the get the SharePoint context</param> // =========================================================================================================== public Deployer(string WorkingDirectory, EnvironmentType Environment, ICredentials Credentials) { // -------------------------------------------------- // If the WorkingDirectory doesn't exist // -------------------------------------------------- if (!Directory.Exists(WorkingDirectory)) throw new DeployerArgumentsException(String.Format(ERROR_FOLDER_INVALID, WorkingDirectory)); // -------------------------------------------------- // Initializes the deployer's arguments // -------------------------------------------------- this.WorkingDirectory = WorkingDirectory; logger.Info("Loaded 'WorkingDirectory' with value '{0}'", this.WorkingDirectory); this.Environment = Environment; logger.Info("Loaded 'EnvironmentType' with value '{0}'", this.Environment); this.Credentials = Credentials; logger.Info("Loaded 'Credentials' with success"); }
public bool TryGetEnvironmentBasedValue(string property, EnvironmentType env, out string value) { try { var dependentValue = this.OfType<EnvironmentDependentValue>().FirstOrDefault(cs => cs.Property == property && cs.Environment == env); if (dependentValue != null) { value = dependentValue.Value; return true; } else { value = null; return false; } } catch (Exception e) { throw new ConfigurationErrorsException(String.Format("Unable to get configuration property '{0}' from environment based variable for {1} platform", property, env.ToString()), e); } }
// =========================================================================================================== /// <summary> /// Returns the correct credential set based on the environment and PromptCredentials switch /// </summary> /// <param name="environment">The environment on which the deployer is executed</param> /// <param name="prompt">Whether the user should be prompted for credentials or not (always true for online)</param> /// <returns>A <b>NetworkCredential</b> object</returns> // =========================================================================================================== private static ICredentials GetAuthenticationCredentials(EnvironmentType environment, bool prompt) { ICredentials credentials = CredentialCache.DefaultNetworkCredentials; if(prompt || environment == EnvironmentType.Online) { string username = ConsoleUtility.GetInputAsText(LABEL_USERNAME); SecureString password = ConsoleUtility.GetInputAsSecureString(LABEL_PASSWORD); Console.WriteLine(string.Empty); if(environment == EnvironmentType.Online) { credentials = new SharePointOnlineCredentials(username, password); } else { credentials = new NetworkCredential(username, password); } } return credentials; }
public static IServiceCollection AddHygouServices(this IServiceCollection sc, EnvironmentType envType) { sc.AddSetting <HygouSetting>(); sc.AddInitializer("data", "初始化Hygou数据", sp => SystemInitializer.Initialize(sp, envType)); sc.AddInitializer("product", "初始化Hygou产品", sp => SampleImporter.ImportSamples(sp)); sc.InitServices("初始化服务", NewSerivces); return(sc); }
/// <summary> /// 绑顶 方法 到一个环境的 Update /// </summary> /// <param name="action">方法</param> /// <param name=" envType"></param> public static void BindEnvUpdate(this Action action, EnvironmentType envType) { action.BindEnvUpdate(GetEnv(envType)); }
public T GetConfiguration <T>(EnvironmentType env) { var objectProperties = _dataProvider.GetProperties(env); return(_objectBuilder.Build <T>(objectProperties)); }
/// <summary> /// 开启一个携程 /// </summary> /// <param name="obj"></param> /// <param name=" envType"></param> /// <param name="routine">迭代器</param> /// <returns></returns> public static ICoroutine StartCoroutine(this object obj, IEnumerator routine, EnvironmentType envType) { var _env = Framework.GetEnv(envType); return(_env.modules.Coroutine.StartCoroutine(routine)); }
public ServiceCategoryHandler(AuthenticationToken authenticationToken, string accountID, EnvironmentType environmentType = EnvironmentType.Production, int itemsPerRequest = 100, int maximumRecursiveRequests = 50) : base($"{Common.GetBaseUrl(environmentType)}/v1/service_categories", authenticationToken, accountID, itemsPerRequest, maximumRecursiveRequests) { }
public void EnvironmentTypeTest() { var EnvType = new EnvironmentType(); Assert.IsNotNull(EnvType); }
public CheckoutShoppingCartRequestWrapper(string MerchantID, string MerchantKey, EnvironmentType Env, string Currency, int CartExpirationMinutes) : base(MerchantID, MerchantKey, Env, Currency, CartExpirationMinutes) { }
public static bool Check(OBB obb, EnvironmentType type) { return((int)(EnvironmentManager.Get(obb) & type) != 0); }
public static bool Check(Vector3 pos, EnvironmentType type) { return((int)(EnvironmentManager.Get(pos) & type) != 0); }
/// <summary> The the confirmation link /// </summary> /// <param name="userIdHash"> The user id hash. </param> /// <param name="confirmationCode"> The confirmation code. </param> /// <param name="entityType"> The entity type. </param> /// <param name="environment"> The environment. </param> /// <returns> /// The confirmation link /// </returns> /// <exception cref="NotSupportedException"> entity type isn't EmailAddress or AccountLink or environment isn't Integration or Production </exception> public static Uri GetLink(string userIdHash, int confirmationCode, EntityType entityType, EnvironmentType environment) { Uri baseUri; string method; switch (environment) { case EnvironmentType.Int: baseUri = BaseUriIntegration; break; case EnvironmentType.Prod: baseUri = BaseUriProd; break; default: throw new NotSupportedException(string.Format("The only supported envrironments are Prod and Int. {0} isn't supported", environment)); } switch (entityType) { case EntityType.AuthenticatedEmailAddress: method = "email"; break; case EntityType.UnAuthenticatedEmailAddress: method = "coemail"; break; case EntityType.AccountLink: method = "alink"; break; default: throw new NotSupportedException(string.Format("The only supported entities are EmailAddress and AccountLink. {0} isn't supported", entityType)); } string relativeUri = string.Format("{0}?uh={1}&c={2}", method, userIdHash, confirmationCode); return(new Uri(baseUri, relativeUri)); }
public override void ReadData(ESPReader reader, long dataEnd) { while (reader.BaseStream.Position < dataEnd) { string subTag = reader.PeekTag(); switch (subTag) { case "EDID": if (EditorID == null) { EditorID = new SimpleSubrecord <String>(); } EditorID.ReadBinary(reader); break; case "OBND": if (ObjectBounds == null) { ObjectBounds = new ObjectBounds(); } ObjectBounds.ReadBinary(reader); break; case "SNAM": if (Sounds == null) { Sounds = new List <RecordReference>(); } RecordReference tempSNAM = new RecordReference(); tempSNAM.ReadBinary(reader); Sounds.Add(tempSNAM); break; case "WNAM": if (WallaTriggerCount == null) { WallaTriggerCount = new SimpleSubrecord <UInt32>(); } WallaTriggerCount.ReadBinary(reader); break; case "RDAT": if (UseSoundFromRegion == null) { UseSoundFromRegion = new RecordReference(); } UseSoundFromRegion.ReadBinary(reader); break; case "ANAM": if (EnvironmentType == null) { EnvironmentType = new SimpleSubrecord <EnvironmentType>(); } EnvironmentType.ReadBinary(reader); break; case "INAM": if (IsInterior == null) { IsInterior = new SimpleSubrecord <IsInteriorEnum>(); } IsInterior.ReadBinary(reader); break; default: throw new Exception(); } } }
public override void ReadDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; if (ele.TryPathTo("EditorID", false, out subEle)) { if (EditorID == null) { EditorID = new SimpleSubrecord <String>(); } EditorID.ReadXML(subEle, master); } if (ele.TryPathTo("ObjectBounds", false, out subEle)) { if (ObjectBounds == null) { ObjectBounds = new ObjectBounds(); } ObjectBounds.ReadXML(subEle, master); } if (ele.TryPathTo("Sounds", false, out subEle)) { if (Sounds == null) { Sounds = new List <RecordReference>(); } foreach (XElement e in subEle.Elements()) { RecordReference tempSNAM = new RecordReference(); tempSNAM.ReadXML(e, master); Sounds.Add(tempSNAM); } } if (ele.TryPathTo("WallaTriggerCount", false, out subEle)) { if (WallaTriggerCount == null) { WallaTriggerCount = new SimpleSubrecord <UInt32>(); } WallaTriggerCount.ReadXML(subEle, master); } if (ele.TryPathTo("UseSoundFromRegion", false, out subEle)) { if (UseSoundFromRegion == null) { UseSoundFromRegion = new RecordReference(); } UseSoundFromRegion.ReadXML(subEle, master); } if (ele.TryPathTo("EnvironmentType", false, out subEle)) { if (EnvironmentType == null) { EnvironmentType = new SimpleSubrecord <EnvironmentType>(); } EnvironmentType.ReadXML(subEle, master); } if (ele.TryPathTo("IsInterior", false, out subEle)) { if (IsInterior == null) { IsInterior = new SimpleSubrecord <IsInteriorEnum>(); } IsInterior.ReadXML(subEle, master); } }
private static EnvironmentType GetCurrentEnvironment() { string currentEnvironment = ConfigurationManager.AppSettings["Environment"].ToLower(CultureInfo.CurrentCulture); EnvironmentType Environment = new EnvironmentType(); try { Environment = (EnvironmentType)Enum.Parse(typeof(EnvironmentType), currentEnvironment, true); } catch (System.ArgumentException) { Assert.Fail(" The current environment setting in 'Environment' in the app.config is invalid."); } return Environment; }
public string GetConnectionString(DatabaseType db, EnvironmentType env) { return this.OfType<ConnectionString>().Single(cs => cs.Database == db && cs.Environment == env).Value; }
/// <summary> /// Returns true if PipelineExecutionStepState instances are equal /// </summary> /// <param name="other">Instance of PipelineExecutionStepState to be compared</param> /// <returns>Boolean</returns> public bool Equals(PipelineExecutionStepState other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( StepId == other.StepId || StepId != null && StepId.Equals(other.StepId) ) && ( PhaseId == other.PhaseId || PhaseId != null && PhaseId.Equals(other.PhaseId) ) && ( Action == other.Action || Action != null && Action.Equals(other.Action) ) && ( Repository == other.Repository || Repository != null && Repository.Equals(other.Repository) ) && ( Branch == other.Branch || Branch != null && Branch.Equals(other.Branch) ) && ( Environment == other.Environment || Environment != null && Environment.Equals(other.Environment) ) && ( EnvironmentType == other.EnvironmentType || EnvironmentType != null && EnvironmentType.Equals(other.EnvironmentType) ) && ( StartedAt == other.StartedAt || StartedAt != null && StartedAt.Equals(other.StartedAt) ) && ( FinishedAt == other.FinishedAt || FinishedAt != null && FinishedAt.Equals(other.FinishedAt) ) && ( Details == other.Details || Details != null && other.Details != null && Details.SequenceEqual(other.Details) ) && ( Status == other.Status || Status.Equals(other.Status) ) && ( Links == other.Links || Links != null && Links.Equals(other.Links) )); }
public static void Simulate(string machineName, EnvironmentType? type, EnvironmentName? name) { _simulatedMachineName = machineName; _simulatedEnvironmentType = type; _simulatedEnvironmentName = name; _isSimulating = true; }
private PlatformEnvironment(EnvironmentType environmentType) { this.EnvironmentType = environmentType; }
public DBManagerBase(OriginType objOrigin, EnvironmentType objEnvironment) { iOrigin = objOrigin; iEnvironment = objEnvironment; switch (iOrigin) { case OriginType.STORMS: switch (iEnvironment) { case EnvironmentType.PRD: OLEDB_ConnectStr = WM.Common.Properties.Settings.Default.dbStormsOLE_Prod; Oracle_ConnectStr = WM.Common.Properties.Settings.Default.OracleConnection_STORMS_PRD; ServiceLoggerDomain = WM.Common.Properties.Settings.Default.LoggerDomain_PRD; ServiceLoggerUser = WM.Common.Properties.Settings.Default.LoggerUser_PRD; ServiceLoggerPassword = WM.Common.Properties.Settings.Default.LoggerPassword_PRD; CadApplicationServerName = WM.Common.Properties.Settings.Default.CadServer_PRD; StormsApiUri = new Uri(WM.Common.Properties.Settings.Default.StormsWebApiUri_PRD.ToString()); StormsApiCredentials = WM.Common.Properties.Settings.Default.STORMS_Api_PRD.ToString(); break; case EnvironmentType.STG: OLEDB_ConnectStr = WM.Common.Properties.Settings.Default.dbStormsOLE_Test; Oracle_ConnectStr = WM.Common.Properties.Settings.Default.OracleConnection_STORMS_STG; ServiceLoggerDomain = WM.Common.Properties.Settings.Default.LoggerDomain_STG; ServiceLoggerUser = WM.Common.Properties.Settings.Default.LoggerUser_STG; ServiceLoggerPassword = WM.Common.Properties.Settings.Default.LoggerPassword_STG; CadApplicationServerName = WM.Common.Properties.Settings.Default.CadServer_STG; StormsApiUri = new Uri(WM.Common.Properties.Settings.Default.StormsWebApiUri_STG.ToString()); StormsApiCredentials = WM.Common.Properties.Settings.Default.STORMS_Api_STG.ToString(); break; case EnvironmentType.DEV: OLEDB_ConnectStr = WM.Common.Properties.Settings.Default.dbStormsOLE_Dev; Oracle_ConnectStr = WM.Common.Properties.Settings.Default.OracleConnection_STORMS_DEV; ServiceLoggerDomain = WM.Common.Properties.Settings.Default.LoggerDomain_DEV; ServiceLoggerUser = WM.Common.Properties.Settings.Default.LoggerUser_DEV; ServiceLoggerPassword = WM.Common.Properties.Settings.Default.LoggerPassword_DEV; CadApplicationServerName = WM.Common.Properties.Settings.Default.CadServer_DEV; StormsApiUri = new Uri(WM.Common.Properties.Settings.Default.StormsWebApiUri_DEV.ToString()); StormsApiCredentials = WM.Common.Properties.Settings.Default.STORMS_Api_DEV.ToString(); System.Net.NetworkCredential myCred = new System.Net.NetworkCredential("xxxxx", "xxxxx", "WE"); System.Net.CredentialCache myCache = new System.Net.CredentialCache(); myCache.Add(new Uri(StormsApiUri.AbsoluteUri), "Basic", myCred); StormsWebRequest = System.Net.WebRequest.Create(new Uri(StormsApiUri.AbsoluteUri)); StormsWebRequest.Credentials = myCache; break; default: break; } break; case OriginType.CAD: switch (iEnvironment) { case EnvironmentType.PRD: OLEDB_ConnectStr = WM.Common.Properties.Settings.Default.dbCadOLE_Prod; Oracle_ConnectStr = WM.Common.Properties.Settings.Default.OracleConnection_CAD_PRD; iInboundJobUri = new Uri(WM.Common.Properties.Settings.Default.WM_Common_InboundJobService_InboundJobService.ToString()); iInboundDataItemUri = new Uri(WM.Common.Properties.Settings.Default.WM_Common_InboundDataItemService_InboundDataItemService.ToString()); iInboundAssignmentUri = new Uri(WM.Common.Properties.Settings.Default.WM_Common_InboundAssignmentService_InboundAssignmentService.ToString()); iInboundPersonnelUri = new Uri(WM.Common.Properties.Settings.Default.WM_Common_InboundPersonnelService_InboundPersonnelService.ToString()); iInboundAvailabilityUri = new Uri(WM.Common.Properties.Settings.Default.WM_Common_InboundAvailabilityService_InboundAvailabilityService.ToString()); ServiceLogFileName = WM.Common.Properties.Settings.Default.CadServiceLogFileName_PRD; ServiceLogDirectoryName = WM.Common.Properties.Settings.Default.CadServiceLogDirectoryName_PRD; ServiceLogHttpMessageFileName = WM.Common.Properties.Settings.Default.CadServiceLogHttpMessageFileName_PRD; ServiceLoggerDomain = WM.Common.Properties.Settings.Default.LoggerDomain_PRD; ServiceLoggerUser = WM.Common.Properties.Settings.Default.LoggerUser_PRD; ServiceLoggerPassword = WM.Common.Properties.Settings.Default.LoggerPassword_PRD; CadApplicationServerName = WM.Common.Properties.Settings.Default.CadServer_PRD; break; case EnvironmentType.STG: OLEDB_ConnectStr = WM.Common.Properties.Settings.Default.dbCadOLE_Stage; Oracle_ConnectStr = WM.Common.Properties.Settings.Default.OracleConnection_CAD_STG; iInboundJobUri = new Uri(WM.Common.Properties.Settings.Default.WM_Common_InboundJobService_InboundJobService_STG.ToString()); iInboundDataItemUri = new Uri(WM.Common.Properties.Settings.Default.WM_Common_InboundDataItemService_InboundDataItemService_STG.ToString()); iInboundAssignmentUri = new Uri(WM.Common.Properties.Settings.Default.WM_Common_InboundAssignmentService_InboundAssignmentService_STG.ToString()); iInboundPersonnelUri = new Uri(WM.Common.Properties.Settings.Default.WM_Common_InboundPersonnelService_InboundPersonnelService_STG.ToString()); iInboundAvailabilityUri = new Uri(WM.Common.Properties.Settings.Default.WM_Common_InboundAvailabilityService_InboundAvailabilityService_STG.ToString()); ServiceLogFileName = WM.Common.Properties.Settings.Default.CadServiceLogFileName_STG; ServiceLogDirectoryName = WM.Common.Properties.Settings.Default.CadServiceLogDirectoryName_STG; ServiceLogHttpMessageFileName = WM.Common.Properties.Settings.Default.CadServiceLogHttpMessageFileName_STG; ServiceLoggerDomain = WM.Common.Properties.Settings.Default.LoggerDomain_STG; ServiceLoggerUser = WM.Common.Properties.Settings.Default.LoggerUser_STG; ServiceLoggerPassword = WM.Common.Properties.Settings.Default.LoggerPassword_STG; CadApplicationServerName = WM.Common.Properties.Settings.Default.CadServer_STG; break; case EnvironmentType.DEV: OLEDB_ConnectStr = WM.Common.Properties.Settings.Default.dbCadOLE_Dev; Oracle_ConnectStr = WM.Common.Properties.Settings.Default.OracleConnection_CAD_DEV; iInboundJobUri = new Uri(WM.Common.Properties.Settings.Default.WM_Common_InboundJobService_InboundJobService_DEV.ToString()); iInboundDataItemUri = new Uri(WM.Common.Properties.Settings.Default.WM_Common_InboundDataItemService_InboundDataItemService_DEV.ToString()); iInboundAssignmentUri = new Uri(WM.Common.Properties.Settings.Default.WM_Common_InboundAssignmentService_InboundAssignmentService_DEV.ToString()); iInboundPersonnelUri = new Uri(WM.Common.Properties.Settings.Default.WM_Common_InboundPersonnelService_InboundPersonnelService_DEV.ToString()); iInboundAvailabilityUri = new Uri(WM.Common.Properties.Settings.Default.WM_Common_InboundAvailabilityService_InboundAvailabilityService_DEV.ToString()); ServiceLogFileName = WM.Common.Properties.Settings.Default.CadServiceLogFileName_DEV; ServiceLogDirectoryName = WM.Common.Properties.Settings.Default.CadServiceLogDirectoryName_DEV; ServiceLogHttpMessageFileName = WM.Common.Properties.Settings.Default.CadServiceLogHttpMessageFileName_DEV; ServiceLoggerDomain = WM.Common.Properties.Settings.Default.LoggerDomain_DEV; ServiceLoggerUser = WM.Common.Properties.Settings.Default.LoggerUser_DEV; ServiceLoggerPassword = WM.Common.Properties.Settings.Default.LoggerPassword_DEV; CadApplicationServerName = WM.Common.Properties.Settings.Default.CadServer_DEV; CadAttachmentRepository = WM.Common.Properties.Settings.Default.CadAttachmentRepository_DEV; CadLocalAttachmentRepository = WM.Common.Properties.Settings.Default.CadLocalAttachmentRepository_DEV; FieldOrderApiUri = new Uri(WM.Common.Properties.Settings.Default.StormsWebApiUri_DEV.ToString()); FieldOrderApiCredentials = WM.Common.Properties.Settings.Default.FieldOrderApi64EncodedCredentials_DEV.ToString(); System.Net.NetworkCredential myCred = new System.Net.NetworkCredential("xxxxx", "xxxxx", "WE"); System.Net.CredentialCache myCache = new System.Net.CredentialCache(); myCache.Add(new Uri(FieldOrderApiUri.AbsoluteUri), "Basic", myCred); FieldOrderWebRequest = System.Net.WebRequest.Create(new Uri(FieldOrderApiUri.AbsoluteUri)); FieldOrderWebRequest.Credentials = myCache; break; default: OLEDB_ConnectStr = WM.Common.Properties.Settings.Default.dbCadOLE_Prod; Oracle_ConnectStr = WM.Common.Properties.Settings.Default.OracleConnection_CAD_PRD; iInboundJobUri = new Uri(WM.Common.Properties.Settings.Default.WM_Common_InboundJobService_InboundJobService.ToString()); iInboundDataItemUri = new Uri(WM.Common.Properties.Settings.Default.WM_Common_InboundDataItemService_InboundDataItemService.ToString()); iInboundAssignmentUri = new Uri(WM.Common.Properties.Settings.Default.WM_Common_InboundAssignmentService_InboundAssignmentService.ToString()); iInboundPersonnelUri = new Uri(WM.Common.Properties.Settings.Default.WM_Common_InboundPersonnelService_InboundPersonnelService.ToString()); iInboundAvailabilityUri = new Uri(WM.Common.Properties.Settings.Default.WM_Common_InboundAvailabilityService_InboundAvailabilityService.ToString()); break; } break; case OriginType.ADS: switch (iEnvironment) { case EnvironmentType.DEV: AdsApiUri = new Uri(WM.Common.Properties.Settings.Default.AdsWebApiUri_DEV.ToString()); //AdsApiUri = new Uri("http://localhost/WMServices.ADSService/api/"); break; case EnvironmentType.STG: AdsApiUri = new Uri(WM.Common.Properties.Settings.Default.AdsWebApiUri_STG.ToString()); break; case EnvironmentType.PRD: AdsApiUri = new Uri(WM.Common.Properties.Settings.Default.AdsWebApiUri_PRD.ToString()); break; default: break; } break; case OriginType.CO: switch (iEnvironment) { case EnvironmentType.DEV: CoApiUri = new Uri(WM.Common.Properties.Settings.Default.CoWebApiUri_DEV.ToString()); break; case EnvironmentType.STG: CoApiUri = new Uri(WM.Common.Properties.Settings.Default.CoWebApiUri_STG.ToString()); break; case EnvironmentType.PRD: CoApiUri = new Uri(WM.Common.Properties.Settings.Default.CoWebApiUri_PRD.ToString()); break; default: break; } break; default: break; } }
public static void SubscribeToOnDirectoryInitializeExec(StorageEnvironmentOptions options, StorageConfiguration config, string databaseName, EnvironmentType envType, Logger logger) { if (string.IsNullOrEmpty(config.OnDirectoryInitializeExec)) { return; } var directoryParameters = new DirectoryParameters { OnDirectoryInitializeExec = config.OnDirectoryInitializeExec, OnDirectoryInitializeExecArguments = config.OnDirectoryInitializeExecArguments, OnDirectoryInitializeExecTimeout = config.OnDirectoryInitializeExecTimeout.AsTimeSpan, DatabaseName = databaseName, Type = envType }; void OnDirectory(StorageEnvironmentOptions internalOptions) { OnDirectoryInitialize(internalOptions, directoryParameters, logger); } options.OnDirectoryInitialize += OnDirectory; }
/// <summary> /// 分配一个实例 /// </summary> /// <param name="type">类型</param> /// <param name=" envType"></param> /// <returns></returns> public static RecyclableObject Allocate(Type type, EnvironmentType envType) { var _env = Framework.GetEnv(envType); return(Allocate(type, _env)); }
/// <summary> /// Create the application Context /// </summary> /// <param name="parent"></param> /// <param name="configContext"></param> /// <param name="section"></param> /// <returns></returns> public object Create(object parent, object configContext, XmlNode section) { GCheckoutConfigSection retVal = new GCheckoutConfigSection(); string productionMerchantID = string.Empty; string productionMerchantKey = string.Empty; string sandboxMerchantID = string.Empty; string sandboxMerchantKey = string.Empty; string currency = string.Empty; long platformID = 0; int envTemp = 0; bool useProxy = false; string proxyHost = string.Empty; string proxyUserName = string.Empty; string proxyPassword = string.Empty; string proxyDomain = string.Empty; EnvironmentType environment = EnvironmentType.Unknown; bool logging = false; string logTemp = string.Empty; string platformIDTemp = string.Empty; string logDirectory = string.Empty; string logDirectoryXml = string.Empty; GCheckoutConfigurationHelper.GetStringValue( section, "SandboxMerchantID", ref sandboxMerchantID); GCheckoutConfigurationHelper.GetStringValue( section, "SandboxMerchantKey", ref sandboxMerchantKey); GCheckoutConfigurationHelper.GetStringValue( section, "ProductionMerchantID", ref productionMerchantID); GCheckoutConfigurationHelper.GetStringValue( section, "ProductionMerchantKey", ref productionMerchantKey); GCheckoutConfigurationHelper.GetStringValue( section, "Currency", false, ref currency); GCheckoutConfigurationHelper.GetEnumValue( section, "Environment", typeof(EnvironmentType), ref envTemp); environment = (EnvironmentType)envTemp; GCheckoutConfigurationHelper.GetStringValue( section, "Logging", false, ref logTemp); if (logTemp != null && logTemp.Length > 0) { logging = logTemp.ToLower() == "true"; } //ensure we do not throw an exception. try { GCheckoutConfigurationHelper.GetStringValue( section, "PlatformID", false, ref platformIDTemp); if (platformIDTemp != null && platformIDTemp.Length > 0) { platformID = long.Parse(platformIDTemp); } } catch (Exception ex) { throw new ConfigurationErrorsException( "Error Setting PlatformID", ex); } GCheckoutConfigurationHelper.GetStringValue( section, "LogDirectory", false, ref logDirectory); GCheckoutConfigurationHelper.GetStringValue( section, "LogDirectoryXml", false, ref logDirectoryXml); try { retVal.ProductionMerchantID = long.Parse(productionMerchantID); } catch (Exception ex) { throw new ConfigurationErrorsException( "Error Setting ProductionMerchantID", ex); } retVal.ProductionMerchantKey = productionMerchantKey; try { retVal.SandboxMerchantID = long.Parse(sandboxMerchantID); } catch (Exception ex) { throw new ConfigurationErrorsException( "Error Setting SandboxMerchantID", ex); } //try to read the UseProxy Key. try { string useProxyVal = null; GCheckoutConfigurationHelper.GetStringValue( section, "UseProxy", false, ref useProxyVal); if (useProxyVal != null && useProxyVal.Length > 0) { useProxy = bool.Parse(useProxyVal); } } catch (Exception ex) { throw new ConfigurationErrorsException( "Error Setting UseProxy", ex); } //if we have the key, then attempt to read the other values //if true then all other values are required //someday someone may request us to support a blank password, //but we are not going to support that //since it is a security issue. if (useProxy) { GCheckoutConfigurationHelper.GetStringValue( section, "ProxyHost", ref proxyHost); //what we are going to do is attempt to validate the uri of the proxy if (proxyHost != string.Empty) { try { Uri proxyUrl = new Uri(proxyHost); } catch (Exception ex) { throw new ConfigurationErrorsException("Error Setting ProxyHost", ex); } } GCheckoutConfigurationHelper.GetStringValue( section, "ProxyUserName", false, ref proxyUserName); GCheckoutConfigurationHelper.GetStringValue( section, "ProxyPassword", false, ref proxyPassword); GCheckoutConfigurationHelper.GetStringValue( section, "ProxyDomain", false, ref proxyDomain); } retVal.SandboxMerchantKey = sandboxMerchantKey; retVal.Environment = environment; retVal.Logging = logging; retVal.LogDirectory = logDirectory; retVal.LogDirectoryXml = logDirectoryXml; retVal.PlatformID = platformID; retVal.Currency = currency; retVal.UseProxy = useProxy; retVal.ProxyHost = proxyHost; retVal.ProxyUserName = proxyUserName; retVal.ProxyPassword = proxyPassword; retVal.ProxyDomain = proxyDomain; return(retVal); }
public static void SetInstallType(EnvironmentType type) { SetInstallType(null, type); }
public BroadcastHandler(AuthenticationTokenCollection authenticationTokens, string accountID, EnvironmentType environmentType = EnvironmentType.Production, int itemsPerRequest = 100, int maximumRecursiveRequests = 50) : base($"{Common.GetBaseUrl(environmentType)}/v1/broadcasts", authenticationTokens, accountID, itemsPerRequest, maximumRecursiveRequests) { }
public static void SetInstallType(string product, EnvironmentType type) { SetInstallType(product, ProductVersion, type); }
public TaskTemplateHandler(AuthenticationToken authenticationToken, string accountID, EnvironmentType environmentType = EnvironmentType.Production, int itemsPerRequest = 100, int maximumRecursiveRequests = 50) : base($"{Common.GetBaseUrl(environmentType)}/v1/task_templates", authenticationToken, accountID, itemsPerRequest, maximumRecursiveRequests) { }
public abstract IEnumerable<Module> GetModules(EnvironmentType environmentType);
#pragma warning restore CS1591 // 缺少对公共可见类型或成员的 XML 注释 /// <summary> /// 创建一个环境 /// </summary> /// <param name="envName">环境名称</param> /// <param name=" envType">环境类型</param> /// <returns>环境</returns> public static FrameworkEnvironment CreateEnv(string envName, EnvironmentType envType) { return(FrameworkEnvironment.CreateInstance(envName, envType)); }
//TODO public static string SetResidenceType(string xmlConfig, EnvironmentType type) { TestEnvironmentConfigHelper config = new TestEnvironmentConfigHelper(xmlConfig); config.Type = type; return config.ToXML(); }
/// <summary> /// 解除绑顶 方法 到一个环境的 Dispose /// </summary> /// <param name="action">方法</param> /// <param name=" envType"></param> public static void UnBindEnvDispose(this Action action, EnvironmentType envType) { action.UnBindEnvDispose(GetEnv(envType)); }
public override IEnumerable<Module> GetModules(EnvironmentType environmentType) { yield return new SystemParametersCoreModule(); }
private static void CheckEnvironment(Object[] attributes) { TestEnvironment = GetCurrentEnvironment(); if (attributes.Length > 0 && !attributes.Contains(new ExecutionEnvironment(TestEnvironment))) { Assert.Inconclusive("This test is not designed to be executed in the '" + TestEnvironment.ToString() + "' environment."); } }
private BillingEnvironment(EnvironmentType environmentType) { this.EnvironmentType = environmentType; }
public string GetEnvironmentUrlByType(EnvironmentType type) { return(_environments.Find(c => c.Type == type).Url); }
/// <summary> /// 分配一个实例 /// </summary> /// <typeparam name="T"> RecyclableObject </typeparam> /// <param name=" envType"></param> /// <returns></returns> public static T Allocate <T>(EnvironmentType envType) where T : RecyclableObject { var _env = Framework.GetEnv(envType); return(Allocate <T>(_env)); }
public virtual void ConfigureBundles(BundleCollection bundles, EnvironmentType environmentType) { }
public static bool Subscribe <T>(this IMessageListener listener, EnvironmentType envType) where T : IMessagePublisher { return(Subscribe(listener, envType, typeof(T))); }
public static string SetMachineIP(string xmlConfig, EnvironmentType type, string machineName, string ip) { TestEnvironmentConfigHelper config = new TestEnvironmentConfigHelper(xmlConfig); //No matter SUT and TestAgent, update the SUT if (config.SUTConfiguration != null) { foreach (Machine m in config.SUTConfiguration.Machines) { if (m.Name.ToLower() == machineName.ToLower()) { m.IP = ip; } } } if (config.TestAgentConfiguration != null) { foreach (Machine m in config.TestAgentConfiguration.Machines) { if (m.Name.ToLower() == machineName.ToLower()) { m.IP = ip; } } } return config.ToXML(); }
public static bool UnSubscribe(this object obj, Type publishType, MessageListener listener, EnvironmentType envType) { FrameworkEnvironment _env = Framework.GetEnv(envType); return(_env.modules.Message.UnSubscribe(publishType, listener)); }
/// <summary> /// Set the values for the required properties. /// </summary> /// <param name="properties">Property name and values.</param> /// <returns> /// Return true if no other property needed. Return false means there are /// other property required. PTF Tool will invoke GetPrerequisites and /// pop up a dialog to set the value of the properties. /// </returns> public bool SetPrerequisiteProperties(Dictionary<string, string> properties) { // Save the prerequisites set by user detectionInfo.targetSUT = properties[SUTTitle]; detectionInfo.domainName = properties[domainTitle]; detectionInfo.userName = properties[userTitle]; detectionInfo.password = properties[passwordTitle]; detectionInfo.securityPackageType = (SecurityPackageType)Enum.Parse(typeof(SecurityPackageType), properties["Authentication"]); if (detectionInfo.targetSUT == detectionInfo.domainName) env = EnvironmentType.Workgroup; // Check the validity of the inputs if (string.IsNullOrEmpty(detectionInfo.targetSUT) || string.IsNullOrEmpty(detectionInfo.userName) || string.IsNullOrEmpty(detectionInfo.password)) { throw new Exception(string.Format( "Following boxes should not be empty: {0} Target SUT {1} User Name {2} Password", Environment.NewLine, Environment.NewLine, Environment.NewLine)); } if (env == EnvironmentType.Domain) { if (string.IsNullOrEmpty(detectionInfo.domainName)) throw new Exception(string.Format("Following box should not be empty: {0} Domain Name", Environment.NewLine)); } // No other property needed return true; }
public static bool UnSubscribe <T>(this object obj, MessageListener listener, EnvironmentType envType) where T : IMessagePublisher { return(UnSubscribe(obj, typeof(T), listener, envType)); }
public static bool Publish(this object obj, EnvironmentType envType, Type publishType, int code, IEventArgs args, params object[] param) { FrameworkEnvironment _env = Framework.GetEnv(envType); return(_env.modules.Message.Publish(publishType, code, args, param)); }
public static bool Publish <T>(this T obj, EnvironmentType envType, int code, IEventArgs args, params object[] param) where T : IMessagePublisher { return(Publish(obj, envType, typeof(T), code, args, param)); }
/// <summary> /// Set the domain to use, this is only used when testing, once the app goes into production this is always /// EnvironmentType.PROD /// </summary> /// <param name="environmentType"></param> public static void SetDomain(EnvironmentType environmentType) { if (environmentType == EnvironmentType.PROD) { Domain = "https://www.altinn.no/"; } else if (environmentType == EnvironmentType.ST2) { Domain = "https://st02.altinn.basefarm.net/"; } else if (environmentType == EnvironmentType.AT3) { Domain = "https://at03.altinn.basefarm.net/"; } else if (environmentType == EnvironmentType.AT6) { Domain = "https://at06.altinn.basefarm.net/"; } else if (environmentType == EnvironmentType.TT2) { Domain = "https://tt02.altinn.basefarm.net/"; } _restrUrlReportee = Domain + RelativeRestUrlReportee; RESTUrlOrg = Domain + "api/{0}/messages"; _resturl = Domain + RelativeRESTURL; RESTUrlOrgs = Domain + RelativeRestUrlOrgs; _loginUrl = Domain + RelativeLoginUrl; _appStopUrl = Domain + RelativeAppStopUrl; AppStartUrl = Domain + RelativeAppStartUrl; ProfileURL = Domain + RelativeProfileUrl; }
public List<Setting> GetApplicationSettings(Action<string> sessionLog, EnvironmentType environment) { List<Setting> result = CustomActions.GetApplicationSettings(sessionLog, environment); return result; }
public ExecutionEnvironment(EnvironmentType environmentTypes) { EnvironmentType = environmentTypes; }
/// <summary> /// Ctor /// </summary> /// <param name="type"></param> public OnEnvironmentInitAttribute(EnvironmentType type = EnvironmentType.None) { this.type = type; }
/// <summary> /// This method is called by the <see cref="GCheckoutButton"/> class and /// initializes a new instance of the /// <see cref="CheckoutShoppingCartRequest"/> class. /// </summary> /// <param name="MerchantID">The Google Checkout merchant ID assigned /// to a particular merchant.</param> /// <param name="MerchantKey">The Google Checkout merchant key assigned /// to a particular merchant.</param> /// <param name="Env">The environment where a request is being executed. /// Valid values for this parameter are "Sandbox" and "Production".</param> /// <param name="Currency">The currency associated with prices in a /// Checkout API request.</param> /// <param name="CartExpirationMinutes"> /// The length of time, in minutes, after which the shopping cart will /// expire if it has not been submitted. A value of <b>0</b> indicates /// the cart does not expire. /// </param> public CheckoutShoppingCartRequest(string MerchantID, string MerchantKey, EnvironmentType Env, string Currency, int CartExpirationMinutes) : this(MerchantID, MerchantKey, Env, Currency, CartExpirationMinutes, false) { }
void Start() { environment = GameObject.FindObjectOfType<Environment>(); CurrentType = EnvironmentType.SPRING; Camera cam = Camera.main; Vector3 cameraLeft = cam.ScreenToWorldPoint( new Vector3( 0, 0, cam.nearClipPlane ) ); Vector3 cameraRight = cam.ScreenToWorldPoint( new Vector3( Screen.width, 0, cam.nearClipPlane ) ); cameraToWorldWidth = Mathf.Abs( (cameraRight - cameraLeft).x ); transform.position = new Vector3( cameraLeft.x, transform.position.y, transform.position.z ); initializeSpriteMap(); initializeSections(); }