예제 #1
0
        public Main()
        {
            QuitOption = QuitOption.QuitProgram;

            Current = this;

            File.Delete(m_shellContentMenuFilePath);

            InitializeComponent();

            this.Text = "Waveface ";

            m_dragDropClipboardHelper = new DragDrop_Clipboard_Helper();

            //initVirtualFolderForm();

            InitTaskbarNotifier();

            m_formSettings                = new FormSettings(this);
            m_formSettings.UseSize        = true;
            m_formSettings.UseLocation    = true;
            m_formSettings.UseWindowState = true;
            m_formSettings.AllowMinimized = false;
            m_formSettings.SaveOnClose    = true;

            //System.Net.ServicePointManager.DefaultConnectionLimit = 64;

            m_autoUpdator = new AppLimit.NetSparkle.Sparkle(WService.WebURL + "/extensions/windowsUpdate/versioninfo.xml");
            m_autoUpdator.StartLoop(true, TimeSpan.FromHours(5.0));

            s_logger.Trace("Constructor: OK");
        }
예제 #2
0
        // callback handlers

        public void OpenSettings()
        {
            if (currentFormSettings != null)
            {
                currentFormSettings.BringToFront();
            }
            else
            {
                bool prevEnableUpdateCheck = Config.EnableUpdateCheck;

                currentFormSettings = new FormSettings(this, plugins, updates);

                currentFormSettings.FormClosed += (sender, args) => {
                    currentFormSettings = null;

                    if (!prevEnableUpdateCheck && Config.EnableUpdateCheck)
                    {
                        updates.Settings.DismissedUpdate = string.Empty;
                        Config.DismissedUpdate           = string.Empty;
                        Config.Save();

                        updates.Check(false);
                    }

                    if (!Config.EnableTrayHighlight)
                    {
                        trayIcon.HasNotifications = false;
                    }

                    UpdateProperties(PropertyBridge.Properties.ExpandLinksOnHover | PropertyBridge.Properties.HasCustomNotificationSound);
                };

                ShowChildForm(currentFormSettings);
            }
        }
        private void OpenSettings_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            FormSettings form = new FormSettings();

            form.Owner = this;
            form.ShowDialog();
        }
예제 #4
0
        public static string Parse(IParseContext context)
        {
            var title = string.Empty;
            var theme = string.Empty;

            foreach (var name in context.StlAttributes.Keys)
            {
                var value = context.StlAttributes[name];

                if (Utils.EqualsIgnoreCase(name, AttributeTitle))
                {
                    title = Main.Instance.ParseApi.ParseAttributeValue(value, context);
                }
                else if (Utils.EqualsIgnoreCase(name, AttributeTheme))
                {
                    theme = value;
                }
            }

            var formId = !string.IsNullOrEmpty(title) ? Main.Instance.FormDao.GetFormIdByTitle(context.SiteId, title) : Main.Instance.FormDao.GetFormIdByContentId(context.SiteId, context.ChannelId, context.ContentId);

            var formInfo     = Main.Instance.FormDao.GetFormInfo(formId);
            var formSettings = new FormSettings(formInfo?.Settings);

            if (string.IsNullOrEmpty(theme))
            {
                theme = formSettings.DefaultTheme;
            }
            theme = ParseUtils.GetTheme(theme);

            return(formInfo == null ? string.Empty : ParseImpl(context, formInfo, formSettings, theme));
        }
