/**
         * this is the constructor for the GUI, it does the following:
         * 1.  set up the DAO objects to access the local database
         * 2.  add any active meetings in the database to the field in the GUI
         * 3.  extract my X.509 certificate from the local store
         * 4.  instantiate 5 "dummy" resources, add them to resource list
         * */
        public Form1()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //

            dbConnect = "DSN=TotalRecall;UID=TotalRecallUser;PWD=totalrecall;DATABASE=TotalRecall";

            mDAO  = new MeetingDAO(dbConnect);
            pDAO  = new ParticipantDAO(dbConnect);
            rDAO  = new ResourceDAO(dbConnect);
            cDAO  = new ContactDAO(dbConnect);
            cmDAO = new ContextMsgDAO(dbConnect);

            strSelectedMtg = "";
            ArrayList lstMtgs = mDAO.GetMeetingIDs(enuMeetingState.Active);

            foreach (string s in lstMtgs)
            {
                m_boxMtgs.Items.Add(s);
            }

            strMyUrl = "http://localhost/TotalRecall/InfoAgent.asmx?wsdl";

            store = X509CertificateStore.LocalMachineStore(X509CertificateStore.MyStore);
            store.OpenRead();

            strMyName = "CN=Omar";
            certCol   = store.FindCertificateBySubjectName(strMyName);

            cert      = (X509Certificate)certCol[0];
            certToken = new X509SecurityToken(cert);

            lstResources = new ArrayList();
            for (int i = 0; i < 5; i++)
            {
                Resource res = new Resource();
                res.ID   = "res" + (i + 1);
                res.Name = "Foo" + (i + 1) + ".txt";
                res.Url  = "file:///c:\\" + res.Name;
                rDAO.AddNewResource(res);
                lstResources.Add(res);
            }

            foreach (Resource r in lstResources)
            {
                m_boxResources.Items.Add(r.ID);
            }
        }
        private void addResourceButton_Click(object sender, System.EventArgs e)
        {
            AddResourceForm form   = new AddResourceForm();
            DialogResult    result = form.ShowDialog(this);

            if (result != DialogResult.Cancel)
            {
                Resource resource = new Resource();
                resource.Name = form.ResourceName;
                resource.Url  = form.ResourceUrl;
                string id = resourceDAO.AddNewResource(resource);
                if (id.Length > 0)
                {
                    resourcesList.Items.Add(resource);
                }
                else
                {
                    Error("Could not add resource.");
                }
            }
        }