コード例 #1
0
        /// <summary>
        /// This function is called when we have selected a specific 'Operating System Family' node below 'All Assets'
        /// In this case we need to display a list of assets for which this Operating System has been installed
        /// </summary>
        /// <param name="displayedNode"></param>
        protected void DisplayAllAssets_OS(UltraTreeNode displayedNode)
        {
            // Ensure that the tree view is already populated for this branch
            NetworkExplorerView explorerView = workItem.ExplorerView as NetworkExplorerView;

            explorerView.ExpandNode(displayedNode);

            // We are displaying ALL publishers - add in columns for
            // Application Object and Publisher
            DataColumn column1 = new DataColumn("ApplicationObject", typeof(object));
            DataColumn column2 = new DataColumn("Asset", typeof(string));
            DataColumn column3 = new DataColumn("Version", typeof(string));
            DataColumn column4 = new DataColumn("Serial Number", typeof(string));
            DataColumn column5 = new DataColumn("CD Key", typeof(string));

            // Add these columns to the DataSet
            applicationsDataSet.Tables[0].Columns.AddRange(new System.Data.DataColumn[] { column1, column2, column3, column4, column5 });

            // Get a list of assets for which this application has
            AllAssets   allAssets = displayedNode.Tag as AllAssets;
            InstalledOS thisOS    = allAssets.Tag as InstalledOS;

            // This will give us (any) instances
            foreach (OSInstance instance in thisOS.Instances)
            {
                // Note we save the UltraTreeNode tag with this row as this should relate to the application
                Asset asset = new Asset();
                asset.Name    = instance.InstalledOnComputer;
                asset.AssetID = instance.InstalledOnComputerID;
                asset.Icon    = instance.InstalledOnComputerIcon;
                applicationsDataSet.Tables[0].Rows.Add(new object[] { asset, asset.Name, instance.Version, instance.Serial.ProductId, instance.Serial.CdKey });
            }
        }
コード例 #2
0
 /// <summary>
 /// Copy Constructor
 /// </summary>
 /// <param name="other"></param>
 public AllAssets(AllAssets other)
 {
     _parentGroup = other.ParentGroup;
     _nodeType    = other.AllAssetType;
     _branchName  = other.BranchName;
     _itemValue   = other.ItemValue;
     _listAssets  = other.ListAssets;
     _tag         = other.Tag;
 }
コード例 #3
0
        /// <summary>
        /// Called when we have selected a specific item value within the 'AllAssets' branch.  We are to display
        /// the assets which have this value
        /// </summary>
        /// <param name="displayedNode"></param>
        protected void DisplayAllAssetsDataValues(UltraTreeNode displayedNode)
        {
            DataColumn objectColumn = new DataColumn("DataObject", typeof(object));
            DataColumn itemColumn   = new DataColumn("Asset", typeof(string));

            auditDataSet.Tables[0].Columns.AddRange(new System.Data.DataColumn[] { objectColumn, itemColumn });

            // First we add the SUB-CATEGORIES to the list
            AllAssets allAssets = displayedNode.Tag as AllAssets;

            foreach (Asset asset in allAssets.ListAssets)
            {
                auditDataSet.Tables[0].Rows.Add(new object[] { asset, asset.Name });
            }
        }
コード例 #4
0
        /// <summary>
        /// Display the data for this tab where we have selected an 'All Assets' node or child node thereof
        /// </summary>
        /// <param name="displayedNode"></param>
        protected void DisplayForAllAssets(UltraTreeNode displayedNode)
        {
            // Determine the key for this displayed item from the key for the tree node remembering that we must
            // strip off the AllAssets key name which is the first part of the key.
            string    itemKey    = displayedNode.Key;
            int       nDelimiter = itemKey.IndexOf(AWMiscStrings.AllAssetsNode);
            AllAssets allAssets  = displayedNode.Tag as AllAssets;

            // Ensure that the tree view is already populated for this branch
            NetworkExplorerView explorerView = workItem.ExplorerView as NetworkExplorerView;

            explorerView.ExpandNode(displayedNode);

            // Are we displaying a category or value/
            if (allAssets.ItemValue == "")
            {
                DisplayAllAssetsDataCategories(displayedNode);
            }
            else
            {
                DisplayAllAssetsDataValues(displayedNode);
            }
        }