void Initialize() { myNoteConfiguraiton = new ApplicationConfiguration(); xmlInteraction = new XMLInteraction(myNoteConfiguraiton); if (null != xmlInteraction && Common.DesktopApplicaiton) { Sync.CheckSyncRequired(myNoteConfiguraiton.SyncFile, ref xmlInteraction); } UpdateTreeView(); if (treeView1.Nodes.Count > 0) { string title; string note; string lastUpdated; if (xmlInteraction.GetNodeDetails(treeView1.Nodes[0].Name, out title, out note, out lastUpdated)) { noteForm = new NoteForm(treeView1.Nodes[0].Name, title, note, lastUpdated); } else { noteForm = new NoteForm(); } } else { CreateNote(); } ShowNoteForm(); }
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { string title; string note; string lastUpdated; if (xmlInteraction.GetNodeDetails(treeView1.SelectedNode.Name, out title, out note, out lastUpdated)) { noteForm.Initalize(treeView1.SelectedNode.Name, title, note, lastUpdated); deleteButton.Visible = true; ShowNoteForm(); } else { Logger.GetInstance.LogMessage(System.Reflection.MethodBase.GetCurrentMethod().Name, string.Format("Failed to retrive note: [{0}]", treeView1.SelectedNode.Name)); } }