public static IView GetCrossWrapper(View view)
        {
            IView widget = null;

            switch (view)
            {
            case TextView _:
                widget = new CrossTextWrapper(view);
                break;

            case ImageView _:
                widget = new CrossImageWrapper(view);
                break;

            case RecyclerView _:
                widget = new CrossListViewWrapper(view);
                break;

            case View _:
                widget = new CrossViewWrapper(view);
                break;

            default:
                ExceptionLogger.RaiseNonFatalException(
                    new WidgetWrapperFactoryException(string.Format(ViewTypeRecognitionFaultMessage,
                                                                    view?.GetType()?.Name ?? "null")));
                break;
            }

            return(widget);
        }
Esempio n. 2
0
        public static IView GetCrossWrapper(UIView view)
        {
            IView widget = null;

            switch (view)
            {
            case UITextView _:
            case UILabel _:
            case UITextField _:
                widget = new CrossTextWrapper(view);
                break;

            case UIImageView _:
                widget = new CrossImageWrapper(view);
                break;

            case UITableView _:
            case UICollectionView _:
                widget = new CrossListViewWrapper(view);
                break;

            case UIButton _:
                widget = new CrossViewWrapper(view);
                break;

            case UIView _:
                widget = new CrossViewWrapper(view);
                break;

            default:
                ExceptionLogger.RaiseNonFatalException(
                    new WidgetWrapperFactoryException(string.Format(ViewTypeRecognitionFaultMessage, "null")));
                break;
            }

            return(widget);
        }