Esempio n. 1
0
 public static void AnnounceRange(this IDisplayControl displayedEntities, IEnumerable <BaseEntity> entities)
 {
     if (entities != null)
     {
         entities.Each(x => displayedEntities.Announce(x));
     }
 }
Esempio n. 2
0
        private void RefreshList()
        {
            IDisplayControl display = GetCurrentDisplay();

            if (display != null)
            {
                display.RefreshList();
            }
        }
Esempio n. 3
0
        private void deleteButton_Click(object sender, EventArgs e)
        {
            IDisplayControl display = GetCurrentDisplay();

            if (display != null)
            {
                display.DeleteSelectedItem();
            }
        }
Esempio n. 4
0
        private void newButton_Click(object sender, EventArgs e)
        {
            IDisplayControl display = GetCurrentDisplay();

            if (display != null)
            {
                display.NewItem();
            }
        }
Esempio n. 5
0
 public WidgetZoneFilter(
     ICommonServices services,
     Lazy <IWidgetProvider> widgetProvider,
     ProfilerSettings profilerSettings,
     IDisplayControl displayControl)
 {
     _services         = services;
     _widgetProvider   = widgetProvider;
     _profilerSettings = profilerSettings;
     _displayControl   = displayControl;
 }
Esempio n. 6
0
 public DefaultWidgetSelector(
     SmartDbContext db,
     ICacheManager cache,
     IRequestCache requestCache,
     IWidgetService widgetService,
     IWidgetProvider widgetProvider,
     IWorkContext workContext,
     IStoreContext storeContext,
     IDisplayControl displayControl)
 {
     _db             = db;
     _cache          = cache;
     _requestCache   = requestCache;
     _widgetService  = widgetService;
     _widgetProvider = widgetProvider;
     _workContext    = workContext;
     _storeContext   = storeContext;
     _displayControl = displayControl;
 }
Esempio n. 7
0
        /// <summary>
        /// Reacts to the selection of a specific tab page by ensuring that
        /// a display has been attached.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tabControl_Selected(object sender, TabControlEventArgs e)
        {
            IDisplayControl display = (IDisplayControl)e.TabPage.Tag;

            if (display == null)
            {
                if (e.TabPage == domainsPage)
                {
                    AttachListData <DomainListData>(domainsPage);
                }
                else if (e.TabPage == entityTypesPage)
                {
                    AttachListData <EntityListData>(entityTypesPage);
                }
                else if (e.TabPage == fontsPage)
                {
                    AttachListData <FontListData>(fontsPage);
                }
                else if (e.TabPage == idGroupsPage)
                {
                    AttachListData <IdGroupListData>(idGroupsPage);
                }
                else if (e.TabPage == layersPage)
                {
                    AttachListData <LayerListData>(layersPage);
                }
                else if (e.TabPage == propertiesPage)
                {
                    AttachDisplay <PropertyGridControl>(propertiesPage);
                }
                else if (e.TabPage == tablesPage)
                {
                    AttachListData <TableListData>(tablesPage);
                }
                else if (e.TabPage == templatesPage)
                {
                    AttachListData <TemplateListData>(templatesPage);
                }
                else if (e.TabPage == themesPage)
                {
                    AttachListData <ThemeListData>(themesPage);
                }
                else if (e.TabPage == zonesPage)
                {
                    AttachListData <ZoneListData>(zonesPage);
                }
                else
                {
                    throw new Exception("No display for tab page");
                }

                display = (IDisplayControl)e.TabPage.Tag;
            }

            Debug.Assert(display != null);

            // Ensure the display is up to date. This is meant to cover the
            // fact that items on one page may have been removed via changes
            // on other pages.
            display.RefreshList();
        }