示例#1
0
        public void Init()
        {
#if WINDOWS
            AddDirectoryCatalog(catalog, "Extensions");
            AddDirectoryCatalog(catalog, "EventHandlers");
#endif
            CompositionContainer container = new CompositionContainer(catalog);

            container.ComposeParts(this);

            if (Extensions != null)
            {
                foreach (var plugin in Extensions)
                {
                    plugin.Init();
                }
            }

            EventHandlerManager.AnalyzeCommandHandlers(ImportedHandlers);
        }
示例#2
0
        private void ExecuteEventCommands()
        {
            while (!StoreManager.ShuttingDown)
            {
                //Debug.Write(string.Format("step1 : {0}", DateTime.Now.ToString("ss:ffff")));
                CommandsReady.WaitOne(5000);
                //Debug.Write(string.Format("step2 : {0}", DateTime.Now.ToString("ss:ffff")));
                if (_waitingevents.Count == 0)
                {
                    CommandsReady.Reset();
                    continue;
                }

                EventCommand we;
                lock (_waitingevents)
                    we = _waitingevents.Dequeue();

                EventHandlerManager.ExecuteCommandEvent(DatabaseName, we);

                LastExecutedCommandSN = we.CommandSN;

                if (Debugger.IsAttached)
                {
                    if (LastExecutedCommandSN % 1000 == 0)
                    {
                        Console.Write(string.Format("LEC: {0} - ", LastExecutedCommandSN));
                    }
                }

                if (Configuration.EnableOperationsLog)
                {
                    _operationsLog.LogCommand(we);
                }

                //if (_waitingevents.Count == 0)
                //  Session.RaiseStoreUpdated(LastExecutedCommandSN);
            }
        }