Exemplo n.º 1
0
        public static void UpdateOptions()
        {
            if (!File.Exists(optionsFile))
            {
                UpdateOptionsFile(getDefaultOptions());
            }

            List <Option> options1 = JsonConvert.DeserializeObject <List <Option> >(File.ReadAllText(optionsFile));

            options = new Dictionary <string, Option>();
            foreach (Option option1 in options1)
            {
                options.Add(option1.Name, option1);
            }
            if (!checkOptions())
            {
                writeMissing();
                return;
            }

            if (OptionsChanged != null)
            {
                OptionsChanged?.Invoke(JeremieLauncher.instance, new OptionsChangedEventArgs(options));
            }
        }
Exemplo n.º 2
0
 private void RaiseEvent(OptionsChanged evt)
 {
     if (evt != null)
     {
         evt();
     }
 }
Exemplo n.º 3
0
        private void CheckBox_Click(object sender, RoutedEventArgs e)
        {
            CheckBox c = sender as CheckBox;

            Microsoft.Win32.RegistryKey key;

            key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\\CSMP3Player", true);

            if (c.IsChecked == true)
            {
                key.SetValue("InTray", true);
            }
            else
            {
                key.SetValue("InTray", false);
            }

            key.Close();

            trayChanged = true;

            OptionsChanged options = optionsChanged;

            if (options != null)
            {
                options(this, EventArgs.Empty);
            }
        }
Exemplo n.º 4
0
 private void OptionListBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (mbPaused)
     {
         return;
     }
     if (mOptionToValue == null)
     {
         mBoundSelectionList.Clear();
         foreach (object item in OptionListBox.CheckedItems)
         {
             mBoundSelectionList.Add(item.ToString());
         }
     }
     else
     {
         mBoundSelectionList.Clear();
         foreach (object item in OptionListBox.CheckedItems)
         {
             mBoundSelectionList.Add(mOptionToValue[item.ToString()]);
         }
     }
     if (OptionsChanged != null)
     {
         OptionsChanged.Invoke(this, null);
     }
 }
Exemplo n.º 5
0
 public void Watch()
 {
     foreach (PropertyDescriptor property in TypeDescriptor.GetProperties(this, new Attribute[] { DesignerSerializationVisibilityAttribute.Visible }))
     {
         property.AddValueChanged(this, (s, e) => { OptionsChanged?.Invoke(this, e); });
     }
 }
Exemplo n.º 6
0
        private void RemoveButton_Click(object sender, EventArgs e)
        {
            List <object> hitlist = new List <object>();

            if (mOptionToValue == null)
            {
                foreach (object item in CollectionListBox.SelectedItems)
                {
                    mBoundSelectionList.Remove(item.ToString());
                    hitlist.Add(item);
                }
            }
            else
            {
                foreach (object item in CollectionListBox.SelectedItems)
                {
                    mBoundSelectionList.Remove(mOptionToValue[item.ToString()]);
                    hitlist.Add(item);
                }
            }
            foreach (object o in hitlist)
            {
                CollectionListBox.Items.Remove(o);
            }
            if (OptionsChanged != null)
            {
                OptionsChanged.Invoke(this, null);
            }
        }
Exemplo n.º 7
0
 /// <summary>
 ///     Safely trigger OptionsChanged, unless TriggerEvents is false.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected virtual void OnOptionsChanged(object sender, EventArgs e)
 {
     if (TriggerEvents)
     {
         OptionsChanged.Raise(sender, e);
     }
 }
Exemplo n.º 8
0
        public async Task OpenGraphItFile(InputFileChangeEventArgs e, bool overwrite)
        {
            Overwrite = overwrite;
            try
            {
                byte[]  temp;
                Options newOptions = new Options();
                using (var streamReader = new MemoryStream())
                {
                    await e.File.OpenReadStream().CopyToAsync(streamReader);

                    temp = streamReader.ToArray();
                }
                OpenPreference = false;
                string      graph   = DecodeAndInflate(temp);
                XmlDocument xmlData = new XmlDocument();
                xmlData.LoadXml(graph);
                if (Overwrite)
                {
                    Graph = new Graph();
                }
                Traverse(xmlData, NodeService.NextId(Graph.Nodes), EdgeService.NextId(Graph.Edges));
                await GraphChanged.InvokeAsync(Graph);

                if (Overwrite)
                {
                    await OptionsChanged.InvokeAsync(Options);
                }
            }
            catch (ObjectDisposedException)
            {
                ErrorOpening = true;
            }
        }
        /// <summary>
        /// Show the dialogue displaying the scan progress and start the scan
        /// </summary>
        /// <param name="manager"></param>
        public static void ShowFragment(FragmentManager manager, OptionsChanged selectionCallback)
        {
            // Save the parameters so that they are available after a configuration change
            reporter = selectionCallback;

            new AutoplayOptionsDialogFragment().Show(manager, "fragment_autoplay_options");
        }
Exemplo n.º 10
0
 private void Options_OptionsChanged(object sender, EventArgs e)
 {
     OnPropertyChanged(nameof(Options));
     if (isEnabled)
     {
         OptionsChanged?.Invoke(Options, isEnabled);
     }
 }
