/// <summary>Loads the <c>Update</c> information to the UI.</summary> /// <param name="sender">The object that called the event.</param> /// <param name="e">The <c>System.Windows.RoutedEventArgs</c> instance containing the event data.</param> void LoadUI(object sender, RoutedEventArgs e) { if (string.IsNullOrWhiteSpace(this.tbxUpdateDetails.Text)) { this.tbxUpdateDetails.HasError = true; this.tbxUpdateDetails.ToolTip = Properties.Resources.InputRequired; } else { this.tbxUpdateDetails.HasError = false; this.tbxUpdateDetails.ToolTip = null; } if (string.IsNullOrWhiteSpace(this.tbxUpdateName.Text)) { this.tbxUpdateName.HasError = true; this.tbxUpdateName.ToolTip = Properties.Resources.InputRequired; } else { this.tbxUpdateName.HasError = false; this.tbxUpdateName.ToolTip = null; } var urlRule = new UrlInputRule { IsRequired = true }; this.tbxSourceLocation.HasError = !urlRule.Validate(this.tbxSourceLocation.Text, null).IsValid; urlRule.IsRequired = false; this.tbxLicenseUrl.HasError = !urlRule.Validate(this.tbxLicenseUrl.Text, null).IsValid; this.tbxUpdateInfoUrl.HasError = !urlRule.Validate(this.tbxUpdateInfoUrl.Text, null).IsValid; // Load Values foreach (var t in Core.UpdateInfo.Description.Where(t => t.Lang == Utilities.Locale)) { this.tbxUpdateDetails.Text = t.Value; } foreach (var t in Core.UpdateInfo.Name.Where(t => t.Lang == Utilities.Locale)) { this.tbxUpdateName.Text = t.Value; } }
/// <summary>Loads the application info into the UI.</summary> /// <param name="sender">The object that called the event.</param> /// <param name="e">The <c>System.Windows.RoutedEventArgs</c> instance containing the event data.</param> void LoadAppInfo(object sender, RoutedEventArgs e) { if (string.IsNullOrWhiteSpace(this.tbxAppName.Text)) { this.tbxAppName.HasError = true; this.tbxAppName.ToolTip = Properties.Resources.InputRequired; } else { this.tbxAppName.HasError = false; this.tbxAppName.ToolTip = null; } if (string.IsNullOrWhiteSpace(this.tbxAppDescription.Text)) { this.tbxAppDescription.HasError = true; this.tbxAppDescription.ToolTip = Properties.Resources.InputRequired; } else { this.tbxAppDescription.HasError = false; this.tbxAppDescription.ToolTip = null; } if (string.IsNullOrWhiteSpace(this.tbxPublisher.Text)) { this.tbxPublisher.HasError = true; this.tbxPublisher.ToolTip = Properties.Resources.InputRequired; } else { this.tbxPublisher.HasError = false; this.tbxPublisher.ToolTip = null; } var urlRule = new UrlInputRule { IsRequired = true }; this.tbxValueName.HasError = !new RequiredInputRule().Validate(this.tbxValueName.Text, null).IsValid; if (this.rbtnRegistry.IsChecked.GetValueOrDefault()) { this.tbxAppLocation.HasError = !new RegistryPathRule().Validate(this.tbxAppLocation.Text, null).IsValid; } else { this.tbxAppLocation.HasError = !new AppDirectoryRule().Validate(this.tbxAppLocation.Text, null).IsValid; } this.tbxSuiUrl.HasError = !new SuiLocationRule().Validate(this.tbxSuiUrl.Text, null).IsValid; this.tbxAppUrl.HasError = !urlRule.Validate(this.tbxAppUrl.Text, null).IsValid; this.tbxHelpUrl.HasError = !urlRule.Validate(this.tbxHelpUrl.Text, null).IsValid; this.tbxValueName.ToolTip = this.tbxValueName.HasError ? Properties.Resources.InputRequired : null; this.tbxAppLocation.ToolTip = this.tbxAppLocation.HasError ? Properties.Resources.UrlSui : null; this.tbxSuiUrl.ToolTip = this.tbxSuiUrl.HasError ? Properties.Resources.FilePathInvalid : null; this.tbxAppUrl.ToolTip = this.tbxAppUrl.HasError ? Properties.Resources.UrlNotValid : null; this.tbxHelpUrl.ToolTip = this.tbxHelpUrl.HasError ? Properties.Resources.UrlNotValid : null; // Load Values foreach (var t in Core.AppInfo.Name.Where(t => t.Lang == Utilities.Locale)) { this.tbxAppName.Text = t.Value; } foreach (var t in Core.AppInfo.Description.Where(t => t.Lang == Utilities.Locale)) { this.tbxAppDescription.Text = t.Value; } foreach (var t in Core.AppInfo.Publisher.Where(t => t.Lang == Utilities.Locale)) { this.tbxPublisher.Text = t.Value; } oldPlatform = Core.AppInfo.Platform; }