예제 #1
0
        public NotesPeekContent()
        {
            InitializeComponent();

            SpellChecking.HandleSpellChecking(titleTextBox);
            SpellChecking.HandleSpellChecking(contentTextBox);

            contentTextBox.Document.Blocks.Clear();
        }
예제 #2
0
        public MonthDetail(DateTime date, Appointment appointment)
        {
            InitializeComponent();
            _date        = date;
            _appointment = appointment;
            InitializeDisplay();

            SpellChecking.HandleSpellChecking(subjectEdit);
        }
예제 #3
0
        public TasksPeekContent()
        {
            InitializeComponent();

            _showCompleted = Settings.ShowCompletedTasks;
            SpellChecking.HandleSpellChecking(newTaskTextBox);

            Loaded   += TasksPeekContent_Loaded;
            Unloaded += TasksPeekContent_Unloaded;
        }
        public AppointmentEditor(Grid crossZoom, Appointment appointment)
        {
            InitializeComponent();
            editDetails.Document.Blocks.Clear();

            Appointment = appointment;
            _crossZoom  = crossZoom;

            SpellChecking.HandleSpellChecking(editSubject);
            SpellChecking.HandleSpellChecking(editDetails);

            Unloaded += AppointmentEditor_Unloaded;
        }
예제 #5
0
        public MonthDetail(DateTime date)
        {
            InitializeComponent();
            _date = date;

            _appointment           = new Appointment();
            _appointment.StartDate = date;
            _appointment.EndDate   = date < DateTime.MaxValue.Date ? date.AddDays(1) : DateTime.MaxValue;

            InitializeDisplay();

            SpellChecking.HandleSpellChecking(subjectEdit);
        }
예제 #6
0
        public NotesView()
        {
            InitializeComponent();

            Loaded += NotesView_Loaded;

            SpellChecking.HandleSpellChecking(pageTitleBox);
            SpellChecking.HandleSpellChecking(document);

            ColumnDefinitions[0].Width = Settings.NotesColumn0Width;
            ColumnDefinitions[1].Width = Settings.NotesColumn1Width;
            ColumnDefinitions[2].Width = Settings.NotesColumn2Width;

            document.Document.Blocks.Clear();
        }
        /// <summary>
        /// Add a word to the dictionary. A message is shown if the word is
        /// not in the correct format.
        /// </summary>
        /// <param name="text"></param>
        private void AddItem(string text)
        {
            text = text.Trim();

            //
            // Check that the word is not blank
            //
            if (!string.IsNullOrEmpty(text))
            {
                //
                // Check that the word is a single word
                //
                if (text.Split(' ').Length == 1)
                {
                    //
                    // Check that the word is not already in the dictionary
                    //
                    string[] entries = new string[0];

                    if (File.Exists(SpellChecking.CustomDictionaryLocation))
                    {
                        entries = File.ReadAllLines(SpellChecking.CustomDictionaryLocation);
                    }

                    if (Array.IndexOf(entries, text) == -1)
                    {
                        AddItem(text, true, true);
                        SpellChecking.AddWordToDictionary(text);
                        addNewText.Clear();
                    }
                    else
                    {
                        TaskDialog dlg = new TaskDialog(this, "Duplicate Entry", "The word you entered already exists in the dictionary.", MessageType.Error);
                        dlg.ShowDialog();
                    }

                    entries = null;
                }
                else
                {
                    TaskDialog dlg = new TaskDialog(this, "Invalid Entry", "Entry cannot be more than one word long.", MessageType.Error);
                    dlg.ShowDialog();
                }
            }
        }
        private void deleteButton_Click(object sender, RoutedEventArgs e)
        {
            ListBoxItem item = (ListBoxItem)((FrameworkElement)sender).TemplatedParent;
            string      text = (string)item.Content;

            SpellChecking.DeleteWordFromDictionary(text);

            if (Settings.AnimationsEnabled)
            {
                AnimationHelpers.DeleteAnimation delete = new AnimationHelpers.DeleteAnimation(item);
                delete.OnAnimationCompletedEvent += delete_OnAnimationCompletedEvent;
                delete.Animate();
            }
            else
            {
                listBox.Items.Remove(item);
            }
        }
