LoadDetails() public method

Loads the Details data.
public LoadDetails ( ) : void
return void
Beispiel #1
0
        internal DatabaseItem(DatabaseInfo info)
        {
            if (info == null)
                throw new ArgumentNullException("info");

            _info = info;
            _hasKeyFile = info.HasKeyFile;
            _hasPassword = info.HasPassword;

            if (info.Details == null)
                info.LoadDetails();
        }
Beispiel #2
0
        protected override void OnNavigatedTo(
            bool cancelled, NavigationEventArgs e)
        {
            if (cancelled)
                return;

            _database = new DatabaseInfo(
                NavigationContext.QueryString["db"]);
            _database.LoadDetails();

            _originalName = _database.Details.Name;

            lblRename.Text = string.Format(
                lblRename.Text, _originalName);
        }
Beispiel #3
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            _database = new DatabaseInfo(NavigationContext.QueryString["db"]);
            _database.LoadDetails();

            _originalName = _database.Details.Name;

            DateTime convertedDate;
            convertedDate = DateTime.Now;

            txtName.Text = _originalName;
            var urlstr = _database.Details.Url;

            var locCH = "";
            if (_database.Details.HasLocalChanges)
                locCH = "\n " + Strings.DBDetail_LocalCH;

            mnuDelKeyFile.IsEnabled = _database.HasKeyFile;
            mnuClearPW.IsEnabled =_database.HasPassword;

            switch (_database.Details.Source)
            {
                case "Demo":
                    lblSource.Text = _database.Details.Source + locCH;

                    txtURL.Visibility = Visibility.Collapsed;
                    txtURLUser.Visibility = Visibility.Collapsed;
                    txtURLPW.Visibility = Visibility.Collapsed;
                    txtDomain.Visibility = Visibility.Collapsed;
                    break;
                case "Web":
                    urlstr = _database.Details.Url;
                    lblSource.Text = _database.Details.Source + ", " + Strings.DBDetail_Updated + locCH;
                    string[] urlarr = urlstr.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                    string[] domain = urlarr[0].Split(new string[] { "\":\"" }, StringSplitOptions.RemoveEmptyEntries);
                    string[] pwd = urlarr[1].Split(new string[] { "\":\"" }, StringSplitOptions.RemoveEmptyEntries);
                    string[] url = urlarr[2].Split(new string[] { "\":\"" }, StringSplitOptions.RemoveEmptyEntries);
                    string[] user = urlarr[3].Split(new string[] { "\":\"" }, StringSplitOptions.RemoveEmptyEntries);

                    txtURL.Text = url[1].Replace("\"", string.Empty);
                    _originalURL = txtURL.Text;

                    if (user.Length > 1)
                    {
                        txtURLUser.Text = user[1].Replace("\"", string.Empty).Replace("}", string.Empty);
                        _originalUser = txtURLUser.Text;
                    }
                    else
                    {
                        txtURLUser.Visibility = Visibility.Collapsed;
                    }

                    if (pwd.Length > 1)
                    {
                        txtURLPW.Password = pwd[1].Replace("\"", string.Empty);
                        _originalPW = txtURLPW.Password;
                    }
                    else
                    {
                        txtURLPW.Visibility = Visibility.Collapsed;
                    }

                    if (domain.Length > 1)
                    {
                        txtDomain.Text = domain[1].Replace("\"", string.Empty);
                        _originalDomain = txtDomain.Text;
                    }
                    else
                    {
                        txtDomain.Visibility = Visibility.Collapsed;
                    }
                    break;
                case "DropBox":
                    convertedDate = DateTime.Parse(_database.Details.Modified);
                    lblSource.Text = _database.Details.Source + ", " + convertedDate.ToLocalTime() + locCH;
                    txtURL.Text = _database.Details.Url;
                    _originalURL = _database.Details.Url;

                    txtURLUser.Visibility = Visibility.Collapsed;
                    txtURLPW.Visibility = Visibility.Collapsed;
                    txtDomain.Visibility = Visibility.Collapsed;
                    break;
                case "SkyDrive":
                    convertedDate = DateTime.Parse(_database.Details.Modified);
                    lblSource.Text = _database.Details.Source + ", " + convertedDate.ToLocalTime() + locCH;

                    txtURL.Visibility = Visibility.Collapsed;
                    txtURLUser.Visibility = Visibility.Collapsed;
                    txtURLPW.Visibility = Visibility.Collapsed;
                    txtDomain.Visibility = Visibility.Collapsed;
                    break;
                case "WebDAV":
                    convertedDate = DateTime.Parse(_database.Details.Modified);
                    //lblModified.Text = _database.Details.Modified;
                    lblSource.Text = _database.Details.Source + ", " + convertedDate.ToLocalTime() + locCH;
                    txtName.Text = _originalName;
                    string[] urlarr2 = urlstr.Split(new string[] { "\n" }, StringSplitOptions.RemoveEmptyEntries);
                    {
                        txtURL.Text = urlarr2[0];
                        _originalURL = txtURL.Text;

                        txtURLUser.Text = urlarr2[1];
                        _originalUser = txtURLUser.Text;

                        txtURLPW.Password = urlarr2[2];
                        _originalPW = txtURLPW.Password;
                    }
                    txtDomain.Visibility = Visibility.Collapsed;
                    break;
                default:
                    lblSource.Text = Strings.Download_LocalFile + locCH;

                    txtURL.Visibility = Visibility.Collapsed;
                    txtURLUser.Visibility = Visibility.Collapsed;
                    txtURLPW.Visibility = Visibility.Collapsed;
                    txtDomain.Visibility = Visibility.Collapsed;
                    return;
            }
        }