コード例 #1
0
        /// <summary>
        /// Method for Select/If commands
        /// </summary>
        /// <param name="command">Enum for SelectIfCommands</param>
        private void DesignSelectIfCommand(SelectIfCommands command)
        {
            try
            {
                Rule_Context Context = this.mainForm.EpiInterpreter.Context;
                switch (command)
                {
                case SelectIfCommands.CancelSelect:
                    //Fix defect 225
                    if (Context.CurrentRead != null)
                    {
                        DesignAndProcessCommand(new CancelSelect(mainForm));
                    }
                    else
                    {
                        DisplayNoDataSourceMessage();
                    }
                    break;

                case SelectIfCommands.CancelSort:
                    DesignAndProcessCommand(new CancelSort(mainForm));
                    break;

                case SelectIfCommands.If:
                    //dpb DisplayFeatureNotImplementedMessage();
                    DesignAndProcessCommand(new IfDialog(mainForm));
                    break;

                case SelectIfCommands.Select:
                    if (Context.CurrentRead != null)
                    {
                        DesignAndProcessCommand(new SelectDialog(mainForm));
                    }
                    else
                    {
                        DisplayNoDataSourceMessage();
                    }
                    break;

                case SelectIfCommands.Sort:
                    if (Context.CurrentRead != null)
                    {
                        DesignAndProcessCommand(new SortDialog(mainForm));
                    }
                    else
                    {
                        DisplayNoDataSourceMessage();
                    }
                    break;

                default:
                    break;
                } //switch
            }     //try
            finally
            {
                //programEditor.SavePGM(Files.LastPgm);
            }//finally
        }
コード例 #2
0
ファイル: CommandBlock.cs プロジェクト: NALSS/epiinfo-82474
 /// <summary>
 /// Method for Select/If commands
 /// </summary>
 /// <param name="command">Enum for SelectIfCommands</param>
 private void DesignSelectIfCommand(SelectIfCommands command)
 {
     try
     {
         Rule_Context Context = this.mainForm.EpiInterpreter.Context;
         switch (command)
         {
             case SelectIfCommands.CancelSelect:
                 //Fix defect 225
                 if (Context.CurrentRead != null)
                 {
                     DesignAndProcessCommand(new CancelSelect(mainForm));
                 }
                 else
                 {
                     DisplayNoDataSourceMessage();
                 }
                 break;
             case SelectIfCommands.CancelSort:
                 DesignAndProcessCommand(new CancelSort(mainForm));
                 break;
             case SelectIfCommands.If:
                 //dpb DisplayFeatureNotImplementedMessage();
                 DesignAndProcessCommand(new IfDialog(mainForm));
                 break;
             case SelectIfCommands.Select:
                 if (Context.CurrentRead != null)
                 {
                     DesignAndProcessCommand(new SelectDialog(mainForm));
                 }
                 else
                 {
                     DisplayNoDataSourceMessage();
                 }
                 break;
             case SelectIfCommands.Sort:
                 if (Context.CurrentRead != null)
                 {
                     DesignAndProcessCommand(new SortDialog(mainForm));
                 }
                 else
                 {
                     DisplayNoDataSourceMessage();
                 }
                 break;
             default:
                 break;
         } //switch
     } //try
     finally
     {
         //programEditor.SavePGM(Files.LastPgm);
     }//finally
 }