public void AddCategory(SettingsBase item)
 {
     if (!Categories.Contains(item))
     {
         Categories.Add(item);
     }
 }
Example #2
0
        protected static bool IsNewerAppVersion(SettingsBase settings)
        {
            var currentVersion = PhoneInteraction.GetAppVersion();
            var storedVersion = settings.AppVersion;

            return string.Compare(currentVersion, storedVersion, StringComparison.Ordinal) > 0;
        }
Example #3
0
 public RezhimSKReportPage()
 {
     InitializeComponent();
     settings = new SettingsBase();
     settings.Date = DateTime.Now.Date.AddDays(-1);
     pnlSettings.DataContext = settings;
     context = new ReportBaseDomainContext();
 }
Example #4
0
 public SutVedPage()
 {
     InitializeComponent();
     settings = new SettingsBase();
     settings.Date = DateTime.Now.Date.AddDays(-1);
     pnlSettings.DataContext = settings;
     context = new ReportBaseDomainContext();
     SettingsControl.InitOnlyDates();
     SettingsControl.Settings.ReportType = ReportTypeEnum.day;
 }
		public MainController(MainWindow mainForm)
        {
			this.mainForm = mainForm;
			itemToTorrent = new Dictionary<ListViewItem, TorrentManager>();
			itemToPeers = new Dictionary<ListViewItem, PeerId>();
			peerlocker = new ReaderWriterLock();
			settingsBase = new SettingsBase();
            mono = ResourceHandler.GetIcon("mono", 16, 16);

            this.miniWindow = new MiniWindow(this);

			LoadViewSettings();
            Init();
        }
        public override bool Export(Dictionary dictionary, string exportPath, SettingsBase settings = null)
        {
            var s = (settings as LatexExporterSettings) ?? new LatexExporterSettings();

            Func<string, string> pronProc;
            if (s.UseXelatex || s.Encoding == LatexEncoding.Utf8)
                pronProc = x => x;
            else
                pronProc = _ParseIpaToTipa;

            if (s.UseXelatex)
                return _ExportXelatex(dictionary, exportPath, s);

            // final failback.
            return false;
        }
        public CheckGraphVyrabPage()
        {
            InitializeComponent();
            settings = new SettingsBase();
            settings.Date = DateTime.Now.Date.AddHours(-24);
            pnlSettings.DataContext = settings;
            chbIsSteppedPBR.IsChecked = true;
            context = new GraphVyrabDomainContext();

            tabHHReport.Visibility = System.Windows.Visibility.Collapsed;
            tabHReport.Visibility = System.Windows.Visibility.Collapsed;
            tabHHRGEReport.Visibility = System.Windows.Visibility.Collapsed;
            tabHRGEReport.Visibility = System.Windows.Visibility.Collapsed;
            tabChart.Visibility = System.Windows.Visibility.Collapsed;
            tabChartRGE.Visibility = System.Windows.Visibility.Collapsed;
            tabChart.Visibility = System.Windows.Visibility.Collapsed;
        }
Example #8
0
        public OptionWindow(MainController mainController, SettingsBase settings)
        {
            InitializeComponent();
            this.controller = mainController;
            this.Icon = ResourceHandler.GetIcon("mono", 16, 16);
            GetButtonImages();

            GuiGeneralSettings genSettings = settings.LoadSettings<GuiGeneralSettings>("General Settings");
            MaxConnectionsNumericUpDown.Value = genSettings.GlobalMaxConnections;
            MaxDownloadSpeedNumericUpDown.Value = genSettings.GlobalMaxDownloadSpeed;
            HalfOpenConnectionsNumericUpDown.Value = genSettings.GlobalMaxHalfOpenConnections;
            MaxUploadSpeedNumericUpDown.Value = genSettings.GlobalMaxUploadSpeed;
            ListenPortNumericUpDown.Value = genSettings.ListenPort;
            SavePathTextBox.Text = genSettings.SavePath;
            TorrentPathTextBox.Text = genSettings.TorrentsPath;
            UseUPnPCheckBox.Checked = genSettings.UsePnP;
        }
 public static void InitAndPersistPosition(Window window, SettingsBase settings)
 {
     InitAndPersistPosition(window, settings, w => w.GetType().FullName);
 }
Example #10
0
 private void OnSettingsChanged(SettingsBase settings)
 {
     this.ResetTimer();
 }
Example #11
0
 public bool SetInitialState(SettingsBase data)
 {
     return(OnSetInitialState(data));
 }
