public static NamePosition GetNamePosition(string regName, global::GME.MGA.IMgaFCO subject) { string regValue = subject.RegistryValue[regName]; NamePosition result; int enumValue = 0; if (string.IsNullOrEmpty(regValue)) { regValue = DefaultValues[regName]; } enumValue = int.Parse(regValue); string enumName = Enum.GetName(typeof(NamePosition), enumValue); if (Enum.TryParse(enumName, out result)) { return(result); } else { throw new FormatException(String.Format( "{0} = {1} could not be parsed as {2}.", regName, regValue, result.GetType().FullName)); } }
public static int GetIntValueByName( string regName, global::GME.MGA.IMgaFCO subject) { string regValue = subject.RegistryValue[regName]; int result; if (string.IsNullOrEmpty(regValue)) { regValue = DefaultValues[regName]; } if (int.TryParse(regValue, out result)) { return(result); } else { throw new FormatException(String.Format( "{0} = {1} could not be parsed as {2}.", regName, regValue, result.GetType().FullName)); } }
public static void SetIntValueByName( string regName, global::GME.MGA.IMgaFCO subject, int value) { subject.RegistryValue[regName] = value.ToString(); }
public static void SetBoolValueByName( string regName, global::GME.MGA.IMgaFCO subject, bool value) { subject.RegistryValue[regName] = value.ToString().ToLowerInvariant(); }
public static void SetStrValueByName( string regName, global::GME.MGA.IMgaFCO subject, string value) { subject.RegistryValue[regName] = value; }
public static void SetColorValueByName( string regName, global::GME.MGA.IMgaFCO subject, System.Drawing.Color value) { subject.RegistryValue[regName] = String.Format( "0x{0:x2}{1:x2}{2:x2}", value.R, value.G, value.B); }
public static string GetStrValueByName( string regName, global::GME.MGA.IMgaFCO subject) { string regValue = subject.RegistryValue[regName]; if (string.IsNullOrEmpty(regValue)) { return(DefaultValues[regName]); } else { return(regValue); } }
public static System.Drawing.Color GetColorValueByName( string regName, global::GME.MGA.IMgaFCO subject) { string regValue = subject.RegistryValue[regName]; System.Drawing.Color result = System.Drawing.Color.Gray; if (string.IsNullOrEmpty(regValue)) { regValue = DefaultValues[regName]; } int color = Convert.ToInt32(regValue.Substring("0x".Length), 16); result = System.Drawing.ColorTranslator.FromWin32(color); return(result); }
public PreferencesSet(global::GME.MGA.IMgaFCO impl) : base(impl) { }
public PreferencesFCO(global::GME.MGA.IMgaFCO impl) { Contract.Requires(impl != null); this.Impl = impl; }
public PreferencesConnection(global::GME.MGA.IMgaFCO impl) : base(impl) { }