Example #1
0
        public ApplicationRibbonFormBase()
        {
            DevExpress.Data.Linq.CriteriaToEFExpressionConverter.EntityFunctionsType = typeof(System.Data.Entity.DbFunctions);
            DevExpress.Data.Linq.CriteriaToEFExpressionConverter.SqlFunctionsType    = typeof(System.Data.Entity.SqlServer.SqlFunctions);
            CriteriaOperator.RegisterCustomFunction(new xwcs.core.linq.LikeFunction());



            InitializeComponent();

            /*
             * Assembly locating
             */

            if (!DesignMode)
            {
                documentManager.View.DocumentProperties.UseFormIconAsDocumentImage = true;
                documentManager.View.UseDocumentSelector = DevExpress.Utils.DefaultBoolean.True;
                tabbedView.FloatingDocumentContainer     = FloatingDocumentContainer.DocumentsHost;

                // Security context must be call first time in main app and
                // must have providers set
                _user = SecurityContext.getInstance().CurrentUser;

                _proxy = SEventProxy.getInstance();
                _proxy.addEventHandler <AddToolBarRequestEvent>(EventType.AddToolBarRequestEvent, HandleAddToolbarRequestEvent);
                _proxy.addEventHandler <OpenPanelRequestEvent>(EventType.OpenPanelRequestEvent, HandleOpenPanelRequestEvent);
                _proxy.addEventHandler <VisualControlActionEvent>(EventType.VisualControlActionEvent, HandleVisualControlAction);
                _proxy.addEventHandler <ClosePanelRequestEvent>(EventType.ClosePanelRequestEvent, HandleClosePanelRequestEvent);

                // invocation target for events
                SEventProxy.InvokeDelegate = this;

                //do it here before any other plugin will be loaded!!!!!
                _widgetManager = SWidgetManager.getInstance();

                //now we can load plugins
                _loader = SPluginsLoader.getInstance();
                _loader.LoadPlugins(this, ".");

                controls.ViewBaseEventsHandler.AttachToView(documentManager.View);

                _managerSupport = new DocumentManagerSupport(documentManager,
                                                             new DevExpress.XtraBars.BarItem[] { barButtonItem_FileSave },
                                                             new DevExpress.XtraBars.BarItem[] { barButtonItem_FileSaveAll });
                ribbonControl.SelectedPage = ribbonPagePlugins;


                // some form function tweaks
                // AutoValidate = AutoValidate.EnableAllowFocusChange;
                this.FormClosing += ApplicationRibbonFormBase_FormClosing;
            }
        }
Example #2
0
        public ApplicationFormBase()
        {
            InitializeComponent();

            /*
             * Assembly locating
             */

            if (!DesignMode)
            {
                documentManager.View.DocumentProperties.UseFormIconAsDocumentImage = true;
                documentManager.View.UseDocumentSelector = DevExpress.Utils.DefaultBoolean.True;
                tabbedView.FloatingDocumentContainer     = FloatingDocumentContainer.DocumentsHost;

                // Security context must be call first time in main app and
                // must have providers set
                _user = SecurityContext.getInstance().CurrentUser;

                _proxy = SEventProxy.getInstance();
                _proxy.addEventHandler <AddToolBarRequestEvent>(EventType.AddToolBarRequestEvent, HandleAddToolbarRequestEvent);
                _proxy.addEventHandler <OpenPanelRequestEvent>(EventType.OpenPanelRequestEvent, HandleOpenPanelRequestEvent);

                //do it here before any other plugin will be loaded!!!!!
                _widgetManager = SWidgetManager.getInstance();

                //now we can load plugins
                _loader = SPluginsLoader.getInstance();
                _loader.LoadPlugins(this, ".");

                controls.ViewBaseEventsHandler.AttachToView(documentManager.View);

                _managerSupport = new DocumentManagerSupport(documentManager,
                                                             new DevExpress.XtraBars.BarItem[] { barButton_Save },
                                                             new DevExpress.XtraBars.BarItem[] { barButton_SaveAll });
            }
        }