Exemplo n.º 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;
            }
        }
Exemplo n.º 2
0
        private void showWidgets()
        {
            foreach (xwcs.core.controls.WidgetDescriptor wdsr in SWidgetManager.getInstance().Widgets)
            {
                if (wdsr.Visible)
                {
                    XtraUserControl controlNormal = SPluginsLoader.getInstance().getControlByGuid(wdsr.GuidNormalControl);
                    if (controlNormal != null)
                    {
                        Document document = widgetView1.AddDocument(controlNormal) as Document;

                        XtraUserControl controlMax = SPluginsLoader.getInstance().getControlByGuid(wdsr.GuidMaxControl);
                        if (controlMax != null)
                        {
                            document.MaximizedControl = controlMax;
                        }
                    }
                }
            }
        }
Exemplo n.º 3
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 });
            }
        }