Ejemplo n.º 1
0
        /// <summary>
        /// Add all our Extra Icons inside ExtraImages (member variable) in the order
        ///  they exist in our ImageList.  If programmer does not add things in the
        ///  right order, an Exception will be thrown by this method (see Important Notes
        ///  above).
        /// </summary>
        protected void AddExtraIcons()
        {
            int    i = 0;
            string keyString;

            foreach (Image image in ExtraImages.Images)
            {
                switch (i)
                {
                case (int)ExtraImageTypes.Relationships:
                    keyString = Relationship_ImageText;
                    break;

                case (int)ExtraImageTypes.BaseFolder:
                    keyString = BaseFolder_ImageText;
                    break;

                case (int)ExtraImageTypes.PackageGroup:
                    keyString = PackageGroup_ImageText;
                    break;

                case (int)ExtraImageTypes.PackageObject:
                    keyString = PackageObject_ImageText;
                    break;

                case (int)ExtraImageTypes.Package:
                    keyString = Package_ImageText;
                    break;

                case (int)ExtraImageTypes.GeneralAsset:
                    keyString = Asset_ImageText;
                    break;

                default:
                    throw new Exception("Programmer has added an image to the 'ExtraImages' ImageList in "
                                        + "MogControl_BaseTreeView without properly adding a const string and or an enum "
                                        + "for that Image!!");
                }
                MogUtil_AssetIcons.AddIcon(image, keyString);
                ++i;
            }
        }