コード例 #1
0
        private void btnSaveSearch_Click(object sender, EventArgs e)
        {
            //OutlookSearch();
            if (!(txtSucheName.Text == ""))
            {
                SearchTag sTag = new SearchTag(
                    txtSucheName.Text,
                    txtBetreff.Text,
                    txInhalt.Text,
                    txtKategorie.Text,
                    txtVon.Text,
                    txtAn.Text,
                    chkbAnlagen.Checked
                    );
                TreeNode newNode = new TreeNode(txtSucheName.Text);
                newNode.Tag = sTag.SearchString;
                TreeNode tn = treeView1.SelectedNode;

                if (tn == null)
                {
                    treeView1.Nodes.Add(newNode);
                }
                else
                {
                    TreeNode trN = treeView1.SelectedNode.Nodes.Add(txtSucheName.Text);
                    trN.Tag = sTag.SearchString;
                    trN.TreeView.SelectedNode = trN;
                    treeView1.SelectedNode    = null;
                }
                txtSucheName.Text = "";
            }
        }
コード例 #2
0
        private void anwendenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (treeView1.SelectedNode != null)
            {
                string searchString = (string)treeView1.SelectedNode.Tag;
                MessageBox.Show(searchString);
                MessageBox.Show(searchString.Split(';').Length.ToString());
                SearchTag sTag = new SearchTag(searchString);
                MessageBox.Show(sTag.Name);
                txtSucheName.Text   = sTag.Name;
                txtBetreff.Text     = sTag.Betreff;
                txInhalt.Text       = sTag.Inhalt;
                txtKategorie.Text   = sTag.Kategorie;
                txtVon.Text         = sTag.Von;
                txtAn.Text          = sTag.An;
                chkbAnlagen.Checked = sTag.Anhang;

                //if (filter != "")
                //{
                //    oApp.ActiveExplorer().Search(filter, Microsoft.Office.Interop.Outlook.OlSearchScope.olSearchScopeAllFolders);
                //}
                //filter = "";
            }
        }