Exemplo n.º 1
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);
            }
        }
Exemplo n.º 2
0
        public override void Execute(IActionContext context)
        {
            //  Edit Contact can be issued on resources of both "Contact" and
            //  "ContactName" types.
            IResource contact = context.SelectedResources[0];

            if (contact.Type == "ContactName")
            {
                contact = contact.GetLinkProp(Core.ContactManager.Props.LinkBaseContact);
            }

            ContactView cv = new ContactView();

            Core.UIManager.OpenResourceEditWindow(cv, contact, false);
        }
Exemplo n.º 3
0
        public void Execute(IActionContext context)
        {
            ContactView cv      = new ContactView();
            IResource   contact = Core.ResourceStore.NewResourceTransient("Contact");

            NewContactLocation location = new NewContactLocation();
            IResource          owner    = Core.ResourceBrowser.OwnerResource;

            if (context.SelectedResources.Count == 1 && context.SelectedResources [0].Type == "AddressBook")
            {
                location.AddressBook = context.SelectedResources [0];
            }
            else if (owner != null && owner.Type == "AddressBook")
            {
                location.AddressBook = owner;
            }
            if (owner != null && owner.Type == "Category")
            {
                location.Category = owner;
            }

            Core.UIManager.OpenResourceEditWindow(cv, contact, true, OnNewContactSaved, location);
        }