예제 #5
0
        public void BtnSubmit_Click(object sender, EventArgs e)
        {
            var settings = new FormSettings(FormInfo.Settings)
            {
                DefaultTheme                = DdlDefaultTheme.SelectedValue,
                IsCaptcha                   = CbIsCaptcha.Checked,
                IsAdministratorSmsNotify    = Convert.ToBoolean(DdlIsAdministratorSmsNotify.SelectedValue),
                AdministratorSmsNotifyTplId = TbAdministratorSmsNotifyTplId.Text,
                AdministratorSmsNotifyKeys  =
                    Utils.GetSelectedListControlValueCollection(LbAdministratorSmsNotifyKeys),
                AdministratorSmsNotifyMobile = TbAdministratorSmsNotifyMobile.Text
            };

            FormInfo.Title       = TbTitle.Text;
            FormInfo.Description = TbDescription.Text;
            FormInfo.IsTimeout   = CbIsTimeout.Checked;
            FormInfo.TimeToStart = TbTimeToStart.DateTime;
            FormInfo.TimeToEnd   = TbTimeToEnd.DateTime;

            FormInfo.Settings = settings.ToString();

            Main.Instance.FormDao.Update(FormInfo);

            LtlMessage.Text = Utils.GetMessageHtml("设置保存成功!", true);
        }
예제 #6
0
        /// ------------------------------------------------------------------------------------
        public WelcomeDialog(WelcomeDialogViewModel viewModel)
        {
            Logger.WriteEvent("WelcomeDialog constructor");

            InitializeComponent();

            Font = SystemFonts.MessageBoxFont;             //use the default OS UI font

            Model = viewModel;

            if (Settings.Default.WelcomeDialog == null)
            {
                StartPosition = FormStartPosition.CenterScreen;
                Settings.Default.WelcomeDialog = FormSettings.Create(this);
            }

            tsOptions.Renderer       = new SIL.Windows.Forms.NoToolStripBorderRenderer();
            tsOptions.BackColorBegin = Color.White;
            tsOptions.BackColorEnd   = Color.White;
            DialogResult             = DialogResult.Cancel;

            LoadMRUButtons();

            LocalizeItemDlg.StringsLocalized += LocalizationInitiated;
            LocalizationInitiated();
        }
예제 #7
0
        public PostForm(List <string> files, PostType postType, Post post, bool editMode)
        {
            InitializeComponent();

            EditMode          = editMode;
            m_post            = post;
            m_oldImageFiles   = new Dictionary <string, string>();
            m_fileNameMapping = new Dictionary <string, string>();

            m_formSettings                = new FormSettings(this);
            m_formSettings.UseLocation    = true;
            m_formSettings.UseWindowState = true;
            m_formSettings.AllowMinimized = false;
            m_formSettings.SaveOnClose    = true;

            CreateLinkFormattingRule();

            weblink_UI.MyParent  = this;
            photo_UI.MyParent    = this;
            richText_UI.MyParent = this;
            document_UI.MyParent = this;

            btnAddPhoto.Focus();

            pureTextBox.WaterMarkText = I18n.L.T("PostForm.PuretextWaterMark");

            if (EditMode)
            {
                InitEditMode();
            }
            else
            {
                InitNewMode(files, postType);
            }
        }
예제 #8
0
        public void OpenSettings(int tabIndex)
        {
            if (!TryBringToFront <FormSettings>())
            {
                bool prevEnableUpdateCheck = Config.EnableUpdateCheck;

                FormSettings form = new FormSettings(this, plugins, updates, tabIndex);

                form.FormClosed += (sender, args) => {
                    if (!prevEnableUpdateCheck && Config.EnableUpdateCheck)
                    {
                        updates.DismissUpdate(string.Empty);
                        updates.Check(false);
                    }

                    if (!Config.EnableTrayHighlight)
                    {
                        trayIcon.HasNotifications = false;
                    }

                    UpdateProperties(PropertyBridge.Properties.ExpandLinksOnHover | PropertyBridge.Properties.HasCustomNotificationSound);
                    form.Dispose();
                };

                ShowChildForm(form);
            }
        }
