예제 #1
0
        private void listBox_Custom_SelectedIndexChanged(object sender, EventArgs e)
        {
            //インスタンス作成時の自動実行は避ける
            if (proc == null)
            {
                return;
            }


            contextCustomMenuStrip.Items[0].Enabled = false;  //開くNG
            contextCustomMenuStrip.Items[2].Enabled = false;  //MyListNG

            //何も選択していない場合は終了
            if (listBox_Custom.SelectedIndex == -1)
            {
                return;
            }

            if (listBox_Custom.SelectedItems.Count == 1)
            {
                PathData path = PathDB.GetPathData(listBox_Custom.SelectedValue.ToString());
                if (path.WbOK)
                {
                    contextCustomMenuStrip.Items[0].Enabled = true;  //開くOK
                }
            }
            contextCustomMenuStrip.Items[2].Enabled = true;  //MyListOK
        }
예제 #2
0
        /// <summary>
        /// 親リストのツールStripメニュー変化
        /// </summary>
        private void PListToolStrip(bool multi)
        {
            contextParentMenuStrip.Items[0].Enabled = false;     //開くNG
            contextParentMenuStrip.Items[2].Enabled = false;     //MyListNG
            contextParentMenuStrip.Items[3].Enabled = false;     //List切り離しNG
            contextParentMenuStrip.Items[4].Enabled = false;     //検索Windowへ

            if (listBox_pList.SelectedIndex == -1)
            {
                return;
            }

            if (!multi)
            {
                //open可能
                if (PathDB.GetPathData(listBox_pList.SelectedValue.ToString()).WbOK)
                {
                    contextParentMenuStrip.Items[0].Enabled = true;     //開くOK
                }
            }
            //MyListOK
            contextParentMenuStrip.Items[2].Enabled = true;     //MyListOK
            contextParentMenuStrip.Items[3].Enabled = true;     //List切り離しOK

            //検索WindowOK
            contextParentMenuStrip.Items[4].Enabled = true;      //検索Window許可
        }
예제 #3
0
        /// <summary>
        /// 子リストのツールStripメニュー変化
        /// </summary>
        private void CListToolStrip()
        {
            contextChildMenuStrip.Items[0].Enabled = false;     //開くNG
            contextChildMenuStrip.Items[2].Enabled = false;     //MyListNG
            contextChildMenuStrip.Items[3].Enabled = false;     //List切り離しNG
            contextChildMenuStrip.Items[4].Enabled = false;     //検索Windowへ

            if (listBox_cList.SelectedIndex == -1 || listBox_cList.SelectedValue == null)
            {
                return;
            }


            //open可能
            if (PathDB.GetPathData(listBox_cList.SelectedValue.ToString()).WbOK)
            {
                contextChildMenuStrip.Items[0].Enabled = true;     //開くOK
            }
            //MyListOK
            contextChildMenuStrip.Items[2].Enabled = true;     //MyListOK
            contextChildMenuStrip.Items[3].Enabled = true;     //List切り離しOK

            //検索WindowOK
            contextChildMenuStrip.Items[4].Enabled = true;      //検索Window許可
        }
예제 #4
0
 private void CustomToolStripMenuToMyList_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < listBox_Custom.SelectedItems.Count; i++)
     {
         PathData p = (PathData)listBox_Custom.SelectedItems[i];
         re.DataInsert(PathDB.GetPathData(p.Value));
     }
     re.Visible = true;
 }
예제 #5
0
 private void MainToolStripToMyList_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < listBox1.SelectedItems.Count; i++)
     {
         PathData p = (PathData)listBox1.SelectedItems[i];
         myList.DataInsert(PathDB.GetPathData(p.Value));
     }
     myList.Visible = true;
 }
예제 #6
0
        private void ChildToolStripMenuSplit_Click(object sender, EventArgs e)
        {
            PathData path = PathDB.GetPathData(listBox1.SelectedValue.ToString());

            customList = new CustomList(path.GetChildList());    //→新しいオブジェクトを渡さないとデータソース上から消えてしまう
            customList.titleLabel.Text       = this.listBox1.SelectedValue.ToString();
            customList.parentChildLabel.Text = "子";
            customList.SearchRichTextBox     = this.richTextBox1;
            customList.re   = myList;
            customList.proc = this.proc;
            customList.Show();
        }
