/// <summary>
        /// Parse the livebroadcast into a FlashVideoDescriptor
        /// </summary>
        public static FlashVideoDescriptor ParseLive(LiveBroadcast livebroadcast)
        {
            FlashVideoDescriptor VideoDescriptor = null;

            if (livebroadcast != null)
            {
                VideoDescriptor = new FlashVideoDescriptor();
                VideoDescriptor.IsLive = true;
                VideoDescriptor.Title = livebroadcast.Title;
                VideoDescriptor.LiveID = livebroadcast.WebLiveBroadcastID;
            }

            return VideoDescriptor;
        }
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of LiveBroadcasts
        /// </summary>
        public static List<LiveBroadcast> PopulateObject(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

            List<LiveBroadcast> arr = new List<LiveBroadcast>();

            LiveBroadcast obj;

            while (dr.Read())
            {
                obj = new LiveBroadcast();
                if (list.IsColumnPresent("LiveBroadcastID")) { obj._liveBroadcastID = (int)dr["LiveBroadcastID"]; }
                if (list.IsColumnPresent("WebLiveBroadcastID")) { obj._webLiveBroadcastID = (string)dr["WebLiveBroadcastID"]; }
                if (list.IsColumnPresent("ThumbnailResourceFileID")) { obj._thumbnailResourceFileID = (int)dr["ThumbnailResourceFileID"]; }
                if (list.IsColumnPresent("MemberID")) { obj._memberID = (int)dr["MemberID"]; }
                if (list.IsColumnPresent("BroadcastSource")) { obj._broadcastSource = (int)dr["BroadcastSource"]; }
                if (list.IsColumnPresent("Title")) { obj._title = (string)dr["Title"]; }
                if (list.IsColumnPresent("Description")) { obj._description = (string)dr["Description"]; }
                if (list.IsColumnPresent("DTStart")) { obj._dTStart = (DateTime)dr["DTStart"]; }
                if (list.IsColumnPresent("DTEnd")) { obj._dTEnd = (DateTime)dr["DTEnd"]; }
                if (list.IsColumnPresent("Duration")) { obj._duration = (int)dr["Duration"]; }
                if (list.IsColumnPresent("LiveNow")) { obj._liveNow = (bool)dr["LiveNow"]; }
                if (list.IsColumnPresent("PrivacyFlag")) { obj._privacyFlag = (int)dr["PrivacyFlag"]; }
                if (list.IsColumnPresent("IsActive")) { obj._isActive = (bool)dr["IsActive"]; }
                if (list.IsColumnPresent("DebugInfo")) { obj._debugInfo = (string)dr["DebugInfo"]; }

                arr.Add(obj);
            }

            dr.Close();

            return arr;
        }
Exemple #3
0
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of LiveBroadcasts
        /// </summary>
        public static List <LiveBroadcast> PopulateLiveBroadcastWithJoin(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

            List <LiveBroadcast> arr = new List <LiveBroadcast>();

            LiveBroadcast obj;

            while (dr.Read())
            {
                obj = new LiveBroadcast();
                if (list.IsColumnPresent("LiveBroadcastID"))
                {
                    obj._liveBroadcastID = (int)dr["LiveBroadcastID"];
                }
                if (list.IsColumnPresent("WebLiveBroadcastID"))
                {
                    obj._webLiveBroadcastID = (string)dr["WebLiveBroadcastID"];
                }
                if (list.IsColumnPresent("ThumbnailResourceFileID"))
                {
                    obj._thumbnailResourceFileID = (int)dr["ThumbnailResourceFileID"];
                }
                if (list.IsColumnPresent("MemberID"))
                {
                    obj._memberID = (int)dr["MemberID"];
                }
                if (list.IsColumnPresent("BroadcastSource"))
                {
                    obj._broadcastSource = (int)dr["BroadcastSource"];
                }
                if (list.IsColumnPresent("Title"))
                {
                    obj._title = (string)dr["Title"];
                }
                if (list.IsColumnPresent("Description"))
                {
                    obj._description = (string)dr["Description"];
                }
                if (list.IsColumnPresent("DTStart"))
                {
                    obj._dTStart = (DateTime)dr["DTStart"];
                }
                if (list.IsColumnPresent("DTEnd"))
                {
                    obj._dTEnd = (DateTime)dr["DTEnd"];
                }
                if (list.IsColumnPresent("Duration"))
                {
                    obj._duration = (int)dr["Duration"];
                }
                if (list.IsColumnPresent("LiveNow"))
                {
                    obj._liveNow = (bool)dr["LiveNow"];
                }

                if (list.IsColumnPresent("ThumbnailURL"))
                {
                    obj.ThumbnailURL = (string)dr["ThumbnailURL"];
                }

                obj.Member = new Member();
                if (list.IsColumnPresent("Nickname"))
                {
                    obj.Member.NickName = (string)dr["Nickname"];
                }
                if (list.IsColumnPresent("ISOCountry"))
                {
                    obj.Member.ISOCountry = (string)dr["ISOCountry"];
                }



                arr.Add(obj);
            }

            dr.Close();

            return(arr);
        }
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of LiveBroadcasts
        /// </summary>
        public static List<LiveBroadcast> PopulateLiveBroadcastWithJoin(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

            List<LiveBroadcast> arr = new List<LiveBroadcast>();

            LiveBroadcast obj;

            while (dr.Read())
            {
                obj = new LiveBroadcast();
                if (list.IsColumnPresent("LiveBroadcastID")) { obj._liveBroadcastID = (int)dr["LiveBroadcastID"]; }
                if (list.IsColumnPresent("WebLiveBroadcastID")) { obj._webLiveBroadcastID = (string)dr["WebLiveBroadcastID"]; }
                if (list.IsColumnPresent("ThumbnailResourceFileID")) { obj._thumbnailResourceFileID = (int)dr["ThumbnailResourceFileID"]; }
                if (list.IsColumnPresent("MemberID")) { obj._memberID = (int)dr["MemberID"]; }
                if (list.IsColumnPresent("BroadcastSource")) { obj._broadcastSource = (int)dr["BroadcastSource"]; }
                if (list.IsColumnPresent("Title")) { obj._title = (string)dr["Title"]; }
                if (list.IsColumnPresent("Description")) { obj._description = (string)dr["Description"]; }
                if (list.IsColumnPresent("DTStart")) { obj._dTStart = (DateTime)dr["DTStart"]; }
                if (list.IsColumnPresent("DTEnd")) { obj._dTEnd = (DateTime)dr["DTEnd"]; }
                if (list.IsColumnPresent("Duration")) { obj._duration = (int)dr["Duration"]; }
                if (list.IsColumnPresent("LiveNow")) { obj._liveNow = (bool)dr["LiveNow"]; }

                if (list.IsColumnPresent("ThumbnailURL")) { obj.ThumbnailURL = (string)dr["ThumbnailURL"]; }

                obj.Member = new Member();
                if (list.IsColumnPresent("Nickname")) { obj.Member.NickName = (string)dr["Nickname"]; }
                if (list.IsColumnPresent("ISOCountry")) { obj.Member.ISOCountry = (string)dr["ISOCountry"]; }



                arr.Add(obj);
            }

            dr.Close();

            return arr;
        }