예제 #9
0
        private void btnSettings_Click(object sender, EventArgs e)
        {
            FormSettings f = new FormSettings(Index);

            if (f.ShowDialog() == DialogResult.OK)
            {
                Settings s = Settings.Load();
                s.SiteAddress[Index]       = f.SiteAddress;
                s.Providers[Index]         = f.ConnectionProvider;
                s.ConnectionStrings[Index] = f.ConnectingString;
                if (s.Emails == null)
                {
                    s.Emails = new Dictionary <int, string>();
                }
                if (s.Passwords == null)
                {
                    s.Passwords = new Dictionary <int, string>();
                }
                if (s.Feed == null)
                {
                    s.Feed = new Dictionary <int, string>();
                }
                s.Emails[Index]    = f.Email;
                s.Passwords[Index] = f.Password;
                s.Feed[Index]      = f.Feed;
                s.Save();

                loadCategories(false);
            }
        }
예제 #10
0
        private void Shell_Load(object sender, EventArgs e)
        {
            //Handle window sizing/location. Normally, we just Maximize the window.
            //The exceptions to this are if we are in a DEBUG build or the settings have a MaximizeWindow=='False", which at this time
            //must be done by hand (no user UI is provided).
            try
            {
                SuspendLayout();

                if (Settings.Default.WindowSizeAndLocation == null)
                {
                    StartPosition = FormStartPosition.WindowsDefaultLocation;
                    WindowState   = FormWindowState.Maximized;
                    Settings.Default.WindowSizeAndLocation = FormSettings.Create(this);
                    Settings.Default.Save();
                }

                // This feature is not yet a normal part of Bloom, since we think just maximizing is more rice-farmer-friendly.
                // However, we added the ability to remember this stuff at the request of the person making videos, who needs
                // Bloom to open in the same place / size each time.
                if (Settings.Default.MaximizeWindow == false)
                {
                    Settings.Default.WindowSizeAndLocation.InitializeForm(this);
                }
                else
                {
                    // BL-1036: save and restore un-maximized settings
                    var savedBounds = Settings.Default.RestoreBounds;
                    if ((savedBounds.Width > 200) && (savedBounds.Height > 200) && (IsOnScreen(savedBounds)))
                    {
                        StartPosition = FormStartPosition.Manual;
                        WindowState   = FormWindowState.Normal;
                        Bounds        = savedBounds;
                    }
                    else
                    {
                        StartPosition = FormStartPosition.CenterScreen;
                    }

                    WindowState = FormWindowState.Maximized;

                    UpdatePerformanceMeasurementStatus();
                }
            }
            catch (Exception error)
            {
                Debug.Fail(error.Message);

// ReSharper disable HeuristicUnreachableCode
                //Not worth bothering the user. Just reset the values to something reasonable.
                StartPosition = FormStartPosition.WindowsDefaultLocation;
                WindowState   = FormWindowState.Maximized;
// ReSharper restore HeuristicUnreachableCode
            }
            finally
            {
                ResumeLayout();
            }
        }
예제 #11
0
        public static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            FormSettings formSettingsForDamka = new FormSettings();

            formSettingsForDamka.ShowDialog();
        }
예제 #12
0
        public LoginForm()
        {
            InitializeComponent();

            m_formSettings             = new FormSettings(this);
            m_formSettings.UseSize     = false;
            m_formSettings.SaveOnClose = true;
        }
 private void FormMain_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F7)
     {
         FormSettings settings = new FormSettings();
         settings.ShowDialog();
     }
 }
예제 #14
0
 private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (this.WindowState == FormWindowState.Minimized)
     {
         return;
     }
     FormSettings.SaveSettings(this);
 }
예제 #15
0
        private void conToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var settings = new FormSettings
            {
                Owner = this
            };

            settings.Show();
        }
예제 #16
0
        public void FormPositionDefaults()
        {
            FormSettings f  = UserSettings.Form;
            Point        pt = f.Location;
            Size         sz = f.Size;

            Assert.AreEqual(DEFAULT_LOCATION, pt);
            Assert.AreEqual(DEFAULT_SIZE, sz);
        }
