Example #1
0
        private Control GetErrorControl(SkinControlLoadException exception)
        {
            var result = GetLoadControlResult(SystemFolderName, ErrorControlName);
            Debug.Assert(result != null, "The result should never be null");
            var control = result.SkinControl;
            if (control == null)
            {
                throw new InvalidOperationException("The system Error skin control is missing. Did you delete it by mistake? It should be located at '" + result.ControlPath + "'");
            }

            var errorControl = result.SkinControl as IErrorControl;
            if (errorControl != null)
            {
                errorControl.Exception = exception;
            }
            return control;
        }
Example #2
0
        private Control GetErrorControl(SkinControlLoadException exception)
        {
            var result = GetLoadControlResult(SystemFolderName, ErrorControlName);

            Debug.Assert(result != null, "The result should never be null");
            var control = result.SkinControl;

            if (control == null)
            {
                throw new InvalidOperationException("The system Error skin control is missing. Did you delete it by mistake? It should be located at '" + result.ControlPath + "'");
            }

            var errorControl = result.SkinControl as IErrorControl;

            if (errorControl != null)
            {
                errorControl.Exception = exception;
            }
            return(control);
        }