public override void OnShowDepartureMonitorOverview(object sender, EventArgs e)
        {
            DepartureMonitorOverviewViewParameters viewParameters = null;
            bool   openInNewWindow = false;
            string favoriteId      = string.Empty;

            if (e is MenuEventArgs)
            {
                openInNewWindow = ((MenuEventArgs)e).OpenInNewWindow;
                string parameters = ((MenuEventArgs)e).Parameters;
                favoriteId = ((MenuEventArgs)e).MenuItemId;

                if (!string.IsNullOrEmpty(parameters))
                {
                    viewParameters = new DepartureMonitorOverviewViewParameters();
                    HyperlinkHelper.MapQueryString(parameters, viewParameters);
                }
            }
            else if (e is MenuItemExecutedEventArgs)
            {
                openInNewWindow = ((MenuItemExecutedEventArgs)e).OpenInNewWindow;
                string parameters = ((MenuItemExecutedEventArgs)e).MenuItem.Parameters;
                favoriteId = ((MenuItemExecutedEventArgs)e).MenuItem.Id;

                if (!string.IsNullOrEmpty(parameters))
                {
                    viewParameters = new DepartureMonitorOverviewViewParameters();
                    HyperlinkHelper.MapQueryString(parameters, viewParameters);
                }
            }
            else if (e is DataEventArgs <DepartureMonitorOverviewViewParameters> )
            {
                viewParameters = ((DataEventArgs <DepartureMonitorOverviewViewParameters>)e).Data;
            }

            ControlledWorkItem <DepartureMonitorController> workItem = (from wi in WorkItem.WorkItems.FindByType <ControlledWorkItem <DepartureMonitorController> >()
                                                                        where wi.Items.Get <string>("ModuleId") == ShellInteractionService.ActiveModule.Id
                                                                        select wi).LastOrDefault();

            if (workItem == null || openInNewWindow)
            {
                workItem = WorkItem.WorkItems.AddNew <ControlledWorkItem <DepartureMonitorController> >();
                workItem.Items.Add(ShellInteractionService.ActiveModule.Id, "ModuleId");
                workItem.Controller.Run(viewParameters, favoriteId);
            }
            else
            {
                workItem.Controller.Activate(viewParameters, favoriteId);
            }
        }
Esempio n. 2
0
        public void Activate(DepartureMonitorOverviewViewParameters parameters, string favoriteId)
        {
            _favoriteId = favoriteId;

            if (departureMonitorOverviewView != null && !string.IsNullOrEmpty(_favoriteId))
            {
                UXSettingsService favoriteSettingsService = WorkItem.Items.AddNew <UXSettingsService>(_favoriteId);
                favoriteSettingsService.ContainerName = _favoriteId;
                favoriteSettingsService.AddProvider(departureMonitorOverviewView, new DepartureMonitorControllerSettingsProvider());
                favoriteSettingsService.LoadSettings();
                WorkItem.Items.Remove(favoriteSettingsService);
            }

            Activate(parameters);
        }
Esempio n. 3
0
 public void Run(DepartureMonitorOverviewViewParameters parameters, string favoriteId)
 {
     _favoriteId = favoriteId;
     Run(parameters, false);
 }