Beispiel #1
0
        public new static TControl FromUIComponent <TControl>(UIComponent component)
            where TControl : IColossalControl
        {
            IColossalControl control = (TControl)ColossalControl <ColossalFramework.UI.UIComponent> .FromUIComponent(component);

            if (!typeof(TControl).IsAssignableFrom(control.GetType()))
            {
                throw new InvalidCastException();
            }

            return((TControl)control);
        }