예제 #1
0
            public AppearanceOptions GetAppearanceOptions([NotNull] ContentEditor contentEditor)
            {
                Assert.ArgumentNotNull(contentEditor, nameof(contentEditor));

                var options = AppHost.Settings.Options;

                var skinName = SkinName;

                if (string.IsNullOrEmpty(skinName))
                {
                    skinName = options.Skin ?? string.Empty;
                }

                var result = new AppearanceOptions
                {
                    ContentEditor      = contentEditor,
                    SkinName           = skinName,
                    StandardFields     = options.ShowStandardFields,
                    RawValues          = options.ShowRawValues,
                    FieldInformation   = options.ShowFieldInformation,
                    FieldDisplayTitles = options.ShowFieldDisplayTitles
                };

                var panelContext = new PanelContext(result.Skin, contentEditor.ContentModel);

                result.Panels = Panels.Select(d => d.Panel).Where(p => p.CanRender(panelContext));

                return(result);
            }
예제 #2
0
        public static AppearanceOptions GetDefaultAppearanceOptions([NotNull] ContentEditor contentEditor)
        {
            Assert.ArgumentNotNull(contentEditor, nameof(contentEditor));

            var appearance = new AppearanceOptions
            {
                SkinName      = AppHost.Settings.Options.Skin ?? string.Empty,
                Panels        = new List <IPanel>(),
                ContentEditor = contentEditor
            };

            return(appearance);
        }