Ejemplo n.º 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
        }
Ejemplo n.º 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許可
        }
Ejemplo n.º 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許可
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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
            }
        }
Ejemplo n.º 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
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 12
0
 //検索の実態
 private void TextFormSearch( )
 {
     PathDB.TextSearch(richTextBox1.Text, comboBox1.Text); //Listの作成を依頼
     ViewUpdate();                                         //再描画
 }
Ejemplo n.º 13
0
        //ファイルパスを渡して読込む
        public void ReadPathFile(string filePath)
        {
            PathDB.PartsDic.Clear();


            //◎pathテキストを読込む 
            StreamReader stream = new StreamReader(filePath, Encoding.GetEncoding("shift_jis"));
            string       str    = stream.ReadLine(); //日付

            if (stream.ReadLine() != PATH_VERSION)
            {
                MessageBox.Show("◎PathV4のファイルではありません", "注意!", MessageBoxButtons.OK);
                stream.Close();
                return;
            }
            str = stream.ReadLine();     //'//制御タグ

            string[] st1, st2;

            //コレクション作成の処理
            while (!stream.EndOfStream)
            {
                st1 = stream.ReadLine().Split('\t');   //タブでカット
                st2 = st1[0].Split('\\');              //配列の0番目を\でファイル名を取り出す

                PathData p = new PathData()
                {   //初期化子
                    FilePath  = st1[0],
                    SheetName = st1[1],
                    Address   = st1[2],
                    Value     = st1[3],
                    WideValue = Strings.StrConv(st1[3].ToUpper(), VbStrConv.Wide | VbStrConv.Uppercase)
                };

                int layer = 0;
                //◎PathVer4.1.4.vbsだとサウンド設定ファイルの出力が悪いのでここで弾く
                if (int.TryParse(st1[st1.Length - 1], out layer))
                {
                    p.Layer = Strings.StrConv(st1[st1.Length - 1].ToUpper(), VbStrConv.Narrow); //数値に変換したいので小文字
                }

                //パーソナルデータが既に存在している場合は子が先に登録しているので情報のみ追加してあげる
                if (PathDB.PartsDic.ContainsKey(p.WideValue))
                {
                    PathData pathdata = PathDB.PartsDic[p.WideValue];
                    pathdata.FilePath  = p.FilePath;
                    pathdata.SheetName = p.SheetName;
                    pathdata.Address   = p.Address;
                    pathdata.Layer     = p.Layer;
                    pathdata.Value     = p.Value;
                    pathdata.WideValue = p.WideValue;
                }
                else
                {
                    PathDB.PartsDic.Add(p.WideValue, p);
                }
                RegistChild(st1[4].Split(','), p);       //子どもを登録
            }

            //読込み完了した後にLayerListの作成
            PathDB.CreateLayerList();
        }