public GeneralSettingsUpdateControl()
        {
            InitializeComponent();
#if !DEMO
            Updater.Connected           += Client_Connected;
            Updater.ConnectFailed       += Client_ConnectFailed;
            Updater.Disconnected        += Client_Disconnected;
            Updater.Authenticated       += Client_Authenticated;
            Updater.UpdateReceived      += Client_UpdateReceived;
            Updater.ReceivedFileBlock   += Client_ReceivedFileBlock;
            Updater.ReceivedVersion     += Updater_ReceivedVersion;
            Updater.ZipExtractionFailed += Updater_ZipExtractionFailed;
#if DEBUG
            //Updater.Debug += new TextEventHandler(Updater_Debug);
#endif
            flowDocumentScroll.IsEnabled = false;
            flowDocumentScroll.Document  = new FlowDocument();

            int? value = StoreSetting.Get("AutoUpdate").IntValue;
            bool isAutoUpdateEnabled = (value != null) && (value.Value != 0);
            radioButtonAutoUpdateIsEnabled.IsSelected    = isAutoUpdateEnabled;
            radioButtonAutoUpdateIsNotEnabled.IsSelected = !isAutoUpdateEnabled;
            textBoxServer.Text = LocalSetting.Values.String["UpdateServer"];
            textBoxPort.Text   = LocalSetting.Values.String["UpdateServerPort"];
#endif
        }
Esempio n. 2
0
        /// <summary>
        /// Get a single StoreSetting from the StoreSetting table
        /// </summary>
        public static StoreSetting GetStoreSetting(string storeSettingName)
        {
            // Invalid Id
            if (storeSettingName == null)
            {
                return(null);
            }

            // Scan existing
            StoreSetting storeSetting = StoreSetting.Get(storeSettingName);

            if ((StoreSettings.Count > 0) && (StoreSettings.Keys.Contains(storeSetting.Id)))
            {
                StoreSetting.Refresh(StoreSettings[storeSetting.Id], storeSetting);
                return(StoreSettings[storeSetting.Id]);
            }

            // Not found, let's check the database
            if (storeSetting != null)
            {
                StoreSettings.Add(storeSetting.Id, storeSetting);
                return(storeSetting);
            }
            return(null);
        }
Esempio n. 3
0
        private void PrintCurrentStoreSettingValue(string settingName)
        {
            StoreSetting setting = StoreSetting.Get(settingName);

            if (setting == null)
            {
                PrintLine(Types.Strings.ShellStoreSettingNotSet + settingName);
                return;
            }

            bool found = false;

            if (setting.IntValue != null)
            {
                PrintLine(settingName + " (int) = " + setting.IntValue.Value);
                found = true;
            }
            if (setting.StringValue != null)
            {
                PrintLine(settingName + " (string) = " + setting.StringValue);
                found = true;
            }
            if (setting.FloatValue != null)
            {
                PrintLine(settingName + " (double) = " + setting.FloatValue.Value);
                found = true;
            }
            if (setting.DateTimeValue != null)
            {
                PrintLine(settingName + " (datetime) = " + setting.DateTimeValue.Value);
                found = true;
            }

            if (!found)
            {
                PrintLine(Types.Strings.ShellStoreSettingNotSet + settingName);
            }
        }
Esempio n. 4
0
 public static void SetStoreSetting(string settingName, DateTime?dateTimeValue)
 {
     StoreSetting.Set(settingName, dateTimeValue);
     StoreSetting managed = GetUpdatedManagedStoreSetting(StoreSetting.Get(settingName));
 }