コード例 #1
0
ファイル: Form_ToolwindowImpl.cs プロジェクト: muzudho/CSVExE
        //────────────────────────────────────────
        private void Load_Form2_(Log_Reports pg_Logging)
        {
            //
            //
            //
            //()メソッド開始
            //
            //
            //
            Log_Method pg_Method = new Log_MethodImpl(0);
            pg_Method.BeginMethod(Info_Toolwindow.Name_Library, this, "Form1_Load",pg_Logging);

            StringBuilder sb = new StringBuilder();

            MemoryAatoolxmlDialog moAatoolxmlDialog;
            if (null != this.Owner_MemoryApplication)
            {
                moAatoolxmlDialog = this.Owner_MemoryApplication.MemoryForms.MemoryAatoolxmlDialog;
            }
            else
            {
                // ダミーを作成。
                pg_Method.WriteInfo_ToConsole("ダミー・MemoryAatoolxmlDialogを作成。");
                moAatoolxmlDialog = new MemoryAatoolxmlDialogImpl(this.Owner_MemoryApplication);
            }

            moAatoolxmlDialog.MemoryAatoolxml = new MemoryAatoolxmlImpl(this.Owner_MemoryApplication);

            Configurationtree_Node parent_Conf = new Configurationtree_NodeImpl("!ハードコーディング_" + this.GetType().Name + "#Form1_Load", null);

            // ツール設定ファイルへのパスは固定とします。
            Expression_Node_Filepath ec_Fpath_toolcnf;
            {
                Configurationtree_NodeFilepath cf_Fpath = new Configurationtree_NodeFilepathImpl("ファイルパス出典未指定L09TcDlg_3", parent_Conf);
                cf_Fpath.InitPath(
                    ValuesAttr.S_FPATHR_AATOOLXML,
                    pg_Logging);
                if (!pg_Logging.Successful)
                {
                    // 既エラー。
                    goto gt_EndMethod;
                }

                ec_Fpath_toolcnf = new Expression_Node_FilepathImpl(cf_Fpath);
            }

            //
            //
            //
            //「ツール設定ファイル」読取り
            //
            //
            //
            moAatoolxmlDialog.MemoryAatoolxml.LoadFile(ec_Fpath_toolcnf, pg_Logging);
            if (!pg_Logging.Successful)
            {
                // 既エラー。
                goto gt_EndMethod;
            }

            {
                UsercontrolListbox uctLst = (UsercontrolListbox)this.UctlstNameProject;
                uctLst.Clear();
                foreach (string sName_Project in moAatoolxmlDialog.MemoryAatoolxml.Dictionary_Editor.Dictionary_Item.Keys)
                {
                    uctLst.Items.Add(sName_Project);
                }

                if ("" == moAatoolxmlDialog.Name_SelectedEditor)
                {
                    // 選択プロジェクト名が指定されていなければ。

                    if (0 < uctLst.Items.Count)
                    {
                        // 先頭の要素を選択します。
                        uctLst.ControlCommon.BAutomaticinputting = true;
                        uctLst.SelectedIndex = 0;
                        uctLst.ControlCommon.BAutomaticinputting = false;
                    }
                    else
                    {
                        // 非選択にします。
                        uctLst.ControlCommon.BAutomaticinputting = true;
                        uctLst.SelectedIndex = -1;
                        uctLst.ControlCommon.BAutomaticinputting = false;
                    }
                }
                else
                {
                    // 選択プロジェクト名が指定されていれば。

                    int selectedIndex = uctLst.Items.IndexOf(moAatoolxmlDialog.Name_SelectedEditor);

                    uctLst.ControlCommon.BAutomaticinputting = true;
                    uctLst.SelectedIndex = selectedIndex;
                    uctLst.ControlCommon.BAutomaticinputting = false;
                }
            }

            sb.Append("[◆コマンドライン引数]");
            sb.Append(Environment.NewLine);

            // コマンドライン引数を取得します。
            string[] args = System.Environment.GetCommandLineArgs();

            //コマンドライン引数の表示
            int n = 1;
            foreach (string sArg in args)
            {
                sb.Append("【");
                sb.Append(n);
                sb.Append("】");
                sb.Append(sArg);
                sb.Append(Environment.NewLine);
            }

            this.pctxtInformation.Text = sb.ToString();

            Expression_Node_String parent_Expression_Null = null;

            //  ■
            //■  ■ 「変数書出ボタン」のイベント設定
            //  ■
            {
                Expression_Node_Function expr_Func = Collection_Function.NewFunction2( Expression_Node_Function45Impl.NAME_FUNCTION,
                    parent_Expression_Null, parent_Conf, this.Owner_MemoryApplication, pg_Logging);
                expr_Func.SetAttribute(Expression_Node_Function28Impl.PM_MESSAGE, new Expression_Leaf_StringImpl("変数出力試し", null, parent_Conf), pg_Logging);
            }

            //  ■
            //■  ■ 「フォームCSV書出ボタン」のイベント設定
            //  ■
            {
                Expression_Node_Function expr_Func = Collection_Function.NewFunction2(Expression_Node_Function46Impl.NAME_FUNCTION,
                        parent_Expression_Null, parent_Conf, this.Owner_MemoryApplication, pg_Logging);
                expr_Func.SetAttribute(Expression_Node_Function28Impl.PM_MESSAGE, new Expression_Leaf_StringImpl("フォームCSV出力試し", null, parent_Conf), pg_Logging);

                this.uctButton2.UsercontroleventhandlerClick += new EventHandler(expr_Func.Execute4_OnOEa);
            }

            goto gt_EndMethod;
            //
            //
            gt_EndMethod:
            pg_Method.EndMethod(pg_Logging);
        }
