예제 #1
0
    /// <summary>
    /// To run the device detection methods andd fire 
    /// any existing OnDetectXXX events. 
    /// </summary>
    public void FireEvents()
    {
        if (useragent == "" && httpaccept == "")
        {
            useragent = (Request.ServerVariables["HTTP_USER_AGENT"] ?? "").ToUpper();
            httpaccept = (Request.ServerVariables["HTTP_ACCEPT"] ?? "").ToUpper();
        }

        #region Event Fire Methods

        MDetectArgs mda = null;
        if (this.DetectIpod())
        {
            mda = new MDetectArgs(dargsIpod);
            if (this.OnDetectIpod != null)
            {
                this.OnDetectIpod(this, mda);
            }
        }
        if (this.DetectIpad())
        {
            mda = new MDetectArgs(dargsIpad);
            if (this.OnDetectIpad != null)
            {
                this.OnDetectIpad(this, mda);
            }
        }
        if (this.DetectIphone())
        {
            mda = new MDetectArgs(dargsIphone);
            if (this.OnDetectIphone != null)
            {
                this.OnDetectIphone(this, mda);
            }
        }
        if (this.DetectIphoneOrIpod())
        {
            mda = new MDetectArgs(dargsIphoneOrIpod);
            if (this.OnDetectDetectIPhoneOrIpod != null)
            {
                this.OnDetectDetectIPhoneOrIpod(this, mda);
            }
        }
        if (this.DetectIos())
        {
            mda = new MDetectArgs(dargsIos);
            if (this.OnDetectIos != null)
            {
                this.OnDetectIos(this, mda);
            }
        }
        if (this.DetectAndroid())
        {
            mda = new MDetectArgs(dargsAndroid);
            if (this.OnDetectAndroid != null)
            {
                this.OnDetectAndroid(this, mda);
            }
        }
        if (this.DetectAndroidPhone())
        {
            mda = new MDetectArgs(dargsAndroidPhone);
            if (this.OnDetectAndroidPhone != null)
            {
                this.OnDetectAndroidPhone(this, mda);
            }
        }
        if (this.DetectAndroidTablet())
        {
            mda = new MDetectArgs(dargsAndroidTablet);
            if (this.OnDetectAndroidTablet != null)
            {
                this.OnDetectAndroidTablet(this, mda);
            }
        }
        if (this.DetectGoogleTV())
        {
            mda = new MDetectArgs(dargsGoogleTV);
            if (this.OnDetectGoogleTV != null)
            {
                this.OnDetectGoogleTV(this, mda);
            }
        }
        if (this.DetectWebkit())
        {
            mda = new MDetectArgs(dargsWebKit);
            if (this.OnDetectWebkit != null)
            {
                this.OnDetectWebkit(this, mda);
            }
        }
        if (this.DetectS60OssBrowser())
        {
            mda = new MDetectArgs(dargsS60);
            if (this.OnDetectS60OssBrowser != null)
            {
                this.OnDetectS60OssBrowser(this, mda);
            }
        }
        if (this.DetectSymbianOS())
        {
            mda = new MDetectArgs(dargsSymbianOS);
            if (this.OnDetectSymbianOS != null)
            {
                this.OnDetectSymbianOS(this, mda);
            }
        }
        if (this.DetectWindowsPhone())
        {
            mda = new MDetectArgs(dargsWindowsPhone);
            if (this.OnDetectWindowsPhone != null)
            {
                this.OnDetectWindowsPhone(this, mda);
            }
        }
        if (this.DetectWindowsMobile())
        {
            mda = new MDetectArgs(dargsWindowsMobile);
            if (this.OnDetectWindowsMobile != null)
            {
                this.OnDetectWindowsMobile(this, mda);
            }
        }
        if (this.DetectBlackBerry())
        {
            mda = new MDetectArgs(dargsBlackBerry);
            if (this.OnDetectBlackBerry != null)
            {
                this.OnDetectBlackBerry(this, mda);
            }
        }
        if (this.DetectBlackBerryWebKit())
        {
            mda = new MDetectArgs(dargsBlackBerryWebkit);
            if (this.OnDetectBlackBerryWebkit != null)
            {
                this.OnDetectBlackBerryWebkit(this, mda);
            }
        }
        if (this.DetectPalmOS())
        {
            mda = new MDetectArgs(dargsPalmOS);
            if (this.OnDetectPalmOS != null)
            {
                this.OnDetectPalmOS(this, mda);
            }
        }
        if (this.DetectPalmWebOS())
        {
            mda = new MDetectArgs(dargsPalmWebOS);
            if (this.OnDetectPalmWebOS != null)
            {
                this.OnDetectPalmWebOS(this, mda);
            }
        }
        if (this.DetectWebOSTablet())
        {
            mda = new MDetectArgs(dargsWebOSTablet);
            if (this.OnDetectWebOSTablet != null)
            {
                this.OnDetectWebOSTablet(this, mda);
            }
        }
        if (this.DetectSmartphone())
        {
            mda = new MDetectArgs(dargsSmartphone);
            if (this.OnDetectSmartphone != null)
            {
                this.OnDetectSmartphone(this, mda);
            }
        }
        if (this.DetectBrewDevice())
        {
            mda = new MDetectArgs(dargsBrewDevice);
            if (this.OnDetectBrewDevice != null)
            {
                this.OnDetectBrewDevice(this, mda);
            }
        }
        if (this.DetectDangerHiptop())
        {
            mda = new MDetectArgs(dargsDangerHiptop);
            if (this.OnDetectDangerHiptop != null)
            {
                this.OnDetectDangerHiptop(this, mda);
            }
        }
        if (this.DetectOperaMobile())
        {
            mda = new MDetectArgs(dargsOperaMobile);
            if (this.OnDetectOperaMobile != null)
            {
                this.OnDetectOperaMobile(this, mda);
            }
        }
        if (this.DetectWapWml())
        {
            mda = new MDetectArgs(dargsWapWml);
            if (this.OnDetectWapWml != null)
            {
                this.OnDetectWapWml(this, mda);
            }
        }
        if (this.DetectKindle())
        {
            mda = new MDetectArgs(dargsKindle);
            if (this.OnDetectKindle != null)
            {
                this.OnDetectKindle(this, mda);
            }
        }
        if (this.DetectMobileQuick())
        {
            mda = new MDetectArgs(dargsMobileQuick);
            if (this.OnDetectMobileQuick != null)
            {
                this.OnDetectMobileQuick(this, mda);
            }
        }
        if (this.DetectTierTablet())
        {
            mda = new MDetectArgs(dargsTierTablet);
            if (this.OnDetectTierTablet != null)
            {
                this.OnDetectTierTablet(this, mda);
            }
        }
        if (this.DetectTierIphone())
        {
            mda = new MDetectArgs(dargsTierIphone);
            if (this.OnDetectTierIphone != null)
            {
                this.OnDetectTierIphone(this, mda);
            }
        }
        if (this.DetectTierRichCss())
        {
            mda = new MDetectArgs(dargsTierRichCss);
            if (this.OnDetectTierRichCss != null)
            {
                this.OnDetectTierRichCss(this, mda);
            }
        }
        if (this.DetectTierOtherPhones())
        {
            mda = new MDetectArgs(dargsTierOtherPhones);
            if (this.OnDetectTierOtherPhones != null)
            {
                this.OnDetectTierOtherPhones(this, mda);
            }
        }

        #endregion Event Fire Methods

    }
