Esempio n. 1
0
        /// <summary>
        ///     Channel_s the on restore UI message.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The e.</param>
        private void Channel_OnRestoreUiMessage(object sender, RestoreUiMessage e)
        {
            var defaultSection = "Entity";
            var defaultEntry   = "Entity Browser";
            var evt            = RestoreUi;

            if (evt != null)
            {
                evt(this, new EventArgs( ));
            }

            var sectionName = e.Section ?? defaultSection;
            var entryName   = e.Entry ?? defaultEntry;

            if (!e.ShowEntityBrowser && sectionName == defaultSection && entryName == defaultEntry)
            {
                return;
            }

            var foundSection = Sections.FirstOrDefault(section => section.Name == sectionName);

            if (foundSection != null)
            {
                SelectedSection = foundSection;

                var foundEntry = SelectedSection.Entries.FirstOrDefault(entry => entry.Name == entryName);

                if (foundEntry != null)
                {
                    SelectedSection.SelectedEntry = foundEntry;
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        ///     Called when a restore UI message is received.
        /// </summary>
        /// <param name="message">The message.</param>
        protected void OnRestoreUiMessageReceived(RestoreUiMessage message)
        {
            var evt = OnRestoreUiMessage;

            if (evt != null)
            {
                evt(this, message);
            }
        }