예제 #17
0
		// ----------------------------------------------------------------------
		public DataGridViewSettingsForm()
		{
			InitializeComponent();
			formSettings = new FormSettings( this );
			formSettings.SaveOnClose = false; // disable auto-save
			formSettings.Settings.Add( new DataGridViewSetting( customersDataGridView ) );

			customersDataGridView.DataSource = LoadCustomers();
		} // DataGridViewSettingsForm
예제 #18
0
        public AssignCharacterDlg(AssignCharacterViewModel viewModel)
        {
            InitializeComponent();

            m_viewModel = viewModel;

            if (Settings.Default.AssignCharacterDialogFormSettings == null)
            {
                Settings.Default.AssignCharacterDialogFormSettings = FormSettings.Create(this);
            }

            m_txtCharacterFilter.CorrectHeight();
            m_txtDeliveryFilter.CorrectHeight();
            if (Settings.Default.AssignCharactersShowGridView)
            {
                m_toolStripButtonGridView.Checked = true;
            }

            var books = new BookSet();

            foreach (var bookId in m_viewModel.IncludedBooks)
            {
                books.Add(bookId);
            }
            m_scriptureReference.VerseControl.BooksPresentSet = books;
            m_scriptureReference.VerseControl.ShowEmptyBooks  = false;

            m_scriptureReference.VerseControl.AllowVerseSegments = false;
            m_scriptureReference.VerseControl.Versification      = m_viewModel.Versification;
            m_scriptureReference.VerseControl.VerseRefChanged   += m_scriptureReference_VerseRefChanged;
            m_scriptureReference.VerseControl.Disposed          += (sender, args) =>
                                                                   m_scriptureReference.VerseControl.VerseRefChanged -= m_scriptureReference_VerseRefChanged;

            m_blocksViewer.Initialize(m_viewModel,
                                      AssignCharacterViewModel.Character.GetCharacterIdForUi,
                                      block => block.Delivery);
            m_viewModel.CurrentBlockChanged += LoadBlock;

            UpdateProgressBarForMode();

            HandleStringsLocalized();
            LocalizeItemDlg.StringsLocalized += HandleStringsLocalized;

            m_listBoxCharacters.DisplayMember = "LocalizedDisplay";
            m_originalDefaultFontForLists     = m_listBoxCharacters.Font;
            SetFontsFromViewModel();

            m_viewModel.AssignedBlocksIncremented += m_viewModel_AssignedBlocksIncremented;
            m_viewModel.UiFontSizeChanged         += (sender, args) => SetFontsFromViewModel();

            m_blocksViewer.VisibleChanged += LoadBlock;
            m_blocksViewer.Disposed       += (sender, args) => m_blocksViewer.VisibleChanged -= LoadBlock;

            SetFilterControlsFromMode();

            m_viewModel.CurrentBookSaved += UpdateSavedText;
        }
예제 #19
0
        // ----------------------------------------------------------------------
        public DataGridViewSettingsForm()
        {
            InitializeComponent();
            formSettings             = new FormSettings(this);
            formSettings.SaveOnClose = false;             // disable auto-save
            formSettings.Settings.Add(new DataGridViewSetting(customersDataGridView));

            customersDataGridView.DataSource = LoadCustomers();
        }         // DataGridViewSettingsForm
예제 #20
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            FormSettings.LoadSettings(this);

            if (tabMain.TabPages.Count < 1)
            {
                addWorkspace(null);
            }
        }
예제 #21
0
 private void ApplyLayout(FormSettings settings)
 {
     // make layout DPI aware
     MakeDPIAware();
     // place form completely inside a screen
     settings.PlaceOnScreen(this);
     // place splitters
     settings.AdjustGUI(this);
 }