예제 #2
0
    /// <summary>
    /// To run the device detection methods andd fire
    /// any existing OnDetectXXX events.
    /// </summary>
    public void FireEvents()
    {
        if (useragent == "" && httpaccept == "")
        {
            useragent  = (Request.ServerVariables["HTTP_USER_AGENT"] ?? "").ToUpper();
            httpaccept = (Request.ServerVariables["HTTP_ACCEPT"] ?? "").ToUpper();
        }

        #region Event Fire Methods

        MDetectArgs mda = null;
        if (this.DetectIpod())
        {
            mda = new MDetectArgs(dargsIpod);
            if (this.OnDetectIpod != null)
            {
                this.OnDetectIpod(this, mda);
            }
        }
        if (this.DetectIpad())
        {
            mda = new MDetectArgs(dargsIpad);
            if (this.OnDetectIpad != null)
            {
                this.OnDetectIpad(this, mda);
            }
        }
        if (this.DetectIphone())
        {
            mda = new MDetectArgs(dargsIphone);
            if (this.OnDetectIphone != null)
            {
                this.OnDetectIphone(this, mda);
            }
        }
        if (this.DetectIphoneOrIpod())
        {
            mda = new MDetectArgs(dargsIphoneOrIpod);
            if (this.OnDetectDetectIPhoneOrIpod != null)
            {
                this.OnDetectDetectIPhoneOrIpod(this, mda);
            }
        }
        if (this.DetectIos())
        {
            mda = new MDetectArgs(dargsIos);
            if (this.OnDetectIos != null)
            {
                this.OnDetectIos(this, mda);
            }
        }
        if (this.DetectAndroid())
        {
            mda = new MDetectArgs(dargsAndroid);
            if (this.OnDetectAndroid != null)
            {
                this.OnDetectAndroid(this, mda);
            }
        }
        if (this.DetectAndroidPhone())
        {
            mda = new MDetectArgs(dargsAndroidPhone);
            if (this.OnDetectAndroidPhone != null)
            {
                this.OnDetectAndroidPhone(this, mda);
            }
        }
        if (this.DetectAndroidTablet())
        {
            mda = new MDetectArgs(dargsAndroidTablet);
            if (this.OnDetectAndroidTablet != null)
            {
                this.OnDetectAndroidTablet(this, mda);
            }
        }
        if (this.DetectGoogleTV())
        {
            mda = new MDetectArgs(dargsGoogleTV);
            if (this.OnDetectGoogleTV != null)
            {
                this.OnDetectGoogleTV(this, mda);
            }
        }
        if (this.DetectWebkit())
        {
            mda = new MDetectArgs(dargsWebKit);
            if (this.OnDetectWebkit != null)
            {
                this.OnDetectWebkit(this, mda);
            }
        }
        if (this.DetectS60OssBrowser())
        {
            mda = new MDetectArgs(dargsS60);
            if (this.OnDetectS60OssBrowser != null)
            {
                this.OnDetectS60OssBrowser(this, mda);
            }
        }
        if (this.DetectSymbianOS())
        {
            mda = new MDetectArgs(dargsSymbianOS);
            if (this.OnDetectSymbianOS != null)
            {
                this.OnDetectSymbianOS(this, mda);
            }
        }
        if (this.DetectWindowsPhone7())
        {
            mda = new MDetectArgs(dargsWindowsPhone7);
            if (this.OnDetectWindowsPhone7 != null)
            {
                this.OnDetectWindowsPhone7(this, mda);
            }
        }
        if (this.DetectWindowsMobile())
        {
            mda = new MDetectArgs(dargsWindowsMobile);
            if (this.OnDetectWindowsMobile != null)
            {
                this.OnDetectWindowsMobile(this, mda);
            }
        }
        if (this.DetectBlackBerry())
        {
            mda = new MDetectArgs(dargsBlackBerry);
            if (this.OnDetectBlackBerry != null)
            {
                this.OnDetectBlackBerry(this, mda);
            }
        }
        if (this.DetectBlackBerryWebKit())
        {
            mda = new MDetectArgs(dargsBlackBerryWebkit);
            if (this.OnDetectBlackBerryWebkit != null)
            {
                this.OnDetectBlackBerryWebkit(this, mda);
            }
        }
        if (this.DetectPalmOS())
        {
            mda = new MDetectArgs(dargsPalmOS);
            if (this.OnDetectPalmOS != null)
            {
                this.OnDetectPalmOS(this, mda);
            }
        }
        if (this.DetectPalmWebOS())
        {
            mda = new MDetectArgs(dargsPalmWebOS);
            if (this.OnDetectPalmWebOS != null)
            {
                this.OnDetectPalmWebOS(this, mda);
            }
        }
        if (this.DetectWebOSTablet())
        {
            mda = new MDetectArgs(dargsWebOSTablet);
            if (this.OnDetectWebOSTablet != null)
            {
                this.OnDetectWebOSTablet(this, mda);
            }
        }
        if (this.DetectSmartphone())
        {
            mda = new MDetectArgs(dargsSmartphone);
            if (this.OnDetectSmartphone != null)
            {
                this.OnDetectSmartphone(this, mda);
            }
        }
        if (this.DetectBrewDevice())
        {
            mda = new MDetectArgs(dargsBrewDevice);
            if (this.OnDetectBrewDevice != null)
            {
                this.OnDetectBrewDevice(this, mda);
            }
        }
        if (this.DetectDangerHiptop())
        {
            mda = new MDetectArgs(dargsDangerHiptop);
            if (this.OnDetectDangerHiptop != null)
            {
                this.OnDetectDangerHiptop(this, mda);
            }
        }
        if (this.DetectOperaMobile())
        {
            mda = new MDetectArgs(dargsOperaMobile);
            if (this.OnDetectOperaMobile != null)
            {
                this.OnDetectOperaMobile(this, mda);
            }
        }
        if (this.DetectWapWml())
        {
            mda = new MDetectArgs(dargsWapWml);
            if (this.OnDetectWapWml != null)
            {
                this.OnDetectWapWml(this, mda);
            }
        }
        if (this.DetectKindle())
        {
            mda = new MDetectArgs(dargsKindle);
            if (this.OnDetectKindle != null)
            {
                this.OnDetectKindle(this, mda);
            }
        }
        if (this.DetectMobileQuick())
        {
            mda = new MDetectArgs(dargsMobileQuick);
            if (this.OnDetectMobileQuick != null)
            {
                this.OnDetectMobileQuick(this, mda);
            }
        }
        if (this.DetectTierTablet())
        {
            mda = new MDetectArgs(dargsTierTablet);
            if (this.OnDetectTierTablet != null)
            {
                this.OnDetectTierTablet(this, mda);
            }
        }
        if (this.DetectTierIphone())
        {
            mda = new MDetectArgs(dargsTierIphone);
            if (this.OnDetectTierIphone != null)
            {
                this.OnDetectTierIphone(this, mda);
            }
        }
        if (this.DetectTierRichCss())
        {
            mda = new MDetectArgs(dargsTierRichCss);
            if (this.OnDetectTierRichCss != null)
            {
                this.OnDetectTierRichCss(this, mda);
            }
        }
        if (this.DetectTierOtherPhones())
        {
            mda = new MDetectArgs(dargsTierOtherPhones);
            if (this.OnDetectTierOtherPhones != null)
            {
                this.OnDetectTierOtherPhones(this, mda);
            }
        }

        #endregion Event Fire Methods
    }