Exemplo n.º 11
0
        public bool Send(object sender, Dictionary <string, Value> options)
        {
            var eventArgs = new OptionsChangedEventArgs(options);

            OptionsChanged?.Invoke(sender, eventArgs);

            return(eventArgs.Reloaded);
        }
 public void ToggleSelectedProjects(string project)
 {
     project = project.ToLowerInvariant();
     if (!_selectedProjects.Remove(project))
     {
         _selectedProjects.Add(project);
     }
     OptionsChanged?.Invoke();
 }
Exemplo n.º 13
0
        protected void RaiseChanged()
        {
            OptionsChanged d = this.Changed;

            if (d != null)
            {
                d();
            }
        }
Exemplo n.º 14
0
        public static void EndUpdate()
        {
            updateLevel--;

            if (updateLevel == 0 && changed)
            {
                changed = false;
                OptionsChanged?.Invoke(null, EventArgs.Empty);
            }
        }
Exemplo n.º 15
0
        private void dynamicCheck_Click(object sender, RoutedEventArgs e)
        {
            colorChanged   = false;
            dynamicChanged = true;

            OptionsChanged options = optionsChanged;

            if (options != null)
            {
                options(this, EventArgs.Empty);
            }
        }
Exemplo n.º 16
0
        public void RaiseOptionsChanged()
        {
            AdvancedOptions = GetDialogPage <ShaderLabAdvancedOptionsPage>().Options;

            FormattingOptions = new FormattingOptions
            {
                SpacesPerIndent = ShaderLabPackage.Instance.LanguagePreferences.SpacesPerIndent
            };

            GeneralOptions = GetDialogPage <ShaderLabFormattingGeneralOptionsPage>().Options;

            OptionsChanged?.Invoke(this, EventArgs.Empty);
        }
        private void OkButton_Click(object sender, RoutedEventArgs e)
        {
            UpdateSelected(PresetComboBox.SelectedItem as Setting);
            Config.Save(Settings.ToList());
            _options = GetClientConfiguration();

            var name = NameTextBox.Text;

            OptionsChanged?.Invoke(this, new OidcOptionsChangedEventArgs(_options, ConfiguredScopes, name));

            DialogResult = true;
            Close();
        }
Exemplo n.º 18
0
        private void OnOptionsChanged()
        {
            Editor.Log("Editor options changed!");

#if !UNIT_TEST_COMPILANT
            // Sync C++ backend options
            Editor.InternalOptions internalOptions;
            internalOptions.AutoReloadScriptsOnMainWindowFocus = (byte)(Options.General.AutoReloadScriptsOnMainWindowFocus ? 1 : 0);
            internalOptions.AutoRebuildCSG          = (byte)(Options.General.AutoRebuildCSG ? 1 : 0);
            internalOptions.AutoRebuildCSGTimeoutMs = Options.General.AutoRebuildCSGTimeoutMs;
            Editor.Internal_SetOptions(ref internalOptions);
#endif

            // Send event
            OptionsChanged?.Invoke(Options);
        }
Exemplo n.º 19
0
        private void OnOptionsChanged()
        {
            Editor.Log("Editor options changed!");

            // Sync C++ backend options
            Editor.InternalOptions internalOptions;
            internalOptions.AutoReloadScriptsOnMainWindowFocus = (byte)(Options.General.AutoReloadScriptsOnMainWindowFocus ? 1 : 0);
            internalOptions.ForceScriptCompilationOnStartup    = (byte)(Options.General.ForceScriptCompilationOnStartup ? 1 : 0);
            internalOptions.AutoRebuildCSG              = (byte)(Options.General.AutoRebuildCSG ? 1 : 0);
            internalOptions.AutoRebuildCSGTimeoutMs     = Options.General.AutoRebuildCSGTimeoutMs;
            internalOptions.AutoRebuildNavMesh          = (byte)(Options.General.AutoRebuildNavMesh ? 1 : 0);
            internalOptions.AutoRebuildNavMeshTimeoutMs = Options.General.AutoRebuildNavMeshTimeoutMs;
            Editor.Internal_SetOptions(ref internalOptions);

            EditorAssets.Cache.OnEditorOptionsChanged(Options);

            // Send event
            OptionsChanged?.Invoke(Options);
        }
Exemplo n.º 20
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            using (var fbd = new FolderBrowserDialog())
            {
                DialogResult result = fbd.ShowDialog();

                if (result == System.Windows.Forms.DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath))
                {
                    path        = fbd.SelectedPath;
                    pathChanged = true;

                    OptionsChanged options = optionsChanged;
                    if (options != null)
                    {
                        options(this, EventArgs.Empty);
                    }
                }
            }
        }
