internal ConnectionOptions() { odbc = new BooleanOption(); host = new ListOption(); uid = new StringOption(); pwd = new StringOption(); database = new StringOption(); charset = new StringOption(); encrypt = new StringOption(); persistSecurityInfo = new BooleanOption(); connectionTimeout = new IntegerOption(); connectionLifetime = new IntegerOption(); minPoolSize = new IntegerOption(); maxPoolSize = new IntegerOption(); pooling = new BooleanOption(); enlist = new BooleanOption(); roundrobin = new BooleanOption(); Reset(); options = CollectionsUtil.CreateCaseInsensitiveHashtable(23); options.Add(ODBC, odbc); options.Add(HOST, host); options.Add(DATASOURCE, host); options.Add(SERVER, host); options.Add(ADDRESS, host); options.Add(NETWORKADDRESS, host); options.Add(UID, uid); options.Add(USER_ID, uid); options.Add(USERID, uid); options.Add(PWD, pwd); options.Add(PASSWORD, pwd); options.Add(DATABASE, database); options.Add(INITIALCATALOG, database); options.Add(CHARSET, charset); options.Add(ENCRYPT, encrypt); options.Add(PERSISTSECURITYINFO, persistSecurityInfo); options.Add(PERSIST_SECURITY_INFO, persistSecurityInfo); options.Add(CONNECTTIMEOUT, connectionTimeout); options.Add(CONNECT_TIMEOUT, connectionTimeout); options.Add(CONNECTIONTIMEOUT, connectionTimeout); options.Add(CONNECTION_TIMEOUT, connectionTimeout); options.Add(CONNECTIONLIFETIME, connectionLifetime); options.Add(CONNECTION_LIFETIME, connectionLifetime); options.Add(MINPOOLSIZE, minPoolSize); options.Add(MIN_POOL_SIZE, minPoolSize); options.Add(MAXPOOLSIZE, maxPoolSize); options.Add(MAX_POOL_SIZE, maxPoolSize); options.Add(POOLING, pooling); options.Add(ENLIST, enlist); options.Add(ROUNDROBIN, roundrobin); options.Add(ROUND_ROBIN, roundrobin); }
public void UpdateManager(StoryProgressionObject manager) { mManager = manager; mAgeGenderOptions = new List <AgeGenderOption>(); foreach (string name in mUserAgeGenders) { AgeGenderOption option = manager.GetOption <AgeGenderOption>(name); if (option == null) { continue; } mAgeGenderOptions.Add(option); } StoryProgressionObject valueTestManager = manager; if (!string.IsNullOrEmpty(mClan)) { valueTestManager = manager.Personalities.GetPersonality(mClan); } List <IValueTestOption> values = new List <IValueTestOption>(); if (valueTestManager != null) { foreach (ValueTestLoadStore store in mValueTestLoads) { IntegerOption intOption = manager.GetOption <IntegerOption>(store.mName); if (intOption != null) { values.Add(new IntegerOption.ValueTest(intOption, store.mMinimum, store.mMaximum)); } else { BooleanOption boolOption = manager.GetOption <BooleanOption>(store.mName); if (boolOption != null) { values.Add(new BooleanOption.ValueTest(boolOption, store.mMatch)); } } } } mValueTestOptions = values; }
private static IOption CreateShellOptionInternal(Category shellSubCategory, OptionDefType uiOption, string defaultValue) { IOption shellOption = null; string s = !string.IsNullOrEmpty(string.Concat(uiOption.Text)) ? string.Concat(uiOption.Text) : defaultValue; if (string.IsNullOrEmpty(s)) { s = string.Empty; } bool canOverride = uiOption.IsOverrideAllowed; switch (uiOption.DataType) { case OptionDataTypeEnum.Boolean: { bool val = GetBool(s); shellOption = new BoolOption(uiOption.Name, val, val, canOverride) { DisplayName = uiOption.DisplayText, Description = uiOption.DisplayText, Category = shellSubCategory == null ? null : shellSubCategory.Parent, SubCategory = shellSubCategory }; break; } case OptionDataTypeEnum.Integer: { int val = GetInt(s); shellOption = new IntegerOption(uiOption.Name, val, val, canOverride) { DisplayName = uiOption.DisplayText, Description = uiOption.DisplayText, Category = shellSubCategory == null ? null : shellSubCategory.Parent, SubCategory = shellSubCategory }; break; } case OptionDataTypeEnum.String: { if (uiOption.Encrypted) { shellOption = new EncryptionOption(uiOption.Name, s, s, canOverride) { DisplayName = uiOption.DisplayText, Description = uiOption.DisplayText, Category = shellSubCategory == null ? null : shellSubCategory.Parent, SubCategory = shellSubCategory }; } else { shellOption = new StringOption(uiOption.Name, s, s, canOverride) { DisplayName = uiOption.DisplayText, Description = uiOption.DisplayText, Category = shellSubCategory == null ? null : shellSubCategory.Parent, SubCategory = shellSubCategory, IsPrimaryKey = uiOption.IsPrimaryKey }; } break; } case OptionDataTypeEnum.Color: { var val = GetColor(s); shellOption = new ColorOption(uiOption.Name, val, val, canOverride) { DisplayName = uiOption.DisplayText, Description = uiOption.DisplayText, Category = shellSubCategory == null ? null : shellSubCategory.Parent, SubCategory = shellSubCategory }; break; } case OptionDataTypeEnum.KeyValueRange: { int val = GetInt(s); shellOption = new EnumOption(uiOption.Name, val, val, canOverride, GetEnumValues(uiOption)) { DisplayName = uiOption.DisplayText, Description = uiOption.DisplayText, Category = shellSubCategory == null ? null : shellSubCategory.Parent, SubCategory = shellSubCategory }; break; } case OptionDataTypeEnum.Format: case OptionDataTypeEnum.Range: default: { // do nothing. these need to be converted #if DEBUG throw new NotImplementedException(); #else break; #endif } } return shellOption; }
internal ConnectionOptions () { odbc = new BooleanOption (); host = new ListOption (); uid = new StringOption (); pwd = new StringOption (); database = new StringOption (); charset = new StringOption (); encrypt = new StringOption (); persistSecurityInfo = new BooleanOption (); connectionTimeout = new IntegerOption (); connectionLifetime = new IntegerOption (); minPoolSize = new IntegerOption (); maxPoolSize = new IntegerOption (); pooling = new BooleanOption (); enlist = new BooleanOption (); roundrobin = new BooleanOption (); Reset (); options = CollectionsUtil.CreateCaseInsensitiveHashtable (23); options.Add (ODBC, odbc); options.Add (HOST, host); options.Add (DATASOURCE, host); options.Add (SERVER, host); options.Add (ADDRESS, host); options.Add (NETWORKADDRESS, host); options.Add (UID, uid); options.Add (USER_ID, uid); options.Add (USERID, uid); options.Add (PWD, pwd); options.Add (PASSWORD, pwd); options.Add (DATABASE, database); options.Add (INITIALCATALOG, database); options.Add (CHARSET, charset); options.Add (ENCRYPT, encrypt); options.Add (PERSISTSECURITYINFO, persistSecurityInfo); options.Add (PERSIST_SECURITY_INFO, persistSecurityInfo); options.Add (CONNECTTIMEOUT, connectionTimeout); options.Add (CONNECT_TIMEOUT, connectionTimeout); options.Add (CONNECTIONTIMEOUT, connectionTimeout); options.Add (CONNECTION_TIMEOUT, connectionTimeout); options.Add (CONNECTIONLIFETIME, connectionLifetime); options.Add (CONNECTION_LIFETIME, connectionLifetime); options.Add (MINPOOLSIZE, minPoolSize); options.Add (MIN_POOL_SIZE, minPoolSize); options.Add (MAXPOOLSIZE, maxPoolSize); options.Add (MAX_POOL_SIZE, maxPoolSize); options.Add (POOLING, pooling); options.Add (ENLIST, enlist); options.Add (ROUNDROBIN, roundrobin); options.Add (ROUND_ROBIN, roundrobin); }
/// <summary> /// create a new set of file buffer options /// </summary> /// <param name="parent"></param> public FileBufferOptions(FileBufferOptions?parent = default) : base("FileBuffer", parent) { PageSize = new IntegerOption("PageSize", parent?.PageSize, FileBuffers.DefaultPageSize); NumberOfPages = new IntegerOption("NumberOfPages", parent?.NumberOfPages, FileBuffers.DefaultNumberOfPages); }