예제 #9
0
        /// <summary>
        /// Create a new Feedback window with extra text added to the message.
        /// </summary>
        /// <param name="type"></param>
        /// <param name="addend">the text to append to the end of the message</param>
        public Feedback(FeedbackType type, string addend)
        {
            InitializeComponent();

            _type   = type;
            _addend = addend;

            if (type == FeedbackType.Smile)
            {
                header.Text            = "We appreciate your feedback. What did you like?";
                detailsTip.Description = "Tell us what you liked about Daytimer.";
            }
            else if (type == FeedbackType.Error)
            {
                header.Text            = "We're extremely sorry this happened. Can you give us more information about the problem?";
                detailsTip.Description = "Tell us what you were doing when the error occurred.";
            }

            SpellChecking.HandleSpellChecking(details);
        }
예제 #10
0
        public NotesAppBar()
        {
            InitializeComponent();

            Width = Settings.NotesAppBarWidth;

            Loaded   += NotesAppBar_Loaded;
            Unloaded += NotesAppBar_Unloaded;

            document.Document.Blocks.Clear();

            SpellChecking.HandleSpellChecking(document, false);

            Window main = Application.Current.MainWindow;

            if (main.WindowState == WindowState.Normal)
            {
                MainWindowWidth    = main.ActualWidth;
                MainWindowLocation = new Point(main.Left, main.Top);
            }
        }
예제 #11
0
        public void Save()
        {
            Settings.AlertSound     = editReminderSound.SelectedIndex == editReminderSound.Items.Count - 1 ? "" : editReminderSound.SelectedItem.ToString();
            Settings.UnmuteSpeakers = editAlwaysReminder.IsChecked == true;

            TimeSpan?autosave = editAutoSave.SelectedTime;

            if (autosave == TimeSpan.Zero)
            {
                autosave = TimeSpan.FromSeconds(-1);
            }

            Settings.AutoSaveFrequency = autosave.HasValue ? autosave.Value : TimeSpan.FromSeconds(-1);
            Settings.TimeFormat        = editTimeFormat.SelectedIndex == 0 ? TimeFormat.Standard : TimeFormat.Universal;

            if (calendarTab.Tag != null)
            {
                TimeSpan?reminder = editReminder.SelectedTime;
                Settings.DefaultReminder = reminder.HasValue ? reminder.Value : TimeSpan.FromSeconds(-1);

                Settings.SnapToGrid = editSnaptoGrid.IsChecked.Value;

                TimeSpan newWorkStart = TimeSpan.Parse(editWorkStart.TextDisplay);
                TimeSpan newWorkEnd   = TimeSpan.Parse(editWorkEnd.TextDisplay);
                string   workdays     = GetWorkDays();

                Settings.WorkHoursStart = newWorkStart;
                Settings.WorkHoursEnd   = newWorkEnd;
                Settings.WorkDays       = workdays;
            }

            if (peopleTab.Tag != null)
            {
                Settings.PeopleCheckDuplicates = editPeopleCheckDuplicate.IsChecked.Value;
            }

            if (weatherTab.Tag != null)
            {
                Settings.WeatherMetric = editWeatherMetric.SelectedIndex == 1;
            }

            if (appearanceTab.Tag != null)
            {
                Settings.ThemeColor      = editTheme.CurrentlySelected;
                Settings.BackgroundImage = editBackground.Text;
            }

            if (searchTab.Tag != null)
            {
                int maxSearch;

                if (int.TryParse(editMaxSearchResults.Text, out maxSearch))
                {
                    if (maxSearch > 0)
                    {
                        Settings.MaxSearchResults = maxSearch;
                    }
                }

                Settings.InstantSearchCap = editInstantSearchCap.IsChecked.Value;
            }

            if (proofingTab.Tag != null)
            {
                SpellChecking.EnableSpellChecking(Settings.SpellCheckingEnabled = editSpellChecking.IsChecked.Value);
            }

            if (experimentsTab.Tag != null)
            {
                Experiments.MiniToolbar        = miniToolbar.IsChecked.Value;
                Experiments.GoogleMaps         = googleMaps.IsChecked.Value;
                Experiments.DocumentSearch     = documentSearch.IsChecked.Value;
                Experiments.NotesDockToDesktop = notesDock.IsChecked.Value;
                Experiments.Quotes             = quotes.IsChecked.Value;
            }

            if (advancedTab.Tag != null)
            {
                Settings.JoinedCEIP = editCEIP.IsChecked == true;
            }
        }