Example #1
0
        private ScanNowDocumentForm LoadNewFileFromScanNow(String stringFileName)
        {
            this.SuspendLayout();

            ScanNowDocumentForm documentForm = new ScanNowDocumentForm();

            documentForm.m_ScanNowReportList = m_ScanNowReportList;

            //if ( documentForm.OpenSGLFile( stringFileName ) == false )
            //    return;

            documentForm.Text      = stringFileName;
            documentForm.MdiParent = this;
            //documentForm.SGLEditorForm = this;
            //documentForm.WindowState = FormWindowState.Normal;
            documentForm.Show();

            this.Text = "DemoSoft - " + documentForm.Text;

            axCommandBars.EnableOffice2007FrameHandle(documentForm.Handle.ToInt32());

            //documentForm.WindowState = FormWindowState.Maximized;

            this.ResumeLayout(false);
            this.Refresh();

            return(documentForm);
        }
        private void axCommandBars_Execute( object sender, AxXtremeCommandBars._DCommandBarsEvents_ExecuteEvent eventArgs )
        {
            switch ( eventArgs.control.Id )
            {
                case (int)XtremeCommandBars.XTPCommandBarsSpecialCommands.XTP_ID_RIBBONCUSTOMIZE:
                    axCommandBars.ShowCustomizeDialog( 3 );
                    break;
                case ResourceId.ID_FILE_CONFIG_POLICY:

                    m_PolicyForm.ShowDialog();

                    break;
                case ResourceId.ID_FILE_CONFIG_NEW_POLICY:

                    m_PolicyForm.NewPolicy();
                    m_PolicyForm.ShowDialog();

                    break;
                case ResourceId.ID_FILE_CONFIG_TASK:

                    m_TaskForm.ShowDialog();

                    break;
                case ResourceId.ID_FILE_CONFIG_NEW_TASK:

                    m_TaskForm.NewTask();
                    m_TaskForm.ShowDialog();

                    break;
                case ResourceId.ID_FILE_OPEN:
                case ResourceId.ID_FILE_OPEN_ALL:


                    break;
                case ResourceId.ID_FILE_OPEN_SCAN_POLICY:

                    if ( m_ScanNowDocumentForm == null )
                        m_ScanNowDocumentForm = LoadNewFileFromScanNow( "扫描中的报表" );
                    else if ( m_ScanNowDocumentForm.Visible == false )
                        m_ScanNowDocumentForm = LoadNewFileFromScanNow( "扫描中的报表" );
                    else
                        m_ScanNowDocumentForm.Activate();


                    break;
                case ResourceId.ID_FILE_CLOSE:
                case ResourceId.ID_FILE_CLOSE_ALL:

                    break;
                case ResourceId.ID_SHOW_STATUS:
                    axCommandBars.StatusBar.Visible = !axCommandBars.StatusBar.Visible;
                    break;
                case ResourceId.ID_SHOW_WORKSPACE:
                    eventArgs.control.Checked = !eventArgs.control.Checked;
                    axCommandBars.ShowTabWorkspace( eventArgs.control.Checked );
                    break;
                case ResourceId.ID_APP_HIDE:
                    this.Close();
                    break;
                default:

                    ControlCommandInfo outCommandInfo = null;
                    if ( m_ControlCommandInfoDictionary.TryGetValue( eventArgs.control.Id, out outCommandInfo ) == true )
                    {
                        if ( outCommandInfo.IsOpen == true )
                        {
                            if ( outCommandInfo.Form == null )
                            {
                                outCommandInfo.Form = LoadNewFile( outCommandInfo.Name );
                            }
                            else
                            {
                                if ( outCommandInfo.Form.Visible == true )
                                    outCommandInfo.Form.Activate();
                                else
                                {
                                    outCommandInfo.Form = LoadNewFile( outCommandInfo.Name );
                                }
                            }
                            outCommandInfo.Form.m_OpenCommandInfo = outCommandInfo;

                            ControlCommandInfo outCommandInfoClose = null;
                            if ( m_ControlCommandInfoDictionary.TryGetValue( outCommandInfo.CloseID, out outCommandInfoClose ) == true )
                            {
                                outCommandInfoClose.Form = outCommandInfo.Form;

                                outCommandInfoClose.IsShowOK = true;

                                outCommandInfoClose.Form.m_CloseCommandInfo = outCommandInfoClose;
                            }
                        }
                        else
                        {
                            if ( outCommandInfo.Form != null )
                            {
                                outCommandInfo.Form.Close();
                                outCommandInfo.Form = null;
                                outCommandInfo.IsShowOK = false;
                                outCommandInfo.Form.m_CloseCommandInfo = null;

                                ControlCommandInfo outBoolOpen = null;
                                if ( m_ControlCommandInfoDictionary.TryGetValue( outCommandInfo.OpenID, out outBoolOpen ) == true )
                                {
                                    outBoolOpen.Form = null;
                                    outBoolOpen.Form.m_OpenCommandInfo = null;
                                }
                            }
                            else
                            {
                            }
                        }
                    }

                    break;
            }
        }
        private ScanNowDocumentForm LoadNewFileFromScanNow( String stringFileName )
        {
            this.SuspendLayout();

            ScanNowDocumentForm documentForm = new ScanNowDocumentForm();
            documentForm.m_ScanNowReportList = m_ScanNowReportList;

            //if ( documentForm.OpenSGLFile( stringFileName ) == false )
            //    return;

            documentForm.Text = stringFileName;
            documentForm.MdiParent = this;
            //documentForm.SGLEditorForm = this;
            //documentForm.WindowState = FormWindowState.Normal;
            documentForm.Show();

            this.Text = "DemoSoft - " + documentForm.Text;

            axCommandBars.EnableOffice2007FrameHandle( documentForm.Handle.ToInt32() );

            //documentForm.WindowState = FormWindowState.Maximized;

            this.ResumeLayout( false );
            this.Refresh();

            return documentForm;
        }
