예제 #1
0
        internal Classes()
        {
            this.MFactory = new MessageFactory();
            this.CFactory = new CommandFactory();
            this.DFactory = new DebugFactory();
            Loggers.Initialize();
            Fingerprint      = new Fingerprint();
            this.CSV         = new CSV();
            this.Home        = new Home();
            this.Npc         = new NPC();
            this.Game_Events = new Game_Events();
            this.Fingerprint = new Fingerprint();
            switch (Constants.Database)
            {
            case DBMS.Redis:
            case DBMS.Both:
                this.Redis = new Redis();
                break;
            }

            this.Events = new EventsHandler();
#if DEBUG
            Console.WriteLine("We loaded " + MessageFactory.Messages.Count + " messages, " + CommandFactory.Commands.Count + " commands, and " + DebugFactory.Debugs.Count + " debug commands.\n");
#endif
            this.Timers = new Timers();

            this.Test = new Test();

            MySQL_V2.GetAllSeed();
        }
예제 #2
0
 public UtilityProvider(DIContainer container, IConfigService configService, IMessageProvider messageProvider)
 {
     this.container         = container;
     this.debug             = new Lazy <IDebug>(() => DebugFactory.Create(configService), LazyThreadSafetyMode.ExecutionAndPublication);
     this.instrumentation   = new Lazy <IInstrumentation>(() => InstrumentationFactory.Create(configService), LazyThreadSafetyMode.ExecutionAndPublication);
     this.compression       = new Lazy <ICompression>(() => new Compression.Compression(), LazyThreadSafetyMode.ExecutionAndPublication);
     this.logger            = new Lazy <ILogger>(() => LoggerFactory.Create(configService, messageProvider), LazyThreadSafetyMode.ExecutionAndPublication);
     this.safeBlockProvider = new Lazy <ISafeBlockProvider>(() => new SafeBlockProvider(configService, this.logger.Value), LazyThreadSafetyMode.ExecutionAndPublication);
     this.defaultSerializer = new Lazy <Serializer>(() => Serializer.Binary, LazyThreadSafetyMode.ExecutionAndPublication);
     this.printService      = new Lazy <IPrintService>(() => PrintServiceFactory.Create(configService, this.logger.Value), LazyThreadSafetyMode.ExecutionAndPublication);
     this.threadProvider    = new Lazy <IThreadPoolFactory>(() => new ThreadPoolFactory(configService), LazyThreadSafetyMode.ExecutionAndPublication);
 }
예제 #3
0
 /// <summary>
 /// Debugs the specified d string.
 /// </summary>
 /// <param name="dString">The d string.</param>
 private void debug(string dString)
 {
     DebugFactory.getInstance().debug(debugMode, dString);
 }
예제 #4
0
        private static void LoadDebug(IDIContainer container, IConfigService configService)
        {
            var debug = DebugFactory.Create(configService);

            container.RegistryInstance <IDebug>(debug);
        }
예제 #5
0
 protected void debug(DEBUG_LEVEL level, string s)
 {
     DebugFactory.getInstance().debug(level, debugMode, s);
 }
예제 #6
0
 /// <summary>
 /// Debugs the specified s.
 /// </summary>
 /// <param name="s">The s.</param>
 protected void debug(string s)
 {
     DebugFactory.getInstance().debug(debugMode, s);
 }
예제 #7
0
 /// <summary>
 /// Debugs the specified d string.
 /// </summary>
 /// <param name="dString">The d string.</param>
 protected void debug(string dString)
 {
     DebugFactory.getInstance().debug(debugMode, dString);
 }
예제 #8
0
        public MainWindow()
        {
            DebugFactory.getInstance().DebugLevel = DEBUG_LEVEL.ALL;
            debugMode = DEBUG_MODE.CONSOLE;

            initUserContext();

            InitializeComponent();

            this.Visible = true;

            traceElementList = new List <TraceElement>();

            // ----------------------------------------------------------------

            traceListBox     = new TraceGuiListBox();
            traceBindingList = new BindingList <TraceGuiListItem>();

            tableLayoutPanel1.Controls.Add(traceListBox, 0, 0);

            traceListBox.Dock = System.Windows.Forms.DockStyle.Fill;
            traceListBox.FormattingEnabled = true;
            traceListBox.Location          = new System.Drawing.Point(3, 3);
            traceListBox.Size                  = new System.Drawing.Size(656, 389);
            traceListBox.TabIndex              = 0;
            traceListBox.SelectedIndexChanged += new EventHandler(onTraceListBoxSelectedIndexChanged);

            traceListBox.HorizontalScrollbar = true;
            traceListBox.DataSource          = traceBindingList;

            // ------------------------------------------------------

            traceFileContentListBox = new TracerGuiFileContentListBox();
            fileContentBindingList  = new BindingList <TraceFileContentElement>();

            /*
             * this.tableLayoutPanel1.Controls.Add(this.traceFileContentListBox, 1, 0);
             */
            this.traceFileContentListBox.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.traceFileContentListBox.Location = new System.Drawing.Point(339, 3);
            this.traceFileContentListBox.Size     = new System.Drawing.Size(320, 409);
            this.traceFileContentListBox.TabIndex = 0;
            this.traceFileContentListBox.Text     = "";

            traceFileContentListBox.HorizontalScrollbar = true;
            traceFileContentListBox.DataSource          = fileContentBindingList;

            // ------------------------------------------------------


            // ------------------------------------------------------

            TracerFactory.getInstance().getInterface().init();
            TracerFactory.getInstance().getInterface().setConnectionInterface(SerialIOFactory.getInstance().getSerialConnection());
            TracerFactory.getInstance().getInterface().getUpdateHandler().Event_UpdateNotification += new TracerUpdateNotification.UpdateNotificationHandler(onTraceEvent);

            this.traceListBox.KeyDown += new KeyEventHandler(onKeyDown);
            this.KeyDown += new KeyEventHandler(onKeyDown);
            this.traceFileContentListBox.KeyDown += new KeyEventHandler(onKeyDown);
            this.traceFileContentTextBox.KeyDown += new KeyEventHandler(onKeyDown);

            progressTraceWindow = new TraceInProgressWindow();
            progressTraceWindow.Event_UpdateNotification += new CommonWindow.UpdateNotificationHandler(onWindowEvent);

            comportWindow = new ComportSelectionWindow();
            comportWindow.prepare();
            comportWindow.StartPosition             = FormStartPosition.CenterParent;
            comportWindow.Event_UpdateNotification += new CommonWindow.UpdateNotificationHandler(onWindowEvent);
            comportWindow.ShowDialog(this);
        }
예제 #9
0
 /// <summary>
 /// Debugs the specified level.
 /// </summary>
 /// <param name="level">The level.</param>
 /// <param name="dString">The d string.</param>
 private void debug(DEBUG_LEVEL level, string dString)
 {
     DebugFactory.getInstance().debug(level, debugMode, dString);
 }
예제 #10
0
 /// <summary>
 /// Debugs the error.
 /// </summary>
 /// <param name="dString">The d string.</param>
 private void debugError(string dString)
 {
     DebugFactory.getInstance().debug(Debug.DEBUG_LEVEL.ERROR, debugMode, dString);
 }