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 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; } }
public static string GetEwsTrackingPath(DisplayMonkeyEntities _db) { Setting s = Setting.GetSetting(_db, Keys.EWSTracingPath); if (s != null) { return(s.StringValue); } return(null); }
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); }
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; }