public void init(DisplayMonkeyEntities _db) { if (Frame != null) { Setting defCacheInt = Setting.GetSetting(_db, Setting.Keys.DefaultCacheIntervalOutlook); if (defCacheInt != null) { Frame.CacheInterval = defCacheInt.IntValuePositive; } Setting defTemplate = Setting.GetSetting(_db, Setting.Keys.DefaultTemplateOutlook); if (defTemplate != null) { string templateName = defTemplate.StringValue; Frame.TemplateId = _db.Templates .Where(t => t.Name == templateName && t.FrameType == FrameTypes.Outlook) .FirstOrDefault() .TemplateId ; } } this.Mode = OutlookModes.OutlookMode_Today; this.ShowEvents = 0; }
public void init(DisplayMonkeyEntities _db) { if (Frame != null) { Setting defCacheInt = Setting.GetSetting(_db, Setting.Keys.DefaultCacheIntervalVideo); if (defCacheInt != null) { Frame.CacheInterval = defCacheInt.IntValuePositive; } Setting defTemplate = Setting.GetSetting(_db, Setting.Keys.DefaultTemplateVideo); if (defTemplate != null) { string templateName = defTemplate.StringValue; Frame.TemplateId = _db.Templates .Where(t => t.Name == templateName && t.FrameType == FrameTypes.Video) .FirstOrDefault() .TemplateId ; } } PlayMuted = true; AutoLoop = true; }
protected override void init(DisplayMonkeyEntities _db) { Setting fadeLength = Setting.GetSetting(_db, Setting.Keys.DefaultFullPanelFadeLength); if (fadeLength != null) { this.FadeLength = fadeLength.DecimalValue; } }
protected override void init(DisplayMonkeyEntities _db) { base.init(_db); this.ShowSeconds = true; this.ShowDate = true; this.ShowTime = true; }
//public Video() : base() { } protected override void init(DisplayMonkeyEntities _db) { base.init(_db); this.CacheInterval = Setting.GetDefaultCacheInterval(_db, this.FrameType); this.PlayMuted = true; this.AutoLoop = true; }
protected override void init(DisplayMonkeyEntities _db) { base.init(_db); this.Aspect = YTAspect.YTAspect_Auto; this.Quality = YTQuality.YTQuality_Default; this.Rate = YTRate.YTRate_Normal; this.Start = 0; this.Volume = 0; this.AutoLoop = true; }
protected override void init(DisplayMonkeyEntities _db) { base.init(_db); this.CacheInterval = Setting.GetDefaultCacheInterval(_db, this.FrameType); this.Mode = OutlookModes.OutlookMode_Today; this.Privacy = OutlookPrivacy.OutlookPrivacy_All; this.ShowEvents = 0; this.ShowAsFlags = -1; }
public static string GetEwsTrackingPath(DisplayMonkeyEntities _db) { Setting s = Setting.GetSetting(_db, Keys.EWSTracingPath); if (s != null) { return(s.StringValue); } return(null); }
public FullScreen(DisplayMonkeyEntities _db, Canvas _canvas) : base(_db) { Left = 0; Top = 0; Height = _canvas.Height; Width = _canvas.Width; Name = Resources.FullScreen; Canvas = _canvas; init(_db); }
public void init(DisplayMonkeyEntities _db) { if (Frame != null) { Setting defTemplate = Setting.GetSetting(_db, Setting.Keys.DefaultTemplateMemo); if (defTemplate != null) { string templateName = defTemplate.StringValue; Frame.TemplateId = _db.Templates .Where(t => t.Name == templateName && t.FrameType == FrameTypes.Memo) .FirstOrDefault() .TemplateId ; } } }
public static IEncryptor GetEncryptor(DisplayMonkeyEntities _db) // 1.4.0 { EncryptionMethods encryptionMethod = EncryptionMethods.RsaContainer; IEncryptor encryptor = null; Setting s = Setting.GetSetting(_db, Keys.EncryptionMethod); if (s != null) { encryptionMethod = (EncryptionMethods)s.IntValuePositive; } switch (encryptionMethod) { case EncryptionMethods.RsaContainer: encryptor = new RsaEncryptor(); break; case EncryptionMethods.Aes: encryptor = new AesEncryptor(); s = Setting.GetSetting(_db, Keys.EncryptionIV); if (s != null && s.RawValue != null) { (encryptor as AesEncryptor).IV = s.RawValue; } else { Setting.SaveSetting(_db, Keys.EncryptionIV, (encryptor as AesEncryptor).IV); } s = Setting.GetSetting(_db, Keys.EncryptionKey); if (s != null && s.RawValue != null) { (encryptor as AesEncryptor).Key = s.RawValue; } else { Setting.SaveSetting(_db, Keys.EncryptionKey, (encryptor as AesEncryptor).Key); } break; } return(encryptor); }
public static int GetDefaultTemplate(DisplayMonkeyEntities _db, FrameTypes?_frameType) { int ret = 0; Keys key = Keys.Count; switch (_frameType) { case FrameTypes.Clock: key = Keys.DefaultTemplateClock; break; case FrameTypes.Html: key = Keys.DefaultTemplateHtml; break; case FrameTypes.Memo: key = Keys.DefaultTemplateMemo; break; case FrameTypes.Outlook: key = Keys.DefaultTemplateOutlook; break; case FrameTypes.Picture: key = Keys.DefaultTemplatePicture; break; case FrameTypes.Powerbi: key = Keys.DefaultTemplatePowerbi; break; case FrameTypes.Report: key = Keys.DefaultTemplateReport; break; case FrameTypes.Video: key = Keys.DefaultTemplateVideo; break; case FrameTypes.Weather: key = Keys.DefaultTemplateWeather; break; case FrameTypes.YouTube: key = Keys.DefaultTemplateYouTube; break; default: return(ret); } Setting defTemplate = GetSetting(_db, key); if (defTemplate != null) { string templateName = defTemplate.StringValue; ret = _db.Templates .Where(t => t.Name == templateName && t.FrameType == _frameType) .FirstOrDefault() .TemplateId ; } return(ret); }
public static void SaveSetting(DisplayMonkeyEntities _db, Setting.Keys _id, object _value) { Guid key = _keyGuids[(int)_id]; Setting setting = _db.Settings.FirstOrDefault(s => s.Key == key); if (setting == null) { setting = new Setting() { Key = key, AnyValue = _value, }; _db.Settings.Add(setting); } else { setting.AnyValue = _value; _db.Entry(setting).State = System.Data.Entity.EntityState.Modified; } _db.SaveChanges(); }
protected void init(DisplayMonkeyEntities _db) { Setting readyTimeout = Setting.GetSetting(_db, Setting.Keys.DefaultDisplayReadyEventTimeout); if (readyTimeout != null) { this.ReadyTimeout = readyTimeout.IntValuePositive; } Setting errorLength = Setting.GetSetting(_db, Setting.Keys.DefaultDisplayErrorLength); if (errorLength != null) { this.ErrorLength = errorLength.IntValuePositive; } Setting pollInterval = Setting.GetSetting(_db, Setting.Keys.DefaultDisplayPollInterval); if (pollInterval != null) { this.PollInterval = pollInterval.IntValuePositive; } }
public void init(DisplayMonkeyEntities _db) { if (Frame != null) { Setting defTemplate = Setting.GetSetting(_db, Setting.Keys.DefaultTemplateYouTube); if (defTemplate != null) { string templateName = defTemplate.StringValue; Frame.TemplateId = _db.Templates .Where(t => t.Name == templateName && t.FrameType == FrameTypes.YouTube) .FirstOrDefault() .TemplateId ; } } Aspect = YTAspect.YTAspect_Auto; Quality = YTQuality.YTQuality_Default; Rate = YTRate.YTRate_Normal; Start = 0; Volume = 0; AutoLoop = true; }
public void init(DisplayMonkeyEntities _db) { this.EwsVersion = OutlookEwsVersions.OutlookEwsVersion_Exchange2007_SP1; this.Url = "https://outlook.office365.com/EWS/Exchange.asmx"; }
public Youtube(Frame _fromFrame, DisplayMonkeyEntities db) : base(_fromFrame) { init(db); }
public static void FillTemplatesSelectList( this BaseController _controller, DisplayMonkeyEntities _db, FrameTypes _frameType, object _selected = null ) { var query = _db.Templates .Where(t => t.FrameType == _frameType) .Select(t => new { TemplateId = t.TemplateId, Name = t.Name }) .OrderBy(t => t.Name) .ToList() ; _controller.ViewBag.Templates = new SelectList(query, "TemplateId", "Name", _selected); }
public Memo(Frame _fromFrame, DisplayMonkeyEntities db) : base(_fromFrame) { init(db); }
public void init(DisplayMonkeyEntities _db) { this.Provider = OauthProviders.OauthProvider_Yahoo; }
public Picture(Frame _fromFrame, DisplayMonkeyEntities db) : base(_fromFrame) { init(db); }
public Powerbi(Frame _fromFrame, DisplayMonkeyEntities db) : base(_fromFrame) { init(db); }
public Outlook(Frame _fromFrame, DisplayMonkeyEntities db) : base(_fromFrame) { init(db); }
public Display(DisplayMonkeyEntities _db, int _canvasId, int _locationId) { CanvasId = _canvasId; LocationId = _locationId; init(_db); }
public Report(Frame _fromFrame, DisplayMonkeyEntities db) : base(_fromFrame) { init(db); }
public Weather(Frame _fromFrame, DisplayMonkeyEntities db) : base(_fromFrame) { init(db); }
public static Setting GetSetting(DisplayMonkeyEntities _db, Setting.Keys _id) { Guid key = _keyGuids[(int)_id]; return(_db.Settings.FirstOrDefault(s => s.Key == key)); }
public static int GetDefaultTemplate(DisplayMonkeyEntities _db, FrameTypes? _frameType) { int ret = 0; Keys key = Keys.Count; switch (_frameType) { case FrameTypes.Clock: key = Keys.DefaultTemplateClock; break; case FrameTypes.Html: key = Keys.DefaultTemplateHtml; break; case FrameTypes.Memo: key = Keys.DefaultTemplateMemo; break; case FrameTypes.Outlook: key = Keys.DefaultTemplateOutlook; break; case FrameTypes.Picture: key = Keys.DefaultTemplatePicture; break; case FrameTypes.Powerbi: key = Keys.DefaultTemplatePowerbi; break; case FrameTypes.Report: key = Keys.DefaultTemplateReport; break; case FrameTypes.Video: key = Keys.DefaultTemplateVideo; break; case FrameTypes.Weather: key = Keys.DefaultTemplateWeather; break; case FrameTypes.YouTube: key = Keys.DefaultTemplateYouTube; break; default: return ret; } Setting defTemplate = GetSetting(_db, key); if (defTemplate != null) { string templateName = defTemplate.StringValue; ret = _db.Templates .Where(t => t.Name == templateName && t.FrameType == _frameType) .FirstOrDefault() .TemplateId ; } return ret; }
public void init(DisplayMonkeyEntities _db) { this.Resource = AzureResources.AzureResource_PowerBi; }
public Panel(DisplayMonkeyEntities _db) { init(_db); }
protected virtual void init(DisplayMonkeyEntities _db) { this.TemplateId = Setting.GetDefaultTemplate(_db, this.FrameType); }
public void init(DisplayMonkeyEntities _db) { if (Frame != null) { Setting defCacheInt = Setting.GetSetting(_db, Setting.Keys.DefaultCacheIntervalWeather); if (defCacheInt != null) { Frame.CacheInterval = defCacheInt.IntValuePositive; } Setting defTemplate = Setting.GetSetting(_db, Setting.Keys.DefaultTemplateWeather); if (defTemplate != null) { string templateName = defTemplate.StringValue; Frame.TemplateId = _db.Templates .Where(t => t.Name == templateName && t.FrameType == FrameTypes.Weather) .FirstOrDefault() .TemplateId ; } } }
public Video(Frame _fromFrame, DisplayMonkeyEntities db) : base(_fromFrame) { init(db); }
public void init(DisplayMonkeyEntities _db) { Setting readyTimeout = Setting.GetSetting(_db, Setting.Keys.DefaultDisplayReadyEventTimeout); if (readyTimeout != null) { this.ReadyTimeout = readyTimeout.IntValuePositive; } Setting errorLength = Setting.GetSetting(_db, Setting.Keys.DefaultDisplayErrorLength); if (errorLength != null) { this.ErrorLength = errorLength.IntValuePositive; } Setting pollInterval = Setting.GetSetting(_db, Setting.Keys.DefaultDisplayPollInterval); if (pollInterval != null) { this.PollInterval = pollInterval.IntValuePositive; } }
public static int GetDefaultCacheInterval(DisplayMonkeyEntities _db, FrameTypes? _frameType) { int ret = 0; Keys key = Keys.Count; switch (_frameType) { //case FrameTypes.Clock: //case FrameTypes.Html: //case FrameTypes.Memo: case FrameTypes.Outlook: key = Keys.DefaultCacheIntervalOutlook; break; case FrameTypes.Picture: key = Keys.DefaultCacheIntervalPicture; break; //case FrameTypes.Powerbi: case FrameTypes.Report: key = Keys.DefaultCacheIntervalReport; break; case FrameTypes.Video: key = Keys.DefaultCacheIntervalVideo; break; case FrameTypes.Weather: key = Keys.DefaultCacheIntervalWeather; break; //case FrameTypes.YouTube: default: return ret; } Setting defCacheInt = Setting.GetSetting(_db, key); if (defCacheInt != null) { ret = defCacheInt.IntValuePositive; } return ret; }
public static Setting GetSetting(DisplayMonkeyEntities _db, Setting.Keys _id) { Guid key = _keyGuids[(int)_id]; return _db.Settings.FirstOrDefault(s => s.Key == key); }