Beispiel #1
0
        private void AddType()
        {
            // Get the selected (active) category
            AssetType activeAssetType = _activeItem.Tag as AssetType;

            // Create a new asset type object
            AssetType newAssetType = new AssetType();

            newAssetType.SetParentCategory(activeAssetType);
            newAssetType.Icon = activeAssetType.Icon;

            // ...and invoke the AssetType Properties form
            FormAssetType form = new FormAssetType(activeAssetType, newAssetType);

            if (form.ShowDialog() == DialogResult.OK)
            {
                RefreshTab();
            }
        }
Beispiel #2
0
        private void EditType()
        {
            // Get the currently selected asset type in the list view (if any)
            if (this.ulvAssetTypes.SelectedItems.Count == 0)
            {
                return;
            }
            AssetType subType = this.ulvAssetTypes.SelectedItems[0].Tag as AssetType;

            // Get the selected (active) category
            AssetType activeAssetCategory = _activeItem.Tag as AssetType;

            // ...and invoke the AssetType Properties form
            FormAssetType form = new FormAssetType(activeAssetCategory, subType);

            if (form.ShowDialog() == DialogResult.OK)
            {
                RefreshTab();
            }
        }