Home
%3CLINGO-SUB%20id%3D%22lingo-sub-347713%22%20slang%3D%22en-US%22%3EIIS7%20%E2%80%93%20Adding%20your%20UI%20extension%20to%20the%20IIS%20manager%20hierarchy%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-347713%22%20slang%3D%22en-US%22%3E%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoe%20ui%26amp%3Bquot%3B%2Ctahoma%2Carial%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Csans-serif%3B%20font-size%3A%2014px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200px%200px%2010px%200px%3B%22%3EIn%20the%20%3CA%20style%3D%22background-color%3A%20transparent%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23337ab7%3B%20text-decoration%3A%20none%3B%22%20href%3D%22http%3A%2F%2Fblogs.msdn.com%2Fwebtopics%2Farchive%2F2008%2F06%2F10%2Fiis7-writing-your-first-custom-ui-module-with-all-winform-controls.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Elast%20post%3C%2FA%3E%20I%20was%20talking%20about%20writing%20a%20simple%20UI%20extension%20which%20would%20appear%20like%20below%3A%3C%2FP%3E%0A%3CBLOCKQUOTE%20style%3D%22border-left-color%3A%20%23eeeeee%3B%20border-left-style%3A%20solid%3B%20border-left-width%3A%205px%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoe%20ui%26amp%3Bquot%3B%2Ctahoma%2Carial%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Csans-serif%3B%20font-size%3A%2017.5px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20padding%3A%2010px%2020px%2010px%2020px%3B%20margin%3A%200px%200px%2020px%200px%3B%22%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20margin%3A%200px%3B%22%3E%3CA%20style%3D%22background-color%3A%20transparent%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23337ab7%3B%20text-decoration%3A%20none%3B%22%20href%3D%22https%3A%2F%2Fmsdnshared.blob.core.windows.net%2Fmedia%2FTNBlogsFS%2FBlogFileStorage%2Fblogs_msdn%2Fwebtopics%2FWindowsLiveWriter%2FIIS7AddingyourUIextensiontotheIISmanager_716B%2Fimage_2.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CIMG%20width%3D%22194%22%20height%3D%22140%22%20title%3D%22image%22%20style%3D%22border-image-outset%3A%200%3B%20border-image-repeat%3A%20stretch%3B%20border-image-slice%3A%20100%25%3B%20border-image-source%3A%20none%3B%20border-image-width%3A%201%3B%20box-sizing%3A%20border-box%3B%20height%3A%20auto%3B%20max-width%3A%20100%25%3B%20vertical-align%3A%20middle%3B%20border%3A%200px%20none%20currentColor%3B%22%20alt%3D%22image%22%20src%3D%22https%3A%2F%2Fmsdnshared.blob.core.windows.net%2Fmedia%2FTNBlogsFS%2FBlogFileStorage%2Fblogs_msdn%2Fwebtopics%2FWindowsLiveWriter%2FIIS7AddingyourUIextensiontotheIISmanager_716B%2Fimage_thumb.png%22%20border%3D%220%22%20%2F%3E%3C%2FA%3E%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoe%20ui%26amp%3Bquot%3B%2Ctahoma%2Carial%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Csans-serif%3B%20font-size%3A%2014px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200px%200px%2010px%200px%3B%22%3EHow%20about%20you%20adding%20this%20to%20the%20IIS%20manager%20hierarchy%20%E2%80%93%20just%20below%20%E2%80%9CApplication%20Pools%E2%80%9D%20and%20%E2%80%9CFTP%20Sites%E2%80%9D%3F%20Here%20is%20what%20you%20need%20to%20do%20additional%20to%20the%20steps%20you%20followed%20using%20my%20%3CA%20style%3D%22background-color%3A%20transparent%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23337ab7%3B%20text-decoration%3A%20none%3B%22%20href%3D%22http%3A%2F%2Fblogs.msdn.com%2Fwebtopics%2Farchive%2F2008%2F06%2F10%2Fiis7-writing-your-first-custom-ui-module-with-all-winform-controls.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Eprevious%20blog%3C%2FA%3E%20on%20this.%3C%2FP%3E%0A%3COL%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoe%20ui%26amp%3Bquot%3B%2Ctahoma%2Carial%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Csans-serif%3B%20font-size%3A%2014px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20margin-bottom%3A%2010px%3B%20margin-top%3A%200px%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3E%0A%3CLI%20style%3D%22box-sizing%3A%20border-box%3B%22%3EAdd%20a%20new%20class%20to%20the%20project%20and%20name%20it%20as%20MyHierarchyProvider%2C%20and%20the%20file%20as%20MyHierarchyProvider.cs%3C%2FLI%3E%0A%3CLI%20style%3D%22box-sizing%3A%20border-box%3B%22%3EMyHierarchyProvider%20should%20derive%20from%20Microsoft.Web.Management.Client.HierarchyProvider%3C%2FLI%3E%0A%3CLI%20style%3D%22box-sizing%3A%20border-box%3B%22%3EIt%20should%20have%20an%20internal%20class%20deriving%20from%20Microsoft.Web.Management.Client.HierarchyInfo%20where%20you%20can%20extend%20few%20properties%20to%20specify%20the%20display%20text%2C%20and%20which%20ModulePage%20it%20links%20to.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoe%20ui%26amp%3Bquot%3B%2Ctahoma%2Carial%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Csans-serif%3B%20font-size%3A%2014px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200px%200px%2010px%200px%3B%22%3EBelow%20is%20a%20sample%20code%20which%20would%20define%20a%20class%20deriving%20from%20HierarchyProvider%2C%20and%20has%20an%20internal%20class%20with%20all%20its%20properties%20set.%3C%2FP%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoe%20ui%26amp%3Bquot%3B%2Ctahoma%2Carial%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Csans-serif%3B%20font-size%3A%2014px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200px%200px%2010px%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%20style%3D%22background-attachment%3A%20scroll%3B%20background-clip%3A%20border-box%3B%20background-color%3A%20%23808080%3B%20background-image%3A%20none%3B%20background-origin%3A%20padding-box%3B%20background-position-x%3A%200%25%3B%20background-position-y%3A%200%25%3B%20background-repeat%3A%20repeat%3B%20background-size%3A%20auto%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoe%20ui%26amp%3Bquot%3B%2Ctahoma%2Carial%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Csans-serif%3B%20font-size%3A%2014px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20margin-left%3A%204px%3B%20margin-right%3A%204px%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20padding%3A%200px%3B%22%3E%0A%3CDIV%20style%3D%22background-attachment%3A%20scroll%3B%20background-clip%3A%20border-box%3B%20background-color%3A%20%23ffffff%3B%20background-image%3A%20none%3B%20background-origin%3A%20padding-box%3B%20background-position-x%3A%200%25%3B%20background-position-y%3A%200%25%3B%20background-repeat%3A%20repeat%3B%20background-size%3A%20auto%3B%20box-sizing%3A%20border-box%3B%20color%3A%20black%3B%20left%3A%20-2px%3B%20position%3A%20relative%3B%20top%3A%20-2px%3B%20border%3A%201px%20solid%20%232e595c%3B%22%3E%0A%3CDIV%20style%3D%22background-attachment%3A%20scroll%3B%20background-clip%3A%20border-box%3B%20background-color%3A%20%233f73b6%3B%20background-image%3A%20none%3B%20background-origin%3A%20padding-box%3B%20background-position-x%3A%200%25%3B%20background-position-y%3A%200%25%3B%20background-repeat%3A%20repeat%3B%20background-size%3A%20auto%3B%20box-sizing%3A%20border-box%3B%20color%3A%20white%3B%20width%3A%20100%25%3B%20border%3A%201px%20solid%20blue%3B%22%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20width%3A%20100%25%3B%22%3EMyHierarchyProvider.cs%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CPRE%20style%3D%22background-color%3A%20%23f5f5f5%3B%20border-bottom-left-radius%3A%204px%3B%20border-bottom-right-radius%3A%204px%3B%20border-image-outset%3A%200%3B%20border-image-repeat%3A%20stretch%3B%20border-image-slice%3A%20100%25%3B%20border-image-source%3A%20none%3B%20border-image-width%3A%201%3B%20border-top-left-radius%3A%204px%3B%20border-top-right-radius%3A%204px%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20display%3A%20block%3B%20font-family%3A%20Menlo%2CMonaco%2CConsolas%2C%26amp%3Bquot%3B%20courier%20new%26amp%3Bquot%3B%2Cmonospace%3B%20font-size%3A%2013px%3B%20line-height%3A%201.4285%3B%20overflow%3A%20auto%3B%20overflow-wrap%3A%20break-word%3B%20word-break%3A%20break-all%3B%20padding%3A%209.5px%3B%20margin%3A%200px%200px%2010px%200px%3B%20border%3A%201px%20solid%20%23cccccc%3B%22%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Eusing%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20System%3B%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Eusing%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20System.Collections.Generic%3B%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Eusing%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20System.Text%3B%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Eusing%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20Microsoft.Web.Management.Client%3B%0A%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Enamespace%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20MyIIS7UIExtensions%0A%7B%0A%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Einternal%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Eclass%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23a31515%3B%22%3EMyHierarchyProvider%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20%3A%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23a31515%3B%22%3EHierarchyProvider%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Epublic%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20MyHierarchyProvider(%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23a31515%3B%22%3EIServiceProvider%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20serviceProvider)%0A%20%20%20%20%20%20%20%20%20%20%20%20%3A%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Ebase%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E(serviceProvider)%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Epublic%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Eoverride%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23a31515%3B%22%3EHierarchyInfo%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%5B%5D%20GetChildren(%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23a31515%3B%22%3EHierarchyInfo%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20item)%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Eif%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20(item.NodeType%20%3D%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23a31515%3B%22%3EHierarchyInfo%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E.ServerConnection)%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Ereturn%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Enew%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23a31515%3B%22%3EHierarchyInfo%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%5B%5D%20%7B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Enew%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23a31515%3B%22%3EDemoHierarchyInfo%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E(%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Ethis%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E)%20%7D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Ereturn%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Enull%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Einternal%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Eclass%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23a31515%3B%22%3EDemoHierarchyInfo%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20%3A%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23a31515%3B%22%3EHierarchyInfo%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20%20%20%20%20%20%20%20%7B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Epublic%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20DemoHierarchyInfo(%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23a31515%3B%22%3EIServiceProvider%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20serviceProvider)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Ebase%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E(serviceProvider)%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Epublic%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Eoverride%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Estring%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20NodeType%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Eget%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Ereturn%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23ff00ff%3B%22%3E%22MyHierarchyProvider%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Epublic%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Eoverride%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Ebool%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20SupportsChildren%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Eget%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Ereturn%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Efalse%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Epublic%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Eoverride%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Estring%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20Text%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Eget%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Ereturn%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23ff00ff%3B%22%3E%22SimpleIIS7UIModule%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Eprotected%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Eoverride%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Ebool%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20OnSelected()%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Ereturn%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E%20Navigate(%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3Etypeof%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E(%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23a31515%3B%22%3EMyPage%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3E))%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%7D%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20margin%3A%200px%200px%2010px%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoe%20ui%26amp%3Bquot%3B%2Ctahoma%2Carial%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Csans-serif%3B%20font-size%3A%2014px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200px%200px%2010px%200px%3B%22%3EAfter%20doing%20above%2C%20you%20might%20also%20want%20to%20make%20some%20changes%20in%20your%20existing%20Module%20class%2C%20so%20that%20it%20has%20the%20information%20about%20the%20hierarchy.%20If%20you%20have%20downloaded%20the%20sample%20which%20I%20have%20linked%20in%20my%20%3CA%20style%3D%22background-color%3A%20transparent%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23337ab7%3B%20text-decoration%3A%20none%3B%22%20href%3D%22http%3A%2F%2Fblogs.msdn.com%2Fwebtopics%2Farchive%2F2008%2F06%2F10%2Fiis7-writing-your-first-custom-ui-module-with-all-winform-controls.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Eearlier%3C%2FA%3E%20post%2C%20you%20should%20be%20having%202%20lines%20commented%20(I%20forgot%20to%20remove%20them%20last%20time..%20lol)%20%E2%80%93%20uncomment%20them%2C%20and%20you%20are%20good%20to%20go.%20However%20below%20are%20the%202%20lines%20which%20you%20need%20to%20add%20to%20link%20this%20hierarchy%20provider%20with%20our%20module.%3C%2FP%3E%0A%3CBLOCKQUOTE%20style%3D%22border-left-color%3A%20%23eeeeee%3B%20border-left-style%3A%20solid%3B%20border-left-width%3A%205px%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoe%20ui%26amp%3Bquot%3B%2Ctahoma%2Carial%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Csans-serif%3B%20font-size%3A%2017.5px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20padding%3A%2010px%2020px%2010px%2020px%3B%20margin%3A%200px%200px%2020px%200px%3B%22%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20margin%3A%200px%3B%22%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3EIExtensibilityManager%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%232b91af%3B%22%3E%20extensibilityManager%20%3D%20(%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3EIExtensibilityManager%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%232b91af%3B%22%3E)GetService(%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23a31515%3B%22%3Etypeof%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%232b91af%3B%22%3E(%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3EIExtensibilityManager%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%232b91af%3B%22%3E))%3B%3CBR%20style%3D%22box-sizing%3A%20border-box%3B%22%20%2F%3E%3CBR%20style%3D%22box-sizing%3A%20border-box%3B%22%20%2F%3EextensibilityManager.RegisterExtension(%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23a31515%3B%22%3Etypeof%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%232b91af%3B%22%3E(%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3EHierarchyProvider%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%232b91af%3B%22%3E)%2C%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23a31515%3B%22%3Enew%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%230000ff%3B%22%3EMyHierarchyProvider%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%232b91af%3B%22%3E(serviceProvider))%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoe%20ui%26amp%3Bquot%3B%2Ctahoma%2Carial%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Csans-serif%3B%20font-size%3A%2014px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200px%200px%2010px%200px%3B%22%3EThis%20would%20register%20the%20HierarchyProvider%20class%20to%20our%20module%2C%20and%20after%20building%20our%20assembly%2C%20and%20placing%20the%20DLL%20in%20GAC%20successfully%2C%20and%20after%20having%20all%20the%20administrationHost.config%20settings%2C%20you%20must%20see%20the%20below%3A%3C%2FP%3E%0A%3CBLOCKQUOTE%20style%3D%22border-left-color%3A%20%23eeeeee%3B%20border-left-style%3A%20solid%3B%20border-left-width%3A%205px%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoe%20ui%26amp%3Bquot%3B%2Ctahoma%2Carial%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Csans-serif%3B%20font-size%3A%2017.5px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20padding%3A%2010px%2020px%2010px%2020px%3B%20margin%3A%200px%200px%2020px%200px%3B%22%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20margin%3A%200px%3B%22%3E%3CA%20style%3D%22background-color%3A%20transparent%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23337ab7%3B%20text-decoration%3A%20none%3B%22%20href%3D%22https%3A%2F%2Fmsdnshared.blob.core.windows.net%2Fmedia%2FTNBlogsFS%2FBlogFileStorage%2Fblogs_msdn%2Fwebtopics%2FWindowsLiveWriter%2FIIS7AddingyourUIextensiontotheIISmanager_716B%2Fimage_4.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CIMG%20width%3D%22621%22%20height%3D%22230%22%20title%3D%22image%22%20style%3D%22border-image-outset%3A%200%3B%20border-image-repeat%3A%20stretch%3B%20border-image-slice%3A%20100%25%3B%20border-image-source%3A%20none%3B%20border-image-width%3A%201%3B%20box-sizing%3A%20border-box%3B%20height%3A%20auto%3B%20max-width%3A%20100%25%3B%20vertical-align%3A%20middle%3B%20border%3A%200px%20none%20currentColor%3B%22%20alt%3D%22image%22%20src%3D%22https%3A%2F%2Fmsdnshared.blob.core.windows.net%2Fmedia%2FTNBlogsFS%2FBlogFileStorage%2Fblogs_msdn%2Fwebtopics%2FWindowsLiveWriter%2FIIS7AddingyourUIextensiontotheIISmanager_716B%2Fimage_thumb_1.png%22%20border%3D%220%22%20%2F%3E%3C%2FA%3E%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoe%20ui%26amp%3Bquot%3B%2Ctahoma%2Carial%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Csans-serif%3B%20font-size%3A%2014px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200px%200px%2010px%200px%3B%22%3EAnd%2C%20you%20can%20change%20the%20Text%20property%20of%20our%20HierachyInfo%20which%20is%20an%20internal%20class%20to%20change%20the%20display%20name%20appearing%20in%20the%20UI.%20Don%E2%80%99t%20hesitate%20to%20put%20your%20questions%20or%20anything%20you%20want%20to%20let%20me%20know%20through%20comments!%3C%2FP%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoe%20ui%26amp%3Bquot%3B%2Ctahoma%2Carial%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Csans-serif%3B%20font-size%3A%2014px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200px%200px%2010px%200px%3B%22%3EHappy%20learning.%3C%2FP%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoe%20ui%26amp%3Bquot%3B%2Ctahoma%2Carial%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Csans-serif%3B%20font-size%3A%2014px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200px%200px%2010px%200px%3B%22%3E%3CSTRONG%3EAuthor%3A%20Rakki%20Muthukumar%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E

