//──────────────────────────────────────── protected void Execute6_Sub( Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_Functions.Name_Library, this, "Execute6_Sub", log_Reports); string sFncName0; this.TrySelectAttribute(out sFncName0, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports); if (log_Reports.CanStopwatch) { log_Method.Log_Stopwatch.Message = "Nアクション[" + sFncName0 + "]実行"; log_Method.Log_Stopwatch.Begin(); } // // // // 指定された引数から、または、 // この<action>要素を含んでいる control要素から、コントロールの名前を取得。 List <Usercontrol> list_FcUc = new List <Usercontrol>(); if (log_Reports.Successful) { // 正常時 Expression_Node_String ec_FcName_Prm; this.TrySelectAttribute(out ec_FcName_Prm, Expression_Node_Function36Impl.PM_CONTROL_NAME, EnumHitcount.One_Or_Zero, log_Reports); string sFcName_Prm = ec_FcName_Prm.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports); List <Expression_Node_String> ecList_FcName = new List <Expression_Node_String>(); if ("" == sFcName_Prm) { // // fcName未設定時は、この<action>要素を含んでいるcontrol要素から // コントロールの名前を取得。 // Configuration_Node cf_Event = this.Cur_Configuration.GetParentByNodename( NamesNode.S_EVENT, EnumConfiguration.Unknown, false, log_Reports); if (null != cf_Event) { Configuration_Node owner_Configurationtree_Control = cf_Event.GetParentByNodename( NamesNode.S_CONTROL1, EnumConfiguration.Tree, true, log_Reports); if (null != owner_Configurationtree_Control) { string sName; bool bHit = ((Configurationtree_Node)owner_Configurationtree_Control).Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName, false, log_Reports); if (bHit) { Expression_Node_StringImpl ec_Str = new Expression_Node_StringImpl(this, this.Cur_Configuration); ec_Str.AppendTextNode( sName, this.Cur_Configuration, log_Reports ); // 上書き ec_FcName_Prm = ec_Str; ecList_FcName.Add(ec_FcName_Prm); } else { } } else { //nFcName_prm = null; } } else { //nFcName_prm = null; } } else { // // fcName 指定時。 // カンマ区切りか確認。 CsvTo_ListImpl csvTo = new CsvTo_ListImpl(); List <string> sList_FcName_Prm = csvTo.Read(sFcName_Prm); foreach (string sFcName2 in sList_FcName_Prm) { // コントロール名。 Expression_Node_StringImpl ec_FcName4 = new Expression_Node_StringImpl(this, this.Cur_Configuration); ec_FcName4.AppendTextNode( sFcName2, this.Cur_Configuration, log_Reports ); ecList_FcName.Add(ec_FcName4); } } foreach (Expression_Node_String ec_FcName5 in ecList_FcName) { // // 指定のコントロール // List <Usercontrol> list_FcUc2 = this.Owner_MemoryApplication.MemoryForms.GetUsercontrolsByName( ec_FcName5, true, log_Reports ); if (0 < list_FcUc2.Count) { Usercontrol fcUc = list_FcUc2[0]; list_FcUc.Add(fcUc); } } } else { } foreach (Usercontrol fcUc in list_FcUc) { if (log_Reports.Successful) { //// //// 妥当性判定を行います。 //// //if (log_Reports.Successful) //{ // fcUc.JudgeValidity( // log_Reports // ); // //.WriteLine(this.GetType().Name + "#: ◆ 妥当性判定を行った。"); //} if (fcUc.ControlCommon.BAutomaticinputting) { // コンピューターにより自動入力されたとき。 } else { // 手入力による更新。 { ToMemory_Performer toM = new ExpressionDataTargetUpdaterImpl(); toM.ToMemory( "",// 空文字列 fcUc.ControlCommon.Expression_Control, fcUc.ControlCommon.Owner_MemoryApplication, log_Reports ); } } } } log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── protected void Execute6_Sub( object sender, Log_Reports log_Reports ) { // // // //()メソッド開始 // // // Log_Method log_Method = new Log_MethodImpl(1, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_Functions.Name_Library, this, "Execute6_Sub", log_Reports); // // // // // // // if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("関数30「新規ウィンドウを開く」を実行します。"); } string sName_Fnc; this.TrySelectAttribute(out sName_Fnc, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports); if (log_Reports.CanStopwatch) { log_Method.Log_Stopwatch.Message = "Nアクション[" + sName_Fnc + "]実行"; log_Method.Log_Stopwatch.Begin(); } // // // //()タスク・デスクリプション // // // { if (sender is Customcontrol) { Customcontrol cct = (Customcontrol)sender; string sName_Control; if (null == cct.ControlCommon.Expression_Name_Control) { sName_Control = "<エラー:名無し>"; } else { sName_Control = cct.ControlCommon.Expression_Name_Control.Execute4_OnExpressionString( EnumHitcount.Unconstraint, log_Reports ); } log_Reports.Comment_EventCreationMe = "/追記:[" + sName_Control + "]コントロールが、[" + sName_Fnc + "]アクションを実行。"; } else { log_Reports.Comment_EventCreationMe = "/追記:[" + sName_Fnc + "]アクションを実行。"; } } // ┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━ // ┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━ // 開始 // ┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━┳━ // ┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━┻━ Configurationtree_NodeImpl cf_ThisMethod = new Configurationtree_NodeImpl("!ハードコーディング_NAction30#Execute6_Sub", null); if (log_Reports.Successful) { // 正常時 Expression_Node_String ec_ArgFormgroup; this.TrySelectAttribute(out ec_ArgFormgroup, Expression_Node_Function30Impl.PM_NAME_FORM, EnumHitcount.One_Or_Zero, log_Reports); if (null == ec_ArgFormgroup) { // // エラー goto gt_Error_NoForm; } } // // // //(3)レイアウト_テーブル読取 // // // List <Table_Humaninput> oList_Table_Form;//(フォームのセットアップに使う) // // 「フォーム名(レイアウト_ターゲット名)」を指定。 if (log_Reports.Successful) { // 正常時 // テーブル名から、レイアウト・ファイルパスの取得。 Expression_Node_String ec_ArgFormgroup; this.TrySelectAttribute(out ec_ArgFormgroup, Expression_Node_Function30Impl.PM_NAME_FORM, EnumHitcount.One_Or_Zero, log_Reports); oList_Table_Form = this.Owner_MemoryApplication.MemoryTables.GetTable_HumaninputByFormgroup(ec_ArgFormgroup, true, log_Reports); } else { oList_Table_Form = new List <Table_Humaninput>(); } // // // //(4)formsフォルダーパス取得 // // // Expression_Node_Filepath ec_Fopath_Forms; if (log_Reports.Successful) { // 正常時 XenonName o_Name_Variable = new XenonNameImpl(NamesVar.S_SP_FORMS, this.Cur_Configuration); // 変数名。 Expression_Leaf_StringImpl ec_Atom = new Expression_Leaf_StringImpl(this, o_Name_Variable.Cur_Configuration); ec_Atom.SetString(o_Name_Variable.SValue, log_Reports); // ファイルパス。 log_Reports.Log_Callstack.Push(log_Method, "⑤"); ec_Fopath_Forms = this.Owner_MemoryApplication.MemoryVariables.GetExpressionfilepathByVariablename(ec_Atom, true, log_Reports); log_Reports.Log_Callstack.Pop(log_Method, "⑤"); } else { ec_Fopath_Forms = null; } // // // //(5)フォームをセットアップ。 // // // if (log_Reports.Successful) { // 正常時 this.Owner_MemoryApplication.MemoryForms.SetupFormAndLoadUsercontrolconfigs( oList_Table_Form, ec_Fopath_Forms, this.Owner_MemoryApplication.MemoryForms.Mainwnd_FormWrapping.Form, log_Reports ); } // // // //(6)『トゥゲザー設定ファイル』読取。 // // // if (log_Reports.Successful) { // タイプデータ値「ScriptTogethers」。 Expression_Leaf_StringImpl ec_NameVariable = new Expression_Leaf_StringImpl(this, cf_ThisMethod); ec_NameVariable.SetString(ValuesTypeData.S_CODE_TOGETHERS, log_Reports); List <MemoryCodefileinfo> listInfo = null; if (log_Reports.Successful) { listInfo = this.Owner_MemoryApplication.MemoryCodefiles.GetCodefileinfoByTypedata(ec_NameVariable, true, log_Reports); } if (log_Reports.Successful) { foreach (MemoryCodefileinfo scriptfile in listInfo) { if (log_Reports.Successful) { this.Owner_MemoryApplication.MemoryTogethers.LoadFile(scriptfile.Expression_Filepath, log_Reports); } else { break; } } } } // // // //(7)「プロジェクトが選択(切替)されたとき」 // // // if (null != this.In_Subroutine_Function30_2) { this.In_Subroutine_Function30_2.Perform( oList_Table_Form, ec_Fopath_Forms, this.Cur_Configuration, this.Owner_MemoryApplication.MemoryForms.Mainwnd_FormWrapping.Form, sender, log_Reports ); } // // // //(8)独自実装のコントロールのプロパティー編集。主に、フォームの活性化をしているだけ。 // // // if (null != this.In_Subroutine_Function30_1) { this.In_Subroutine_Function30_1.Perform(this.Owner_MemoryApplication, log_Reports); } // (X5)コントロールに、妥当性判定を設定します。 if (log_Reports.Successful) { // タイプデータ値。 Expression_Leaf_StringImpl ec_Name_Variable = new Expression_Leaf_StringImpl(this, cf_ThisMethod); ec_Name_Variable.SetString(ValuesTypeData.S_CODE_VALIDATORS, log_Reports); List <MemoryCodefileinfo> list_Info = null; if (log_Reports.Successful) { list_Info = this.Owner_MemoryApplication.MemoryCodefiles.GetCodefileinfoByTypedata(ec_Name_Variable, true, log_Reports); } if (log_Reports.Successful) { foreach (MemoryCodefileinfo moScriptfile in list_Info) { if (log_Reports.Successful) { this.Owner_MemoryApplication.MemoryValidators.LoadFile( moScriptfile.Expression_Filepath.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports), log_Reports); } else { break; } } } } // // // //(9)「レイアウトテーブル」に書かれているコントロール名だけの一覧を作成。 // // // List <string> sList_Name_Control = new List <string>(); foreach (Table_Humaninput tableH_Form in oList_Table_Form) { if (tableH_Form.DataTable.Columns.Contains(NamesFld.S_NAME)) { // 「NAME」フィールドのあるテーブルが本表。無いのは参照表。 foreach (DataRow row in tableH_Form.DataTable.Rows) { string name_Control = ((Value_Humaninput)row[NamesFld.S_NAME]).Text; sList_Name_Control.Add(name_Control.Trim()); } } } // // // //(10)指定レイアウト内の全てのコントロールの、"Se:読取時;" イベントを実行します。 // // // if (log_Reports.Successful) { Executer1_UsercontrolAndEvent exe1 = new Executer1_UsercontrolAndEventImpl(); exe1.Execute1_AllUsercontrols( sList_Name_Control, sender, new XenonNameImpl(NamesSe.S_LOAD, cf_ThisMethod), this.Owner_MemoryApplication, log_Reports ); } // // // // ロード完了 // // // goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_NoForm: { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, Log_RecordReportsImpl.ToText_Configuration(cf_ThisMethod), log_Reports);//設定位置パンくずリスト this.Owner_MemoryApplication.CreateErrorReport("Er:110015;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── protected override void Parse_ChildNodes( XmlElement cur_X, Configurationtree_Node cur_Cf, MemoryApplication memoryApplication, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0); log_Method.BeginMethod(Info_XmlToConf.Name_Library, this, "Parse_ChildNodes", log_Reports); // // XmlNode err_Child_XNode; // <arg>要素のリスト XmlNodeList child_XNl = cur_X.ChildNodes; foreach (XmlNode child_XNode in child_XNl) { if (XmlNodeType.Element == child_XNode.NodeType) { XmlElement xChild = (XmlElement)child_XNode; if (NamesNode.S_ARG == xChild.Name) { // // <arg>要素 XmlToConfigurationtree_C15_Elm to = XmlToConfigurationtree_Collection.GetTranslatorByNodeName(xChild.Name, log_Reports); to.XmlToConfigurationtree(xChild, cur_Cf, memoryApplication, log_Reports); } else { // エラー。 err_Child_XNode = xChild; goto gt_Error_UndefinedChild01; } } } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_UndefinedChild01: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー386!", log_Method); StringBuilder t = new StringBuilder(); t.Append("<validator>要素に、<arg>要素以外の要素["); t.Append(err_Child_XNode.Name); t.Append("]が含まれていました。"); t.Append(Environment.NewLine); t.Append(Environment.NewLine); // ヒント r.Message = t.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── /// <summary> /// S → E。 /// </summary> public void Translate( MemoryApplication memoryApplication, Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports); if (log_Method.CanDebug(1)) { pg_ParsingLog.Increment("(41)バリデーションファイル"); } // // // // if (log_Reports.Successful) { // // コントロール順 memoryApplication.MemoryForms.ForEach_Children(delegate(string sKey, Usercontrol uct, ref bool bRemove, ref bool bBreak) { if (uct is UsercontrolListbox) { // // リストボックスなら。 UsercontrolListbox uctLst = (UsercontrolListbox)uct; List <Configurationtree_Node> cfList_ValidatorConfig = uctLst.ControlCommon.Configurationtree_Control.GetChildrenByNodename(NamesNode.S_CODEFILE_VALIDATORS, false, log_Reports); if (1 < cfList_ValidatorConfig.Count) { throw new Exception("バリデーター設定要素が2つ以上ありました。"); } else if (0 < cfList_ValidatorConfig.Count) { Configurationtree_Node cf_ValidatorConfig = cfList_ValidatorConfig[0]; // (Sv)コントロールのSv { ConfigurationtreeToExpression_V52_FListboxValidationImpl_ to = new ConfigurationtreeToExpression_V52_FListboxValidationImpl_(); List <Configurationtree_Node> cfList_Validation = cf_ValidatorConfig.GetChildrenByNodename(NamesNode.S_F_LISTBOX_VALIDATION, false, log_Reports); foreach (Configurationtree_Node child_Cf in cfList_Validation) { // // <f-list-box-validation> to.Translate( child_Cf, uctLst, memoryApplication, pg_ParsingLog, log_Reports ); }//foreach } { ConfigurationtreeToUsercontrol_V52_ValidatorImpl_ to = new ConfigurationtreeToUsercontrol_V52_ValidatorImpl_(); List <Configurationtree_Node> cfList_Validator = cf_ValidatorConfig.GetChildrenByNodename(NamesNode.S_VALIDATOR, false, log_Reports); foreach (Configurationtree_Node cf in cfList_Validator) { to.ConfigurationtreeToUsercontrol( cf, uct, pg_ParsingLog, log_Reports ); } } }//Ov } else { } }); } goto gt_EndMethod; // // // // gt_EndMethod: if (Log_ReportsImpl.BDebugmode_Static) { pg_ParsingLog.Decrement("(41)バリデーションファイル"); } log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── protected void Execute6_Sub( Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_Functions.Name_Library, this, "Execute6_Sub", log_Reports); string sName_Fnc; this.TrySelectAttribute(out sName_Fnc, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports); if (log_Reports.CanStopwatch) { log_Method.Log_Stopwatch.Message = "Nアクション[" + sName_Fnc + "]実行"; log_Method.Log_Stopwatch.Begin(); } //ScriptVariableフォルダー string pm_Folder_Source; this.TrySelectAttribute(out pm_Folder_Source, Expression_Node_Function47Impl.PM_FOLDER_SOURCE, EnumHitcount.One_Or_Zero, log_Reports); //書出し先ファイル Expression_Node_String fileExport_Expr; this.TrySelectAttribute(out fileExport_Expr, Expression_Node_Function47Impl.PM_FILE_EXPORT, EnumHitcount.One_Or_Zero, log_Reports); //書出し先フィールド Expression_Node_String fieldExport_Expr; this.TrySelectAttribute(out fieldExport_Expr, Expression_Node_Function47Impl.PM_FIELD_EXPORT, EnumHitcount.One, log_Reports); //フィルター指定 string pm_Filter; this.TrySelectAttribute(out pm_Filter, Expression_Node_Function47Impl.PM_FILTER, EnumHitcount.One_Or_Zero, log_Reports); pm_Filter = pm_Filter.Trim(); //サブフォルダー検索 string pm_Is_Search_Subfolder; this.TrySelectAttribute(out pm_Is_Search_Subfolder, Expression_Node_Function47Impl.PM_IS_SEARCH_SUBFOLDER, EnumHitcount.One_Or_Zero, log_Reports); //ポップアップ指定 string str_Popup; this.TrySelectAttribute(out str_Popup, Expression_Node_Function47Impl.PM_POPUP, EnumHitcount.One_Or_Zero, log_Reports); str_Popup = str_Popup.Trim(); //ディレクトリー階層を走査したい。 Filesystemreport filesystemreporter = new FilesystemreportImpl(); if (log_Reports.Successful) { Filesystemrunner runner = new FilesystemrunnerImpl(); //log_Method.WriteDebug_ToConsole("初回 pm_Folder_Source=[" + pm_Folder_Source + "] pm_Filter=[" + pm_Filter + "] pm_Is_Search_Subfolder=[" + pm_Is_Search_Subfolder + "]"); runner.Run( filesystemreporter, pm_Folder_Source, pm_Filter, pm_Is_Search_Subfolder, log_Reports ); } // 検索結果をCSVテーブルの形にして出力。 if (log_Reports.Successful) { StringBuilder sb = new StringBuilder(); sb.Append("NO,"); sb.Append(fieldExport_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));// "FILE" sb.Append(",END"); sb.Append(Environment.NewLine); sb.Append("int,string,END"); sb.Append(Environment.NewLine); sb.Append("-1,ファイルパス,END"); sb.Append(Environment.NewLine); int field_No = 0; filesystemreporter.ForEach(delegate(string filesystementry, ref bool isBreak2, Log_Reports log_Reports2) { //連番 sb.Append(field_No); sb.Append(","); sb.Append(filesystementry); sb.Append(",END"); sb.Append(Environment.NewLine); field_No++; }, log_Reports); sb.Append("EOF,,"); sb.Append(Environment.NewLine); try { string sFile_Export2 = fileExport_Expr.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports); System.IO.File.WriteAllText( sFile_Export2, sb.ToString(), Global.ENCODING_CSV ); if (str_Popup != S_BLOCK) { Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("ファイルに書き込みました。"); s.Newline(); s.Append("["); s.Append(sFile_Export2); s.Append("]"); s.Newline(); s.Newline(); s.Append("検索した場所:"); s.Newline(); s.Append("["); s.Append(pm_Folder_Source); s.Append("]"); s.Newline(); s.Newline(); s.Append("検索オプション(Pm:filter;):"); s.Newline(); s.Append("["); s.Append(pm_Filter); s.Append("]"); s.Newline(); MessageBox.Show(s.ToString(), "▲実行結果!(L02)"); } } catch (Exception ex) { // 異常時は必ずポップアップが出る。 MessageBox.Show( ex.Message, "▲エラー201!(" + log_Method.Fullname + ")#Write" ); } } log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── public static bool TryParse( object value, out Value_Humaninput out_ValueH, bool isRequired, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0); log_Method.BeginMethod(Info_Table.Name_Library, "Utility_HumaninputValue", "TryParse", log_Reports); bool bResult; if (value is Value_Humaninput) { out_ValueH = (Value_Humaninput)value; bResult = true; } else { out_ValueH = null; bResult = false; if (isRequired) { goto gt_Error_AnotherType; } goto gt_EndMethod; } goto gt_EndMethod; // #region 異常系 //──────────────────────────────────────── gt_Error_AnotherType: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー201!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("string,int,boolセルデータクラス以外のオブジェクトが指定されました。"); s.Newline(); s.Append("指定された値のクラス=["); s.Append(value.GetType().Name); s.Append("]"); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // gt_EndMethod: log_Method.EndMethod(log_Reports); return(bResult); }
//──────────────────────────────────────── /// <summary> /// フィールドがなかった場合に、警告を作成してくれます。 /// </summary> /// <param name="fieldName"></param> /// <param name="c"></param> /// <param name="log_Reports"></param> /// <param name="dataSourceHintName"></param> /// <returns></returns> public static Value_Humaninput GetFieldvalue( string name_Field, DataRow row, bool isNoHitIsError, Log_Reports log_Reports, string nodeConfigtree_Datasource ) { Log_Method log_Method = new Log_MethodImpl(0); log_Method.BeginMethod(Info_Table.Name_Library, "Utility_Row", "GetFieldvalue", log_Reports); Value_Humaninput result; // ArgumentException予防 if (!row.Table.Columns.Contains(name_Field)) { // 該当なしの場合 result = null; if (isNoHitIsError) { // 指定のフィールドが、該当なしの場合エラーになる設定なら goto gt_Error_NotFoundField; } // 該当なしの場合エラーにならない設定なら、フィールドがなくても無視します。 // 正常 goto gt_EndMethod; } Exception err_Excp; try { // bug: 列名には、大文字・小文字の区別はないようです。 result = (Value_Humaninput)row[name_Field]; } catch (Exception e) { result = null; err_Excp = e; goto gt_Error_Exception; } if (isNoHitIsError && null == result) { goto gt_Error_Null; } // 正常 goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_NotFoundField: // エラー。指定のフィールドが見つからなかった。 if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー603!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("指定のフィールド["); s.Append(name_Field); s.Append("]は、データソース["); s.Append(nodeConfigtree_Datasource); s.Append("]にはありませんでした。"); s.Append(Environment.NewLine); s.Append("テーブル名=["); s.Append(row.Table.TableName); s.Append("]"); s.Append(Environment.NewLine); //sB.Append("エラー型:"); //sB.Append(err_Excp.GetType().Name); //sB.Append(Environment.NewLine); //sB.Append("エラーメッセージ:"); //sB.Append(err_Excp.Message); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_Exception: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー601!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("指定のフィールド["); s.Append(name_Field); s.Append("]の読取りに失敗しました。"); s.Append(Environment.NewLine); s.Append("テーブル名=["); s.Append(row.Table.TableName); s.Append("]"); s.Append(Environment.NewLine); s.Append("データソースヒント名:"); s.Append(nodeConfigtree_Datasource); s.Append(Environment.NewLine); s.Append("メッセージ:"); s.Append(err_Excp.Message); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_Null: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー602!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("▲エラー4101!(" + Info_Table.Name_Library + ")"); s.Newline(); s.Append("指定のフィールド["); s.Append(name_Field); s.Append("]は、ヌルでした。"); s.Append(Environment.NewLine); s.Append("データソースヒント名:"); s.Append(nodeConfigtree_Datasource); s.Append(Environment.NewLine); s.Append("テーブル名=["); s.Append(row.Table.TableName); s.Append("]"); s.Append(Environment.NewLine); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); return(result); }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── public void CreateErrorReport( string errorSymbol, Builder_TexttemplateP1p texttemplateBuilder_ParameterSetted, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "CreateErrorReport", log_Reports); // int errorNumber; { string tempErrorSymbol = errorSymbol; if (tempErrorSymbol.StartsWith("Er:")) { tempErrorSymbol = tempErrorSymbol.Substring(3); if (tempErrorSymbol.EndsWith(";")) { tempErrorSymbol = tempErrorSymbol.Substring(0, tempErrorSymbol.Length - 1); if (int.TryParse(tempErrorSymbol, out errorNumber)) { } else { goto gt_Error_Symbol; } } else { goto gt_Error_Symbol; } } else { goto gt_Error_Symbol; } } if (log_Reports.CanCreateReport) { string strTypedata = ValuesTypeData.S_TABLE_ERRORMESSAGES; Configurationtree_Node cur_Ct = new Configurationtree_NodeImpl(log_Method.Fullname, null); List <Table_Humaninput> tables = this.MemoryTables.GetTable_HumaninputByTypedata( new Expression_Leaf_StringImpl(strTypedata, null, cur_Ct), true, log_Reports); bool hit = false; foreach (Table_Humaninput table in tables) { foreach (DataRow dataRow in table.DataTable.Rows) { Int_HumaninputImpl xenonValue_Int = (Int_HumaninputImpl)dataRow["ID"]; int valueInt; xenonValue_Int.TryGet(out valueInt); if (valueInt == errorNumber) { //ヒット hit = true; Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("Er:" + errorNumber + ";", log_Method); String_HumaninputImpl xenonValue_String = (String_HumaninputImpl)dataRow["MESSAGE"]; string valueStr; xenonValue_String.TryGet(out valueStr); texttemplateBuilder_ParameterSetted.Text = valueStr; r.Message = texttemplateBuilder_ParameterSetted.Compile(log_Reports).Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports); //log_Method.WriteDebug_ToConsole(texttemplateBuilder_ParameterSetted.Compile(log_Reports).Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports)); goto gt_EndLoop1; } } } gt_EndLoop1: if (!hit) { //エラーメッセージの登録がない。 Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("Er:0;", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("エラーメッセージテーブルに、エラーメッセージの登録がありませんでした。\n%1%=[%2%]\nテーブル数=[%3%]"); Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(s.ToString()); tmpl.SetParameter(1, NamesFld.S_TYPE_DATA, log_Reports); tmpl.SetParameter(2, strTypedata, log_Reports); tmpl.SetParameter(3, tables.Count.ToString(), log_Reports); r.Message = tmpl.Compile(log_Reports).Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports); } log_Reports.EndCreateReport(); } goto gt_EndMethod; // #region 異常系 //──────────────────────────────────────── gt_Error_Symbol: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー204!", log_Method); StringBuilder s = new StringBuilder(); s.Append("エラーシンボルがおかしい。[" + errorSymbol + "]。プログラムのミス?"); s.Append(Environment.NewLine); s.Append(Environment.NewLine); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // gt_EndMethod: log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── public override void Translate( Configurationtree_Node cur_Cf, //<lookup-id> Expression_Node_String parent_Ec, //< Sf:text-template;> MemoryApplication memoryApplication, Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports); if (log_Method.CanDebug(1)) { pg_ParsingLog.Increment("(9)" + cur_Cf.Name); } // // // // // // 自 // // // Expression_Node_String cur_Ec = new Expression_Node_StringImpl(parent_Ec, cur_Cf); // // // // 親へ連結 (value属性) // // // { // // 自要素の value="" 属性を、親へ連結 // PmName pmName = PmNames.S_VALUE; string sValue; bool bHit = cur_Cf.Dictionary_Attribute.TryGetValue(pmName, out sValue, false, log_Reports); if (bHit) { cur_Ec.AppendTextNode( sValue, cur_Cf, log_Reports ); // // // // 子 // // // this.ParseChild_InConfigurationtreeToExpression( cur_Cf, cur_Ec,//自 memoryApplication, pg_ParsingLog, log_Reports ); // // // // 親へ連結 ※属性連結 // // // parent_Ec.SetAttribute(PmNames.S_LOOKUP_ID.Name_Pm, cur_Ec, log_Reports); goto gt_EndMethod; } else { } } // // // // 子 // // // { //<a-default>の子要素を確認し、親<f-switch>のdefault属性に追加します。 this.ParseChild_InConfigurationtreeToExpression( cur_Cf, cur_Ec, memoryApplication, pg_ParsingLog, log_Reports ); } // // // // 親へ連結 // // // parent_Ec.SetAttribute(PmNames.S_LOOKUP_ID.Name_Pm, cur_Ec, log_Reports); // // // // 親へ連結 debug // // // if (log_Method.CanDebug(1)) { string parent_SName_Fnc; parent_Ec.TrySelectAttribute(out parent_SName_Fnc, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports); log_Method.WriteDebug_ToConsole(" ☆☆☆☆☆☆☆☆ 親<[" + parent_Ec.Cur_Configuration.Name + "] name=”[" + parent_SName_Fnc + "]” >"); string sName_MyFnc; cur_Ec.TrySelectAttribute(out sName_MyFnc, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports); log_Method.WriteDebug_ToConsole(" ☆☆☆☆☆☆☆☆ 自<[" + cur_Ec.Cur_Configuration.Name + "] name=”[" + sName_MyFnc + "]” >"); } goto gt_EndMethod; // // gt_EndMethod: if (Log_ReportsImpl.BDebugmode_Static) { pg_ParsingLog.Decrement(cur_Cf.Name); } log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── /// <summary> /// スタイルシート・テーブルは、最低限「NAME」「STYLE」の2つで構成されたテーブルです。 /// </summary> /// <param name="oStyleSheetTable"></param> /// <returns></returns> public MemoryStyles Translate( Table_Humaninput xenonTable_Stylesheet, Log_Reports log_Reports ) { Log_Method pg_Method = new Log_MethodImpl(); pg_Method.BeginMethod(Info_Operating.Name_Library, this, "MToO", log_Reports); // // // // if (null == xenonTable_Stylesheet) { goto gt_Error_NullTable; } MemoryStyles oStyleAttrList = new MemoryStylesImpl(); int nIndex = 0; foreach (DataRow dataRow in xenonTable_Stylesheet.DataTable.Rows) { string sId; if (log_Reports.Successful) { // 正常時 Value_Humaninput valueH; if (log_Reports.Successful) { // 正常時 valueH = Utility_Row.GetFieldvalue( "NAME", dataRow, true, log_Reports, "スタイルシートテーブル(NAME検索時)" ); if (!log_Reports.Successful) { // 既エラー。 goto gt_EndMethod; } } else { valueH = null; } if (log_Reports.Successful) { // 正常時 sId = ((Value_Humaninput)valueH).Text;//"スタイルシートテーブルパーサーのID" } else { sId = ""; } } else { sId = ""; } string sStyle; if (log_Reports.Successful) { // 正常時 Value_Humaninput valueH = Utility_Row.GetFieldvalue( "STYLE", dataRow, true, log_Reports, "スタイルシートテーブル(STYLE検索時)" ); if (!log_Reports.Successful) { // 既エラー。 goto gt_EndMethod; } sStyle = ((Value_Humaninput)valueH).Text;//"スタイルシートテーブルパーサーのSTYLE" } else { sStyle = ""; } RecordXenonStyle item = new RecordXenonStyleImpl(); item.Id = sId; item.Style = sStyle; oStyleAttrList.Dictionary_RecordStyle.Add(sId, item); nIndex++; } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_NullTable: { oStyleAttrList = null; if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー99999!", pg_Method); StringBuilder t = new StringBuilder(); t.Append("テーブルがヌルでした。"); t.Append(Environment.NewLine); t.Append(Environment.NewLine); // ヒント r.Message = t.ToString(); log_Reports.EndCreateReport(); } } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: pg_Method.EndMethod(log_Reports); return(oStyleAttrList); }
//──────────────────────────────────────── /// <summary> /// 設定されている内容を空っぽにします。 /// /// todo:イベントハンドラーを外してから、フォームを外すこと。リストボックスが誤挙動を起こしている。 /// </summary> public void ClearProject( Control.ControlCollection formControls, Log_Reports log_Reports ) { // // // //()メソッド開始 // // // Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "ClearProject", log_Reports); // // // // クリアー: form1の、コントロール: // this.MemoryForms.ClearForms( formControls, log_Reports ); // // クリアー: バックアップ情報を空っぽにします。 // this.MemoryBackup.Clear(this); // // クリアー: 関数を空っぽにします。 // this.MemoryFunctions.Clear(this); // // クリアー: 変数を空っぽにします。 // this.MemoryVariables.Clear(this); // // クリアー: テーブルを空っぽにします。 // this.MemoryTables.Clear(this); // // クリアー: リローディング設定ファイルを空っぽにします。 // this.MemoryTogethers.Clear(this);//.Cf_RfrCnf.List_Child.Clear(log_Reports); // // クリアー: スクリプトファイル一覧を空っぽにします。 // this.MemoryCodefiles.Clear(this); // // クリアー: バリデーター一覧を空っぽにします。 // this.MemoryValidators.Clear(this); // // // // log_Method.EndMethod(log_Reports); }
public void TryGetInt( out int out_NValue, string sName, bool bRequired, int nAlt, MemoryApplication memoryApplication, Log_Reports log_Reports) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_Expr.Name_Library, this, "TryGetInt", log_Reports); // if (!this.Dictionary_Field.ContainsKey(sName)) { //該当なし。 if (bRequired) { out_NValue = -1; goto gt_Error_NotFound; } else { out_NValue = nAlt; goto gt_EndMethod; } } FieldUserformtable fo_Field = this.Dictionary_Field[sName]; if (EnumTypedb.Int != fo_Field.EnumTypedb) { //型が異なる。 if (bRequired) { out_NValue = -1; goto gt_Error_Type; } else { out_NValue = nAlt; goto gt_EndMethod; } } out_NValue = (int)fo_Field.Data; goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_NotFound: { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, sName, log_Reports);//フィールド名 memoryApplication.CreateErrorReport("Er:6001;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_Type: { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, sName, log_Reports); //フィールド名 tmpl.SetParameter(2, fo_Field.EnumTypedb.ToString(), log_Reports); //フィールドの型名 memoryApplication.CreateErrorReport("Er:6002;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); }
public void TryGetFilepath_Configurationtree(out Configurationtree_NodeFilepath out_Value, string sName, bool bRequired, MemoryApplication memoryApplication, Log_Reports log_Reports) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_Expr.Name_Library, this, "TryGetFilepath_Configurationtree", log_Reports); // if (!this.Dictionary_Field.ContainsKey(sName)) { //該当なし。 if (bRequired) { out_Value = new Configurationtree_NodeFilepathImpl(log_Method.Fullname, null);//ヌル・オブジェクト。 goto gt_Error_NotFound; } else { out_Value = new Configurationtree_NodeFilepathImpl(log_Method.Fullname, null);//ヌル・オブジェクト。 goto gt_EndMethod; } } FieldUserformtable fo_Field = this.Dictionary_Field[sName]; if (EnumTypedb.ConfFilepath != fo_Field.EnumTypedb) { //型が異なる。 if (bRequired) { out_Value = new Configurationtree_NodeFilepathImpl(log_Method.Fullname, null);//ヌル・オブジェクト。 goto gt_Error_Type; } else { out_Value = new Configurationtree_NodeFilepathImpl(log_Method.Fullname, null);//ヌル・オブジェクト。 goto gt_EndMethod; } } out_Value = (Configurationtree_NodeFilepath)fo_Field.Data; goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_NotFound: { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, sName, log_Reports);//フィールド名 memoryApplication.CreateErrorReport("Er:6007;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_Type: { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, sName, log_Reports); //フィールド名 tmpl.SetParameter(2, fo_Field.EnumTypedb.ToString(), log_Reports); //フィールドの型名 memoryApplication.CreateErrorReport("Er:6008;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── /// <summary> /// アクション実行。 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public override string Execute5_Main(Log_Reports log_Reports) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_Functions.Name_Library, this, "Execute5_Main", log_Reports); // // if (this.EnumEventhandler == EnumEventhandler.O_Lr) { if (this.Functionparameterset.Sender is Customcontrol) { Customcontrol fcCc = (Customcontrol)this.Functionparameterset.Sender; string sName_Usercontrol = fcCc.ControlCommon.Expression_Name_Control.Execute4_OnExpressionString( EnumHitcount.Unconstraint, log_Reports ); log_Reports.Comment_EventCreationMe += "/追記:[" + sName_Usercontrol + "]コントロールが、[" + this.GetType().Name + "]を実行。"; } else { log_Reports.Comment_EventCreationMe += "/追記:[" + this.GetType().Name + "]を実行。"; } // // // // this.Execute6_Sub( log_Reports ); } else if (this.EnumEventhandler == EnumEventhandler.O_Ea) { if (this.Functionparameterset.Sender is Customcontrol) { Customcontrol fcCc = (Customcontrol)this.Functionparameterset.Sender; string sName_Usercontrol = fcCc.ControlCommon.Expression_Name_Control.Execute4_OnExpressionString( EnumHitcount.Unconstraint, log_Reports ); log_Reports.Comment_EventCreationMe += "/追記:[" + sName_Usercontrol + "]コントロールが、[" + this.GetType().Name + "]を実行。"; } else { log_Reports.Comment_EventCreationMe += "/追記:[" + this.GetType().Name + "]を実行。"; } this.Execute6_Sub( log_Reports ); } // // log_Method.EndMethod(log_Reports); return(""); }
//──────────────────────────────────────── /// <summary> /// イベント アクション リストを作成します。 /// </summary> /// <param nFcName="eventName"></param> /// <param nFcName="nActionSuper"></param> /// <param nFcName="log_Reports"></param> public Functionlist CreateFunctionlist( ConfigurationtreeToExpression_Event sToE_Event, MemoryApplication owner_MemoryApplication, Log_Reports log_Reports ) { Log_Method pg_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); pg_Method.BeginMethod(Info_Controls.Name_Library, this, "CreateFunctionlist", log_Reports); // // Functionlist fc_Result = null; //.WriteLine(this.GetType().Name + "#CreateEventActionList: <構築>【開始】 イベントに対応ついたアクションリストを追加します。 (チェックボックス)"); switch (sToE_Event.Name) { case NamesSe.S_LOAD: { // // このコントロールの「アプリケーション起動時」。 // // (NActionPerformEnum.O_EA) // // // 無視します。 // } break; case NamesSe.S_ITEM_SELECTED: { // // チェックした時/チェックを外した時 // if (null == this.functionlist_Event_CheckedChanged) { Functionlist_FormChkImpl fw = new Functionlist_FormChkImpl( //EnumEventhandler.O_Ea, sToE_Event, owner_MemoryApplication); fw.InitializeBeforeUse(); fc_Result = fw; this.functionlist_Event_CheckedChanged = fw; this.customcontrolCheckbox1.CheckedChanged += new System.EventHandler(this.functionlist_Event_CheckedChanged.Execute4_OnOEa); } } break; default: goto gt_Error_NotSupportedEvent; } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_NotSupportedEvent: { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, this.GetType().Name, log_Reports); //クラス名 tmpl.SetParameter(2, sToE_Event.Name, log_Reports); //イベント名 tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(sToE_Event.Configurationtree_Event), log_Reports); //設定位置パンくずリスト this.ControlCommon.Owner_MemoryApplication.CreateErrorReport("Er:519;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: pg_Method.EndMethod(log_Reports); //.WriteLine(this.GetType().NFcName + "#CreateEventActionList: ■■■■■■■■■■未実装です。無視されます。rEvent.NFcName=[" + rEvent.NFcName + "]■■■■■■■■■■"); return(fc_Result); }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── /// <summary> /// TODO:「,」「"」に対応したい。 /// /// /// 縦、横がひっくり返っていて、 /// 型定義レコードがないCSVテーブルの読取。 /// </summary> /// <param name="csvText"></param> /// <returns>列名情報も含むテーブル。</returns> public Table_Humaninput Read( string string_Csv, Request_ReadsTable forTable_Request, Format_Table_Humaninput forTable_Format, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(); log_Method.BeginMethod(Info_Table.Name_Library, this, "Read", log_Reports); // // // // CsvLineParserImpl csvParser = new CsvLineParserImpl(); Table_Humaninput xenonTable = new Table_HumaninputImpl( forTable_Request.Name_PutToTable, forTable_Request.Expression_Filepath, forTable_Request.Expression_Filepath.Cur_Configuration); xenonTable.Tableunit = forTable_Request.Tableunit; xenonTable.Typedata = forTable_Request.Typedata; xenonTable.IsDatebackupActivated = forTable_Request.IsDatebackupActivated; xenonTable.Format_Table_Humaninput = forTable_Format; // // 一旦、テーブルを全て読み込みます。 // List <List <string> > lines = new List <List <string> >(); { // CSVテキストを読み込み、型とデータのバッファーを作成します。 System.IO.StringReader reader = new System.IO.StringReader(string_Csv); string[] sFields; while (-1 < reader.Peek()) { string sLine = reader.ReadLine(); List <string> tokens = new List <string>(); sFields = csvParser.UnescapeLineToFieldList(sLine, this.charSeparator).ToArray(); int nColumnIndex = 0; foreach (string sToken in sFields) { if (nColumnIndex == 0 && ToCsv_Table_Humaninput_RowColRegularImpl.S_END == sToken.Trim().ToUpper()) { // 1列目にENDがある場合、その手前までの列が有効データです。 // END以降の行は無視します。 goto row_end; } tokens.Add(sToken); nColumnIndex++; } lines.Add(tokens); } row_end: // ストリームを閉じます。 reader.Close(); } // // 型定義部 // // (※NO,ID,EXPL,NAME など、フィールドの定義を持つテーブル) // RecordFielddefinition recordFielddefinition = new RecordFielddefinitionImpl(); // // データ・テーブル部 // List <List <string> > rows = new List <List <string> >(); // // まず、0列目、1列目のデータを読み取ります。 // int nRowIndex = 0; foreach (List <string> tokens in lines) { Fielddefinition fieldDefinition = null; int nColumnIndex = 0; foreach (string sToken in tokens) { if (0 == nColumnIndex) { // // 0列目は、フィールド名です。 // string sFieldName = sToken;//.Trim().ToUpper(); // テーブルのフィールドを追加します。フィールドの型は、intに固定です。 fieldDefinition = new FielddefinitionImpl(sFieldName, EnumTypeFielddefinition.Int); recordFielddefinition.Add(fieldDefinition); } else if (1 == nColumnIndex) { // // 1列目は、フィールドのコメントとします。 // nColumnIndex = 1; { fieldDefinition.Comment = sToken; } } else { // // 2列目から右側は、データ・テーブル部。 // if (0 == nRowIndex) { // // 先頭行 // // // 「EOF」というトークンが出てくるまで。 // if (ToCsv_Table_Humaninput_RowColRegularImpl.S_EOF == sToken.Trim().ToUpper()) { goto column_end; } List <string> record = new List <string>(); // 1番目のフィールド_データを追加。 record.Add(sToken); rows.Add(record); } else { // // 2番目以降のフィールド_データを追加。 // // // 先頭の2つのレコード分、切り詰めます。 // int nDataIndex = nColumnIndex - 2; if (nDataIndex < rows.Count) { List <string> record = rows[nDataIndex]; record.Add(sToken); } else { // 無視 } } } nColumnIndex++; }//c column_end: nRowIndex++; } //essageBox.Show("CSV読取終わり1 rows.Count=[" + rows.Count + "]", "TableCsvLibデバッグ"); // テーブル作成。テーブルのフィールド型定義と、データ本体をセットします。 xenonTable.CreateTable(recordFielddefinition, log_Reports); if (log_Reports.Successful) { xenonTable.AddRecordList(rows, recordFielddefinition, log_Reports); //essageBox.Show("CSV読取後のテーブル作成終わり", "TableCsvLibデバッグ"); } goto gt_EndMethod; // // gt_EndMethod: log_Method.EndMethod(log_Reports); return(xenonTable); }
//──────────────────────────────────────── public static Value_Humaninput NewInstance( object value, bool isRequired, string nodeConfigtree, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0); log_Method.BeginMethod(Info_Table.Name_Library, "Utility_HumaninputValue", "NewInstance", log_Reports); Value_Humaninput result; if (value is String_HumaninputImpl) { result = new String_HumaninputImpl(nodeConfigtree); } else if (value is Int_HumaninputImpl) { result = new Int_HumaninputImpl(nodeConfigtree); } else if (value is Bool_HumaninputImpl) { result = new Bool_HumaninputImpl(nodeConfigtree); } else { result = null; if (isRequired) { //エラー goto gt_Error_AnotherType; } } goto gt_EndMethod; // #region 異常系 //──────────────────────────────────────── gt_Error_AnotherType: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー292!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("▲エラー201!(" + Info_Table.Name_Library + ")"); s.Newline(); s.Append("string,int,boolセルデータクラス以外のオブジェクトが指定されました。"); s.Newline(); s.Append("指定された値のクラス=["); s.Append(value.GetType().Name); s.Append("]"); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // gt_EndMethod: log_Method.EndMethod(log_Reports); return(result); }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── protected override void Parse_SAttribute( XmlElement cur_X, Configurationtree_Node cur_Cf, MemoryApplication memoryApplication, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0); log_Method.BeginMethod(Info_XmlToConf.Name_Library, this, "Parse_SAttr", log_Reports); // // // // name属性は必須。 // string sName_Fnc = cur_X.GetAttribute(PmNames.S_NAME.Name_Attribute); if ("" == sName_Fnc) { goto gt_Error_UndefinedFncNameAttr; } XmlAttribute err_XAttr = null; if (NamesFnc.S_CELL == sName_Fnc) { foreach (XmlAttribute xAttr in cur_X.Attributes) { // ② // name,description PmName pmName = PmNames.FromSAttribute(xAttr.Name); if (null != pmName) { cur_Cf.Dictionary_Attribute.Add(pmName.Name_Pm, xAttr.Value, cur_Cf, true, log_Reports); } else { err_XAttr = xAttr; goto gt_Error_UndefinedAttr; } } } else if (NamesFnc.S_SWITCH == sName_Fnc) { foreach (XmlAttribute xAttr in cur_X.Attributes) { // ③ // name,description PmName pmName = PmNames.FromSAttribute(xAttr.Name); if (null != pmName) { cur_Cf.Dictionary_Attribute.Add(pmName.Name_Pm, xAttr.Value, cur_Cf, true, log_Reports); } else { err_XAttr = xAttr; goto gt_Error_UndefinedAttr; } } } else if (NamesFnc.S_CASE == sName_Fnc) { foreach (XmlAttribute xAttr in cur_X.Attributes) { // ④ // name,description PmName pmName = PmNames.FromSAttribute(xAttr.Name); if (null != pmName) { cur_Cf.Dictionary_Attribute.Add(pmName.Name_Pm, xAttr.Value, cur_Cf, true, log_Reports); } else { err_XAttr = xAttr; goto gt_Error_UndefinedAttr; } } } else if (NamesFnc.S_VALUE_CONTROL == sName_Fnc) { foreach (XmlAttribute xAttr in cur_X.Attributes) { // ⑤ // name,description PmName pmName = PmNames.FromSAttribute(xAttr.Name); if (null != pmName) { cur_Cf.Dictionary_Attribute.Add(pmName.Name_Pm, xAttr.Value, cur_Cf, true, log_Reports); } else { err_XAttr = xAttr; goto gt_Error_UndefinedAttr; } } // value属性の指定がなければ、このコントロールの名前を入れておく。 if (!cur_Cf.Dictionary_Attribute.ContainsKey(PmNames.S_VALUE.Name_Pm)) { Configurationtree_Node owner_Configurationtree_Control; if (!(cur_Cf.Parent is Configurationtree_Node)) { //todo:エラーか? owner_Configurationtree_Control = null; goto gt_Error_UndefinedClass; } else { Configurationtree_Node parent_Cf = (Configurationtree_Node)cur_Cf.Parent; if (NamesNode.S_CONTROL1 == parent_Cf.Name) { owner_Configurationtree_Control = parent_Cf; } else { Configuration_Node parent2 = parent_Cf.GetParentByNodename( NamesNode.S_CONTROL1, EnumConfiguration.Tree, true, log_Reports); if (log_Reports.Successful) { owner_Configurationtree_Control = (Configurationtree_Node)parent2; } else { owner_Configurationtree_Control = null; } } } if (null != owner_Configurationtree_Control) { if (owner_Configurationtree_Control.Dictionary_Attribute.ContainsKey(PmNames.S_NAME.Name_Pm)) { string sFcName; owner_Configurationtree_Control.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sFcName, true, log_Reports); cur_Cf.Dictionary_Attribute.Add(PmNames.S_VALUE.Name_Pm, sFcName, cur_Cf, true, log_Reports); } } } } else if (NamesFnc.S_RECORD_SET_SAVE_TO2 == sName_Fnc) { foreach (XmlAttribute xAttr in cur_X.Attributes) { string xName_AttrTrim = xAttr.Name.Trim(); if ( PmNames.S_REQUIRED.Name_Attribute == xAttr.Name || // 特にS→Eにパースは無い PmNames.S_FROM.Name_Attribute == xAttr.Name || // Xn_L07_SToE:SToE_F_5FElem/Xn_L07_SToE:SToE_F_A6FromImpl PmNames.S_STORAGE.Name_Attribute == xAttr.Name || // 特にS→Eにパースは無い PmNames.S_FIELD.Name_Attribute == xAttr.Name // 特にS→Eにパースは無い ) { // // 属性=”” cur_Cf.Dictionary_Attribute.Add(xAttr.Name, xAttr.Value, cur_Cf, true, log_Reports); } else { // // エラー。 err_XAttr = xAttr; goto gt_Error_UndefinedAttr; } }//foreach } else { foreach (XmlNode xAttr in cur_X.Attributes) { // とりあえず、どんな属性名でも受け入れる。 if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("<fnc name=”[" + sName_Fnc + "]”>の属性 " + xAttr.Name + "=”" + xAttr.Value + "”"); } // // value="" // // ⑥ PmName pmName = PmNames.FromSAttribute(xAttr.Name); if (null != pmName) { cur_Cf.Dictionary_Attribute.Add(pmName.Name_Pm, xAttr.Value, cur_Cf, true, log_Reports); } else { cur_Cf.Dictionary_Attribute.Add(xAttr.Name, xAttr.Value, cur_Cf, true, log_Reports); } // // 子<arg1>は、ここでは処理しない。 // } } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_UndefinedAttr: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー336!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("["); s.Append(cur_X.Name); s.Append("]要素を探索中に、未対応の属性が記述されていました。"); s.Newline(); s.Append("xAttr.Name=["); s.Append(err_XAttr.Name); s.Append("]"); s.Newline(); s.Newline(); // ヒント s.Append(r.Message_Configuration(cur_Cf)); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_UndefinedFncNameAttr: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー413!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("<fnc>要素に、name属性が指定されていませんでした。"); s.Newline(); s.Newline(); // ヒント s.Append(r.Message_Configuration(cur_Cf)); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_UndefinedClass: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー341!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("何らかのエラー。"); s.Newline(); // ヒント s.Append(r.Message_Configuration(cur_Cf)); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── private void ReadKeyconfig(Gamepadmainloop mainloop, int nPlayerPrm, Memory_GameController gc) { Log_Method pg_Method = new Log_MethodImpl(0); Log_Reports log_Reports_ThisMethod = new Log_ReportsImpl(pg_Method); pg_Method.BeginMethod(Info_Operating.Name_Library, this, "ReadKeyConfig", log_Reports_ThisMethod); // テーブルを、上から下に読んでいく。 // 列の並び順は NO ID Expl PLAYER BEFORE AFTER if (null != this.Table_Humaninput_Keyconfig)//テーブルの読取が成功していること。 { DataTable dataTable = this.Table_Humaninput_Keyconfig.DataTable; foreach (DataRow dataRow in dataTable.Rows) { int nPlayer; Int_HumaninputImpl.TryParse( dataRow.ItemArray[3], out nPlayer, EnumOperationIfErrorvalue.Spaces_To_Alt_Value, 0, log_Reports_ThisMethod ); if (nPlayerPrm == nPlayer) { string sBefore; string sAfter; String_HumaninputImpl.TryParse( dataRow.ItemArray[4], out sBefore, "", "", pg_Method, log_Reports_ThisMethod ); String_HumaninputImpl.TryParse( dataRow.ItemArray[5], out sAfter, "", "", pg_Method, log_Reports_ThisMethod ); EnumGamepadkeyIx o_Before; EnumGamepadkeyBit o_After; switch (sBefore) { case "Up": o_Before = EnumGamepadkeyIx.Up; break; case "Right": o_Before = EnumGamepadkeyIx.Right; break; case "Down": o_Before = EnumGamepadkeyIx.Down; break; case "Left": o_Before = EnumGamepadkeyIx.Left; break; case "1": o_Before = EnumGamepadkeyIx.B0; break; case "2": o_Before = EnumGamepadkeyIx.B1; break; case "3": o_Before = EnumGamepadkeyIx.B2; break; case "4": o_Before = EnumGamepadkeyIx.B3; break; case "5": o_Before = EnumGamepadkeyIx.B4; break; case "6": o_Before = EnumGamepadkeyIx.B5; break; case "7": o_Before = EnumGamepadkeyIx.B6; break; case "8": o_Before = EnumGamepadkeyIx.B7; break; default: o_Before = EnumGamepadkeyIx.Up; break; } switch (sAfter) { case "Up": o_After = EnumGamepadkeyBit.Up; break; case "Right": o_After = EnumGamepadkeyBit.Right; break; case "Down": o_After = EnumGamepadkeyBit.Down; break; case "Left": o_After = EnumGamepadkeyBit.Left; break; case "A": o_After = EnumGamepadkeyBit.A; break; case "B": o_After = EnumGamepadkeyBit.B; break; case "X": o_After = EnumGamepadkeyBit.X; break; case "Y": o_After = EnumGamepadkeyBit.Y; break; case "L": o_After = EnumGamepadkeyBit.L; break; case "R": o_After = EnumGamepadkeyBit.R; break; case "Select": o_After = EnumGamepadkeyBit.Select; break; case "Start": o_After = EnumGamepadkeyBit.Start; break; default: o_After = EnumGamepadkeyBit.Up; break; } gc.KeyCnf.KeyconfigArray[(int)o_Before] = o_After; } } } // // pg_Method.EndMethod(log_Reports_ThisMethod); log_Reports_ThisMethod.EndLogging(pg_Method); }
//──────────────────────────────────────── protected override Configurationtree_Node CreateMyself( XmlElement cur_X, Configurationtree_Node parent_Cf, MemoryApplication memoryApplication, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(1); log_Method.BeginMethod(Info_XmlToConf.Name_Library, this, "CreateMyself", log_Reports); if (log_Method.CanDebug(1)) { } // // Configurationtree_Node cur_Cf = null; // // name属性は必須。 // string sName_Fnc = cur_X.GetAttribute(PmNames.S_NAME.Name_Attribute); if ("" == sName_Fnc) { goto gt_Error_UndefinedFncNameAttr; } // // if ( NamesFnc.S_CELL == sName_Fnc || //Sf:cell; NamesFnc.S_WHERE == sName_Fnc || //Sf:where; NamesFnc.S_REC_COND == sName_Fnc || //Sf:rec-cond; NamesFnc.S_VALUE_CONTROL == sName_Fnc || NamesFnc.S_CASE == sName_Fnc || //Sf:case;” NamesFnc.S_LISTBOX_LABELS == sName_Fnc || //Sf:list-box-labels; NamesFnc.S_SWITCH == sName_Fnc || //Sf:switch; NamesFnc.S_ITEM_LABEL2 == sName_Fnc || //Sf:item-label; NamesFnc.S_ITEM_VALUE == sName_Fnc || //Sf:item-value; NamesFnc.S_ITEM_GRAY_OUT == sName_Fnc || //Sf:item-gray-out; NamesFnc.S_TEXT_TEMPLATE == sName_Fnc || //Sf:text-template; NamesFnc.S_EMPTY_FIELD == sName_Fnc || NamesFnc.S_ALL_TRUE == sName_Fnc ) { cur_Cf = new Configurationtree_NodeImpl(NamesNode.S_FNC, parent_Cf); } else if (NamesNode.S_DATA == cur_X.Name) { // 【追加】 cur_Cf = new Configurationtree_NodeImpl(NamesNode.S_DATA, parent_Cf); } else if (NamesFnc.S_RECORD_SET_SAVE_TO2 == sName_Fnc) { // ノード名は fnc では。 cur_Cf = new Configurationtree_NodeImpl(NamesNode.S_A_RECORD_SET_SAVE_TO, parent_Cf); } else { // <fnc name=”Sa:入力値の確定;”> // などがここにくる。 cur_Cf = new Configurationtree_NodeImpl(NamesNode.S_FNC, parent_Cf); } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_UndefinedFncNameAttr: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー412!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("<fnc>要素に、name属性が指定されていませんでした。"); s.Newline(); s.Newline(); // ヒント s.Append(r.Message_Configuration(parent_Cf)); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); return(cur_Cf); }
//──────────────────────────────────────── /// <summary> /// O_TableImpl#AddRecordListで使います。 /// </summary> /// <param name="columnIndex"></param> /// <param name="value"></param> /// <param name="oTable"></param> /// <param name="log_Reports"></param> /// <returns></returns> public static Value_Humaninput ConfigurationTo_Field( int index_Column, string value, RecordFielddefinition recordFielddefinition, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(); log_Method.BeginMethod(Info_Table.Name_Library, "Utility_Row", "ConfigurationTo_Field", log_Reports); // // // セルのソースヒント名 string nodeConfigtree; try { nodeConfigtree = recordFielddefinition.ValueAt(index_Column).Name_Humaninput; } catch (ArgumentOutOfRangeException) { // エラー goto gt_Error_Index; } Value_Humaninput result; // 型毎に処理を分けます。 switch (recordFielddefinition.ValueAt(index_Column).Type_Field) { case EnumTypeFielddefinition.Int: { // 空白データも自動処理 Int_HumaninputImpl cellData = new Int_HumaninputImpl(nodeConfigtree); cellData.Text = value; result = cellData; } break; case EnumTypeFielddefinition.Bool: { // 空白データも自動処理 Bool_HumaninputImpl cellData = new Bool_HumaninputImpl(nodeConfigtree); cellData.Text = value; result = cellData; } break; default: { String_HumaninputImpl cellData = new String_HumaninputImpl(nodeConfigtree); cellData.Text = value; result = cellData; } break; } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_Index: result = null; if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー461!", log_Method); Log_TextIndented t = new Log_TextIndentedImpl(); t.Append("列インデックス[" + index_Column + "](0スタート)が指定されましたが、"); t.Newline(); t.Append("列は[" + recordFielddefinition.Count + "]個しかありません。(列定義リストは、絞りこまれている場合もあります)"); t.Newline(); // ヒント r.Message = t.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); return(result); }
//──────────────────────────────────────── protected override void Test_ChildNodes( XmlElement cur_X, Configurationtree_Node cur_Cf, Log_Reports log_Reports) { // // // //()メソッド開始 // // // Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_XmlToConf.Name_Library, this, "Test_ChildNodes", log_Reports); // // name属性は必須。 // string sName_Fnc = cur_X.GetAttribute(PmNames.S_NAME.Name_Attribute); if ("" == sName_Fnc) { goto gt_Error_UndefinedFncNameAttr; } // // // // 「Sf:cell;」では、子要素<fnc name=”Sf:where;”>が必須。 // // // int nAwhrCount = 0;//where要素の数。 { if (NamesFnc.S_CELL == sName_Fnc) { cur_Cf.List_Child.ForEach(delegate(Configurationtree_Node s_Child, ref bool bBreak) { string sName_Attr; bool bHit = s_Child.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Attr, false, log_Reports); if (bHit) { if (NamesFnc.S_WHERE == sName_Attr) { nAwhrCount++; } } }); if (0 == nAwhrCount) { goto gt_Error_ZeroAwhr; } else if (1 < nAwhrCount) { goto gt_Error_SomeAwhr; } } } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_UndefinedFncNameAttr: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー411!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("<fnc>要素に、name属性が指定されていませんでした。"); s.Newline(); s.Newline(); // ヒント s.Append(r.Message_Configuration(cur_Cf)); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_ZeroAwhr: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー377!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("func系要素の下に、<a-where>要素がありませんでした。"); // ヒント s.Append(r.Message_Configuration(cur_Cf)); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_SomeAwhr: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー319!", log_Method); StringBuilder s = new StringBuilder(); s.Append("<a-where>要素が["); s.Append(nAwhrCount); s.Append("]つありました。<a-where>要素は、<f-cell>要素の中に1つまでしか書いてはいけません。"); // ヒント s.Append(r.Message_Configuration(cur_Cf)); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── protected void Execute6_Sub( object sender, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_Functions.Name_Library, this, "Execute6_Sub", log_Reports); string sFncName0; this.TrySelectAttribute(out sFncName0, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports); if (log_Reports.CanStopwatch) { log_Method.Log_Stopwatch.Message = "Nアクション[" + sFncName0 + "]実行"; log_Method.Log_Stopwatch.Begin(); } // // if (log_Reports.Successful) { // 正常時 if (sender is Customcontrol) { Customcontrol fcCc = (Customcontrol)sender; string sName_Usercontrol = fcCc.ControlCommon.Expression_Name_Control.Execute4_OnExpressionString( EnumHitcount.Unconstraint, log_Reports ); log_Reports.Comment_EventCreationMe += "/追記:[" + sName_Usercontrol + "]コントロールが、[" + sFncName0 + "]アクションを実行。"; } else { log_Reports.Comment_EventCreationMe += "/追記:[" + sFncName0 + "]アクションを実行。"; } } else { } // // // // リストボックス // // // UsercontrolListbox uctLst; if (log_Reports.Successful) { Expression_Node_String ec_ArgFcName; this.TrySelectAttribute(out ec_ArgFcName, Expression_Node_Function33Impl.PM_NAME_CONTROL, EnumHitcount.One_Or_Zero, log_Reports); List <Usercontrol> list_FcUc = this.Owner_MemoryApplication.MemoryForms.GetUsercontrolsByName( ec_ArgFcName, true, log_Reports ); if (0 < list_FcUc.Count) { Usercontrol uct = list_FcUc[0]; if (uct is UsercontrolListbox) { uctLst = (UsercontrolListbox)uct; } else { uctLst = null; } } else { uctLst = null; } } else { uctLst = null; } // // // // 項目選択の要求。 // // // if (log_Reports.Successful) { Expression_Node_String ec_ArgExpectedValue; this.TrySelectAttribute(out ec_ArgExpectedValue, Expression_Node_Function33Impl.PM_VALUE_EXPECTED, EnumHitcount.One_Or_Zero, log_Reports); Expression_Node_String ec_ArgKeyFieldName; this.TrySelectAttribute(out ec_ArgKeyFieldName, Expression_Node_Function33Impl.PM_NAME_FIELD_KEY, EnumHitcount.One_Or_Zero, log_Reports); Expression_Node_String ec_ArgEmptyToAltValue; this.TrySelectAttribute(out ec_ArgEmptyToAltValue, Expression_Node_Function33Impl.PM_VALUE_EMPTY, EnumHitcount.One_Or_Zero, log_Reports); if ("" == ec_ArgExpectedValue.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports)) { // // 空文字列が指定されたときの代替値で検索。(初期値は空文字列)。 // uctLst.SelectItem( ec_ArgKeyFieldName, ec_ArgEmptyToAltValue, log_Reports ); } else { uctLst.SelectItem( ec_ArgKeyFieldName, ec_ArgExpectedValue, log_Reports ); } // // 一致項目がなければ、選択は解除されている。 // if (-1 == uctLst.SelectedIndex) { // #警告 log_Method.WriteWarning_ToConsole("選択されてない。。。"); Expression_Node_String ec_ArgExpectedValue2; this.TrySelectAttribute(out ec_ArgExpectedValue2, Expression_Node_Function33Impl.PM_VALUE_EXPECTED2, EnumHitcount.One_Or_Zero, log_Reports); // // デフォルト値の設定があるかどうか。 // if ("" != ec_ArgExpectedValue2.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports)) { if ("" == ec_ArgExpectedValue2.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports)) { // // 空文字列が指定されたときの代替値で検索。(初期値は空文字列)。 // uctLst.SelectItem( ec_ArgKeyFieldName, ec_ArgEmptyToAltValue, log_Reports ); } else { uctLst.SelectItem( ec_ArgKeyFieldName, ec_ArgExpectedValue2, log_Reports ); } } } } log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── /// <summary> /// 親要素に、この要素を追加。 /// </summary> protected override void LinkToParent( Configurationtree_Node cur_Cf, Configurationtree_Node parent_Cf, MemoryApplication memoryApplication, Log_Reports log_Reports) { Log_Method log_Method = new Log_MethodImpl(0); log_Method.BeginMethod(Info_XmlToConf.Name_Library, this, "LinkToParent", log_Reports); // // name属性は必須。 // string sName_Fnc; cur_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Fnc, true, log_Reports); if (!log_Reports.Successful) { goto gt_EndMethod; //goto gt_Error_UndefinedFncNameAttr; } string parent_SName_Fnc; { // // ※注意 <data >も、<fnc >扱い。name属性を持っていない。 // bool bRequired = false; parent_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out parent_SName_Fnc, bRequired, log_Reports); if (!log_Reports.Successful) { goto gt_EndMethod; //goto gt_Error_UndefinedFncNameAttr; } } if (NamesFnc.S_WHERE == sName_Fnc) { // // // // 親へ連結。 // // // parent_Cf.List_Child.Add( cur_Cf, log_Reports ); // デバッグ出力 if (log_Method.CanDebug(1)) { Log_TextIndented s = new Log_TextIndentedImpl(); parent_Cf.ToText_Locationbreadcrumbs(s); //log_Method.WriteDebug_ToConsole( "<fnc name=”[" + sFncName + "]”>要素 親要素「S■[" + s_Parent.Name_Node + "]」の子リストに、自分を追加。 子要素の数は[" + s_Cur.CountChildNodes + "]でした。"); log_Method.WriteDebug_ToConsole("<fnc name=”[" + sName_Fnc + "]”>要素 親要素「S■[" + parent_Cf.Name + "]」の『属性[" + cur_Cf.Name + "]』に、自分「S■[" + cur_Cf.Name + "]」を追加。 子要素の数は[" + cur_Cf.List_Child.Count + "]でした。 Place=[" + s.ToString() + "]"); } } else if (NamesFnc.S_CASE == sName_Fnc) { // // 親要素は Sf:switch; である必要があります。 // if (NamesFnc.S_SWITCH != parent_SName_Fnc) { if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー308!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("Sf:case;系要素の親は f-switch を期待します。"); s.Newline(); s.Newline(); s.Append("親ノード名=["); s.Append(parent_Cf.Name); s.Append("]"); s.Newline(); s.Newline(); // ヒント s.Append(r.Message_Configuration(parent_Cf)); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; } // 要素の(OAelemListではなく)OAcaseListに、この Sf:case; 要素を追加。 // // // // 親へ連結。 // // // parent_Cf.List_Child.Add( cur_Cf, log_Reports ); } else if ( NamesFnc.S_ITEM_LABEL2 == sName_Fnc ) { // // // // 親へ連結。 // // // parent_Cf.List_Child.Add( cur_Cf, log_Reports ); } else if ( NamesFnc.S_ITEM_VALUE == sName_Fnc ) { // // // // 親へ連結。 // // // parent_Cf.List_Child.Add( cur_Cf, log_Reports ); } else if ( NamesFnc.S_ITEM_GRAY_OUT == sName_Fnc ) { // // // // 親へ連結。 // // // parent_Cf.List_Child.Add( cur_Cf, log_Reports ); } else if ( NamesFnc.S_RECORD_SET_SAVE_TO2 == sName_Fnc ) { // // 暫定で、親要素は<f-all-true>である必要があります。 // if (NamesFnc.S_ALL_TRUE != parent_SName_Fnc) { if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー404!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("<a-empty-field>系要素の親は <f-all-true> であることを期待します。"); s.Newline(); s.Newline(); s.Append("oFnode.NodeName=["); s.Append(parent_Cf.Name); s.Append("]"); s.Newline(); s.Newline(); // ヒント s.Append(r.Message_Configuration(parent_Cf)); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; } if (!(NamesFnc.S_ALL_TRUE == parent_SName_Fnc)) { if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー403!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("内部プログラムのミス。"); s.Newline(); s.Append("<a-empty-field>系要素の親が、OFAllTrueImplクラスでありませんでした。"); s.Newline(); s.Newline(); s.Append("oFnode.NodeName=["); s.Append(parent_Cf.Name); s.Append("]"); s.Newline(); s.Newline(); s.Append("oFnode.GetType().Name=["); s.Append(parent_Cf.GetType().Name); s.Append("]"); s.Newline(); s.Newline(); // ヒント s.Append(r.Message_Configuration(parent_Cf)); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; } // 親要素の(OAelemListではなく)OArecordSetSaveToListに、この<fnc name=”Sf:a-record-set-save-to;”>要素を追加。 // // // // 親へ連結。 // // // parent_Cf.List_Child.Add( cur_Cf, log_Reports ); } else if ( NamesFnc.S_EMPTY_FIELD == sName_Fnc ) { // // 親要素は<f-all-true>である必要があります。 // if (NamesFnc.S_ALL_TRUE != parent_SName_Fnc) { if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー405!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("<a-empty-field>系要素の親は <f-all-true> であることを期待します。"); s.Newline(); s.Newline(); s.Append("oFnode.NodeName=["); s.Append(parent_Cf.Name); s.Append("]"); s.Newline(); s.Newline(); // ヒント s.Append(r.Message_Configuration(parent_Cf)); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; } if (!(NamesFnc.S_ALL_TRUE == parent_SName_Fnc)) { if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー406!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("内部プログラムのミス。"); s.Newline(); s.Append("<a-empty-field>系要素の親が、OFAllTrueImplクラスでありませんでした。"); s.Newline(); s.Newline(); s.Append("oFnode.NodeName=["); s.Append(parent_Cf.Name); s.Append("]"); s.Newline(); s.Newline(); s.Append("oFnode.GetType().Name=["); s.Append(parent_Cf.GetType().Name); s.Append("]"); s.Newline(); s.Newline(); // ヒント s.Append(r.Message_Configuration(parent_Cf)); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; } // // <f-all-true> // // 親要素の(OAelemListではなく)OAemptyFldListに、この<a-empty-field>要素を追加。 // // // // 親へ連結。 // // // parent_Cf.List_Child.Add( cur_Cf, log_Reports ); } else { // 親要素「S■??」に、この「S■fnc」要素を追加。 // 同名要素が複数個並ぶので、属性ではなく子要素として追加する。 // // // // 親へ連結。 // // // parent_Cf.List_Child.Add( cur_Cf, log_Reports ); if (log_Method.CanDebug(1)) { log_Method.WriteDebug_ToConsole("<fnc name=”[" + sName_Fnc + "]”>要素 親要素「S■[" + parent_Cf.Name + "]」の子リストに、自分を追加。 子要素の数は[" + cur_Cf.List_Child.Count + "]でした。"); } } goto gt_EndMethod; // // gt_EndMethod: log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── public override void Translate( Configurationtree_Node cur_Cf, Expression_Node_String parent_Ec, MemoryApplication memoryApplication, Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog, Log_Reports log_Reports ) { // throw new Exception(Info_SToE.LibraryName + ":" + this.GetType().Name + "#SToE: このメソッドは廃止方針です。"); Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports); if (log_Method.CanDebug(1)) { pg_ParsingLog.Increment("(18)" + cur_Cf.Name); } // // // // // // // // 自 // // // Expression_Node_String ec_Value; { ec_Value = new Expression_Node_StringImpl(parent_Ec, cur_Cf); ec_Value.AppendTextNode( cur_Cf.Name, cur_Cf, log_Reports ); } // // // // 自 // // // Expression_Node_StringImpl ec_Ap1p = new Expression_Node_StringImpl(parent_Ec, cur_Cf); ec_Ap1p.SetAttribute( PmNames.S_NAME.Name_Pm, ec_Value, log_Reports ); StringBuilder sb = new StringBuilder(); sb.Append("p"); sb.Append(this.NP1p); sb.Append("p"); // // // // 属性 // // // parent_Ec.SetAttribute( sb.ToString(), ((Expression_Node_String)ec_Ap1p), log_Reports ); // // 子要素 // this.ParseChild_InConfigurationtreeToExpression( cur_Cf, ec_Ap1p, memoryApplication, pg_ParsingLog, log_Reports ); goto gt_EndMethod; // // // // gt_EndMethod: if (Log_ReportsImpl.BDebugmode_Static) { pg_ParsingLog.Decrement(cur_Cf.Name); } log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── public void Translate( Configurationtree_Node cur_Conf,//Sv_3FListboxValidation UsercontrolListbox uctLst, MemoryApplication memoryApplication, Log_TextIndented_ConfigurationtreeToExpression pg_ParsingLog, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_ConfigurationtreeToExpression.Name_Library, this, "SToE", log_Reports); if (log_Method.CanDebug(1)) { pg_ParsingLog.Increment("(34)" + cur_Conf.Name); } // // // バリデーター設定要素 Configurationtree_Node cf_ValidatorConfig; { List <Configurationtree_Node> cfList_ValidatorConfig = uctLst.ControlCommon.Configurationtree_Control.GetChildrenByNodename(NamesNode.S_CODEFILE_VALIDATORS, false, log_Reports); if (1 < cfList_ValidatorConfig.Count) { throw new Exception("バリデーター設定要素が2つ以上ありました。"); } else if (0 < cfList_ValidatorConfig.Count) { cf_ValidatorConfig = cfList_ValidatorConfig[0]; } else { cf_ValidatorConfig = null; } } // // // // 自 // // // Expressionv_3FListboxValidationImpl cur_Exprv = new Expressionv_3FListboxValidationImpl(null, cf_ValidatorConfig, memoryApplication); // // // // 子 // // // List <Configurationtree_Node> cfList_Fnc = cur_Conf.GetChildrenByNodename(NamesNode.S_FNC, false, log_Reports); // #デバッグ中 //d_InMethod.WriteDebug_ToConsole(1, " <a-display>数=[" + sv_Cur.Sv_ADisplayList.Count + "]"); //d_InMethod.WriteDebug_ToConsole(1, " <fnc name=”a-record-set-save-to”>数=[" + sv_Cur.Sv_ASelectRecordList.Count + "]"); foreach (Configurationtree_Node child_Cf in cfList_Fnc) { string sName_Fnc; child_Cf.Dictionary_Attribute.TryGetValue(PmNames.S_NAME, out sName_Fnc, true, log_Reports); if (NamesFnc.S_VLD_SELECT_RECORD == sName_Fnc) { ConfigurationtreeToExpression_V53_ASelectRecordImpl_ to = new ConfigurationtreeToExpression_V53_ASelectRecordImpl_(); to.Translate( child_Cf, cur_Exprv, memoryApplication, pg_ParsingLog, log_Reports ); } else if (NamesFnc.S_VLD_DISPLAY == sName_Fnc) { // <a-display>要素 ConfigurationtreeToExpression_V53_ADisplayImpl_ to = new ConfigurationtreeToExpression_V53_ADisplayImpl_(); to.Translate( child_Cf, cur_Exprv, uctLst, memoryApplication, pg_ParsingLog, log_Reports ); } else { log_Method.WriteError_ToConsole("未実装です。"); throw new Exception("未実装です。"); } } goto gt_EndMethod; // // // // gt_EndMethod: if (Log_ReportsImpl.BDebugmode_Static) { pg_ParsingLog.Decrement(cur_Conf.Name); } log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── static public bool TryParse( object data, out bool isValue_Out, EnumOperationIfErrorvalue enumCellDataErrorSupport, object altValue, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0); log_Method.BeginMethod(Info_Table.Name_Library, "XenonValue_BoolImpl", "TryParse", log_Reports); bool bResult; BoolCellImpl err_BoolCellData; if (data is Boolean) { isValue_Out = (bool)data; bResult = true; } else if (data is BoolCellImpl) { BoolCellImpl boolCellData = (BoolCellImpl)data; if (boolCellData.IsSpaces()) { // 空白の場合 if (EnumOperationIfErrorvalue.Spaces_To_Alt_Value == enumCellDataErrorSupport) { if (altValue is bool) { isValue_Out = (bool)altValue; bResult = true; } else { // エラー isValue_Out = false;//ゴミ値 bResult = false; err_BoolCellData = boolCellData; goto gt_Error_AnotherType; } } else { // エラー isValue_Out = false;//ゴミ値 bResult = false; err_BoolCellData = boolCellData; goto gt_Error_EmptyString; } } else if (!boolCellData.isValidated) { // エラー(変換に失敗した場合) isValue_Out = false;//ゴミ値 bResult = false; err_BoolCellData = boolCellData; goto gt_Error_Invalid; } else { isValue_Out = boolCellData.GetBool(); bResult = true; } } else if (null == data) { // エラー isValue_Out = false;//ゴミ値 bResult = false; goto gt_Error_Null; } else if (!(data is Cell)) { // エラー isValue_Out = false;//ゴミ値 bResult = false; goto gt_Error_AnotherTypeData; } else { // エラー isValue_Out = false;//ゴミ値 bResult = false; goto gt_Error_Class; } // 正常 goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_AnotherType: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー543!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append(" altValue引数には、bool型の値を指定してください。"); s.Append(Environment.NewLine); s.Append(" boolセル値=["); s.Append(err_BoolCellData.Text); s.Append("]"); s.Append(Environment.NewLine); s.Append(Environment.NewLine); s.Append(" 問題箇所ヒント:"); err_BoolCellData.ToText_Locationbreadcrumbs(s); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_EmptyString: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー531!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append(" セルに、bool型の値を入れてください。空欄にしないでください。"); s.Append(Environment.NewLine); s.Append(Environment.NewLine); s.Append(" boolセル値=["); s.Append(err_BoolCellData.Text); s.Append("]"); // // ヒント err_BoolCellData.ToText_Locationbreadcrumbs(s); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_Invalid: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー112!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append(" bool型に変換できませんでした。["); s.Append(err_BoolCellData.Text); s.Append("]"); // // ヒント err_BoolCellData.ToText_Locationbreadcrumbs(s); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_Null: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー231!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append(" 指定の引数dataに、BoolCellData型の値を指定してください。空っぽでした。"); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_AnotherTypeData: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー332!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append(" bool型のデータを入れるところで、"); s.Append(Environment.NewLine); s.Append(" 別の型[" + data.GetType().Name + "]でした。"); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_Class: if (log_Reports.CanCreateReport) { Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error); r.SetTitle("▲エラー233!", log_Method); Log_TextIndented s = new Log_TextIndentedImpl(); s.Append("指定の引数の値["); s.Append(((Cell)data).Text); s.Append("]は、BoolCellData型ではありませんでした。"); s.Append(Environment.NewLine); s.Append(Environment.NewLine); s.Append(" 型=["); s.Append(data.GetType().Name); s.Append("]"); s.Append(Environment.NewLine); s.Append(Environment.NewLine); r.Message = s.ToString(); log_Reports.EndCreateReport(); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); return(bResult); }
//──────────────────────────────────────── /// <summary> /// レイアウト_レコードを元に、コントロールのスタイルを設定します。 /// </summary> /// <param nFcName="fo_Record"></param> /// <param nFcName="log_Reports"></param> public void SetupStyle( RecordUserformconfig fo_Record, Log_Reports log_Reports ) { Log_Method pg_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); pg_Method.BeginMethod(Info_Controls.Name_Library, this, "SetupStyle", log_Reports); // // // 自動入力ここから this.ControlCommon.BAutomaticinputting = true; // リストボックスの Text プロパティーは無視。 bool bEnabled; fo_Record.TryGetBool(out bEnabled, NamesFld.S_ENABLED, this.ControlCommon.Owner_MemoryApplication, log_Reports); this.UsercontrolEnabled = bEnabled; bool bVisible; fo_Record.TryGetBool(out bVisible, NamesFld.S_VISIBLE, this.ControlCommon.Owner_MemoryApplication, log_Reports); this.UsercontrolVisible = bVisible; // 【特殊】チェックボックスの値の型 string sChkValueType; { fo_Record.TryGetString(out sChkValueType, NamesFld.S_CHK_VALUE_TYPE, false, "", this.ControlCommon.Owner_MemoryApplication, log_Reports); this.sUsercontrolChkvaluetype = sChkValueType.Trim(); if (ValuesAttr.S_EMPTY == this.sUsercontrolChkvaluetype) { this.EnumCheckboxValuetype = EnumCheckboxValuetype.Bool; } else if (ValuesAttr.S_ZERO_ONE == this.sUsercontrolChkvaluetype) { this.EnumCheckboxValuetype = EnumCheckboxValuetype.Zero_One; } else if (ValuesAttr.S_BOOL == this.sUsercontrolChkvaluetype) { this.EnumCheckboxValuetype = EnumCheckboxValuetype.Bool; } else { //エラー goto gt_Error_NotSupportedValue; } } // フォントの設定 { // フォント・サイズの設定 float nFontSizePt = Utility_Usercontrol.ParseFontSize(fo_Record, this.ControlCommon.Owner_MemoryApplication, log_Reports); this.Font = new System.Drawing.Font("MS UI Gothic", nFontSizePt, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128))); } // タブ・インデックス int nTabIndex; fo_Record.TryGetInt(out nTabIndex, NamesFld.S_TAB_INDEX, false, -1, this.ControlCommon.Owner_MemoryApplication, log_Reports); if (nTabIndex < 0) { // 未指定の場合は変更しません。 } else { this.UsercontrolTabindex = nTabIndex; } int nAbsXLt; fo_Record.TryGetInt(out nAbsXLt, NamesFld.S_X_LT, false, -1, this.ControlCommon.Owner_MemoryApplication, log_Reports); int nAbsYLt; fo_Record.TryGetInt(out nAbsYLt, NamesFld.S_Y_LT, false, -1, this.ControlCommon.Owner_MemoryApplication, log_Reports); this.Location = new System.Drawing.Point(nAbsXLt, nAbsYLt); int nWidth; fo_Record.TryGetInt(out nWidth, NamesFld.S_WIDTH, false, 1, this.ControlCommon.Owner_MemoryApplication, log_Reports); int nHeight; fo_Record.TryGetInt(out nHeight, NamesFld.S_HEIGHT, false, 1, this.ControlCommon.Owner_MemoryApplication, log_Reports); this.Size = new System.Drawing.Size(nWidth, nHeight); // 背景色の設定 string sBackColor; fo_Record.TryGetString(out sBackColor, NamesFld.S_BACK_COLOR, false, "", this.ControlCommon.Owner_MemoryApplication, log_Reports); this.UsercontrolBackcolor = sBackColor; // コントロールは不可視にする。 this.customcontrolCheckbox1.Visible = false; this.ControlCommon.BAutomaticinputting = false; // 自動入力ここまで goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_NotSupportedValue: { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, this.ControlCommon.Expression_Name_Control.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports), log_Reports); //コントロール名 tmpl.SetParameter(2, sChkValueType, log_Reports); //CHK_VALUE_TYPEフィールド値 tmpl.SetParameter(3, Log_RecordReportsImpl.ToText_Configuration(fo_Record.Parent_TableUserformconfig.Cur_Configurationtree), log_Reports); //設定位置パンくずリスト this.ControlCommon.Owner_MemoryApplication.CreateErrorReport("Er:519;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: pg_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── /// <summary> /// 変数を設定します。 /// </summary> protected void Execute6_Sub( object sender, Log_Reports log_Reports ) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); log_Method.BeginMethod(Info_Functions.Name_Library, this, "Execute6_Sub", log_Reports); string sFlowSkip; this.TrySelectAttribute(out sFlowSkip, Expression_Node_Function34Impl.PM_FLOWSKIP, EnumHitcount.One_Or_Zero, log_Reports); if ("" != sFlowSkip.Trim()) { // 処理をスキップします。 goto gt_EndMethod; } string sFncName0; this.TrySelectAttribute(out sFncName0, PmNames.S_NAME.Name_Pm, EnumHitcount.One_Or_Zero, log_Reports); if (log_Reports.CanStopwatch) { log_Method.Log_Stopwatch.Message = "Nアクション[" + sFncName0 + "]実行"; log_Method.Log_Stopwatch.Begin(); } // // if (log_Reports.Successful) { // 正常時 if (sender is Customcontrol) { Customcontrol fcCc = (Customcontrol)sender; string sName_Usercontrol = fcCc.ControlCommon.Expression_Name_Control.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports); log_Reports.Comment_EventCreationMe += "/追加:[" + sName_Usercontrol + "]コントロールが、[" + sFncName0 + "]アクションを実行。"; } else { log_Reports.Comment_EventCreationMe += "/追加:[" + sFncName0 + "]アクションを実行。"; } } else { } Expression_Node_String ec_ArgVarName; this.TrySelectAttribute(out ec_ArgVarName, Expression_Node_Function34Impl.PM_NAME_VAR, EnumHitcount.One_Or_Zero, log_Reports); if (null == ec_ArgVarName) { goto gt_Error_NullArgVarName; } Expression_Node_String ec_ArgValue; this.TrySelectAttribute(out ec_ArgValue, Expression_Node_Function34Impl.PM_VALUE, EnumHitcount.One_Or_Zero, log_Reports); if (null == ec_ArgValue) { goto gt_Error_NullArgValue; } if (log_Reports.Successful) { // 正常時 this.Owner_MemoryApplication.MemoryVariables.SetVariable( new XenonNameImpl( ec_ArgVarName.Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports), ec_ArgVarName.Cur_Configuration ), ec_ArgValue, true, log_Reports ); } goto gt_EndMethod; // // #region 異常系 //──────────────────────────────────────── gt_Error_NullArgVarName: { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, Log_RecordReportsImpl.ToText_Configuration(this.Cur_Configuration), log_Reports);//設定位置パンくずリスト this.Owner_MemoryApplication.CreateErrorReport("Er:110017;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── gt_Error_NullArgValue: { Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(); tmpl.SetParameter(1, Log_RecordReportsImpl.ToText_Configuration(this.Cur_Configuration), log_Reports);//設定位置パンくずリスト this.Owner_MemoryApplication.CreateErrorReport("Er:110018;", tmpl, log_Reports); } goto gt_EndMethod; //──────────────────────────────────────── #endregion // // gt_EndMethod: log_Method.EndMethod(log_Reports); }
//──────────────────────────────────────── private void Usercontrol_Canvas_DragDrop(object sender, DragEventArgs e) { Log_Method log_Method = new Log_MethodImpl(); Log_Reports log_Reports = new Log_ReportsImpl(log_Method); log_Method.BeginMethod(Info_SpeedCoder.Name_Library, this, "Usercontrol_Canvas_DragDrop", log_Reports); Point locationMouse = this.PointToClient(new Point(e.X, e.Y)); bool isDropped = false; if (e.Data.GetDataPresent(DataFormats.FileDrop)) { // ファイルドロップ TextdropareaImpl droppedArea = null; string[] fileNames = (string[])e.Data.GetData(DataFormats.FileDrop, false); if (this.Textdroparea1.Bounds.Contains(locationMouse.X, locationMouse.Y)) { droppedArea = this.Textdroparea1; } if (this.Textdroparea2.Bounds.Contains(locationMouse.X, locationMouse.Y)) { droppedArea = this.Textdroparea2; } if (null != droppedArea) { droppedArea.IsDropped = true; droppedArea.Clear(); //log_Method.WriteDebug_ToConsole("ファイルをドロップした。 fileNames.length=[" + fileNames.Length + "]"); foreach (string fileName in fileNames) { droppedArea.ListFilepath.Add(fileName); //log_Method.WriteDebug_ToConsole("fileName=[" + fileName + "]"); } isDropped = true; } else { //log_Method.WriteDebug_ToConsole("ファイルをドロップしたが、枠には入っていない。 fileNames.length=[" + fileNames.Length + "]"); } } else if (e.Data.GetDataPresent(DataFormats.StringFormat)) { // 文字列として読み取れる形式のデータがドロップされた場合、 // テキストボックスに、その文字列データを表示します。 string droppedText = (string)e.Data.GetData(typeof(string)); TextdropareaImpl droppedArea = null; if (this.Textdroparea1.Bounds.Contains(locationMouse.X, locationMouse.Y)) { droppedArea = this.Textdroparea1; } if (this.Textdroparea2.Bounds.Contains(locationMouse.X, locationMouse.Y)) { droppedArea = this.Textdroparea2; } if (null != droppedArea) { droppedArea.IsDropped = true; droppedArea.Clear(); droppedArea.DroppedText = droppedText; isDropped = true; } } else { //log_Method.WriteDebug_ToConsole("ファイル以外のものをドロップした。"); } if (isDropped) { //log_Method.WriteDebug_ToConsole("ドロップがあったとき。"); SpeedCodingImpl speedCoding = new SpeedCodingImpl(); bool isError; string result = speedCoding.Perform(out isError, this.Textdroparea1, this.Textdroparea2, log_Reports); this.textBox1.Text = result; if (isError) { this.textBox1.ForeColor = Color.Red; } else { this.textBox1.ForeColor = SystemColors.ControlText; } this.Refresh(); } //log_Method.WriteDebug_ToConsole("locationMouse.X=[" + locationMouse.X + "] .Y=[" + locationMouse.Y + "]"); //log_Method.WriteDebug_ToConsole("this.Textdroparea1.Bounds=[" + this.Textdroparea1.Bounds.X + "][" + this.Textdroparea1.Bounds.Y + "][" + this.Textdroparea1.Bounds.Width + "][" + this.Textdroparea1.Bounds.Height + "]"); //log_Method.WriteDebug_ToConsole("this.Textdroparea2.Bounds=[" + this.Textdroparea2.Bounds.X + "][" + this.Textdroparea2.Bounds.Y + "][" + this.Textdroparea2.Bounds.Width + "][" + this.Textdroparea2.Bounds.Height + "]"); log_Method.EndMethod(log_Reports); }