コード例 #1
0
        /// <summary>
        /// same as we doing in the server see tsk_open.cpp RichClientIsValidWindowType
        /// </summary>
        /// <param name="task"></param>
        private ReturnResult CheckIsValidWindowType(Task task)
        {
            ReturnResult result = ReturnResult.SuccessfulResult;

            if (task.getForm() != null)
            {
                WindowType windowType        = task.getForm().ConcreteWindowType;
                bool       isValidWindowType = IsValidWindowType(windowType);

                // get the main program of the internal

                MGDataCollection mgDataTab   = MGDataCollection.Instance;
                Task             mainPrgTask = mgDataTab.GetMainProgByCtlIdx(0);

                if (isValidWindowType)
                {
                    // if we try to open FitToMdi || MdiChild , the main program should have open window
                    if (windowType == WindowType.FitToMdi || windowType == WindowType.MdiChild)
                    {
                        if (!(mainPrgTask != null && mainPrgTask.isOpenWin()))
                        {
                            result = new ReturnResult(MsgInterface.DN_ERR_MDI_FRAME_ISNOT_OPENED);
                        }
                    }
                }
                else
                {
                    result = new ReturnResult(MsgInterface.DITDEF_STR_ERR_WINDOW_TYPE);
                }
            }
            return(result);
        }
コード例 #2
0
        internal override void Execute()
        {
            com.magicsoftware.richclient.tasks.MGDataCollection mgDataTab = com.magicsoftware.richclient.tasks.MGDataCollection.Instance;
            Task task = (Task)mgDataTab.GetTaskByID(taskId);

            task.TaskTransactionManager.CreateAndExecuteRollbackLocalTransaction(rollbackType);
        }