In the last post I was talking about writing a simple UI extension which would appear like below:

image

How about you adding this to the IIS manager hierarchy – just below “Application Pools” and “FTP Sites”? Here is what you need to do additional to the steps you followed using my previous blog on this.

  1. Add a new class to the project and name it as MyHierarchyProvider, and the file as MyHierarchyProvider.cs
  2. MyHierarchyProvider should derive from Microsoft.Web.Management.Client.HierarchyProvider
  3. It should have an internal class deriving from Microsoft.Web.Management.Client.HierarchyInfo where you can extend few properties to specify the display text, and which ModulePage it links to.

Below is a sample code which would define a class deriving from HierarchyProvider, and has an internal class with all its properties set.

 

MyHierarchyProvider.cs
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Web.Management.Client;

namespace MyIIS7UIExtensions
{
    internal class MyHierarchyProvider : HierarchyProvider
    {
        public MyHierarchyProvider(IServiceProvider serviceProvider)
            : base(serviceProvider)
        {
        }
        public override HierarchyInfo[] GetChildren(HierarchyInfo item)
        {
            if (item.NodeType == HierarchyInfo.ServerConnection)
            {
                return new HierarchyInfo[] { new DemoHierarchyInfo(this) };
            }

            return null;
        }
        internal class DemoHierarchyInfo : HierarchyInfo
        {