コード例 #2
0
        //────────────────────────────────────────

        private void Load_Form2_(Log_Reports pg_Logging)
        {
            //
            //
            //
            //()メソッド開始
            //
            //
            //
            Log_Method pg_Method = new Log_MethodImpl(0);

            pg_Method.BeginMethod(Info_Toolwindow.Name_Library, this, "Form1_Load", pg_Logging);



            StringBuilder sb = new StringBuilder();

            MemoryAatoolxmlDialog moAatoolxmlDialog;

            if (null != this.Owner_MemoryApplication)
            {
                moAatoolxmlDialog = this.Owner_MemoryApplication.MemoryForms.MemoryAatoolxmlDialog;
            }
            else
            {
                // ダミーを作成。
                pg_Method.WriteInfo_ToConsole("ダミー・MemoryAatoolxmlDialogを作成。");
                moAatoolxmlDialog = new MemoryAatoolxmlDialogImpl(this.Owner_MemoryApplication);
            }

            moAatoolxmlDialog.MemoryAatoolxml = new MemoryAatoolxmlImpl(this.Owner_MemoryApplication);


            Configurationtree_Node parent_Conf = new Configurationtree_NodeImpl("!ハードコーディング_" + this.GetType().Name + "#Form1_Load", null);


            // ツール設定ファイルへのパスは固定とします。
            Expression_Node_Filepath ec_Fpath_toolcnf;

            {
                Configurationtree_NodeFilepath cf_Fpath = new Configurationtree_NodeFilepathImpl("ファイルパス出典未指定L09TcDlg_3", parent_Conf);
                cf_Fpath.InitPath(
                    ValuesAttr.S_FPATHR_AATOOLXML,
                    pg_Logging);
                if (!pg_Logging.Successful)
                {
                    // 既エラー。
                    goto gt_EndMethod;
                }

                ec_Fpath_toolcnf = new Expression_Node_FilepathImpl(cf_Fpath);
            }


            //
            //
            //
            //「ツール設定ファイル」読取り
            //
            //
            //
            moAatoolxmlDialog.MemoryAatoolxml.LoadFile(ec_Fpath_toolcnf, pg_Logging);
            if (!pg_Logging.Successful)
            {
                // 既エラー。
                goto gt_EndMethod;
            }

            {
                UsercontrolListbox uctLst = (UsercontrolListbox)this.UctlstNameProject;
                uctLst.Clear();
                foreach (string sName_Project in moAatoolxmlDialog.MemoryAatoolxml.Dictionary_Editor.Dictionary_Item.Keys)
                {
                    uctLst.Items.Add(sName_Project);
                }

                if ("" == moAatoolxmlDialog.Name_SelectedEditor)
                {
                    // 選択プロジェクト名が指定されていなければ。

                    if (0 < uctLst.Items.Count)
                    {
                        // 先頭の要素を選択します。
                        uctLst.ControlCommon.BAutomaticinputting = true;
                        uctLst.SelectedIndex = 0;
                        uctLst.ControlCommon.BAutomaticinputting = false;
                    }
                    else
                    {
                        // 非選択にします。
                        uctLst.ControlCommon.BAutomaticinputting = true;
                        uctLst.SelectedIndex = -1;
                        uctLst.ControlCommon.BAutomaticinputting = false;
                    }
                }
                else
                {
                    // 選択プロジェクト名が指定されていれば。

                    int selectedIndex = uctLst.Items.IndexOf(moAatoolxmlDialog.Name_SelectedEditor);

                    uctLst.ControlCommon.BAutomaticinputting = true;
                    uctLst.SelectedIndex = selectedIndex;
                    uctLst.ControlCommon.BAutomaticinputting = false;
                }
            }

            sb.Append("[◆コマンドライン引数]");
            sb.Append(Environment.NewLine);

            // コマンドライン引数を取得します。
            string[] args = System.Environment.GetCommandLineArgs();

            //コマンドライン引数の表示
            int n = 1;

            foreach (string sArg in args)
            {
                sb.Append("【");
                sb.Append(n);
                sb.Append("】");
                sb.Append(sArg);
                sb.Append(Environment.NewLine);
            }

            this.pctxtInformation.Text = sb.ToString();

            Expression_Node_String parent_Expression_Null = null;

            //  ■
            //■  ■ 「変数書出ボタン」のイベント設定
            //  ■
            {
                Expression_Node_Function expr_Func = Collection_Function.NewFunction2(Expression_Node_Function45Impl.NAME_FUNCTION,
                                                                                      parent_Expression_Null, parent_Conf, this.Owner_MemoryApplication, pg_Logging);
                expr_Func.SetAttribute(Expression_Node_Function28Impl.PM_MESSAGE, new Expression_Leaf_StringImpl("変数出力試し", null, parent_Conf), pg_Logging);
            }

            //  ■
            //■  ■ 「フォームCSV書出ボタン」のイベント設定
            //  ■
            {
                Expression_Node_Function expr_Func = Collection_Function.NewFunction2(Expression_Node_Function46Impl.NAME_FUNCTION,
                                                                                      parent_Expression_Null, parent_Conf, this.Owner_MemoryApplication, pg_Logging);
                expr_Func.SetAttribute(Expression_Node_Function28Impl.PM_MESSAGE, new Expression_Leaf_StringImpl("フォームCSV出力試し", null, parent_Conf), pg_Logging);

                this.uctButton2.UsercontroleventhandlerClick += new EventHandler(expr_Func.Execute4_OnOEa);
            }

            goto gt_EndMethod;
            //
            //
gt_EndMethod:
            pg_Method.EndMethod(pg_Logging);
        }