static void Main() { // Initialize session SessionManager.Instance.InitializeDatabase(); SettingsAttribute.SetAttribute( "templateFile", "Configuration Files", "Template file path", "Path to the JSON configuration file containing all VM templates", new EditorAttribute(typeof(JsonFileSelectorTypeEditor), typeof(UITypeEditor)) ); SettingsAttribute.SetAttribute( "connectionString", "Database", "Connection String", "LiteDB connection string specifier to connect to database" ); // Initialize application Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(MainFrmInstance = new MainFrm()); }
// restore default settings public void Reset() { PropertyInfo[] propInfos = GetProperties(); foreach (PropertyInfo pi in propInfos) { Attribute[] atts = (Attribute[])pi.GetCustomAttributes(typeof(SettingsAttribute), false); // check if the property has the SettingsAttribute if (atts.Length == 0) { continue; } SettingsAttribute sa = (SettingsAttribute)atts[0]; SetPropertyValueFromString(pi, sa.DefaultValue); } // manually override with settings determined at runtime CustomThemeName = CurrentPlatform.IsGnome ? "" : NON_GNOME_CUSTOM_THEME; VolumeSortProperty = DEFAULT_SORT_PROPERTY; }
public void send_updateSettingsAttribute(int reqSeq, SettingsAttribute attr, string value) #endif { oprot_.WriteMessageBegin(new TMessage("updateSettingsAttribute", TMessageType.Call, seqid_)); updateSettingsAttribute_args args = new updateSettingsAttribute_args(); args.ReqSeq = reqSeq; args.Attr = attr; args.Value = value; args.Write(oprot_); oprot_.WriteMessageEnd(); #if SILVERLIGHT return oprot_.Transport.BeginFlush(callback, state); #else oprot_.Transport.Flush(); #endif }
public IAsyncResult send_updateSettingsAttribute(AsyncCallback callback, object state, int reqSeq, SettingsAttribute attr, string value)
public void updateSettingsAttribute(int reqSeq, SettingsAttribute attr, string value) { #if !SILVERLIGHT send_updateSettingsAttribute(reqSeq, attr, value); recv_updateSettingsAttribute(); #else var asyncResult = Begin_updateSettingsAttribute(null, null, reqSeq, attr, value); End_updateSettingsAttribute(asyncResult); #endif }
public IAsyncResult Begin_updateSettingsAttribute(AsyncCallback callback, object state, int reqSeq, SettingsAttribute attr, string value) { return send_updateSettingsAttribute(callback, state, reqSeq, attr, value); }