예제 #22
0
        private void _show_settings_Click(object sender, EventArgs e)
        {
            _logger.Trace($"executing {nameof(_show_settings_Click)}...");

            var settings = new FormSettings();

            settings.ShowDialog(_mwnd);

            _logger.Trace($"completed {nameof(_show_settings_Click)}");
        }
 // Меню +
 private void SettingsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         var wnd = new FormSettings();
         var res = wnd.ShowDialog();
         WebClient();
     }
     catch { }
 }
 public static Show()
 {
     if(_instance == null) // not yet created - create and show
     {
         _instance = new FormSettings();
         _instance.Show();
     }
     else
         _instance.Visible = true; // was created and hidden - un-hide
 }
예제 #25
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }

            var settings = new FormSettings(FormInfo.Settings);

            TbTitle.Text       = FormInfo.Title;
            TbDescription.Text = FormInfo.Description;

            var themeList = ParseUtils.GetThemeList();

            foreach (var theme in themeList)
            {
                DdlDefaultTheme.Items.Add(new ListItem(theme, theme));
            }
            Utils.SelectSingleItem(DdlDefaultTheme, settings.DefaultTheme);

            CbIsTimeout.Checked    = FormInfo.IsTimeout;
            PhTimeout.Visible      = FormInfo.IsTimeout;
            TbTimeToStart.DateTime = FormInfo.TimeToStart;
            TbTimeToEnd.DateTime   = FormInfo.TimeToEnd;

            CbIsCaptcha.Checked = settings.IsCaptcha;

            var smsPlugin = Main.Instance.PluginApi.GetPlugin <SmsPlugin>(SmsPlugin.PluginId);

            if (smsPlugin != null && smsPlugin.IsReady)
            {
                PhSms.Visible = true;

                Utils.SelectSingleItem(DdlIsAdministratorSmsNotify, settings.IsAdministratorSmsNotify.ToString());
                TbAdministratorSmsNotifyTplId.Text = settings.AdministratorSmsNotifyTplId;

                var keys = settings.AdministratorSmsNotifyKeys.Split(',');
                LbAdministratorSmsNotifyKeys.Items.Add(new ListItem(nameof(LogInfo.Id), nameof(LogInfo.Id)));
                LbAdministratorSmsNotifyKeys.Items.Add(new ListItem(nameof(LogInfo.AddDate), nameof(LogInfo.AddDate)));
                var fieldInfoList = Main.Instance.FieldDao.GetFieldInfoList(FormInfo.Id, false);
                foreach (var fieldInfo in fieldInfoList)
                {
                    LbAdministratorSmsNotifyKeys.Items.Add(new ListItem(fieldInfo.Title, fieldInfo.Title));
                }
                Utils.SelectMultiItems(LbAdministratorSmsNotifyKeys, keys);

                TbAdministratorSmsNotifyMobile.Text = settings.AdministratorSmsNotifyMobile;

                PhIsAdministratorSmsNotify.Visible = Convert.ToBoolean(DdlIsAdministratorSmsNotify.SelectedValue);
            }
            else
            {
                PhSmsPluginNotInstalled.Visible = true;
            }
        }
예제 #26
0
        public void OpenSettings(Type startTab)
        {
            if (!FormManager.TryBringToFront <FormSettings>())
            {
                bool prevEnableUpdateCheck = Config.EnableUpdateCheck;

                FormSettings form = new FormSettings(this, plugins, updates, analytics, startTab);

                form.FormClosed += (sender, args) => {
                    if (!prevEnableUpdateCheck && Config.EnableUpdateCheck)
                    {
                        Config.DismissedUpdate = null;
                        Config.Save();

                        updates.Check(true);
                    }

                    if (!Config.EnableTrayHighlight)
                    {
                        trayIcon.HasNotifications = false;
                    }

                    if (Config.AllowDataCollection)
                    {
                        if (analytics == null)
                        {
                            analytics = new AnalyticsManager(this, plugins, Program.AnalyticsFilePath);
                        }
                    }
                    else if (analytics != null)
                    {
                        analytics.Dispose();
                        analytics = null;
                    }

                    BrowserCache.RefreshTimer();

                    if (form.ShouldReloadBrowser)
                    {
                        FormManager.TryFind <FormPlugins>()?.Close();
                        plugins.Reload(); // also reloads the browser
                    }
                    else
                    {
                        browser.UpdateProperties();
                    }

                    notification.RequiresResize = true;
                    form.Dispose();
                };

                AnalyticsFile.OpenOptions.Trigger();
                ShowChildForm(form);
            }
        }
