コード例 #1
0
        public void AddDetailBulider(IDetailBulider item)
        {
            DetailContent content = item.GetContent();

            if (content == null)
            {
                return;
            }

            if (Attribute.IsDefined(content.GetType(), typeof(FeatureCodeAttribute)))
            {
                FeatureCodeAttribute fca = Attribute.GetCustomAttribute(content.GetType(), typeof(FeatureCodeAttribute)) as FeatureCodeAttribute;
                if (fca != null)
                {
                    if (Framework.Legacy.GlobalOld.Acl[content.GetType()].Viewable)
                    {
                        Present.AddDetailBulider(item);
                    }
                }
            }
            else
            {
                Present.AddDetailBulider(item);
            }
        }
コード例 #2
0
 private static void builder_ContentBulided <T>(object sender, ContentBulidedEventArgs <T> e)
 {
     if (ACL.ContainsKey(e.Content.GetType()))
     {
         DetailContent dc = e.Content as DetailContent;
         dc.SaveButtonVisibleChanged += new EventHandler(dc_SaveButtonVisibleChanged);
     }
 }
コード例 #3
0
ファイル: Article.cs プロジェクト: BigHeadDev/OneForDotNet
        protected override async Task OnParametersSetAsync()
        {
            var result = await Client.GetFromJsonAsync <DetailContentBase>($"http://192.168.0.211:8080/oneapi/article?id={Id}");

            if (result.Status == "OK")
            {
                content = result.Data;
            }
            await base.OnParametersSetAsync();
        }
コード例 #4
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();

            if (Content is ActivityIndicator)
            {
                await Task.Delay(1000);

                Content = new DetailContent();
            }
        }
コード例 #5
0
 public DetailContentWindow(DetailContent content, string titleDrect)
 {
     InitializeComponent();
     txtTitle.Text    = content.Title;
     this.Title       = titleDrect + " - " + content.Title;
     txtSubTitle.Text = content.Subtitle;
     content.Paragraphs.ForEach(s => {
         Run myRun = new Run(s);
         document.Blocks.Add(new Paragraph(myRun));
     });
     document.Blocks.Add(new Paragraph(new Run(content.Editor)));
 }
コード例 #6
0
        private static void dc_SaveButtonVisibleChanged(object sender, EventArgs e)
        {
            if (VisibleChanging)
            {
                return;
            }

            DetailContent          content = sender as DetailContent;
            AccessControlAttribute ac      = ACL[sender.GetType()];

            if (!UserAcl.Current[sender.GetType()].Editable)
            {
                VisibleChanging           = true;
                content.SaveButtonVisible = false;
                VisibleChanging           = false;
            }
        }
コード例 #7
0
ファイル: Student.cs プロジェクト: ratalai/JHCore_Bilingual
        public new void AddDetailBulider(IDetailBulider item)
        {
            DetailContent content = item.GetContent();

            if (content == null)
            {
                return;
            }

            if (Attribute.IsDefined(content.GetType(), typeof(FeatureCodeAttribute)))
            {
                FeatureCodeAttribute fca = Attribute.GetCustomAttribute(content.GetType(), typeof(FeatureCodeAttribute)) as FeatureCodeAttribute;
                if (fca != null)
                {
                    if (Framework.Legacy.GlobalOld.Acl[content.GetType()].Viewable)
                    {
                        base.AddDetailBulider(item);
                    }
                }
            }
            else if (Attribute.IsDefined(content.GetType(), typeof(FISCA.Permission.FeatureCodeAttribute)))
            {
                FISCA.Permission.FeatureCodeAttribute fca = Attribute.GetCustomAttribute(content.GetType(), typeof(FISCA.Permission.FeatureCodeAttribute)) as FISCA.Permission.FeatureCodeAttribute;
                if (fca != null)
                {
                    if (FISCA.Permission.UserAcl.Current[fca.Code].Viewable)
                    {
                        base.AddDetailBulider(item);
                    }
                }
            }
            else
            {
                base.AddDetailBulider(item);
            }
        }
コード例 #8
0
        private string ComposeHtmlForReading()
        {
            // Get colors
            string maxWidth    = string.Empty;
            string marginLeft  = string.Empty;
            string marginRight = string.Empty;

            switch (ContentAlignment)
            {
            case HorizontalAlignment.Left:
                maxWidth    = "max-width: 1000px;";
                marginLeft  = "0";
                marginRight = "auto";
                break;

            case HorizontalAlignment.Center:
                maxWidth    = "max-width: 1000px;";
                marginLeft  = "auto";
                marginRight = "auto";
                break;

            case HorizontalAlignment.Right:
                maxWidth    = "max-width: 1000px;";
                marginLeft  = "auto";
                marginRight = "0";
                break;

            case HorizontalAlignment.Stretch:
                marginLeft  = "auto";
                marginRight = "auto";
                break;
            }

            string flyoutStyle = FlyoutEnabled ? "@media screen and (max-width: 800px)  { .was-title { display: none; } img { max-width: 500px; } }" : string.Empty;
            string title       = string.IsNullOrEmpty(Title) ? string.Empty : $"<h2 class='was-title'>{Title}</h2><br/>";
            string subtitle    = string.IsNullOrEmpty(SubTitle) ? string.Empty : $"<h3>{SubTitle}</h3><br/>";
            string htmlContent = string.IsNullOrEmpty(DetailContent) ? string.Empty : DetailContent.Replace("ms-appx://", "ms-appx-web://");

            string imageComponent = GetImageHtmlComponent();

            string html = GetHtmlTemplate();

            html = html.Replace("%COLOR%", GetForegroundColor());
            html = html.Replace("%BACKGROUND%", GetBackgroundColor());
            html = html.Replace("%MAXWIDTH%", maxWidth);
            html = html.Replace("%MARGINLEFT%", marginLeft);
            html = html.Replace("%MARGINRIGHT%", marginRight);
            html = html.Replace("%FLYOUTSTYLE%", flyoutStyle);
            html = html.Replace("%TITLE%", title);
            html = html.Replace("%SUBTITLE%", subtitle);
            html = html.Replace("%IMAGEURL%", imageComponent);
            html = html.Replace("%HTMLCONTENT%", htmlContent);

            return(html);
        }
コード例 #9
0
 public DetailContentViewModel(DetailContent content, string titleDrec)
 {
     Content = content;
     Title   = $"One·{titleDrec} - " + content.Title;
 }