Exemple #1
0
        public override Expression_Node_Function NewInstance(
            Expression_Node_String parent_Expression, Configuration_Node cur_Conf,
            object owner_MemoryApplication, Log_Reports pg_Logging)
        {
            Log_Method pg_Method = new Log_MethodImpl(0);

            pg_Method.BeginMethod(Info_CSVEditorImpl.Name_Library, this, "NewInstance", pg_Logging);
            //

            Expression_Node_Function f0 = new Expression_Node_Function_BootCsvEditorExImpl(this.EnumEventhandler, this.List_NameArgumentInitializer, this.Functiontranslatoritem);

            f0.Parent_Expression = parent_Expression;
            f0.Cur_Configuration = cur_Conf;
            ((Expression_Node_FunctionAbstract)f0).Owner_MemoryApplication = (MemoryApplication)owner_MemoryApplication;
            //関数名初期化
            f0.Dictionary_Expression_Attribute.Set(PmNames.S_NAME.Name_Pm, new Expression_Leaf_StringImpl(NAME_FUNCTION, null, cur_Conf), pg_Logging);

            //「プロジェクト選択時」のイベントハンドラーを上書き要求。
            {
                Expression_Node_Function expr_Func2 = Collection_Function.NewFunction2(
                    Expression_Node_Function_OnEditorSelected_Impl.NAME_FUNCTION,
                    f0,
                    cur_Conf,
                    //EnumEventhandler.Tp_B_Wr_Rhn,
                    owner_MemoryApplication,
                    pg_Logging);

                ((Expression_Node_Function_BootCsvEditorExImpl)f0).Functionitem_OnProjectSelected = expr_Func2;
            }

            //
            pg_Method.EndMethod(pg_Logging);
            return(f0);
        }
Exemple #2
0
        //────────────────────────────────────────

        /// <summary>
        /// 静的関数。
        ///
        /// 関数を登録します。
        /// </summary>
        public static void RegisterFunctions(Log_Reports pg_Logging)
        {
            Log_Method pg_Method = new Log_MethodImpl(0);

            pg_Method.BeginMethod(Info_CSVEditorImpl.Name_Library, "Form1", "static RegisterFunctions", pg_Logging);
            //

            ConfigurationtreeToFunction_Item transUnknown = new ConfigurationtreeToFunction00_ItemImpl();//暫定

            // 親クラスを上書きしないよう、関数名は変えておくこと。
            {
                List <string> sList = new List <string>();
                // arg 不明
                Collection_Function.SetFunction(Expression_Node_Function_BootCsvEditorExImpl.NAME_FUNCTION, new Expression_Node_Function_BootCsvEditorExImpl(EnumEventhandler.O_Ea, sList, transUnknown), pg_Logging);
            }
            pg_Method.WriteDebug_ToConsole("CSVエディター用のブート関数を登録。");

            //
            pg_Method.EndMethod(pg_Logging);
        }
Exemple #3
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);
        }
Exemple #4
0
        //────────────────────────────────────────
        #endregion



        #region イベントハンドラー
        //────────────────────────────────────────

        private void Form1_Load(object sender, EventArgs e)
        {
            //
            //
            //
            //(1)デバッグモード ※Log_MethodImpl#BeginMethod(...)をする前に必要。
            //
            //
            //
            Log_ReportsImpl.BDebugmode_Static = true;
            Log_Reports pg_Logging_ThisMethod;


            //
            //
            //
            //(2)メソッド開始
            //
            //
            //
            Log_Method pg_Method = new Log_MethodImpl(0);

            // デバッグモード静的設定の後で。
            pg_Method.BeginMethod(Info_CSVEditorImpl.Name_Library, this, "Form1_Load", out pg_Logging_ThisMethod);
            //

            Expression_Node_String parent_Expression_Null = null;
            Configurationtree_Node cur_Conf = new Configurationtree_NodeImpl(pg_Method.Fullname, null);



            //
            //
            //
            //(3)CSVエディター・モデル(必要に応じて拡張)用意
            //
            //
            //
            this.memoryCsvEditor = new MemoryApplicationImpl();
            this.MemoryCsvEditor.InitializeBeforeUse(
                new Mainwnd_FormWrappingImpl(this),
                new ConfigurationtreeToFunction_ListImpl(parent_Expression_Null, cur_Conf, this.MemoryCsvEditor, pg_Logging_ThisMethod),
                new Form_ToolwindowImpl(),
                new MemoryAatoolxmlDialogImpl(this.MemoryCsvEditor),
                new UsercontrolStyleSetterImpl(),
                new UsercontrolCreator1Impl(),
                new XToMemory_FormImpl()
                );

            Form1.RegisterFunctions(pg_Logging_ThisMethod);

            //
            //
            //
            //(4)アプリケーション・モデル作成後に E_Sf_BootCsvEditorImpl(必要に応じて拡張)実行。
            //
            //
            //
            if (pg_Logging_ThisMethod.Successful)
            {
                Expression_Node_Function expr_Func = Collection_Function.NewFunction2(
                    Expression_Node_Function_BootCsvEditorExImpl.NAME_FUNCTION,
                    null,
                    cur_Conf,
                    this.MemoryCsvEditor,
                    pg_Logging_ThisMethod
                    );
                //expr_Func.InitializeBeforeUse(this.MoCsvEditor);

                // 実行
                expr_Func.Execute4_OnOEa(sender, e);
            }


            //
            //
            //
            //(5)エラーログ出力
            //
            //
            //
            if (!pg_Logging_ThisMethod.Successful)
            {
                // 異常時

                this.MemoryCsvEditor.MemoryLogwriter.WriteErrorLog(
                    this.MemoryCsvEditor,
                    pg_Logging_ThisMethod,
                    pg_Method.Fullname
                    );
            }

            //
            //
            //
            //(6)メソッド、ロギング終了
            //
            //
            //
            pg_Method.EndMethod(pg_Logging_ThisMethod);
            pg_Logging_ThisMethod.EndLogging(pg_Method);
        }