Exemple #1
0
 private void _lvResources_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Delete)
     {
         e.Handled = true;
         IResourceStore store = Core.ResourceStore;
         if (_lvResources.GetSelectedResources().Count == _lvResources.JetListView.Nodes.Count)
         {
             ClipboardContents = store.EmptyResourceList;
         }
         else
         {
             IntArrayList ids = IntArrayListPool.Alloc();
             try
             {
                 ClipboardContents = _contents.Minus(_lvResources.GetSelectedResources());
             }
             finally
             {
                 IntArrayListPool.Dispose(ids);
             }
         }
     }
     else if (e.KeyData == (Keys.Control | Keys.A))
     {
         e.Handled = true;
         _lvResources.SelectAll();
     }
     else if (e.KeyData == Keys.Escape)
     {
         e.Handled = true;
         Close();
     }
 }
Exemple #2
0
        private void OnSelectContact(object sender, EventArgs e)
        {
            IResourceList sel = _contactsToMerge.GetSelectedResources();

            if (sel.Count > 0)
            {
                textFullName.Text = sel[0].DisplayName;
            }
            VerifyButtonsCondition();
        }
Exemple #3
0
        private void _deleteBtn_Click(object sender, System.EventArgs e)
        {
            IResourceList list = _folderList.GetSelectedResources();

            if (list.Count > 0)
            {
                _wereChanges = true;
                Core.ResourceAP.RunUniqueJob(
                    "Mark directories deleted", new ResourceListDelegate(MarkDeleted), list);
                Core.UserInterfaceAP.QueueJob(new MethodInvoker(UpdateDeleteButton));
            }
        }
Exemple #4
0
        private void treeConditions_DoubleClick(object sender, HandledEventArgs e)
        {
            IResourceList selected = treeConditions.GetSelectedResources();

            if (selected.Count == 1)
            {
                IResource res = selected[0];
                if (res != null && res.Type != FilterManagerProps.ConditionGroupResName)
                {
                    e.Handled    = true;
                    DialogResult = DialogResult.OK;
                    Close();
                }
            }
        }
Exemple #5
0
        private void newFolderButton_Click(object sender, EventArgs e)
        {
            string name = Core.UIManager.InputString("Enter Name of a View Folder", "Folder Name:", "", null, this);

            if (!String.IsNullOrEmpty(name))
            {
                if (_store.FindResources(FilterManagerProps.ViewFolderResName, Core.Props.Name, name).Count > 0)
                {
                    MessageBox.Show(this, "View Folder with such name already exists", "Name Collision", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                else
                {
                    //  Find a proper place for the new folder - if the current
                    //  selection is on the folder - new folder will be its
                    //  subfolder, otherwize put it under the Root.
                    IResourceList selList = viewsTree.GetSelectedResources();
                    if (selList != null && selList.Count == 1 && selList[0].Type == FilterManagerProps.ViewFolderResName)
                    {
                        Core.FilterRegistry.CreateViewFolder(name, selList[0].GetStringProp(Core.Props.Name), 0);
                    }
                    else
                    {
                        Core.FilterRegistry.CreateViewFolder(name, null, 0);
                    }
                    RemovedFolders.Remove(name);
                    AddedFolders.Add(name);
                }
            }
        }
Exemple #6
0
        private void itemShowContact_Click(object sender, EventArgs e)
        {
            Control           ctrl = ((MenuItem)sender).Parent.GetContextMenu().SourceControl;
            ResourceListView2 list = (ResourceListView2)ctrl;
            int count = list.Selection.Count;

            if (count == 1)
            {
                IResourceList sel = list.GetSelectedResources();
                ContactView   cv  = new ContactView();
                Core.UIManager.OpenResourceEditWindow(cv, sel[0], false);
            }
        }
Exemple #7
0
        private void buttonAddContact_Click(object sender, EventArgs e)
        {
            IResourceList sel = _suggestedContacts.GetSelectedResources();

            for (int i = 0; i < sel.Count; i++)
            {
                _contactsToMergeList  = _contactsToMergeList.Union(sel[i].ToResourceList());
                _suggestedContactList = _suggestedContactList.Minus(sel[i].ToResourceList());
                _contactsToMerge.JetListView.Nodes.Add(sel[i]);
                _suggestedContacts.JetListView.Nodes.Remove(sel[i]);
            }
            VerifyButtonsCondition();
        }