Esempio n. 1
0
        private void ElementControl_fsSyncReporter(object sender, FileSystemSyncEventArgs e)
        {
            EndLoadingUI();

            // Navigation Tree Expansion
            if (e.Message == FileSystemSyncMessage.NavigationTreeExpanded)
            {
                NavigationTextBlock_MouseDown(this.NavigationTabList.SelectedItem, null);
                return;
            }

            // Update Today+
            if (this.startPath == StartProcess.START_PATH && StartProcess.FirstTime)
            {
                StartProcess.FirstTime = false;
                elementControl.CreateToday();

                Properties.Settings.Default.LastRunningDateTime = DateTime.Now;
                Properties.Settings.Default.Save();
            }
            else
            {
                if (Properties.Settings.Default.LastRunningDateTime == null ||
                    Properties.Settings.Default.LastRunningDateTime.Year != DateTime.Now.Year ||
                    Properties.Settings.Default.LastRunningDateTime.Month != DateTime.Now.Month ||
                    Properties.Settings.Default.LastRunningDateTime.Day != DateTime.Now.Day)
                {
                    elementControl.UpdateDaysAhead();

                    //Move deferred notes
                    //elementControl.UpdateToday();

                    Properties.Settings.Default.LastRunningDateTime = DateTime.Now;
                    Properties.Settings.Default.Save();
                }

            }

            if (Properties.Settings.Default.LastFocusedElementGuid != String.Empty &&
                e.Message == FileSystemSyncMessage.HighPriorityWorkFinished &&
                elementControl.CurrentElement.ID.ToString() != Properties.Settings.Default.LastFocusedElementGuid)
            {
                Element lastFocused = elementControl.FindElementByGuid(elementControl.Root, new Guid(Properties.Settings.Default.LastFocusedElementGuid));
                if (lastFocused != null)
                {
                    elementControl.CurrentElement = lastFocused;
                    GetFocusToElementTextBox(elementControl.CurrentElement, elementControl.CurrentElement.NoteText.Length, false, false);
                }
                else
                {
                    if (elementControl.Root.HasChildren == false)
                    {
                        Element newElement = elementControl.CreateNewElement(ElementType.Note, String.Empty);
                        elementControl.InsertElement(newElement, elementControl.Root, 0);
                        elementControl.CurrentElement = newElement;
                        GetFocusToElementTextBox(elementControl.CurrentElement, elementControl.CurrentElement.NoteText.Length, false, false);
                    }
                }
            }

            if (Properties.Settings.Default.ShowOutline)
            {
                ShowOutline_Checked(null, null);
            }

            // Load Command Note
            elementControl.LoadCommandNotesUnderDaysAhead();

            SHOW_DONEDEFER_HANDLE = true;

            //elementControl.UpdateStatusChangedElementList();
        }
Esempio n. 2
0
 protected virtual void OnFSSyncFinished(object sender, FileSystemSyncEventArgs e)
 {
     if (fsSyncReporter != null)
         fsSyncReporter(sender, e);
 }