public ScheduledJobAttribute(string uid, StartUpMode startupMode = StartUpMode.Automatic, string cronString = null, string description = null)
 {
     Uid         = uid.ToGuid();
     StartupMode = startupMode;
     CronString  = cronString;
     Description = description;
 }
        /// <summary>
        /// Initializes the device, user and system
        /// </summary>
        private void IntializeSystem()
        {
            _device = _login.Device;
            _device.Location = "pIT lab";

            _owner = _login.User;
            _startMode = _login.Mode;
            InitializeNetwork();
        }
        private void LogIn()
        {
            txtTooltip.Text = "Please wait while we check your login.";
            string baseUrl = Settings.Default.ENVIRONMENT_BASE_URL;
            string result = Rest.Get(baseUrl + "Users?email=" + txtEmail.Text);
            User u = JsonConvert.DeserializeObject<User>(result);
            if (u != null)
                this.User = u;
            else
                CreateUser(baseUrl);

            this.Device = new Device();
            this.Device.Name = txtDevicename.Text;
            this.Device.DeviceType = (DeviceType)cbType.SelectedValue;
            Device.TagValue = (int)cbTag.SelectedValue;

            if (rbClient.IsChecked == true)
                this.Mode = StartUpMode.Client;
            else
                this.Mode = StartUpMode.Host;

            if (chkRemember.IsChecked == true)
                SaveSettings();

            if (LoggedIn != null)
                LoggedIn(this, new EventArgs());
        }