예제 #1
2
        public void Initialize()
        {
            try
            {
                m_itmesSubsciptions = new Dictionary <string, string>();

                //
                m_providerUserName = System.Configuration.ConfigurationManager.AppSettings.Get("UserName");
                m_providerPassword = System.Configuration.ConfigurationManager.AppSettings.Get("Password");

                m_ReceivedFeedBCollecion = new BlockingCollection <FeedMessage>();
                // establish connecion with wcf FeedProvider Service
                //wcf create channel with  Provider.
                EnableLogger          = bool.Parse(System.Configuration.ConfigurationManager.AppSettings["EnableLogger"]);
                m_logHandler          = new LogsHandler();
                m_FeedcallbackHandler = new IFeedCallbackHandler(m_ReceivedFeedBCollecion, EnableLogger, m_logHandler);
                m_InstanceContext     = new InstanceContext(m_FeedcallbackHandler);
                m_factory             = new DuplexChannelFactory <IDataFeed>(m_InstanceContext, "netTcpBinding_Ifeed");
                m_IDataFeedService    = m_factory.CreateChannel();

                ((ICommunicationObject)m_IDataFeedService).Closed  += DataAadapter_Closed;
                ((ICommunicationObject)m_IDataFeedService).Faulted += DataAadapter_Faulted;
                ((ICommunicationObject)m_IDataFeedService).Opened  += DataAadapter_Opened;

                m_PingTimerIntervals = Int32.Parse(System.Configuration.ConfigurationManager.AppSettings["PingTiemrIntervals"]);


                if (EnableLogger)
                {
                    m_logHandler.StartLogging();
                }

                m_subscirptionQueue = new ConcurrentQueue <string>();

                Task.Factory.StartNew(() =>
                {
                    StartProcessFeed(); // sending feed to LS server.
                });


                Task.Factory.StartNew(() =>
                {
                    HandleSubscriptions();  // receive subscribtion from LS server.
                });
            }
            catch (Exception exp)
            {
                m_NLog.Error("Error on Constructor. Error Details : {0} ", exp.ToString());
            }
        }
예제 #2
0
        async Task ExecuteLoadItemsCommand()
        {
            if (LoadItemsIsBusy)
            {
                return;
            }

            LoadItemsIsBusy = true;

            try
            {
                Items.Clear();
                var items = await MainTableDataStore.GetItemsAsync(true);

                foreach (var item in items)
                {
                    Items.Add(item);
                }
            }
            catch (Exception ex)
            {
                LogsHandler.WriteException(ex);
            }
            finally
            {
                LoadItemsIsBusy = false;
            }
        }
예제 #3
0
 public AppsController(AppStoreContext context, ClickHouseDatabase clickDB, UserManager <User> userManager, IHostEnvironment env, NotificationsHub notificationsHub)
 {
     _context          = context;
     _userManager      = userManager;
     _env              = env;
     _fileHandler      = new FileHandler(_env.ContentRootPath, _context);
     _notificationsHub = notificationsHub;
     _logsHandler      = new LogsHandler(clickDB);
 }
예제 #4
0
 static Repository()
 {
     try
     {
         me = new Repository();
     }
     catch (Exception Ex)
     {
         LogsHandler.WriteException(Ex);
     }
 }
예제 #5
0
        public ActionResult Index()
        {
            IndexViewModel _model = new IndexViewModel();

            _model.dicProperties = new Dictionary <string, string>();
            _model.dicProperties = AppSettings.VerifyProperties();

            LogsHandler.LogTest();
            //GitCommand.GitCommands.GitPull();
            //TestJson();
            return(View(_model));
        }
예제 #6
0
        /// <summary>
        /// Initializes a new instance of the Database.
        /// if the database doesn't exist, it will create the database and all the tables.
        /// </summary>
        /// <param name='path'>
        /// Path.
        /// </param>
        public Database(string path) : base(path, true, "Password")
        {
            try
            {
                LogsHandler.WriteDebug("CreateTable MainTable");

                // create the tables
                CreateTable <DataAccessLayer.Models.Tables.MainTable>();
            }
            catch (Exception Ex)
            {
                LogsHandler.WriteException(Ex);
            }
        }
예제 #7
0
        protected Repository()
        {
            try
            {
                LogsHandler.WriteDebug("DataModel.DAL.Repository: Initiate Repository");

                // set the db location
                dbLocation = DatabaseFilePath;

                // instantiate the database
                db = new DL.Database(dbLocation);
            }
            catch (Exception Ex)
            {
                LogsHandler.WriteException(Ex);
            }
        }
예제 #8
0
 public static void Main(string[] args)
 {
     LogsHandler.ConfigureLogging();
     CreateHostBuilder(args).Build().Run();
 }
예제 #9
0
 public static void Main(string[] args)
 {
     LogsHandler.ConfigureLogging();
     RabbitMqHandler.ListenForIntegrationEvents();
     CreateHost(args);
 }
예제 #10
0
 public static void Main(string[] args)
 {
     LogsHandler.ConfigureLogging();
     CreateHost(args);
 }
예제 #11
0
 public IFeedCallbackHandler(BlockingCollection <FeedMessage> receivedFeedBCollecion, bool enableLogger, LogsHandler logsHanlder)
 {
     m_receivedFeedBCollecion = receivedFeedBCollecion;
     EnableLogger             = enableLogger;
     m_logsHandler            = logsHanlder;
 }