public NameValueDataSource[] RetrieveItems(string name, object key) { // Get all the .aspx files in the portlet folder (not its subfolders) string[] strFilePaths = Directory.GetFiles(HttpContext.Current.Request.PhysicalApplicationPath.ToString() + "Portlets\\CUS\\ICS\\ExternalSiteSignon","*.aspx",SearchOption.TopDirectoryOnly); string strJustFile = String.Empty; NameValueDataSource[] sourceArray = new NameValueDataSource[strFilePaths.Length]; string strFileToSkip = "ShowParams.aspx"; int i=0; sourceArray.SetValue(NameValueDataSource.Create(Globalizer.GetGlobalizedString("CUS_EXTSSO_CHOOSE_ASPX_FILE_OPTION_TEXT"),String.Empty),i); i++; foreach (string strFilePath in strFilePaths) { strJustFile = System.IO.Path.GetFileName(strFilePath); if (strJustFile != strFileToSkip) { // add an array item whose name is the file name without the .aspx extension, whose value is the full file name sourceArray.SetValue(NameValueDataSource.Create(strJustFile.Substring(0,strJustFile.Length-5),strJustFile),i); i++; } } return sourceArray; }
public NameValueDataSource[] RetrieveDefaultItems(string name, object key) { NameValueDataSource[] sourceArray = new NameValueDataSource[1]; sourceArray.SetValue(NameValueDataSource.Create("",""),0); return sourceArray; }