예제 #27
0
        /// ------------------------------------------------------------------------------------
        public NewSessionsFromFilesDlg(NewSessionsFromFileDlgViewModel viewModel)
        {
            Logger.WriteEvent("NewSessionsFromFilesDlg constructor");

            InitializeComponent();

            var selectedCol = new DataGridViewCheckBoxColumn();

            selectedCol.AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells;
            selectedCol.DataPropertyName = "Selected";
            selectedCol.HeaderText       = string.Empty;
            selectedCol.Name             = "selectedCol";
            selectedCol.Resizable        = DataGridViewTriState.False;
            selectedCol.SortMode         = DataGridViewColumnSortMode.Automatic;
            _gridFiles.Grid.Columns.Insert(0, selectedCol);
            _chkBoxColHdrHandler = new CheckBoxColumnHeaderHandler(selectedCol);

            _gridFiles.InitializeGrid("NewSessionsFromFilesDlg");
            _gridFiles.AfterComponentSelectionChanged = HandleComponentFileSelected;

            Controls.Add(_panelProgress);

            _labelIncomingFiles.Font = Program.DialogFont;
            _labelInstructions.Font  = Program.DialogFont;
            _linkFindFiles.Font      = Program.DialogFont;
            _labelSourceFolder.Font  = new Font(Program.DialogFont, FontStyle.Bold);
            _panelProgress.Visible   = false;

            if (Settings.Default.NewSessionsFromFilesDlg == null)
            {
                StartPosition = FormStartPosition.CenterScreen;
                Settings.Default.NewSessionsFromFilesDlg = FormSettings.Create(this);
            }

            _folderMissingMsgCtrl = new NewSessionsFromFilesDlgFolderNotFoundMsg();
            _gridFiles.Controls.Add(_folderMissingMsgCtrl);
            _folderMissingMsgCtrl.BringToFront();

            _mediaPlayerPanel.BorderStyle = BorderStyle.None;

            _mediaPlayerViewModel = new MediaPlayerViewModel();

            _mediaPlayerViewModel.SetVolume(Settings.Default.MediaPlayerVolume);
            _mediaPlayer      = new MediaPlayer(_mediaPlayerViewModel);
            _mediaPlayer.Dock = DockStyle.Fill;
            _mediaPlayerPanel.Controls.Add(_mediaPlayer);

            DialogResult                     = DialogResult.Cancel;
            _viewModel                       = viewModel;
            _viewModel.FilesChanged         += UpdateDisplay;
            _viewModel.FileLoadingStarted   += InitializeProgressIndicatorForFileLoading;
            _viewModel.FilesLoaded          += UpdateFileLoadingProgress;
            _viewModel.FileLoadingCompleted += FileLoadingProgressComplete;
            _viewModel.Initialize(this);
        }
예제 #28
0
 private void изменитьToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (FormSettings frm_fs = new FormSettings())
     {
         if (MessageBox.Show("Если Вы вносите новые настройки, Все соединения закрываются." + Environment.NewLine + "Согласны сделать это сейчас?", "Внимание", MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             listView_remote.Items.Clear();
             frm_fs.ShowDialog();
         }
     }
 }
