Пример #1
0
        public BBMediaService(bool test = false) : base("BBMedia", test ? null : "BBMSClient", test ? "ADMServiceTest" : "BBMediaService", test ? null : "BBMediaServiceLog")
        {
            try
            {
                Tracing?.TraceEvent(TraceEventType.Information, 0, "Connecting to media service database...");
                _bbmsdb = BBMediaServiceDB.Create(Properties.Settings.Default, "BBMediaServiceDBName");

                Tracing?.TraceEvent(TraceEventType.Information, 0, "Setting service DB to {0} and settings to default", _bbmsdb.DBName);
                ServiceDB = _bbmsdb;
                Settings  = Properties.Settings.Default;

                Tracing?.TraceEvent(TraceEventType.Information, 0, "Connecting to IR database...");
                _irdb = IRDB.Create(Properties.Settings.Default, IRDB.IREncoding.HEX, "IRDBName");
                Tracing?.TraceEvent(TraceEventType.Information, 0, "Connected to IR database");
            }
            catch (Exception e)
            {
                Tracing?.TraceEvent(TraceEventType.Error, 0, e.Message);
                throw e;
            }
        }
        static public new BBMediaServiceDB Create(System.Configuration.ApplicationSettingsBase settings, String dbnameKey = null)
        {
            BBMediaServiceDB db = dbnameKey != null?DB.Create <BBMediaServiceDB>(settings, dbnameKey) : DB.Create <BBMediaServiceDB>(settings);

            return(db);
        }