Example #1
0
 private void FormQuickPaste_Load(object sender, System.EventArgs e)
 {
     if (!Security.IsAuthorized(Permissions.AutoNoteQuickNoteEdit, true))
     {
         butAddCat.Enabled      = false;
         butDeleteCat.Enabled   = false;
         butAddNote.Enabled     = false;
         butUpCat.Enabled       = false;
         butUpNote.Enabled      = false;
         butDownCat.Enabled     = false;
         butDownNote.Enabled    = false;
         butAlphabetize.Enabled = false;
         butEditNote.Text       = "View";
     }
     if (TextToFill == null)
     {
         butDate.Visible = false;
     }
     _listCats    = QuickPasteCats.GetDeepCopy();
     _listCatsOld = _listCats.Select(x => x.Copy()).ToList();
     FillCats();
     listCat.SelectedIndex = QuickPasteCats.GetDefaultType(QuickType);
     _listNotes            = QuickPasteNotes.GetDeepCopy();
     _listNotesOld         = _listNotes.Select(x => x.Copy()).ToList();
     FillMain();
 }
Example #2
0
 private void FormQuickPaste_Load(object sender, System.EventArgs e)
 {
     if (!Security.IsAuthorized(Permissions.AutoNoteQuickNoteEdit, true))
     {
         butAddCat.Enabled    = false;
         butDeleteCat.Enabled = false;
         butAddNote.Enabled   = false;
         butEditNote.Text     = "View";
     }
     FillCats();
     listCat.SelectedIndex = QuickPasteCats.GetDefaultType(QuickType);
     FillNotes();
 }
Example #3
0
        ///<summary>Called on KeyUp from various textBoxes in the program to look for a ?abbrev and attempt to substitute.  Substitutes the text if found.</summary>
        public static string Substitute(string text, QuickPasteType type)
        {
            int typeIndex = QuickPasteCats.GetDefaultType(type);

            for (int i = 0; i < List.Length; i++)
            {
                if (List[i].Abbreviation == "")
                {
                    continue;
                }
                if (List[i].QuickPasteCatNum != QuickPasteCats.List[typeIndex].QuickPasteCatNum)
                {
                    continue;
                }
                text = Regex.Replace(text, @"\?" + List[i].Abbreviation, List[i].Note);
            }
            return(text);
        }
Example #4
0
 private void FormQuickPaste_Load(object sender, System.EventArgs e)
 {
     FillCats();
     listCat.SelectedIndex = QuickPasteCats.GetDefaultType(QuickType);
     FillNotes();
 }