예제 #1
0
        private void butAddCat_Click(object sender, System.EventArgs e)
        {
            QuickPasteCat     quickCat = new QuickPasteCat();
            FormQuickPasteCat FormQ    = new FormQuickPasteCat(quickCat);

            FormQ.ShowDialog();
            if (FormQ.DialogResult != DialogResult.OK)
            {
                return;
            }
            quickCat = FormQ.QuickCat;
            QuickPasteCats.Insert(quickCat);
            _hasChanges = true;
            //We are doing this so tha when the sync is called in FormQuickPaste_FormClosing(...) we do not re-insert.
            //For now the sync will still detect a change due to the item orders.
            _listCatsOld.Add(quickCat.Copy());
            if (listCat.SelectedIndex != -1)
            {
                _listCats.Insert(listCat.SelectedIndex, quickCat); //insert at selectedindex AND selects new category when we refill grid below.
            }
            else                                                   //Will only happen if they do not have any categories.
            {
                _listCats.Add(quickCat);                           //add to bottom of list, will be selected when we fill grid below.
            }
            FillCats();
            FillMain();
        }
예제 #2
0
        private void listCat_DoubleClick(object sender, System.EventArgs e)
        {
            if (listCat.SelectedIndex == -1)
            {
                return;
            }
            FormQuickPasteCat FormQ = new FormQuickPasteCat(QuickPasteCats.List[listCat.SelectedIndex]);

            FormQ.ShowDialog();
            if (FormQ.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            QuickPasteCats.Refresh();
            FillCats();
            FillNotes();
            localChanged = true;
        }
예제 #3
0
        private void listCat_DoubleClick(object sender, System.EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.AutoNoteQuickNoteEdit))
            {
                return;
            }
            if (listCat.SelectedIndex == -1)
            {
                return;
            }
            FormQuickPasteCat FormQ = new FormQuickPasteCat(_listCats[listCat.SelectedIndex]);

            FormQ.ShowDialog();
            if (FormQ.DialogResult != DialogResult.OK)
            {
                return;
            }
            _listCats[listCat.SelectedIndex] = FormQ.QuickCat;
            FillCats();
            FillMain();
        }
예제 #4
0
        private void listCat_DoubleClick(object sender, System.EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.AutoNoteQuickNoteEdit))
            {
                return;
            }
            if (listCat.SelectedIndex == -1)
            {
                return;
            }
            FormQuickPasteCat FormQ = new FormQuickPasteCat(QuickPasteCats.List[listCat.SelectedIndex]);

            FormQ.ShowDialog();
            if (FormQ.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            QuickPasteCats.RefreshCache();
            FillCats();
            FillNotes();
            localChanged = true;
        }
예제 #5
0
        private void butAddCat_Click(object sender, System.EventArgs e)
        {
            QuickPasteCat quickCat = new QuickPasteCat();

            if (listCat.SelectedIndex == -1)
            {
                quickCat.ItemOrder = listCat.Items.Count;              //one more than list will hold.
            }
            else
            {
                quickCat.ItemOrder = listCat.SelectedIndex;
            }
            QuickPasteCats.Insert(quickCat);
            FormQuickPasteCat FormQ = new FormQuickPasteCat(quickCat);

            FormQ.ShowDialog();
            if (FormQ.DialogResult == DialogResult.OK)
            {
                if (listCat.SelectedIndex != -1)
                {
                    //move other items down in list to make room for new one.
                    for (int i = listCat.SelectedIndex; i < QuickPasteCats.List.Length; i++)
                    {
                        QuickPasteCats.List[i].ItemOrder++;
                        QuickPasteCats.Update(QuickPasteCats.List[i]);
                    }
                }
                localChanged = true;
            }
            else
            {
                QuickPasteCats.Delete(quickCat);
            }
            QuickPasteCats.Refresh();
            FillCats();
            FillNotes();
        }
예제 #6
0
		private void listCat_DoubleClick(object sender,System.EventArgs e) {
			if(!Security.IsAuthorized(Permissions.AutoNoteQuickNoteEdit)) {
				return;
			}
			if(listCat.SelectedIndex==-1){
				return;
			}
			FormQuickPasteCat FormQ=new FormQuickPasteCat(QuickPasteCats.List[listCat.SelectedIndex]);
			FormQ.ShowDialog();
			if(FormQ.DialogResult==DialogResult.Cancel){
				return;
			}
			QuickPasteCats.RefreshCache();
			FillCats();
			FillNotes();
			localChanged=true;
		}
예제 #7
0
		private void butAddCat_Click(object sender, System.EventArgs e) {
			QuickPasteCat quickCat=new QuickPasteCat();
			if(listCat.SelectedIndex==-1){
				quickCat.ItemOrder=listCat.Items.Count;//one more than list will hold.
			}
			else{
				quickCat.ItemOrder=listCat.SelectedIndex;
			}
			QuickPasteCats.Insert(quickCat);
      FormQuickPasteCat FormQ=new FormQuickPasteCat(quickCat);
			FormQ.ShowDialog();
			if(FormQ.DialogResult==DialogResult.OK){
				if(listCat.SelectedIndex!=-1){
					//move other items down in list to make room for new one.
					for(int i=listCat.SelectedIndex;i<QuickPasteCats.List.Length;i++){
						QuickPasteCats.List[i].ItemOrder++;
						QuickPasteCats.Update(QuickPasteCats.List[i]);
					}
				}
				localChanged=true;
			}
			else{
				QuickPasteCats.Delete(quickCat);
			}
			QuickPasteCats.RefreshCache();
			FillCats();
			FillNotes();
		}