Example #12
0
        protected override (bool success, string description) Improve(string userName,
                                                                      Hero adoptedHero, int amount, SettingsBase baseSettings, string args)
        {
            var settings = (AttributePointsSettings)baseSettings;

            return(IncreaseAttribute(adoptedHero, amount, settings.Random, args));
        }
Example #13
0
 bool IFileSystemService.Format(SettingsBase settings)
 {
     // We do not support formatting.
     throw new NotSupportedException();
 }
Example #14
0
        public ConnectionScannerCOM(FloorSet aFloorSet, SettingsBase ConnectionSetting)
            : base(aFloorSet, ConnectionSetting)
        {
            //默认选项
            mComm.CommPort      = 1;
            mComm.DTREnable     = false;
            mComm.EOFEnable     = false;
            mComm.Handshaking   = HandshakeConstants.comNone;   //None Handshakeing
            mComm.InBufferSize  = 1024;
            mComm.InputMode     = InputModeConstants.comInputModeBinary;
            mComm.NullDiscard   = false;
            mComm.OutBufferSize = 512;
            mComm.ParityReplace = "?";
            mComm.RThreshold    = 5;    //R 闸值
            mComm.RTSEnable     = false;
            mComm.Settings      = "2400,e,8,1";
            mComm.SThreshold    = 0;    //S 闸值

            //载入自定义选项
            //检查看看选项是否存在
            mSettings = ConnectionSetting;
            if (ConnectionSetting["CommPort"] == null)
            {
                ConnectionSetting["CommPort"] = 1;
            }
            if (ConnectionSetting["Settings"] == null)
            {
                ConnectionSetting["Settings"] = "2400,e,8,1";
            }
            if (ConnectionSetting["ReceiveDataRepeatTimes"] == null)
            {
                ConnectionSetting["ReceiveDataRepeatTimes"] = 5;
            }
            if (ConnectionSetting["ReceiveDataCheckDelay"] == null)
            {
                ConnectionSetting["ReceiveDataCheckDelay"] = 50;
            }
            if (ConnectionSetting["ReceiveDataCheckRepeatTimes"] == null)
            {
                ConnectionSetting["ReceiveDataCheckRepeatTimes"] = 5;
            }
            if (ConnectionSetting["DisconnectRetryTimes"] == null)
            {
                ConnectionSetting["DisconnectRetryTimes"] = 3;
            }
            //if (ConnectionSetting["WhetherSendTimeToATM"]==null)	ConnectionSetting["WhetherSendTimeToATM"]="True";
            if (ConnectionSetting["SendTimeToATMFrequency"] == null)
            {
                ConnectionSetting["SendTimeToATMFrequency"] = 5;
            }

            //应用选项
            mComm.CommPort          = Convert.ToInt16(ConnectionSetting["CommPort"]);
            mComm.Settings          = (string)ConnectionSetting["Settings"];
            mReceiveDataRepeatTimes = Convert.ToInt32(ConnectionSetting["ReceiveDataRepeatTimes"]);
            mReceiveDataCheckDelay  = Convert.ToInt32(ConnectionSetting["ReceiveDataCheckDelay"]);
            mSendTimeToATMFrequency = Convert.ToInt32(ConnectionSetting["SendTimeToATMFrequency"]);

            mReceiveDataCheckRepeatTimes = Convert.ToInt32(ConnectionSetting["ReceiveDataCheckRepeatTimes"]);
            mDisconnectRetryTimes        = Convert.ToInt32(ConnectionSetting["DisconnectRetryTimes"]);

            mScannerTimeout.Interval    = mReceiveDataCheckDelay;
            mScannerTimeout.Elapsed    += new System.Timers.ElapsedEventHandler(mScannerTimeout_Elapsed);
            mScanNextRoomDelay.Interval = mReceiveDataCheckDelay;
            mScanNextRoomDelay.Elapsed += new System.Timers.ElapsedEventHandler(mScanNextRoomDelay_Elapsed);

            mComm.OnComm += new DMSCommEvents_OnCommEventHandler(mComm_OnComm);

            if (mWhetherSendTimeToATM == true)
            {
                mSendTimeToATMTimer.Interval = mSendTimeToATMFrequency * 1000;
                mSendTimeToATMTimer.Elapsed += new System.Timers.ElapsedEventHandler(mSendTimeToATMTimer_Elapsed);
            }

            //其他
            mFloorSet    = aFloorSet;
            mCurrentRoom = mFloorSet.FirstFloor.FirstRoom;

            //设置所有的Room Connect
            foreach (int FloorNumber in mFloorSet.FloorNumbers)
            {
                for (int RoomNumber = 1; RoomNumber <= mFloorSet[FloorNumber].Length; RoomNumber++)
                {
                    mFloorSet[FloorNumber][RoomNumber].MyATM.Connect();
                }
            }
        }
Example #15
0
        protected override HoldingsResult ConvertResult(ConnectionInfo connInfo, System.IO.Stream stream, SettingsBase settings)
        {
            HoldingsDownloadSettings set = (HoldingsDownloadSettings)settings;
            XDocument doc = MyHelper.ParseXmlDocument(stream);

            Holding[] result = this.ConvertHtmlDoc(doc, set.PortfolioID);
            return(new HoldingsResult(result));
        }
Example #16
0
 public DecryptedProductSettings()
 {
     _settings = ((ProductSettings)(SettingsBase.Synchronized(new ProductSettings())));
 }
 public SettingsPaddingProvider(SettingsBase settingsBase)
     : base(settingsBase)
 {
 }
Example #18
0
 static MySettings()
 {
     MySettings.defaultInstance        = (MySettings)SettingsBase.Synchronized(new MySettings());
     MySettings.addedHandlerLockObject = RuntimeHelpers.GetObjectValue(new object());
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="settings"></param>
 public PlatformSettings(SettingsBase settings)
 {
     _settings    = settings;
     _platformUri = new Uri((string)settings["PlatformUriAddress"]);
 }
 public abstract bool SaveDictionary(Stream stream, Dictionary dictionary, SettingsBase options = null);
        public override bool SaveDictionary(Stream stream,
                                            Dictionary dictionary,
                                            SettingsBase options = null)
        {
            try
            {
                // let's begin by writing the file's header.
                stream.Write(FieldHeaders.DictionaryMagicNumber, 0, FieldHeaders.DictionaryMagicNumber.Length);
                stream.Write(FieldHeaders.ByteOrderMark, 0, FieldHeaders.ByteOrderMark.Length);
                stream.Write(FieldHeaders.VersionMark, 0, FieldHeaders.VersionMark.Length);

                // now let's first begin by writing the dictionary's
                // info.
                _Write(stream, dictionary.Info);

                // now that that's done, let's write the abbreviations.
                foreach (var abbrev in dictionary.Abbreviations)
                    _Write(stream, abbrev);

                // now let's write the entries.
                foreach (var entry in dictionary.Entries)
                    _Write(stream, entry);

                // finally, let's write the images.
                foreach (var img in dictionary.Images)
                    _Write(stream, img);

                // finally, since we expect that everything's written
                // to the output stream.
                return true;
            }
            catch (IOException)
            {
                return false;
            }
        }
Example #22
0
		public bool Format (SettingsBase settings)
		{
			return (fat.Format (((FATSettings)settings)));
		}
Example #23
0
        /// <summary>
        ///
        /// </summary>
        public bool Init()
        {
            string ConfigFilePath = Path.Combine(Downloader.LocalFolder, "buildsync.json");
            bool   IsScript       = false;

            if (!File.Exists(ConfigFilePath))
            {
                ConfigFilePath = Path.Combine(Downloader.LocalFolder, "buildsync.cs");
                IsScript       = true;
            }

            if (!File.Exists(ConfigFilePath))
            {
                MessageBox.Show("Build has no configured launch settings. Ensure a buildsync.json or buildsync.cs file is added to all builds.", "Not Configured", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            if (!IsScript)
            {
                if (!SettingsBase.Load(ConfigFilePath, out Settings))
                {
                    MessageBox.Show("The included buildsync.json file could not be loaded, it may be malformed. Check console output window for details.", "Malformed Config File", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return(false);
                }
            }
            else
            {
                Settings = new BuildSettings();
                try
                {
                    Settings.ScriptSource = File.ReadAllText(ConfigFilePath);
                }
                catch (Exception Ex)
                {
                    Logger.Log(LogLevel.Error, LogCategory.IO, "Failed to read file '{0}' due to exception: {1}", ConfigFilePath, Ex.Message);
                    MessageBox.Show("The included buildsync.cs file could not be loaded, it may be malformed. Check console output window for details.", "Malformed Config File", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return(false);
                }
            }

            List <BuildLaunchMode> Modes;

            try
            {
                Modes = Settings.Compile();

                // Add various internal variables to pass in bits of info.
                foreach (BuildLaunchMode Mode in Modes)
                {
                    Mode.AddStringVariable("INSTALL_LOCATION", DownloadState.InstallLocation);
                    Mode.AddStringVariable("BUILD_DIR", Downloader.LocalFolder);

                    // We show this internal var to the end user.
                    BuildLaunchVariable DeviceVar = Mode.AddStringVariable("INSTALL_DEVICE_NAME", DownloadState.InstallDeviceName);
                    DeviceVar.Internal            = (DownloadState.InstallDeviceName.Length == 0);
                    DeviceVar.FriendlyName        = "Target Device";
                    DeviceVar.FriendlyDescription = "Device to install and launch on.";
                    DeviceVar.FriendlyCategory    = "Launch Device";
                    DeviceVar.Options             = new List <string>();
                    DeviceVar.Value = "";

                    string[] Options = DownloadState.InstallDeviceName.Split(',');
                    foreach (string Option in Options)
                    {
                        string Trimmed = Option.Trim();
                        if (Trimmed.Length > 0)
                        {
                            DeviceVar.Options.Add(Trimmed);

                            if (DeviceVar.Value.Length == 0)
                            {
                                DeviceVar.Value = Trimmed;
                            }
                        }
                    }
                }
            }
            catch (InvalidOperationException Ex)
            {
                MessageBox.Show("Error encountered while evaluating launch settings:\n\n" + Ex.Message, "Malformed Config File", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            if (Modes.Count == 0)
            {
                MessageBox.Show("None of the launch modes are usable.", "Not Configured", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }
            else if (Modes.Count == 1 && Modes[0].GetNonInternalVariableCount() == 0 && !DownloadState.InstallDeviceName.Contains(","))
            {
                // Instant launch, nothing for us to select really.
                Launch(Modes[0]);

                return(false);
            }
            else
            {
                // Show options to launch.
                foreach (BuildLaunchMode Mode in Modes)
                {
                    TreeNode Node = new TreeNode();
                    Node.Text = Mode.Name;
                    Node.Tag  = Mode;
                    ModesTreeView.Nodes.Add(Node);
                }

                // Select first mode.
                ModesTreeView.SelectedNode = ModesTreeView.Nodes[0];
            }

            return(true);
        }
 public SettingsDecodingCheckFinalQuantumProvider(SettingsBase settingsBase)
     : base(settingsBase)
 {
 }
Example #25
0
 private static void old_acctor_mc()
 {
     defaultInstance = (Settings)SettingsBase.Synchronized(new Settings());
 }
 public SettingsSafeCharactersProvider(SettingsBase settingsBase)
     : base(settingsBase)
 {
 }
Example #27
0
            public void Load(SettingsBase settings)
            {
                try
                {
                    KLine[] ks = settings.KLines.ToArray();
                    K = new Cidr[ks.Length];
                    for (int i = 0; i < K.Length; i++)
                    {
                        K[i] = ks[i].Ban;
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Unable to load K:lines: {0}", ex.Message);
                }

                try
                {
                    QLine[] qs = settings.QLines.ToArray();
                    Q = new Regex[qs.Length];
                    for (int i = 0; i < Q.Length; i++)
                    {
                        try
                        {
                            Q[i] = new Regex(qs[i].Ban, RegexOptions.Compiled | RegexOptions.IgnoreCase);
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine("The following Q:line is invalid: {0} ({1})", qs[i], ex.Message);
                        }
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Unable to load Q:lines: {0}", ex.Message);
                }
            }
Example #28
0
 public ConnectionScannerCOM(FloorSet aFloorSet, SettingsBase ConnectionSetting, SettingsBase ProgramSetting)
     : base(aFloorSet, ConnectionSetting)
 {
 }
Example #29
0
 private static void ZYDNGuard()
 {
     Settings.settings_0 = (Settings)SettingsBase.Synchronized(new Settings());
 }
Example #30
0
 static Settings()
 {
     botw_editor.Properties.Settings.defaultInstance = (botw_editor.Properties.Settings)SettingsBase.Synchronized(new botw_editor.Properties.Settings());
 }
Example #31
0
 static Settings()
 {
     Settings.defaultInstance = (Settings)SettingsBase.Synchronized(new Settings());
 }
Example #32
0
 protected virtual bool OnSetInitialState(SettingsBase data)
 {
     return(true);
 }
Example #33
0
 public bool Format(SettingsBase settings)
 {
     return(fat.Format(((FATSettings)settings)));
 }
Example #34
0
 // Token: 0x06000517 RID: 1303 RVA: 0x00004DC0 File Offset: 0x00002FC0
 // Note: this type is marked as 'beforefieldinit'.
 static Settings()
 {
     Class21.smethod_0();
     Settings.defaultInstance = (Settings)SettingsBase.Synchronized(new Settings());
 }
        /// <summary>
        /// Load setting.
        /// </summary>
        /// <param name="settingValue">Setting value.</param>
        /// <param name="isDetails">Is details items.</param>
        private void _LoadSetting(SettingsBase settingValue, bool isDetails)
        {
            if (isDetails)
            {
                DetailConfigurationSettings detailControlSetting = settingValue as DetailConfigurationSettings;
                if (detailControlSetting != null)
                {
                    _settingRepository.Settings.Add(detailControlSetting.SettingsKey, detailControlSetting);
                }
            }
            else
            {
                DataGridControlSettings controlSetting = settingValue as DataGridControlSettings;
                if (controlSetting != null)
                {
                    // Get list of sort fields which are not exists in current Settings Repository.
                    List<string> redundantFields = _GetNonexistentSortFields(controlSetting.SortDescriptions);

                    // If some redundant fields found, need to remove it.
                    if (redundantFields.Count > 0)
                    {
                        controlSetting.SortDescriptions = _GetFieldsForSort(
                            controlSetting.SortDescriptions, redundantFields);
                    }

                    _settingRepository.Settings.Add(controlSetting.SettingsKey, controlSetting);
                }
            }
        }
Example #36
0
 private void OnSettingsChanged(SettingsBase settings)
 {
     this.WindowScale.ScaleX = App.Settings.Scale;
     this.WindowScale.ScaleY = App.Settings.Scale;
 }
 public static SettingsBase Synchronized(SettingsBase settingsBase)
 {
 }
Example #38
0
 /// <summary>
 /// Exports a <see cref="Dictionary" /> to a specified path.
 /// </summary>
 /// <returns>
 /// <see langword="true" /> if the export has been completed
 /// successfully; otherwise <see langword="false" />.
 /// </returns>
 /// <remarks>
 ///     <para>
 ///     The path specified in <paramref name="exportPath" /> can either
 ///     be the path to a file or a directory depending on the exporter
 ///     in question.
 ///     </para>
 /// </remarks>
 public abstract bool Export(Dictionary dictionary,
                             string exportPath,
                             SettingsBase settings = null);
Example #39
0
        private void SaveButtonApp_Click(object sender, EventArgs e)
        {
            // Save settings
            GuiViewSettings guisettings = new GuiViewSettings();
            string btnPath = string.Empty;
            if (lstButtons.SelectedIndex > 0)
                btnPath = Buttons[lstButtons.SelectedIndex - 1];
            GuiViewSettings.CustomButtonPath = btnPath;
            SettingsBase settingsBase = new SettingsBase();
            settingsBase.SaveSettings<GuiViewSettings>("Graphical Settings", guisettings);

            controller.LoadButtons();

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Example #40
0
 static Settings()
 {
     Class19.Q77LubhzKM3NS();
     Settings.defaultInstance = (Settings)SettingsBase.Synchronized(new Settings());
 }
 public DefaultKeyValueCollection(SettingsBase settings)
     : this(Converts.Repository, settings)
 {
 }
Example #42
0
 // Token: 0x0600044F RID: 1103 RVA: 0x00003AC5 File Offset: 0x00001CC5
 static void smethod_12(SettingsBase settingsBase_0)
 {
     settingsBase_0.Save();
 }
Example #43
0
 protected MvcExtenseBase(SettingsBase settings, ViewContext context, IViewDataContainer viewDataContainer)
     : this(settings)
 {
     ViewContext       = context;
     ViewDataContainer = viewDataContainer;
 }
 private static IEnumerable <AltbauWohnungInfo> FilterCandidates([NotNull] IEnumerable <AltbauWohnungInfo> candidates, [NotNull] SettingsBase settings)
 {
     return(candidates
            .Where(c => c.Eigenmittel <= settings.MaxEigenmittel)
            .Where(c => c.MonatlicheKosten <= settings.MaxMonatlicheKosten)
            .Where(c => c.NumberOfRooms >= settings.MinNumberOfRooms)
            .Where(c => settings.Cities.Contains(c.City))
            .Where(c => settings.PostalCodes.Contains(c.PostalCode)));
 }
Example #45
0
 public MvcExtenseBase(SettingsBase settings)
 {
     this.Settings = settings;
 }
 public SerialPortSettings(SettingsBase root, XmlElement element)
     : base(root, element)
 {
 }
        private static bool HasSetting(this SettingsBase settings, string settingName)
        {
            var foundSetting = settings?.Properties.Cast <SettingsProperty>().FirstOrDefault(prop => prop.Name.Equals(settingName, StringComparison.OrdinalIgnoreCase));

            return(foundSetting != null);
        }