コード例 #1
0
ファイル: FileManager.cs プロジェクト: hshProject/FinalModule
        private static void menuItemClick(object sender, EventArgs e)
        {
            ToolStripMenuItem mi  = (ToolStripMenuItem)sender;
            string            str = mi.Name;
            int startIndex        = str.IndexOf('_');
            int lastIndex         = str.LastIndexOf('_');
            int lenth             = lastIndex - startIndex;

            str = str.Substring(startIndex + 1, lenth - 1);
            string name   = mi.Name;
            string progid = name.Substring(lastIndex);

            name.TrimStart('_');
            progid = progid.TrimStart('_');
            string    Criteria = " where ProgId=" + progid + "";
            DataTable dt       = getPrograms(Criteria);

            object[] Parameters = null;
            if (dt.Rows[0]["Parameters"] == null || dt.Rows[0]["Parameters"] == DBNull.Value)
            {
                FormsTasks.openForm(str, null);
            }
            else
            {
                // string[] TempPara = dt.Rows[0]["Parameters"].ToString().Split('_');
                //Parameters = TempPara;
                // string test = Parameters.GetValue(0).ToString();
                //   test = test.Remove(0, 5);
                // string[] test2 = test.Split('=');
                // Parameters = test2;
                Parameters = FormsTasks.PrepareParameters(dt.Rows[0]["Parameters"].ToString());
                FormsTasks.openForm(str, Parameters);
            }
        }
コード例 #2
0
ファイル: FormsTasks.cs プロジェクト: hshProject/FinalModule
 public static void openForm(string formName, object[] Parameters)
 {
     if (Parameters == null)
     {
         o = FormsTasks.createInstance(formName, null);
         (o as Form).Show();
         frm = (o as Form);
     }
     else
     {
         o = FormsTasks.createInstance(formName, Parameters);
         (o as Form).Show();
         frm = (o as Form);
     }
 }