public Form_ConnectionProperties() { InitializeComponent(); Sql.Repository repository = Program.gController.Repository; if (repository.IsValid) { this._groupBox_Properties.Text = repository.Instance; this._label_Properties.Text = "Connected to Repository on " + repository.Instance; //if (repository.User.Length > 0) //{ // this._label_Properties.Text += "\n " + repository.Instance; //} this._listView_Properties.Items.Add("SQL Server:"); this._listView_Properties.Items[_listView_Properties.Items.Count - 1].SubItems.Add(repository.SQLServerVersion + " (" + repository.SQLServerFullVersion + ")"); this._listView_Properties.Items.Add("Schema Version:"); this._listView_Properties.Items[_listView_Properties.Items.Count - 1].SubItems.Add(repository.SchemaVersion.ToString("n0")); this._listView_Properties.Items.Add("DAL Version:"); this._listView_Properties.Items[_listView_Properties.Items.Count - 1].SubItems.Add(repository.DALVersion.ToString("n0")); this._listView_Properties.Items.Add("Access Level:"); this._listView_Properties.Items[_listView_Properties.Items.Count - 1].SubItems.Add(Program.gController.Permissions.UserAccessLevel.ToString()); this._listView_Properties.Items.Add(""); this._listView_Properties.Items.Add("Registered Servers:"); this._listView_Properties.Items[_listView_Properties.Items.Count - 1].SubItems.Add(repository.RegisteredServers.Count.ToString()); } else { this._groupBox_Properties.Text = "Not Connected"; this._label_Properties.Text = "Not currently connected to a Repository"; } }
public Form_About() { InitializeComponent(); this.Text = @"About " + Utility.Constants.COMPANY_STR + " " + Utility.Constants.PRODUCT_STR; if (!string.IsNullOrEmpty(Utility.Constants.BETA_VERSION)) { this.Text += Utility.Constants.BETA_VERSION; } Description = Utility.Constants.ProductsPageText; // get assembly version and show as Product version Assembly assembly = Assembly.GetExecutingAssembly(); String version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); if (version != null && version.Equals("0.0.0.0")) { version = "1.2.0.0"; } if (version != null && version.StartsWith("v")) { version = version.Substring(1, version.Length - 1); } this._label_Version.Text = Utility.Constants.PRODUCT_STR + " " + version; // show the current copyright info this._label_Copyright.Text = Constants.COPYRIGHT_MSG; // get the current repository info Sql.Repository repository = Program.gController.Repository; if (repository.IsValid) { // Display repository info. this.groupBox_Properties.Text = @"Connection: " + repository.Instance; _lbl_SQLVersion.Text = repository.SQLServerVersionFriendlyLong; _lbl_SchemaVersion.Text = repository.SchemaVersion.ToString("g"); _lbl_DALVersion.Text = repository.DALVersion.ToString("g"); _lbl_AccessLvl.Text = Program.gController.Permissions.UserAccessLevel.ToString(); // Display license info. label_LicenseType.Text = Program.gController.Repository.bbsProductLicense.CombinedLicense.typeStr; label_LicensedServers.Text = Program.gController.Repository.bbsProductLicense.CombinedLicense.numLicensedServersStr; label_LicenseDayToExpire.Text = Program.gController.Repository.bbsProductLicense.CombinedLicense.daysToExpireStr; if (Program.gController.Repository.bbsProductLicense.CombinedLicense.isAboutToExpire) { label_LicenseDayToExpire.ForeColor = Color.Red; label_LicenseDayToExpire.BackColor = label_LicenseDayToExpire.BackColor; } } else { this.groupBox_Properties.Text = @"Connection: Not connected to a Repository"; //this._listView_Properties.Columns[0].Width = 300; //this._listView_Properties.Items.Add("Not currently connected to a repository"); } }