Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }