Beispiel #1
0
        public void RemovePanel(string panelAlias)
        {
            PersistCreativePanel panelToRemove = this._state.Panels.ToList().FirstOrDefault(p => p.PanelAlias == panelAlias);

            if (panelToRemove == null)
            {
                throw new DomainException(string.Format("Failed to remove panel for alias \"{0}\".", panelAlias));
            }

            this._state.Panels.Remove(panelToRemove);
        }
Beispiel #2
0
        public void RemovePrimaryPanel()
        {
            PersistCreativePanel panelToRemove = this._state.Panels.ToList().FirstOrDefault(p => p.IsPrimaryPanel);

            if (panelToRemove == null)
            {
                throw new DomainException("Creative does not have primary panel to remove.");
            }

            this._state.Panels.Remove(panelToRemove);
        }
Beispiel #3
0
        public void AddPanel(int panelId, string panelAlias, bool isPrimaryPanel = false)
        {
            ValidateAddPanelParameters(panelAlias, isPrimaryPanel);

            PersistCreativePanel panel = new PersistCreativePanel();

            panel.PanelId        = panelId;
            panel.PanelAlias     = panelAlias;
            panel.IsPrimaryPanel = isPrimaryPanel;
            try
            {
                this._state.Panels.Add(panel);
            }
            catch (Exception e)
            {
                throw new DomainException("Failed to add Panel.", e);
            }
        }