Example #4
0
        private void axCommandBars_Execute(object sender, AxXtremeCommandBars._DCommandBarsEvents_ExecuteEvent eventArgs)
        {
            switch (eventArgs.control.Id)
            {
            case (int)XtremeCommandBars.XTPCommandBarsSpecialCommands.XTP_ID_RIBBONCUSTOMIZE:
                axCommandBars.ShowCustomizeDialog(3);
                break;

            case ResourceId.ID_FILE_CONFIG_POLICY:

                m_PolicyForm.ShowDialog();

                break;

            case ResourceId.ID_FILE_CONFIG_NEW_POLICY:

                m_PolicyForm.NewPolicy();
                m_PolicyForm.ShowDialog();

                break;

            case ResourceId.ID_FILE_CONFIG_TASK:

                m_TaskForm.ShowDialog();

                break;

            case ResourceId.ID_FILE_CONFIG_NEW_TASK:

                m_TaskForm.NewTask();
                m_TaskForm.ShowDialog();

                break;

            case ResourceId.ID_FILE_OPEN:
            case ResourceId.ID_FILE_OPEN_ALL:


                break;

            case ResourceId.ID_FILE_OPEN_SCAN_POLICY:

                if (m_ScanNowDocumentForm == null)
                {
                    m_ScanNowDocumentForm = LoadNewFileFromScanNow("扫描中的报表");
                }
                else if (m_ScanNowDocumentForm.Visible == false)
                {
                    m_ScanNowDocumentForm = LoadNewFileFromScanNow("扫描中的报表");
                }
                else
                {
                    m_ScanNowDocumentForm.Activate();
                }


                break;

            case ResourceId.ID_FILE_CLOSE:
            case ResourceId.ID_FILE_CLOSE_ALL:

                break;

            case ResourceId.ID_SHOW_STATUS:
                axCommandBars.StatusBar.Visible = !axCommandBars.StatusBar.Visible;
                break;

            case ResourceId.ID_SHOW_WORKSPACE:
                eventArgs.control.Checked = !eventArgs.control.Checked;
                axCommandBars.ShowTabWorkspace(eventArgs.control.Checked);
                break;

            case ResourceId.ID_APP_HIDE:
                this.Close();
                break;

            default:

                ControlCommandInfo outCommandInfo = null;
                if (m_ControlCommandInfoDictionary.TryGetValue(eventArgs.control.Id, out outCommandInfo) == true)
                {
                    if (outCommandInfo.IsOpen == true)
                    {
                        if (outCommandInfo.Form == null)
                        {
                            outCommandInfo.Form = LoadNewFile(outCommandInfo.Name);
                        }
                        else
                        {
                            if (outCommandInfo.Form.Visible == true)
                            {
                                outCommandInfo.Form.Activate();
                            }
                            else
                            {
                                outCommandInfo.Form = LoadNewFile(outCommandInfo.Name);
                            }
                        }
                        outCommandInfo.Form.m_OpenCommandInfo = outCommandInfo;

                        ControlCommandInfo outCommandInfoClose = null;
                        if (m_ControlCommandInfoDictionary.TryGetValue(outCommandInfo.CloseID, out outCommandInfoClose) == true)
                        {
                            outCommandInfoClose.Form = outCommandInfo.Form;

                            outCommandInfoClose.IsShowOK = true;

                            outCommandInfoClose.Form.m_CloseCommandInfo = outCommandInfoClose;
                        }
                    }
                    else
                    {
                        if (outCommandInfo.Form != null)
                        {
                            outCommandInfo.Form.Close();
                            outCommandInfo.Form     = null;
                            outCommandInfo.IsShowOK = false;
                            outCommandInfo.Form.m_CloseCommandInfo = null;

                            ControlCommandInfo outBoolOpen = null;
                            if (m_ControlCommandInfoDictionary.TryGetValue(outCommandInfo.OpenID, out outBoolOpen) == true)
                            {
                                outBoolOpen.Form = null;
                                outBoolOpen.Form.m_OpenCommandInfo = null;
                            }
                        }
                        else
                        {
                        }
                    }
                }

                break;
            }
        }