ComponentFactory.Krypton.Docking.KryptonDockingManager.ExpectPageElement C# (CSharp) Method

ExpectPageElement() private method

private ExpectPageElement ( string uniqueName, Type target ) : IDockingElement
uniqueName string
target Type
return IDockingElement
        private IDockingElement ExpectPageElement(string uniqueName, Type target)
        {
            IDockingElement element = FindPageElement(uniqueName);

            // We expecet that the provided unique name does have an associated element
            if (element == null)
                throw new ApplicationException("Cannot find a docking element for the provided unique name");

            // We expect the element to be an exact type
            if (element.GetType() != target)
                throw new ApplicationException("Docking element of type '" + element.GetType().ToString() + "' found when type '" + target.ToString() + "' was expected");

            return element;
        }
KryptonDockingManager