private Canvas _initFromRow(DataRow r) { CanvasId = r.IntOrZero("CanvasId"); Height = r.IntOrZero("Height"); Width = r.IntOrZero("Width"); BackgroundColor = r.StringOrBlank("BackgroundColor"); if (BackgroundColor == "") BackgroundColor = "transparent"; BackgroundImage = r.IntOrZero("BackgroundImage"); Name = r.StringOrBlank("Name"); if (Name == "") Name = string.Format("Canvas {0}", CanvasId); return this; }
private void _initFromRow(DataRow r) { PanelId = r.IntOrZero("PanelId"); Top = r.IntOrZero("Top"); Left = r.IntOrZero("Left"); Width = r.IntOrZero("Width"); Height = r.IntOrZero("Height"); FadeLength = r.DoubleOrZero("FadeLength"); Name = r.StringOrBlank("Name").Trim(); if (Name == "") Name = string.Format("Panel {0}", PanelId); }
private void _initFromRow(DataRow r) { DisplayId = r.IntOrZero("DisplayId"); CanvasId = r.IntOrZero("CanvasId"); LocationId = r.IntOrZero("LocationId"); Host = r.StringOrBlank("Host").Trim(); NoScroll = r.Boolean("NoScroll"); NoCursor = r.Boolean("NoCursor"); ReadyTimeout = r.IntOrZero("ReadyTimeout"); PollInterval = r.IntOrZero("PollInterval"); ErrorLength = r.IntOrZero("ErrorLength"); Name = r.StringOrBlank("Name").Trim(); if (Name == "") Name = string.Format("Display {0}", DisplayId); if (r["RecycleTime"] != DBNull.Value) { RecycleTime = (TimeSpan)r["RecycleTime"]; } }
private void _initfromRow(DataRow dr) { FrameId = dr.IntOrZero("FrameId"); PanelId = dr.IntOrZero("PanelId"); Duration = dr.IntOrDefault("Duration", 60); Sort = dr.IntOrZero("Sort"); BeginsOn = dr["BeginsOn"] == DBNull.Value ? null : (DateTime?)dr["BeginsOn"]; EndsOn = dr["EndsOn"] == DBNull.Value ? null : (DateTime?)dr["EndsOn"]; DateCreated = dr["DateCreated"] == DBNull.Value ? null : (DateTime?)dr["DateCreated"]; TemplateName = dr.StringOrDefault("TemplateName", "default"); Html = dr.StringOrBlank("Html"); FrameType = (FrameTypes)dr.IntOrZero("FrameType"); CacheInterval = dr.IntOrZero("CacheInterval"); CacheInterval = CacheInterval < 0 ? 0 : CacheInterval; Version = BitConverter.ToUInt64((byte[])dr["Version"], 0); // is never a null }
private void _initFromRow(DataRow _dr) { ContentId = _dr.IntOrZero("ContentId"); Name = _dr.StringOrBlank("Name").Trim(); Chunk = (byte[])_dr["Chunk"]; Version = BitConverter.ToUInt64((byte[])_dr["Version"], 0); // is never a null }
private void _initFromRow(DataRow r) { this.LocationId = r.IntOrZero("LocationId"); this.LevelId = r.IntOrZero("LevelId"); this.TemperatureUnit = r.StringOrDefault("TemperatureUnit", "C").ToLower(); this.DateFormat = r.StringOrDefault("DateFormat", "LL"); this.TimeFormat = r.StringOrDefault("TimeFormat", "LT"); this.Name = r.StringOrBlank("Name"); if (this.Name == "") this.Name = string.Format("Location {0}", this.LocationId); this.TimeZone = TimeZoneInfo.FindSystemTimeZoneById( r.StringOrDefault("TimeZone", ServerGeoData.TimeZone.Id) ); double? latitude = r["Latitude"] as Nullable<double>; if (latitude != null) this.Latitude = latitude.Value; else this.Latitude = ServerGeoData.Latitude; double? longitude = r["Longitude"] as Nullable<double>; if (longitude != null) this.Longitude = longitude.Value; else this.Longitude = ServerGeoData.Longitude; int? woeid = r["Woeid"] as Nullable<int>; this.Woeid = woeid ?? 0; this.Culture = r.StringOrBlank("Culture"); }