internal FrmMain(ClientCredential credential, DesktopClientSettings settings, ExtensionManager extensionManager, StyleManager styleManager) { this.credential = credential; this.settings = settings; this.extensionManager = extensionManager; this.styleManager = styleManager; this.InitializeComponent(); this.InitializeHtmlEditor(); this.InitializeExtensions(); this.Text = string.Format("CloudNotes - {0}@{1}", credential.UserName, credential.ServerUri); // Fix the main form size var currentScreen = Screen.FromControl(this); this.Width = Convert.ToInt32(currentScreen.Bounds.Width * 0.75F); this.Height = Convert.ToInt32(currentScreen.Bounds.Height * 0.75F); this.Location = new Point(currentScreen.Bounds.X + (currentScreen.Bounds.Width - this.Width)/2, currentScreen.Bounds.Y + (currentScreen.Bounds.Height - this.Height)/2); this.splitContainer.SplitterDistance = Convert.ToInt32(this.Width*0.25F); this.notifyIcon.Text = string.Format("CloudNotes - {0}", credential.UserName); this.notesNode = this.tvNotes.Nodes.Add("NotesRoot", Resources.NotesNodeTitle, 0, 0); this.trashNode = this.tvNotes.Nodes.Add("TrashRoot", Resources.TrashNodeTitle, 1, 1); Application.Idle += (s, e) => { this.slblStatus.Text = Resources.Ready; }; }
/// <summary> /// When overridden in a derived class, allows a designer to emit code that configures the splash screen and main form. /// </summary> protected override void OnCreateMainForm() { var extensionManager = new ExtensionManager(); var settings = DesktopClientSettings.ReadSettings(); var loadExtensionTask = Task.Factory.StartNew(() => { // As the extensions are loaded in another thread, setting that thread's ui culture // to the one read from the setting preference. Thread.CurrentThread.CurrentUICulture = new CultureInfo(settings.General.Language); extensionManager.Load(); }); Thread.CurrentThread.CurrentUICulture = new CultureInfo(settings.General.Language); var credential = LoginProvider.Login(Application.Exit, settings); if (credential != null) { Task.WaitAll(loadExtensionTask); // Instantiate your main application form this.MainForm = new FrmMain(credential, settings, extensionManager); } }
internal FrmMain(ClientCredential credential, DesktopClientSettings settings, ExtensionManager extensionManager) { this.credential = credential; this.settings = settings; this.extensionManager = extensionManager; this.InitializeComponent(); this.InitializeHtmlEditor(); this.InitializeExtensions(); this.Text = string.Format("CloudNotes - {0}@{1}", credential.UserName, credential.ServerUri); this.notifyIcon.Text = string.Format("CloudNotes - {0}", credential.UserName); this.notesNode = this.tvNotes.Nodes.Add("NotesRoot", Resources.NotesNodeTitle, 0, 0); this.trashNode = this.tvNotes.Nodes.Add("TrashRoot", Resources.TrashNodeTitle, 1, 1); Application.Idle += (s, e) => { this.slblStatus.Text = Resources.Ready; }; }
internal FrmSettings(DesktopClientSettings settings, ExtensionManager extensionManager) { InitializeComponent(); this.settings = settings; this.extensionManager = extensionManager; }
internal FrmAbout(ExtensionManager extensionManager) { this.InitializeComponent(); this.extensionManager = extensionManager; }