Exemple #1
0
        private void FormAddAsset_Load(object sender, EventArgs e)
        {
            AuditWizardConfiguration configuration = new AuditWizardConfiguration();

            this.labelLocation.Text    = (configuration.ShowByDomain) ? "Parent Domain;" : "Parent Location:";
            this.tbAssetName.Text      = _asset.Name;
            this.tbParentLocation.Text = (configuration.ShowByDomain) ? _asset.Domain : _asset.Location;

            // Get Asset Types and load into the combo box
            _listAssetTypes.Populate();

            // Load just the categories
            AssetTypeList categories = _listAssetTypes.EnumerateCategories();

            // ...and add to the combo
            foreach (AssetType assetType in categories)
            {
                // Add categories only if they have children
                if (_listAssetTypes.EnumerateChildren(assetType.AssetTypeID).Count != 0)
                {
                    this.cbAssetCategory.Items.Add(assetType);
                }
            }

            // Select the first asset type
            if (this.cbAssetCategory.Items.Count > 0)
            {
                this.cbAssetCategory.SelectedIndex = 0;
            }

            // Select the asset name as the user will need to change this
            this.tbAssetName.Focus();
            this.tbAssetName.SelectAll();
        }
        public ApplicationsExplorerView([ServiceDependency] WorkItem workItem)
        {
            this._workItem = workItem as LaytonWorkItem;
            InitializeComponent();
            this.Paint += new PaintEventHandler(ApplicationsExplorerView_Paint);

            //Attach the Drawfilter to the tree
            applicationsTree.DrawFilter = UltraTree_DropHightLight_DrawFilter;
            UltraTree_DropHightLight_DrawFilter.Invalidate += new EventHandler(this.UltraTree_DropHightLight_DrawFilter_Invalidate);
            UltraTree_DropHightLight_DrawFilter.QueryStateAllowedForNode += new UltraTree_DropHightLight_DrawFilter_Class.QueryStateAllowedForNodeEventHandler(this.UltraTree_DropHightLight_DrawFilter_QueryStateAllowedForNode);

            // Set the display style foe the tree so that we can swap between vista and 'standard' trees
            AuditWizardConfiguration configuration = new AuditWizardConfiguration();

            this.applicationsTree.DisplayStyle = (configuration.VistaTrees) ? UltraTreeDisplayStyle.WindowsVista : UltraTreeDisplayStyle.Standard;

            // Add the root nodes to the tree for OS and Publishers - the tree is not sorted at the root so we add OS first
            applicationsTree.Override.Sort = SortType.None;
            _rootOsNode = applicationsTree.Nodes.Add(MiscStrings.OperatingSystems, MiscStrings.OperatingSystems);
            _rootOsNode.LeftImages.Add(Properties.Resources.os_16);
            _rootOsNode.Override.Sort = SortType.Descending;
            //
            _rootPublisherNode = applicationsTree.Nodes.Add(MiscStrings.AllPublishers, MiscStrings.AllPublishers);
            _rootPublisherNode.LeftImages.Add(Properties.Resources.application_view_16);
            _rootPublisherNode.Override.Sort = SortType.Descending;

            _rootPublisherNode.Expanded = true;
        }
        public LocationsTabView([ServiceDependency] WorkItem workItem)
        {
            this.workItem = workItem as LaytonWorkItem;
            InitializeComponent();

            // Initialize the list and tree views
            //	Set the DefaultImage to a folder icon, since that is the most common
            //	type of item we will be displaying
            this.locationsList.ItemSettings.DefaultImage = Properties.Resources.location_16;

            // Populate the UltraListView's SubItemColumns collection with the columns that will represent the
            // additional information associated with the locations
            this.locationsList.SubItemColumns.Clear();
            UltraListViewSubItemColumn column = null;

            //	Set the text for the MainColumn
            this.locationsList.MainColumn.Text = "Name";

            //	Add a column for the Starting IP address
            column          = this.locationsList.SubItemColumns.Add("Starting IP Address");
            column.DataType = typeof(string);

            //	Add a column for the Ending IP Address.
            column          = this.locationsList.SubItemColumns.Add("Ending IP Address");
            column.DataType = typeof(string);

            //  Set the UltraWinListView.ColumnAutoSizeMode property so that when the end user double-clicks
            //  on the right edge of a column header, the column's width is adjusted to fully
            //  display the text for all visible items and the header.
            this.locationsList.ViewSettingsDetails.ColumnAutoSizeMode = Infragistics.Win.UltraWinListView.ColumnAutoSizeMode.VisibleItemsAndHeader;

            //  Set UltraWinListView.AutoFitColumns to 'ResizeAllColumns' so that all columns fit in the available
            //  horizontal space.
            this.locationsList.ViewSettingsDetails.AutoFitColumns = Infragistics.Win.UltraWinListView.AutoFitColumns.ResizeAllColumns;

            // Tree View
            // =========
            //
            // Set the tree view to be dynamically expanded
            this.locationsTree.Override.ShowExpansionIndicator = ShowExpansionIndicator.CheckOnExpand;

            // Set the display style foe the tree so that we can swap between vista and 'standard' trees
            AuditWizardConfiguration configuration = new AuditWizardConfiguration();

            this.locationsTree.DisplayStyle = (configuration.VistaTrees) ? UltraTreeDisplayStyle.WindowsVista : UltraTreeDisplayStyle.Standard;

            // Add the root node to the tree - we expand the tree as and when expanded
            PopulateRoot();
        }