Esempio n. 1
0
 public static void Reset()
 {
     _configuration = null;
     _mapper        = null;
     isMobile       = null;
     isNative       = null;
 }
        //
        // GET: /Weather/


        public ActionResult Index()
        {
            if (IsMobile.isMobileBrowser())
            {
                return(View("MobileIndex"));
            }
            else
            {
                return(View());
            }
        }
Esempio n. 3
0
        public static void Configure(SmartResultConfiguration configuration)
        {
            mapperConfiguration = new MapperConfiguration(cfg =>
            {
                configuration.Profiles.ForEach(p =>
                {
                    cfg.AddProfile(p);
                });
            });
            mapper = mapperConfiguration.CreateMapper();

            isMobile = configuration.IsMobileBrowser();
            isNative = configuration.IsNativeDevice();
        }
Esempio n. 4
0
 public SmartResultConfiguration(List <Profile> profiles, IsMobile isMobile = null, IsNative isNative = null)
 {
     this.profiles = profiles;
     this.isMobile = isMobile != null ? isMobile : IsMobileBrowser;
     this.isNative = isNative != null ? isNative : IsMobileBrowser;
 }
Esempio n. 5
0
 public SmartResultConfiguration(List <ISmartResultProfile> profiles, IsMobile isMobile = null, IsNative isNative = null)
 {
     this.Profiles = profiles;
     this.isMobile = isMobile ?? IsMobileBrowser;
     this.isNative = isNative;
 }
Esempio n. 6
0
 /// <inheritdoc cref="object.GetHashCode()"/>
 public override int GetHashCode()
 => 711844102
 ^ Width.GetHashCode()
 ^ Height.GetHashCode()
 ^ IsMobile.GetHashCode()
 ^ DeviceScaleFactor.GetHashCode();