예제 #1
0
        /*
         * string getCurrentApplicationAcceptKey()
         * {
         *
         *  FGLApplicationPanel fGLApplicationPanel = null;
         *  TabPage tp = tabControl1.SelectedTab;
         *  if (tp == null) { return "Escape"; }
         *
         *  foreach (Control c in tp.Controls)
         *  {
         *      if (c is FGLApplicationPanel)
         *      {
         *          fGLApplicationPanel = (FGLApplicationPanel)tp.Controls[0];
         *      }
         *  }
         *
         *
         *  if (fGLApplicationPanel != null)
         *  {
         *      return fGLApplicationPanel.getAcceptKey();
         *  }
         *
         *  return "Escape";
         * }
         */



        string getCurrentApplicationKey(string keyType, string defaultKey)
        {
            FGLApplicationPanel fGLApplicationPanel = null;
            TabPage             tp = tabControl1.SelectedTab;

            if (tp == null)
            {
                return(defaultKey);
            }

            foreach (Control c in tp.Controls)
            {
                if (c is FGLApplicationPanel)
                {
                    fGLApplicationPanel = (FGLApplicationPanel)tp.Controls[0];
                }
            }


            if (fGLApplicationPanel != null)
            {
                string rval =
                    fGLApplicationPanel.getApplicationKey(keyType);
                if (rval != "")
                {
                    return(rval);
                }
            }

            return(defaultKey);
        }