public ISymbolWebPart NewSymbolWebPart() { string type = ConfigurationManager.AppSettings["SYMBOL"]; if (null == type) { throw new ManagerException("Default webpart symbol not set in config"); } Type driverType = Type.GetType(type, false); if (null == driverType) { throw new ManagerException("Default webpart symbol could not be loaded"); } ISymbolWebPart symbol = (Activator.CreateInstance(driverType) as ISymbolWebPart); if (null == symbol) { throw new ManagerException("Default webpart symbol specified in config is not an ISymbolWebPart"); } return(symbol); }
protected virtual WebPart CreateEmptyWebPart() { Manager manager = (Manager)this.WebPartManager; ISymbolWebPart swp = manager.NewSymbolWebPart(); swp.Title = "empty"; swp.SymbolOf = swp.GetType().AssemblyQualifiedName; return(swp as WebPart); }