Ejemplo n.º 1
0
        public ucDistributionList(int domainID, int listID)
        {
            InitializeComponent();

            _domainID = domainID;

            hMailServer.Links links = APICreator.Links;

            hMailServer.Domain domain = links.get_Domain(_domainID);

            if (listID > 0)
            {
                representedObject = links.get_DistributionList(listID);
                Marshal.ReleaseComObject(links);
            }

            textAddress.Text = "@" + domain.Name;

            Marshal.ReleaseComObject(domain);

            EnableDisable();

            DirtyChecker.SubscribeToChange(this, OnContentChanged);

            new TabOrderManager(this).SetTabOrder(TabOrderManager.TabScheme.AcrossFirst);
        }
Ejemplo n.º 2
0
        public void TestDistributionListLink()
        {
            List <string> recipients = new List <string>();

            recipients.Add("Vaffe");
            recipients.Add("Baffe");
            recipients.Add("Laffe");

            hMailServer.DistributionList list =
                SingletonProvider <Utilities> .Instance.AddDistributionList(_domain, "mytest", recipients);

            Assert.AreEqual(recipients.Count, _links.get_DistributionList(list.ID).Recipients.Count);
        }
Ejemplo n.º 3
0
        public void OnDeleteObject(object sender, EventArgs args)
        {
            hMailServer.Links            links = APICreator.Links;
            hMailServer.DistributionList list  = links.get_DistributionList(_listID);

            if (Utility.AskDeleteItem(list.Address))
            {
                list.Delete();

                Marshal.ReleaseComObject(links);
                Marshal.ReleaseComObject(list);

                Instances.MainForm.RefreshParentNode();
            }
        }