            public DemoHierarchyInfo(IServiceProvider serviceProvider)
                : base(serviceProvider)
            {
            }

            public override string NodeType
            {
                get
                {
                    return "MyHierarchyProvider";
                }
            }

            public override bool SupportsChildren
            {
                get
                {
                    return false;
                }
            }

            public override string Text
            {
                get
                {
                    return "SimpleIIS7UIModule";
                }
            }

            protected override bool OnSelected()
            {
                return Navigate(typeof(MyPage));
            }
        }
    }
}

 

After doing above, you might also want to make some changes in your existing Module class, so that it has the information about the hierarchy. If you have downloaded the sample which I have linked in my earlier post, you should be having 2 lines commented (I forgot to remove them last time.. lol) – uncomment them, and you are good to go. However below are the 2 lines which you need to add to link this hierarchy provider with our module.

IExtensibilityManager extensibilityManager = (IExtensibilityManager)GetService(typeof(IExtensibilityManager));

extensibilityManager.RegisterExtension(
typeof(HierarchyProvider), new MyHierarchyProvider(serviceProvider));

This would register the HierarchyProvider class to our module, and after building our assembly, and placing the DLL in GAC successfully, and after having all the administrationHost.config settings, you must see the below:

image

And, you can change the Text property of our HierachyInfo which is an internal class to change the display name appearing in the UI. Don’t hesitate to put your questions or anything you want to let me know through comments!

Happy learning.

Author: Rakki Muthukumar