public DatabaseWindow(ThalamusClient client, IStudentsDatabase db)
        {
            InitializeComponent();

            _controller = new DatabaseWindowController(db);

            // this snippet helps customizing the DatePicker format. (See -> http://www.codeproject.com/Questions/346685/How-to-Display-DatePicker-in-different-format)
            CultureInfo ci = CultureInfo.CreateSpecificCulture(CultureInfo.CurrentCulture.Name); 
            ci.DateTimeFormat.ShortDatePattern = "dd/MM/yyyy";
            Thread.CurrentThread.CurrentCulture = ci;

            
            IsEnabled = false;

            if (db.IsConnected())
            {
                LoadDatabaseData();
                DatabaseStatus.Text = "Connected";
                DatabaseStatus.Foreground = new SolidColorBrush(Colors.Green);
            }
            else
            {
                DatabaseStatus.Text = "Waiting for connection...";
            }

            db.ConnectedEvent += delegate(object sender, EventArgs args)
            {
                this.Dispatcher.Invoke(new Action(() =>
                {
                    DatabaseStatus.Text = "Connected";
                    DatabaseStatus.Foreground = new SolidColorBrush(Colors.Green);
                }));
                LoadDatabaseData();
            };
            db.ConnectedEvent += delegate(object sender, EventArgs args)
            {
                this.Dispatcher.Invoke(new Action(() =>
                {
                    DatabaseStatus.Text = "Timeout";
                    DatabaseStatus.Foreground = new SolidColorBrush(Colors.Red);
                }));
            };
        }
		public ThalamusPublisher (Type interfaceType, ThalamusClient client)
		{
			this.interfaceType = interfaceType;
			this.thalamusClient = client;
			thalamusClient.Debug("Creating publisher from type '" + interfaceType.Name + "'");
		}
Example #3
0
        public ThalamusClientLogForm(ThalamusClient client)
        {
            InitializeComponent();

            this.client = client;

            logs.Columns.Add("Time", typeof(Double));
            logs.Columns.Add("CharacterName", typeof(String));
            logs.Columns.Add("SourceClient", typeof(String));
            logs.Columns.Add("TargetClient", typeof(String));
            logs.Columns.Add("EventName", typeof(String));
            logs.Columns.Add("EventDetails", typeof(String));
                       
            dgvLog.CellFormatting +=new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dgvLog_CellFormatting);
            refreshClock.Start();

            lstEventNameFilters.Sorted = true;

            /*client.ClientConnected += (ThalamusClient.ClientConnectedHandler)(() =>
            {
                this.Invoke((MethodInvoker)(() => RebuildFilters()));
            });

            client.NewClientConnected += (ThalamusClient.NewClientConnectedHandler)((name, newClientId) =>
            {
                this.Invoke((MethodInvoker)(() => RebuildFilters()));
            });

            client.EventLogged += (EventLoggedHandler)((logEntry) =>
            {
                AddLog(logEntry);
            });*/

        }
 public ThalamusClientService(ThalamusClient client, string clientAddress = "")
 {
     this.client = client;
     this.clientAddress = clientAddress;
 }