예제 #29
0
        private void _settingsMI_Click(object sender, EventArgs e)
        {
            using (var view = new FormSettings())
            {
#if NetCF
                view.ShowDialog();
#else
                view.ShowDialog(this);
#endif
            }
        }
		public void SetUp()
		{
			explicitChain = BehaviorChain.For<IntegratedSettingsEndpoint>(x => x.get_int());
			defaultChain = BehaviorChain.For<IntegratedSettingsEndpoint>(x => x.get_string());
			ajaxChain = BehaviorChain.For<IntegratedSettingsEndpoint>(x => x.get_ajax());

			theSettings = new FormSettings();;
			theSettings.ForChainsMatching(new LambdaChainFilter(x => x.ResourceType() == typeof(int)), FormMode.None);

			theRegistry = theSettings.BuildRegistry();
		}
예제 #31
0
        /// ------------------------------------------------------------------------------------
        public MediaFileMoreInfoDlg(string mediaFileInfo) : this()
        {
            if (Settings.Default.MediaFileMoreInfoDlg == null)
            {
                StartPosition = FormStartPosition.CenterScreen;
                Settings.Default.MediaFileMoreInfoDlg = FormSettings.Create(this);
            }

            _mediaFilePath = mediaFileInfo;
            LoadBrowserControl();
        }
        public void SetUp()
        {
            explicitChain = BehaviorChain.For <IntegratedSettingsEndpoint>(x => x.get_int());
            defaultChain  = BehaviorChain.For <IntegratedSettingsEndpoint>(x => x.get_string());
            ajaxChain     = BehaviorChain.For <IntegratedSettingsEndpoint>(x => x.get_ajax());

            theSettings = new FormSettings();;
            theSettings.ForChainsMatching(new LambdaChainFilter(x => x.ResourceType() == typeof(int)), FormMode.None);

            theRegistry = theSettings.BuildRegistry();
        }
예제 #33
0
		// ----------------------------------------------------------------------
		public CollectedSettingsForm()
		{
			InitializeComponent();

			formSettings = new FormSettings( this );
			formSettings.CollectingSetting += FormSettingsCollectingSetting;

			formSettings.SettingCollectors.Add( new PropertySettingCollector( this, typeof( Splitter ), "SplitPosition" ) );
			formSettings.SettingCollectors.Add( new PropertySettingCollector( this, typeof( TextBox ), "Text" ) );
			formSettings.SettingCollectors.Add( new PropertySettingCollector( this, typeof( DateTimePicker ), "Value" ) );
			formSettings.SettingCollectors.Add( new PropertySettingCollector( this, typeof( CheckBox ), "Checked" ) );
			formSettings.SettingCollectors.Add( new PropertySettingCollector( this, typeof( ComboBox ), "SelectedIndex" ) );
		} // CollectedSettingsForm
예제 #34
0
        // Main Form Ctor...
        public MainForm(AppSettings appSettings)
        {
            InitializeComponent();

            // Create settings group...
            //		FormSettings contains all of the Window properties...
            //		It does NOT contain the controls or the app configuration data...
            formSettings = new FormSettings(this);

            // Enable Auto-Save...
            formSettings.SaveOnClose = true;

            // Copy the appSettings argument into this forms appSettings property...
            this.appSettings = appSettings;

            // Set the default form properties and then update them with the last used properties...
            InitControls();

            listViewColumnSorter = new ListViewColumnSorter();
            this.lvSource.ListViewItemSorter = listViewColumnSorter;
            this.lvTarget.ListViewItemSorter = listViewColumnSorter;
        }
