Esempio n. 1
0
        protected IPDFDataSource GetDataSourceComponent(string datasourceComponentID, PDFDataContext context)
        {
            IPDFDataSource datasourceComponent = null;

            if (string.IsNullOrEmpty(datasourceComponentID))
            {
                throw new ArgumentNullException("datasourceComponentID");
            }

            Component found = base.FindDocumentComponentById(datasourceComponentID);

            if (found == null)
            {
                throw RecordAndRaise.ArgumentNull("DataSourceID", Errors.CouldNotFindControlWithID, datasourceComponentID);
            }
            else if (!(found is IPDFDataSource))
            {
                throw RecordAndRaise.Argument("DataSourceID", Errors.AssignedDataSourceIsNotIPDFDataSource, datasourceComponentID);
            }
            else
            {
                datasourceComponent = ((IPDFDataSource)found);
            }


            return(datasourceComponent);
        }
        protected IPDFContainerComponent GetContainerParent()
        {
            Component ele = this;

            while (null != ele)
            {
                Component par = ele.Parent;
                if (par == null)
                {
                    throw RecordAndRaise.ArgumentNull(Errors.TemplateComponentParentMustBeContainer);
                }

                else if ((par is IPDFContainerComponent) == false)
                {
                    ele = par;
                }
                else
                {
                    return(par as IPDFContainerComponent);
                }
            }

            //If we get this far then we haven't got a viable container to add our items to.
            throw RecordAndRaise.ArgumentNull(Errors.TemplateComponentParentMustBeContainer);
        }
        public ComponentWrappingList(ComponentList inner)
        {
            if (null == inner)
            {
                throw RecordAndRaise.ArgumentNull("innerList");
            }

            this._inner = inner;

            //hook into the changed event so we are notified if any new items are added to the collection
            this._inner.CollectionChanged += new EventHandler(inner_CollectionChanged);
        }