Exemplo n.º 21
0
        public void RaiseOptionsChanged()
        {
            AdvancedOptions = GetDialogPage <HlslAdvancedOptionsPage>().Options;

            var indentationOptions = GetDialogPage <HlslFormattingIndentationOptionsPage>().Options;
            var newLinesOptions    = GetDialogPage <HlslFormattingNewLinesOptionsPage>().Options;
            var spacingOptions     = GetDialogPage <HlslFormattingSpacingOptionsPage>().Options;

            FormattingOptions = new FormattingOptions
            {
                Indentation = indentationOptions,
                NewLines    = newLinesOptions,
                Spacing     = spacingOptions,

                SpacesPerIndent = HlslPackage.Instance.LanguagePreferences.SpacesPerIndent
            };

            GeneralOptions = GetDialogPage <HlslFormattingGeneralOptionsPage>().Options;

            OptionsChanged?.Invoke(this, EventArgs.Empty);
        }
Exemplo n.º 22
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            ColorDialog colorDlg = new ColorDialog();

            colorDlg.AllowFullOpen  = true;
            colorDlg.AnyColor       = true;
            colorDlg.SolidColorOnly = false;

            if (colorDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                color        = colorDlg.Color;
                colorChanged = true;
            }

            OptionsChanged options = optionsChanged;

            if (options != null)
            {
                options(this, EventArgs.Empty);
            }
        }
Exemplo n.º 23
0
        private void UpdateNavigation()
        {
            var options = new Dictionary <string, string>();

            AddIfSet(options, nameof(ShowClosed), ShowClosed);
            AddIfSet(options, nameof(ShowUnplanned), ShowUnplanned);
            AddIfSet(options, nameof(HideTodayIndicator), HideTodayIndicator);
            AddIfSet(options, nameof(HideCardDetails), HideCardDetails);

            if (SelectedProjects.Any())
            {
                options[nameof(SelectedProjects).ToLowerInvariant()] = string.Join(';', SelectedProjects.OrderBy(name => name));
            }

            var builder = new UriBuilder(_manager.ToAbsoluteUri(_manager.Uri))
            {
                Query = string.Join('&', options.Select(o => $"{UrlEncoder.Default.Encode(o.Key)}={UrlEncoder.Default.Encode(o.Value)}"))
            };

            _manager.NavigateTo(builder.ToString());
            OptionsChanged?.Invoke();
        }
Exemplo n.º 24
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            if (mOptionToValue == null)
            {
                foreach (object item in EnumListBox.SelectedItems)
                {
                    if (mAllowRepeats == false)
                    {
                        if (mBoundSelectionList.Contains(item.ToString()))
                        {
                            continue;
                        }
                    }

                    mBoundSelectionList.Add(item.ToString());
                    CollectionListBox.Items.Add(item.ToString());
                }
            }
            else
            {
                foreach (object item in EnumListBox.SelectedItems)
                {
                    if (mAllowRepeats == false)
                    {
                        if (mBoundSelectionList.Contains(mOptionToValue[item.ToString()]))
                        {
                            continue;
                        }
                    }

                    mBoundSelectionList.Add(mOptionToValue[item.ToString()]);
                    CollectionListBox.Items.Add(item.ToString());
                }
            }
            if (OptionsChanged != null)
            {
                OptionsChanged.Invoke(this, null);
            }
        }
Exemplo n.º 25
0
        void UpdateData()
        {
            mBoundSelectionList.Clear();

            if (mOptionToValue == null)
            {
                foreach (object item in CollectionListBox.Items)
                {
                    mBoundSelectionList.Add(item.ToString());
                }
            }
            else
            {
                foreach (object item in CollectionListBox.Items)
                {
                    mBoundSelectionList.Add(mOptionToValue[item.ToString()]);
                }
            }
            if (OptionsChanged != null)
            {
                OptionsChanged.Invoke(this, null);
            }
        }
Exemplo n.º 26
0
        public Options()
        {
            initThreadOptions();

            VmLocator.L11n.PropertyChanged += (s, e) =>
            {
                if (e.PropertyName == nameof(L11n._Locale))
                {
                    RaisePropertyChanged(nameof(FloatPrecision));
                    RaisePropertyChanged(nameof(IntPrecision));
                }
            };

            PropertyChanged += (s, e) =>
            {
                if (e.PropertyName == nameof(Float64Bit) ||
                    e.PropertyName == nameof(Int64Bit) ||
                    e.PropertyName == nameof(FloatThreads) ||
                    e.PropertyName == nameof(IntThreads))
                {
                    OptionsChanged?.Invoke(this, null);
                }
            };
        }
Exemplo n.º 27
0
 /// <summary>
 ///     Raises the <see cref="E:OptionsChanged" /> event.
 /// </summary>
 /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
 protected virtual void OnOptionsChanged(EventArgs e) => OptionsChanged?.Invoke(this, e);
 public void RaiseOptionsChanged(IAppOptions appOptions)
 {
     OptionsChanged?.Invoke(appOptions);
 }
Exemplo n.º 29
0
 protected void NotifyDelegate()
 {
     OptionsChanged?.Invoke(this, new PrintingOptionsEventArgs(Options));
 }
Exemplo n.º 30
0
 private void OptionsControl_Changed(object sender, RegexEngineOptionsChangedArgs args)
 {
     OptionsChanged?.Invoke(this, args);
 }