예제 #35
0
        /*private ScreenCapture screenCapture;
        private PictureBox previewPictureBox;*/
        public MainForm()
        {
            try
            {

                //check for wizard
                if(Settings.ShowWizard)
                {
                    //settings file doesnt exist, wizard!
                    //this.Hide();
                    FirstRunWizard wzrd = new FirstRunWizard();
                    wzrd.ShowDialog(this);
                    Settings.ShowWizard = false;
                }

                imageFormatHandler = new ImageFormatHandler();
                //screenCapture = new ScreenCapture(imageFormatHandler);
                _formSettings = new FormSettings(this);
                InitializeComponent();

                if(Settings.Office2007BlueFeel)
                    ToolStripManager.Renderer = Office2007Renderer.Office2007Renderer.GetRenderer(Office2007Renderer.RenderColors.Blue);
                else if(Settings.Office2007BlackFeel)
                    ToolStripManager.Renderer = Office2007Renderer.Office2007Renderer.GetRenderer(Office2007Renderer.RenderColors.Black);
                else
                    ToolStripManager.Renderer = new System.Windows.Forms.ToolStripProfessionalRenderer();

                //Settings.RebuildTagIndex();

                LoadFavorites();
                LoadFavorites("");
                LoadSpecialCommands();
                LoadGroups();
                UpdateControls();
                pnlTagsFavorites.Width = 7;
                LoadTags("");
                ProtocolHandler.Register();
                SingleInstanceApplication.NewInstanceMessage += new NewInstanceMessageEventHandler(SingleInstanceApplication_NewInstanceMessage);
                tcTerminals.MouseClick += new MouseEventHandler(tcTerminals_MouseClick);
                QuickContextMenu.ItemClicked += new ToolStripItemClickedEventHandler(QuickContextMenu_ItemClicked);
                SystemTrayQuickConnectToolStripMenuItem.DropDownItemClicked += new ToolStripItemClickedEventHandler(SystemTrayQuickConnectToolStripMenuItem_DropDownItemClicked);
                //System.Net.NetworkInformation.NetworkChange.NetworkAvailabilityChanged += new System.Net.NetworkInformation.NetworkAvailabilityChangedEventHandler(NetworkChange_NetworkAvailabilityChanged);

                LoadWindowState();

                this.MainWindowNotifyIcon.Visible = Settings.MinimizeToTray;
                this.lockToolbarsToolStripMenuItem.Checked = Settings.ToolbarsLocked;
                this.groupsToolStripMenuItem.Visible = Settings.EnableGroupsMenu;

                if(Settings.ToolbarsLocked)
                    MainMenuStrip.GripStyle = ToolStripGripStyle.Hidden;
                else
                    MainMenuStrip.GripStyle = ToolStripGripStyle.Visible;

                //be sure to turn off the visual studio hosting process for this to work
                //right click the Terminals project, debug, bottom checkbox
                //try {
                //    gma.System.Windows.UserActivityHook hook = new gma.System.Windows.UserActivityHook(false, true);
                //    hook.KeyUp += new KeyEventHandler(hook_KeyUp);
                //} catch(Exception exc) {
                //    Terminals.Logging.Log.Info("Failed to set keyboard hook for global event handling.", exc);
                //}

            }
            catch(Exception exc)
            {
                Terminals.Logging.Log.Info("", exc);
                System.Windows.Forms.MessageBox.Show(exc.ToString());
            }
        }
예제 #36
0
        public bool StartSettingsDialog(IWin32Window owner, SettingsPageReference initalPage = null)
        {
            Func<bool> action = () =>
            {
                using (var form = new FormSettings(this, initalPage))
                {
                    form.ShowDialog(owner);
                }

                return true;
            };

            return DoActionOnRepo(owner, false, true, PreSettings, PostSettings, action);
        }
예제 #37
0
        private void btnSettings_Click(object sender, EventArgs e)
        {
            FormSettings f = new FormSettings(Index);

            if (f.ShowDialog() == DialogResult.OK)
            {
                Settings s = Settings.Load();
                s.SiteAddress[Index] = f.SiteAddress;
                s.Providers[Index] = f.ConnectionProvider;
                s.ConnectionStrings[Index] = f.ConnectingString;
                if (s.Emails == null) s.Emails = new Dictionary<int, string>();
                if (s.Passwords == null) s.Passwords = new Dictionary<int, string>();
                if (s.Feed == null) s.Feed = new Dictionary<int, string>();
                s.Emails[Index] = f.Email;
                s.Passwords[Index] = f.Password;
                s.Feed[Index] = f.Feed;
                s.Save();

                loadCategories(false);
            }
        }