コード例 #1
0
        /// <summary>
        /// Initialize the data displayed on the license tab
        /// </summary>
        private void InitializeLicenseTab()
        {
            // Load the application license types
            // Populate the list view with the existing license types
            LicenseTypesDAO lwDataAccess      = new LicenseTypesDAO();
            DataTable       licenseTypesTable = lwDataAccess.EnumerateLicenseTypes();

            // Iterate through the returned items
            cbLicenseType.BeginUpdate();
            foreach (DataRow row in licenseTypesTable.Rows)
            {
                LicenseType licenseType = new LicenseType(row);
                cbLicenseType.Items.Add(licenseType, licenseType.Name);
            }
            cbLicenseType.SortStyle = ValueListSortStyle.Ascending;
            cbLicenseType.EndUpdate();

            // OK are we editing an existing definition or trying to create a new one?
            if (_applicationLicense.LicenseID == 0)
            {
                cbLicenseType.SelectedIndex = 0;
                footerPictureBox.Image      = Properties.Resources.application_license_add_corner;
                this.Text = "Add Application License";
            }
            else
            {
                footerPictureBox.Image = Properties.Resources.application_license_edit_corner;
                this.Text = "Edit Application License";
                cbLicenseType.SelectedIndex = cbLicenseType.FindStringExact(_applicationLicense.LicenseTypeName);
                nupLicenseCount.Value       = _applicationLicense.Count;
            }

            tbApplication.Text = _applicationName;
        }
コード例 #2
0
        /// <summary>
        /// Initialize the license types form
        /// </summary>
        private void InitializeLicenseTypes()
        {
            lvLicenseTypes.BeginUpdate();
            lvLicenseTypes.Items.Clear();

            // Populate the list view with the existing license types
            LicenseTypesDAO lwDataAccess      = new LicenseTypesDAO();
            DataTable       licenseTypesTable = lwDataAccess.EnumerateLicenseTypes();

            // Iterate through the returned items
            foreach (DataRow row in licenseTypesTable.Rows)
            {
                LicenseType            licenseType  = new LicenseType(row);
                UltraListViewSubItem[] subItemArray = new UltraListViewSubItem[1];
                subItemArray[0]       = new UltraListViewSubItem();
                subItemArray[0].Value = (licenseType.PerComputer) ? "Yes" : "No";
                UltraListViewItem item = new UltraListViewItem(licenseType.Name, subItemArray);
                item.Tag = licenseType;
                lvLicenseTypes.Items.Add(item);
            }
            lvLicenseTypes.EndUpdate();
        }