예제 #7
0
        private void ListBox_cList_DoubleClick(object sender, EventArgs e)
        {
            //子リストをダブルクリックした場合、検索対象とする
            if ((ListBox)sender != null)
            {
                ListBox list = (ListBox)sender;

                //open可能か判定
                PathData p = PathDB.GetPathData(list.Text);
                if (p.WbOK)
                {
                    proc.ExcelOpen(p);
                }
            }
        }
예제 #8
0
        /// <summary>
        /// 検索結果をDBCした場合、ExcelOpen
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ListBox1_DoubleClick(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex == -1)
            {
                return;
            }

            //メイン画面はダブルクリックで開く仕様に変更
            PathData p = PathDB.GetPathData(listBox1.SelectedValue.ToString());

            if (p.WbOK)
            {
                proc.ExcelOpen(p.Value);
            }
        }
예제 #9
0
        private void listBox_myList_SelectedIndexChanged(object sender, EventArgs e)
        {
            //インスタンス作成時の動作はリターン
            if (proc == null)
            {
                return;
            }


            contextMyListMenuStrip.Items[0].Enabled = false;  //開くNG
            if (listBox_myList.SelectedIndex == -1)
            {
                return;
            }

            PathData p = PathDB.GetPathData(listBox_myList.SelectedValue.ToString());

            if (p.WbOK)
            {
                contextMyListMenuStrip.Items[0].Enabled = true;  //開くOK
            }
        }
예제 #10
0
        /// <summary>
        /// メイン検索リストのツールStripメニュー変化 
        /// 引数:マルチ選択時 true
        /// </summary>
        private void MainToolStrip(bool multi)
        {
            //メインメニュー(パーソナル)時のStrip
            contextMainMenuStrip.Items[0].Enabled = false;       //開くNG
            contextMainMenuStrip.Items[2].Enabled = false;       //MyListへNG
            contextMainMenuStrip.Items[3].Enabled = true;        //List切り離しOK
            contextMainMenuStrip.Items[5].Enabled = true;        //MyListの表示OK


            if (listBox1.SelectedIndex == -1)
            {
                return;
            }

            if (!multi)
            {
                PathData src = PathDB.GetPathData(listBox1.SelectedValue.ToString());
                if (src.WbOK)
                {
                    contextMainMenuStrip.Items[0].Enabled = true;  //開くOK
                }
            }
            contextMainMenuStrip.Items[2].Enabled = true;     //MyListへOK
        }
예제 #11
0
        private void ViewUpdate()   //再描画の処理
        {
            if (label4.Text == "データ作成中")
            {
                return;
            }


            listBox1.BeginUpdate();

            listBox_cList.DataSource = null;
            listBox_pList.DataSource = null;

            listBox1.DataSource    = radioButton1.Checked ? PathDB.OrList : PathDB.AndList;
            listBox1.ValueMember   = "value";
            listBox1.DisplayMember = "wideValue";

            MainToolStrip(false);    //まずここでクリア
            textBox2.Text            = "";
            textBox3.Text            = "";
            textBox4.Text            = "";
            textBox1.Text            = "";
            listBox_cList.DataSource = null;
            listBox_pList.DataSource = null;


            //マルチ選択の場合はMyListへ保存のみ許可する
            if (listBox1.SelectedItems.Count > 1)
            {
                textBox2.Text = "non";
                textBox3.Text = "non";
                textBox4.Text = "non";
                textBox1.Text = "non";
                MainToolStrip(true);
            }
            else
            {
                try
                {
                    PathData p = PathDB.GetPathData(listBox1.SelectedValue.ToString());

                    textBox2.Text = p.FilePath;
                    textBox3.Text = p.SheetName;
                    textBox4.Text = p.Address;
                    textBox1.Text = p.Layer;


                    //親リストにバインディング
                    listBox_pList.DataSource    = p.GetParentList();
                    listBox_pList.DisplayMember = "wideValue";
                    listBox_pList.ValueMember   = "value";


                    //子リストにバインディング
                    listBox_cList.DataSource    = p.GetChildList();
                    listBox_cList.DisplayMember = "wideValue";
                    listBox_cList.ValueMember   = "value";
                }
                catch (NullReferenceException)
                {
                    //getPathDataでnullが返ってきた場合
                }
                finally
                {
                    MainToolStrip(false);
                }
            }
            //Allow the ListBox to repaint and display the new items.
            listBox1.EndUpdate();
        }