Beispiel #1
0
        private static List<ContentStyle> LoadListFromReader(IDataReader reader)
        {
            List<ContentStyle> contentStyleList = new List<ContentStyle>();
            try
            {
                while (reader.Read())
                {
                    ContentStyle contentStyle = new ContentStyle();
                    contentStyle.guid = new Guid(reader["Guid"].ToString());
                    contentStyle.siteGuid = new Guid(reader["SiteGuid"].ToString());
                    contentStyle.name = reader["Name"].ToString();
                    contentStyle.element = reader["Element"].ToString();
                    contentStyle.cssClass = reader["CssClass"].ToString();
                    contentStyle.skinName = reader["SkinName"].ToString();
                    contentStyle.isActive = Convert.ToBoolean(reader["IsActive"]);
                    contentStyle.createdUtc = Convert.ToDateTime(reader["CreatedUtc"]);
                    contentStyle.lastModUtc = Convert.ToDateTime(reader["LastModUtc"]);
                    contentStyle.createdBy = new Guid(reader["CreatedBy"].ToString());
                    contentStyle.lastModBy = new Guid(reader["LastModBy"].ToString());
                    contentStyleList.Add(contentStyle);

                }
            }
            finally
            {
                reader.Close();
            }

            return contentStyleList;
        }
Beispiel #2
0
 /// <summary>
 /// Looks up and returns an instance of ContentStyle, if not found returns null.
 /// </summary>
 /// <param name="guid"></param>
 /// <returns></returns>
 public static ContentStyle Get(Guid guid)
 {
     ContentStyle style = new ContentStyle(guid);
     if (style.Guid == Guid.Empty) { return null; }
     return style;
 }
Beispiel #3
0
 public static ContentStyle GetNew(Guid siteGuid)
 {
     ContentStyle style = new ContentStyle();
     style.siteGuid = siteGuid;
     return style;
 }
Beispiel #4
0
 /// <summary>
 /// Compares 2 instances of ContentStyle.
 /// </summary>
 public static int CompareBySkinName(ContentStyle contentStyle1, ContentStyle contentStyle2)
 {
     return contentStyle1.SkinName.CompareTo(contentStyle2.SkinName);
 }
Beispiel #5
0
 /// <summary>
 /// Compares 2 instances of ContentStyle.
 /// </summary>
 public static int CompareByLastModUtc(ContentStyle contentStyle1, ContentStyle contentStyle2)
 {
     return contentStyle1.LastModUtc.CompareTo(contentStyle2.LastModUtc);
 }
Beispiel #6
0
 /// <summary>
 /// Compares 2 instances of ContentStyle.
 /// </summary>
 public static int CompareByElement(ContentStyle contentStyle1, ContentStyle contentStyle2)
 {
     return contentStyle1.Element.CompareTo(contentStyle2.Element);
 }
Beispiel #7
0
 /// <summary>
 /// Compares 2 instances of ContentStyle.
 /// </summary>
 public static int CompareByCssClass(ContentStyle contentStyle1, ContentStyle contentStyle2)
 {
     return contentStyle1.CssClass.CompareTo(contentStyle2.CssClass);
 }
Beispiel #8
0
 /// <summary>
 /// Compares 2 instances of ContentStyle.
 /// </summary>
 public static int CompareByCreatedUtc(ContentStyle contentStyle1, ContentStyle contentStyle2)
 {
     return contentStyle1.CreatedUtc.CompareTo(contentStyle2.CreatedUtc);
 }