Exemplo n.º 1
0
        private void Login_Clicked(TrakHound_UI.Button bt)
        {
            if (!string.IsNullOrEmpty(Username) && !string.IsNullOrEmpty(Password))
            {
                var username = Username;
                var password = Password;
                Password = null;

                var user = User.Get(username, password);
                password = null;
                if (user != null && user.ApiKey != null)
                {
                    // Load the Default DataServer settings to default to
                    var dataServer = GetDefaultDataServer();
                    if (dataServer != null)
                    {
                        var item = new DataServerItem(dataServer);
                        item.Hostname = "streaming.trakhound.com";
                        item.Port     = 443;
                        item.UseSSL   = true;
                        item.ApiKey   = user.ApiKey.Token;

                        DataServerItems.Add(item);
                        SelectedDataServer = item;

                        SaveDataServers();
                    }
                    else
                    {
                        MessageBox.Show("Error Adding DataServer. File 'client.config.default' not found or is corrupt.", "Error Adding DataServer");
                        log.Error("Get Default DataServer Error :: NOT FOUND!");
                    }
                }
            }
        }
Exemplo n.º 2
0
 internal void SetSelectedDataServer(DataServerItem dataServer)
 {
     if (dataServer != null)
     {
         SelectedDataServerHostname     = dataServer.Hostname;
         SelectedDataServerPort         = dataServer.Port;
         SelectedDataServerSendInterval = dataServer.SendInterval;
         SelectedDataServerUseSSL       = dataServer.UseSSL;
     }
     else
     {
         SelectedDataServerHostname     = null;
         SelectedDataServerPort         = 8472;
         SelectedDataServerSendInterval = 500;
         SelectedDataServerUseSSL       = false;
     }
 }
Exemplo n.º 3
0
        private void AddDataServer_Clicked(TrakHound_UI.Button bt)
        {
            // Load the Default DataServer settings to default to
            var dataServer = GetDefaultDataServer();

            if (dataServer != null)
            {
                var item = new DataServerItem(dataServer);
                item.Hostname = AddDataServerHostname;
                item.Port     = AddDataServerPort;
                item.UseSSL   = AddDataServerUseSSL;

                DataServerItems.Add(item);
                SelectedDataServer = item;

                SaveDataServers();
            }
            else
            {
                MessageBox.Show("Error Adding DataServer. File 'client.config.default' not found or is corrupt.", "Error Adding DataServer");
                log.Error("Get Default DataServer Error :: NOT FOUND!");
            }
        }