コード例 #1
0
ファイル: CanvasSection.cs プロジェクト: ywhe/PnP-Sites-Core
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Returns HashCode</returns>
 public override int GetHashCode()
 {
     return(String.Format("{0}|{1}|{2}|{3}|{4}|",
                          this.Controls.Aggregate(0, (acc, next) => acc += (next != null ? next.GetHashCode() : 0)),
                          Order.GetHashCode(),
                          Type.GetHashCode(),
                          BackgroundEmphasis.GetHashCode(),
                          VerticalSectionEmphasis.GetHashCode()
                          ).GetHashCode());
 }
コード例 #2
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Returns HashCode</returns>
 public override int GetHashCode()
 {
     return(String.Format("{0}|{1}|{2}|{3}|{4}|",
                          Layout.GetHashCode(),
                          MenuStyle.GetHashCode(),
                          BackgroundEmphasis.GetHashCode(),
                          ShowSiteTitle.GetHashCode(),
                          ShowSiteNavigation.GetHashCode()
                          ).GetHashCode());
 }
コード例 #3
0
        private int GetVerticalColumnBackgroundEmphasis()
        {
            BackgroundEmphasis emphasis = BackgroundEmphasis.None;

            if (this.pageLayoutMappingModel != null)
            {
                if (this.pageLayoutMappingModel.SectionEmphasis != null && this.pageLayoutMappingModel.SectionEmphasis.VerticalColumnEmphasisSpecified)
                {
                    return(BackgroundEmphasisToInt(this.pageLayoutMappingModel.SectionEmphasis.VerticalColumnEmphasis));
                }
            }

            return(BackgroundEmphasisToInt(emphasis));
        }
コード例 #4
0
        private int BackgroundEmphasisToInt(BackgroundEmphasis emphasis)
        {
            switch (emphasis)
            {
            case BackgroundEmphasis.None: return(0);

            case BackgroundEmphasis.Neutral: return(1);

            case BackgroundEmphasis.Soft: return(2);

            case BackgroundEmphasis.Strong: return(3);
            }

            return(0);
        }
コード例 #5
0
        private int GetBackgroundEmphasis(int row)
        {
            BackgroundEmphasis emphasis = BackgroundEmphasis.None;

            if (this.pageLayoutMappingModel != null)
            {
                if (this.pageLayoutMappingModel.SectionEmphasis != null && this.pageLayoutMappingModel.SectionEmphasis.Section != null)
                {
                    var section = this.pageLayoutMappingModel.SectionEmphasis.Section.Where(p => p.Row == row).FirstOrDefault();
                    if (section != null)
                    {
                        return(BackgroundEmphasisToInt(section.Emphasis));
                    }
                }
            }

            return(BackgroundEmphasisToInt(emphasis));
        }