示例#1
0
 public void Setup(PlatformType? type = null)
 {
     Type = type == null ? GetRandomType() : type.Value;
     switch (Type)
     {
         case PlatformType.Deafult:
             gameObject.renderer.material.color = Color.white;
             break;
         case PlatformType.HighBounce:
             Boost *= 1.33f;
             gameObject.renderer.material.color = Color.blue;
             break;
         case PlatformType.LowBounce:
             Boost /= 2;
             gameObject.renderer.material.color = Color.red;
             break;
         case PlatformType.QuadrupleMoney:
             Money *= 4;
             gameObject.renderer.material.color = Color.yellow;
             break;
         case PlatformType.MovingHorizontal:
             gameObject.renderer.material.color = Color.green;
             gameObject.AddComponent<MoveBackAndForth>();
             break;
     }
 }
 public PlatformInfo(PlatformType platform, Version version)
 {
     Should.NotBeNull(platform, nameof(platform));
     Should.NotBeNull(version, nameof(version));
     _platform = platform;
     _version = version;
 }
 public AssemblyProcessorContext(BaseAssemblyResolver assemblyResolver, AssemblyDefinition assembly, PlatformType platform, TextWriter log)
 {
     AssemblyResolver = assemblyResolver;
     Assembly = assembly;
     Platform = platform;
     Log = log;
 }
        public static void InitPlatform()
        {
            Type = PlatformType.UNKNOWN;

            switch (Environment.OSVersion.Platform)
            {
                case PlatformID.Win32NT:
                case PlatformID.Win32S:
                case PlatformID.Win32Windows:
                case PlatformID.WinCE:
                    Type = PlatformType.WINDOWS;
                    break;
                case PlatformID.MacOSX:
                    Type = PlatformType.MAC;
                    break;
            }

            if(Type == PlatformType.UNKNOWN)
            {
                int platformCode = (int)Environment.OSVersion.Platform;
                if (platformCode == 4 || platformCode == 6 || platformCode == 128)
                {
                    Type = PlatformType.LINUX;
                }
            }
        }
示例#5
0
文件: Config.cs 项目: satishinext/php
		private Config() 
		{
			currPlatform  = PlatformType.iOS;
			gameVersion   = "1.0"; // also change in unity editor
			serverUrl     = "http://personalizedgift.uehelp.com/";
			gameTitle     = "Danjur";
		}
示例#6
0
        public void Register(string deviceModel, PlatformType platformType, string carrier, string platformOS, int timeZoneOffset, string locale, string manufac, Tuple<int, int> resolution)
        {
            DeviceInfo deviceInfo = new DeviceInfo()
            {
                Model = deviceModel,
                PlatformType = platformType,
                Carrier = carrier,
                OperatingSystem = platformOS,
                TimeZoneOffset = timeZoneOffset,
                Locale = locale,
                ResolutionHeight = resolution.Item1,
                ResolutionWidth = resolution.Item2,
                Manufactorer = manufac,
                DateCreated = this.DateCreated,
                Date = this.DateCreated.Date
            };

            ApplicationInfo applicationInfo = new ApplicationInfo()
            {
                ApplicationId = applicationId,
                Version = this.Version
            };

            deviceService.Log(deviceInfo, applicationInfo);

            DeviceId = deviceInfo.Guid;
        }
示例#7
0
 /// <summary>
 /// Determines the current platform
 /// </summary>
 public static void InitPlatform()
 {
     switch (Environment.OSVersion.Platform)
     {
         case PlatformID.Unix:
             Type = (
                 Directory.Exists("/Applications")
                 && Directory.Exists("/System")
                 && Directory.Exists("/Users")
                 && Directory.Exists("/Volumes")
             ) ? PlatformType.MAC : PlatformType.LINUX;
             break;
         case PlatformID.MacOSX:
             Type = PlatformType.MAC;
             break;
         case PlatformID.Win32NT:
         case PlatformID.Win32S:
         case PlatformID.Win32Windows:
         case PlatformID.WinCE:
         case PlatformID.Xbox:
             Type = PlatformType.WINDOWS;
             break;
         default:
             Type = PlatformType.UNKNOWN;
             break;
     }
 }
        /// <summary>
        /// Get authorize config by platform type
        /// </summary>
        /// <param name="platformType">Soical PlatformType</param>
        /// <returns>Authorize Config Value</returns>
        public AuthorizeConfig GetAuthorizeConfig(PlatformType platformType)
        {
            AuthorizeConfig authorizeConfig = null;
            StreamResourceInfo configFile = Application.GetResourceStream(new Uri("/MoCommon;component/Social/SocialConfig.xml", UriKind.RelativeOrAbsolute));
            XDocument configDoc = XDocument.Load(configFile.Stream);
            XElement queryElement = null;

            #region read config content from xml file
            switch (platformType)
            {
                case PlatformType.Tencent:
                    queryElement = configDoc.Elements("social").First().Elements("tencent").First();
                    break;
                case PlatformType.Sina:
                    queryElement = configDoc.Elements("social").First().Elements("sina").First();
                    break;
                case PlatformType.WeChat:
                    queryElement = configDoc.Elements("social").First().Elements("wechat").First();
                    break;
            }
            authorizeConfig = new AuthorizeConfig()
            {
                PlatformType = platformType,
                AppKey = queryElement.Attributes().Single(x => x.Name == "appkey").Value,
                AppSecret = queryElement.Attributes().Single(x => x.Name == "appsecret").Value,
                Url = queryElement.Attributes().Single(x => x.Name == "url").Value,
                RedirectUrl = queryElement.Attributes().Single(x => x.Name == "redirecturl").Value,
                ApiUrl = queryElement.Attributes().Single(x => x.Name == "apiurl").Value,
                OauthApiUrl = queryElement.Attributes().Single(x => x.Name == "oauthapiurl").Value
            };
            #endregion
            return authorizeConfig;
        }
    // Update is called once per frame
    void Update()
    {
        Transform lastChild = transform.GetChild (transform.childCount - 1);

            int auxBeginPercent = 0;
            int auxEndPercent = 0;
            int randomValue = Random.Range (0, 100);

            PlatformType randomType = new PlatformType ();

            foreach (PlatformType PlatformType in PlatformsTypes) {
                auxEndPercent += PlatformType.Percent;

                if (randomValue >= auxBeginPercent && auxBeginPercent < auxEndPercent)
                    randomType = PlatformType;

                auxBeginPercent += PlatformType.Percent;
            }

            if (lastChild.position.x + 2 - transform.position.x < 0) {
                GameObject NewObject = Instantiate (SpawnObjects [0], lastChild.position + new Vector3 (2 + randomType.Width, -lastChild.position.y - (Speed > 0 ? 4.5f : -4.5f) + randomType.Height, 0), transform.rotation) as GameObject;

                if(Random.Range(0, 100) < 10 && CurrentGameState == GameManager.GameState.Resume)
                    NewObject.transform.GetChild(NewObject.transform.childCount - 1).gameObject.SetActive(true);

                int randomGravityValue = Random.Range (0, 100);

                NewObject.transform.parent = transform;
                NewObject.transform.SendMessage ("SetSpeed", Speed);
            }
    }
 public PlatformInfo(PlatformType platform, Version version)
 {
     Should.NotBeNull(platform, "platform");
     Should.NotBeNull(version, "version");
     _platform = platform;
     _version = version;
 }
示例#11
0
 public static MessageData CreateMessageData(Guid msgid, PlatformType platform, string tellerno, string orgno, int msgbiztype, byte[] codemsg)
 {
     MessageData msgdata = new MessageData { MessageID = msgid, FirstTime = DateTime.Now, TragetPlatform = platform, TellerNO = tellerno, OrgNO=orgno, MsgBizType=msgbiztype, ReSentTime = 0 };
     msgdata.ReqPackageList.Enqueue(new PackageData(1, codemsg));
     msgdata.IsMultiPackage = false;
     return msgdata;
 }
 public override void CancelAuthorize(PlatformType platform)
 {
     if (ssdk != null)
     {
         ssdk.Call("removeAccount", (int)platform);
     }
 }
 public DeviceUpgradeSummary(string version, DateTime date, Guid applicationId, PlatformType platformType)
 {
     this.Version = version;
     this.Date = date;
     this.ApplicationId = applicationId;
     this.PlatformType = platformType;
     this.Count += 1;
 }
 public override void AddFriend(int reqID, PlatformType platform, String account)
 {
     Debug.Log("AndroidUtils  ===>>>  FollowFriend" );
     if (ssdk != null)
     {
         ssdk.Call("followFriend", reqID, (int)platform, account);
     }
 }
 public override void Authorize(int reqID, PlatformType platform)
 {
     Debug.Log("AndroidUtils  ===>>>  Authorize" );
     if (ssdk != null)
     {
         ssdk.Call("authorize", reqID, (int)platform);
     }
 }
示例#16
0
        /// <summary>
        /// Initializes a new instance of the TestAssembly class.
        /// </summary>
        /// <param name="mainAssembly">Main Assembly that the test paths are in</param>
        /// <param name="platformType">Platform Type</param>
        public TestAssembly(string mainAssembly, PlatformType platformType)
        {
            ExceptionUtilities.CheckArgumentNotNull(mainAssembly, "mainAssembly");

            this.MainAssembly = mainAssembly;
            this.PlatformType = platformType;
            this.ReferencedAssemblies = new List<string>();
        }
 public override void GetFriendList(int reqID, PlatformType platform, int count, int page)
 {
     Debug.Log("AndroidUtils  ===>>>  GetFriendList" );
     if (ssdk != null)
     {
         ssdk.Call("getFriendList", reqID, (int)platform, count, page);
     }
 }
 public RemoteDriverConfiguration(string browser, PlatformType platform, string browserVersion, string seleniumHubUrl, int seleniumHubPort)
 {
     Browser = browser;
     Platform = platform;
     BrowserVersion = browserVersion;
     SeleniumHubUrl = seleniumHubUrl;
     SeleniumHubPort = seleniumHubPort;
 }
		public override bool IsAuthorizedValid (PlatformType platform) 
		{
			if (ssdk != null) 
			{
				return ssdk.Call<bool>("isAuthValid", (int)platform);
			}
			return false;
		}
		public override bool IsClientValid (PlatformType platform) 
		{
			if (ssdk != null) 
			{
				return ssdk.Call<bool>("isClientValid", (int)platform);
			}
			return false;
		}
		public override void GetUserInfo (int reqID, PlatformType platform) 
		{
			Debug.Log("AndroidUtils  ===>>>  ShowUser" );
			if (ssdk != null) 
			{
				ssdk.Call("showUser", reqID, (int)platform);
			}
		}
示例#22
0
 public PresenceBubble(long time, BubbleDirection direction, string address, bool party, Service service, 
     PresenceType presence, PlatformType platform) 
     : base(time, direction, service)
 {
     Presence = presence;
     Platform = platform;
     Address = address;
     Party = party;
 }
 public PlatformData(int id, double x, double y, PlatformType type, PlatformMovementBaseData movementData, List<PlatformFeatureBaseData> featuresData)
 {
     Id = id;
     X = x;
     Y = y;
     Type = type;
     MovementData = movementData;
     FeaturesData = featuresData;
 }
示例#24
0
 public static void Share(PlatformType platform, string title, string text, string image, ContentType type, ShareResultEvent evt)
 {
     Hashtable hashtable = new Hashtable();
     hashtable["title"] = ((platform != PlatformType.WeChatTimeline) ? title : text);
     hashtable["content"] = ((type != ContentType.News) ? (text + ShareSDK.ShareConfig.url) : text);
     hashtable["image"] = ((type != ContentType.Image) ? ((type != ContentType.News) ? string.Empty : ShareSDK.IconPath) : image);
     hashtable["url"] = ((type != ContentType.News) ? string.Empty : ShareSDK.ShareConfig.url);
     hashtable["type"] = Convert.ToString((int)type);
     ShareUtils.shareContent(platform, hashtable, evt);
 }
示例#25
0
 public static void cancelAuthorie(PlatformType type)
 {
     if (Application.platform != RuntimePlatform.IPhonePlayer)
     {
         if (Application.platform == RuntimePlatform.Android)
         {
             AndroidUtils.getInstance().removeAccount((int)type);
         }
     }
 }
示例#26
0
 public MockSystemReader()
 {
     init(Constants.OS_USER_NAME_KEY);
     init(Constants.GIT_AUTHOR_NAME_KEY);
     init(Constants.GIT_AUTHOR_EMAIL_KEY);
     init(Constants.GIT_COMMITTER_NAME_KEY);
     init(Constants.GIT_COMMITTER_EMAIL_KEY);
     userGitConfig = new FileBasedConfig(null);
     operatingSystem = SystemReader.getInstance().getOperatingSystem();
 }
示例#27
0
 public static void authorize(PlatformType type, AuthResultEvent resultHandler)
 {
     if (Application.platform != RuntimePlatform.IPhonePlayer)
     {
         if (Application.platform == RuntimePlatform.Android)
         {
             AndroidUtils.getInstance().authorize((int)type, resultHandler);
         }
     }
 }
 public override Hashtable GetAuthInfo(PlatformType platform)
 {
     Debug.Log("AndroidUtils  ===>>>  GetAuthInfo" );
     if (ssdk != null)
     {
         String result = ssdk.Call<String>("getAuthInfo", (int)platform);
         return (Hashtable) MiniJSON.jsonDecode(result);
     }
     return new Hashtable ();
 }
示例#29
0
        private void SpawnPlatform(Vector3 nextPos, PlatformType platformType)
        {
            lastPlatformSR = GameObjectUtil.Instantiate(platformPrefab.gameObject, nextPos)
                .GetComponent<SpriteRenderer>();

            lastPlatformSR.GetComponent<FallingPlatform>().SetupPlatform(platformType);
        
            int numCoins = Random.Range(0, maxNumCoins + 1);
            while (numCoins-- > 0) SpawnCoin(lastPlatformSR);
        }
示例#30
0
 void ShareResultHandler(ResponseState state, PlatformType type, Hashtable shareInfo, Hashtable error, bool end)
 {
     if (state == ResponseState.Success) {
         print("share result :");
         print(MiniJSON.jsonEncode(shareInfo));
     } else if (state == ResponseState.Fail) {
         print("fail! error code = " + error["error_code"] + "; error msg = " + error["error_msg"]);
     } else if (state == ResponseState.Cancel) {
         print("cancel !");
     }
 }
示例#31
0
        public ActionResult PaymentToOrders(string ids)
        {
            //红包数据
            var    bonusGrantIds = new Dictionary <long, Entities.ShopBonusInfo>();
            string url           = CurrentUrlHelper.CurrentUrlNoPort() + "/m-weixin/shopbonus/index/";

            if (!string.IsNullOrEmpty(ids))
            {
                string[]    strIds  = ids.Split(',');
                List <long> longIds = new List <long>();
                foreach (string id in strIds)
                {
                    longIds.Add(long.Parse(id));
                }
                var result = PaymentHelper.GenerateBonus(longIds, Request.Host.ToString());
                foreach (var item in result)
                {
                    bonusGrantIds.Add(item.Key, item.Value);
                }
            }

            ViewBag.Path          = url;
            ViewBag.BonusGrantIds = bonusGrantIds;
            ViewBag.Shops         = ShopApplication.GetShops(bonusGrantIds.Select(p => p.Value.ShopId));
            ViewBag.BaseAddress   = CurrentUrlHelper.CurrentUrlNoPort();

            var statistic = StatisticApplication.GetMemberOrderStatistic(CurrentUser.Id);

            ViewBag.WaitingForComments = statistic.WaitingForComments;
            ViewBag.AllOrders          = statistic.OrderCount;
            ViewBag.WaitingForRecieve  = statistic.WaitingForRecieve + OrderApplication.GetWaitConsumptionOrderNumByUserId(CurrentUser.Id);
            ViewBag.WaitingForPay      = statistic.WaitingForPay;
            ViewBag.WaitingForDelivery = statistic.WaitingForDelivery;

            var order = OrderApplication.GetUserOrders(CurrentUser.Id, 1).FirstOrDefault();

            if (order != null && order.OrderType == OrderInfo.OrderTypes.FightGroup)
            {
                var gpord = FightGroupApplication.GetOrder(order.Id);
                if (gpord != null)
                {
                    return(Redirect(string.Format("/m-{0}/FightGroup/GroupOrderOk?orderid={1}", PlatformType.ToString(), order.Id)));
                }
            }
            return(View("~/Areas/Mobile/Templates/Default/Views/Member/Orders.cshtml"));
        }
示例#32
0
 /// <summary>
 /// Authorize the specified platform.
 /// </summary>
 public abstract void Authorize(int reqID, PlatformType platform);
示例#33
0
 /// <summary>
 /// Determine weather the account of the specified platform is valid.
 /// </summary>
 public abstract bool IsAuthorized(PlatformType platform);
示例#34
0
 /// <summary>
 /// Gets the friends.
 /// </summary>
 /// <param name="type">Type.</param>
 /// <param name="count">Count.</param>
 /// <param name="page">Page.</param>
 public int GetFriendList(PlatformType platform, int count, int page)
 {
     reqID++;
     shareSDKUtils.GetFriendList(reqID, platform, count, page);
     return(reqID);
 }
示例#35
0
 /// <summary>
 /// Cancel authorized
 /// </summary>
 /// <param name='type'>
 /// Type.
 /// </param>
 public void CancelAuthorize(PlatformType platform)
 {
     shareSDKUtils.CancelAuthorize(platform);
 }
示例#36
0
 /// <summary>
 /// Has authorized
 /// </summary>
 /// <returns>
 /// true has authorized, otherwise not authorized.
 /// </returns>
 /// <param name='type'>
 /// Type.
 /// </param>
 public bool IsAuthorized(PlatformType platform)
 {
     return(shareSDKUtils.IsAuthorized(platform));
 }
示例#37
0
        public List <ClientInstance> GetEntriesForPlatform(PlatformType platform)
        {
            var cos = clients.Where(t => t.Platform == platform);

            return(cos.ToList());
        }
 public GridAttribute(Web.Browser browser, BrowserBehavior browserBehavior, string browserVersion, PlatformType platformType)
     : base(browser, browserBehavior)
 {
     BrowserConfiguration.ExecutionType = ExecutionType.Grid;
     BrowserVersion = browserVersion;
     PlatformType   = platformType;
 }
示例#39
0
 public bool IsClientValid(PlatformType platform)
 {
     return(shareSDKUtils.IsClientValid(platform));
 }
示例#40
0
 /// <summary>
 /// Gets the auth info.
 /// </summary>
 /// <param name="type">Type.</param>
 public Hashtable GetAuthInfo(PlatformType platform)
 {
     return(shareSDKUtils.GetAuthInfo(platform));
 }
示例#41
0
 /// <summary>
 /// Follows the friend.
 /// </summary>
 /// <param name="type">Type.</param>
 /// <param name="account">Account.</param>
 public int AddFriend(PlatformType platform, String account)
 {
     reqID++;
     shareSDKUtils.AddFriend(reqID, platform, account);
     return(reqID);
 }
示例#42
0
 /// <summary>
 /// Shows the share view of using onekeyshare.
 /// </summary>
 /// <param name='type'>
 /// Type.
 /// </param>
 /// <param name='content'>
 /// Content.
 /// </param>
 /// <param name='callback'>
 /// Callback.
 /// </param>
 public int ShowShareContentEditor(PlatformType platform, ShareContent content)
 {
     reqID++;
     shareSDKUtils.ShowShareContentEditor(reqID, platform, content);
     return(reqID);
 }
示例#43
0
 /// <summary>
 /// Follows the friend.
 /// </summary>
 public abstract void AddFriend(int reqID, PlatformType platform, String account);
示例#44
0
 /// <summary>
 /// Authorize the specified type, observer and resultHandler.
 /// </summary>
 /// <param name='type'>
 /// Type.
 /// </param>
 /// <param name='observer'>
 /// Observer.
 /// </param>
 /// <param name='resultHandler'>
 /// Result handler.
 /// </param>
 public int Authorize(PlatformType platform)
 {
     reqID++;
     shareSDKUtils.Authorize(reqID, platform);
     return(reqID);
 }
示例#45
0
 /// <summary>
 /// Gets the friend list.
 /// </summary>
 public abstract void GetFriendList(int reqID, PlatformType platform, int count, int page);
示例#46
0
 public PlatformData(PlatformType type, SpriteHandle icon, string name)
 {
     PlatformType = type;
     Icon         = icon;
     PlatformName = name;
 }
示例#47
0
 /// <summary>
 /// share according to the name of node<Content> in ShareContent.xml file  (only valid in iOS temporarily)
 /// </summary>
 public abstract void ShareWithContentName(int reqId, PlatformType platform, string contentName, Hashtable customFields);
示例#48
0
 /// <summary>
 /// OGUI share to the specified platform.
 /// </summary>
 public abstract void ShowShareContentEditor(int reqID, PlatformType platform, ShareContent content);
示例#49
0
    private void OnGUI()
    {
        if (GUILayout.Button("打开PD"))
        {
            string output = Application.persistentDataPath;
            if (!Directory.Exists(output))
            {
                Directory.CreateDirectory(output);
            }
            output = output.Replace("/", "\\");
            System.Diagnostics.Process.Start("explorer.exe", output);
        }

        this.platformType = (PlatformType)EditorGUILayout.EnumPopup(platformType);

        isBuildInSA = EditorGUILayout.Toggle("是否同将资源打进SA: ", isBuildInSA);


        if (GUILayout.Button("开始打包"))
        {
            if (this.platformType == PlatformType.None)
            {
                Debug.Log("请选择打包平台!");
                return;
            }
            string fold = ResourceConfig.BD_AB + ResourceConfig.Platform;
            if (!Directory.Exists(fold))
            {
                Directory.CreateDirectory(fold);
            }
            //if (!Directory.Exists(ResourceConfig.URL_AB + ResourceConfig.Platform))
            //{
            //    Debug.Log("没有 路径 = " + ResourceConfig.URL_AB + ResourceConfig.Platform);
            //    return;
            //}
            DeleteFileOrFolder(ResourceConfig.BD_AB + ResourceConfig.Platform);
            BuildHelper.Build(this.platformType, isBuildInSA);
        }


        if (GUILayout.Button("设置标签"))
        {
            string path = string.Format("Assets/Download");

            if (Directory.Exists(path))
            {
                DirectoryInfo direction = new DirectoryInfo(path);
                FileInfo[]    files     = direction.GetFiles("*", SearchOption.AllDirectories);
                Debug.Log(files.Length);
                for (int i = 0; i < files.Length; i++)
                {
                    if (files[i].Name.EndsWith(".meta"))
                    {
                        continue;
                    }
                    //if (files[i].Name.EndsWith(".bytes"))
                    //{
                    //    continue;
                    //}
                    string currentFile = files[i].FullName.Replace("\\", "/").Replace(@"\", "/");
                    int    startIndex  = currentFile.IndexOf("Assets");
                    string assetFile   = currentFile.Substring(startIndex, currentFile.Length - startIndex);
                    Debug.Log(assetFile);
                    string        sceneName = Path.GetFileNameWithoutExtension(assetFile);
                    AssetImporter ai        = AssetImporter.GetAtPath(assetFile);
                    ai.assetBundleName = sceneName + ".assetbundle";
                }
            }
        }


        if (GUILayout.Button("删除资源"))
        {
            if (!Directory.Exists(ResourceConfig.SA_AB + ResourceConfig.Platform))
            {
                return;
            }
            DeleteFileOrFolder(ResourceConfig.SA_AB + ResourceConfig.Platform);
            AssetDatabase.Refresh();
        }

        if (GUILayout.Button("打包轻包"))
        {
            BuildHelper.BuildInitial(ResourceConfig.SA_AB + platformType);
        }
    }
示例#50
0
 /// <summary>
 /// share according to the name of node<Content> in ShareContent.xml file  (only valid in iOS temporarily)(此接口暂时仅支持iOS环境)
 /// </summary>
 /// <param name='platform'>
 /// Platform Type
 /// </param>
 /// <param name='contentName'>
 /// the name of node<Content> in ShareContent.xml file
 /// </param>
 /// <param name='customFields'>
 /// your share customFields which will be replace in ShareContent.xml
 /// </param>
 public int ShowShareContentEditorWithContentName(PlatformType platform, string contentName, Hashtable customFields)
 {
     reqID++;
     shareSDKUtils.ShowShareContentEditorWithContentName(reqID, platform, contentName, customFields);
     return(reqID);
 }
示例#51
0
 /// <summary>
 /// Request the user info of the specified platform.
 /// </summary>
 public abstract void GetUserInfo(int reqID, PlatformType platform);
        public JsonResult GetAllHomeProductIds(PlatformType platformType)
        {
            var homeProductIds = mobileHomeproduct.GetAllHomeProductIds(CurrentManager.ShopId, platformType);

            return(Json(homeProductIds));
        }
示例#53
0
 /// <summary>
 /// Determine weather the APP-Client of platform is valid.
 /// </summary>
 public abstract bool IsClientValid(PlatformType platform);
        public JsonResult GetMobileHomeProducts(PlatformType platformType, int page, int rows, string keyWords, string shopName, long?categoryId = null)
        {
            object model = mobileHomeproduct.GetMobileHomeProducts(CurrentManager.ShopId, platformType, page, rows, keyWords, shopName, categoryId);

            return(Json(model));
        }
示例#55
0
 /// <summary>
 /// Removes the account of the specified platform.
 /// </summary>
 public abstract void CancelAuthorize(PlatformType platform);
示例#56
0
 public PlatformData(PlatformType type, Sprite icon)
 {
     PlatformType = type;
     Icon         = icon;
 }
示例#57
0
 public override void ShowShareContentEditorWithContentName(int reqId, PlatformType platform, string contentName, Hashtable customFields)
 {
 #if SHOW_DEBUG
     Debug.Log("#WARING : Do not support this feature in Android temporarily");
 #endif
 }
示例#58
0
 /// <summary>
 /// Gets the auth info.
 /// </summary>
 public abstract Hashtable GetAuthInfo(PlatformType platform);
        /// <summary>
        /// TryCommonApi 方法的基类
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="platformType">平台类型,PlatformType枚举</param>
        /// <param name="accessTokenContainer_GetFirstOrDefaultAppIdFunc">AccessTokenContainer中的GetFirstOrDefaultAppId()方法</param>
        /// <param name="accessTokenContainer_CheckRegisteredFunc">AccessTokenContainer中的bool CheckRegistered(appId,getNew)方法</param>
        /// <param name="accessTokenContainer_GetAccessTokenResultFunc">AccessTokenContainer中的AccessTokenResult GetAccessTokenResult(appId)方法</param>
        /// <param name="invalidCredentialValue">"ReturnCode.获取access_token时AppSecret错误或者access_token无效"枚举的值</param>
        /// <param name="fun"></param>
        /// <param name="accessTokenOrAppId"></param>
        /// <param name="retryIfFaild"></param>
        /// <returns></returns>
        public static T TryCommonApiBase <T>(
            PlatformType platformType,
            Func <string> accessTokenContainer_GetFirstOrDefaultAppIdFunc,
            Func <string, bool> accessTokenContainer_CheckRegisteredFunc,
            Func <string, bool, IAccessTokenResult> accessTokenContainer_GetAccessTokenResultFunc,
            int invalidCredentialValue,
            Func <string, T> fun, string accessTokenOrAppId = null, bool retryIfFaild = true) where T : BaseJsonResult
        {
            //ApiHandlerWapperFactory.ApiHandlerWapperFactoryCollection["s"] = ()=> new Senparc.Weixin.MP.AdvancedAPIs.User.UserInfoJson();

            //var platform = ApiHandlerWapperFactory.CurrentPlatform;//当前平台

            /*
             * 对于企业微信来说,AppId = key = CorpId+CorpSecret
             */

            string appId       = null;
            string accessToken = null;

            if (accessTokenOrAppId == null)
            {
                appId = accessTokenContainer_GetFirstOrDefaultAppIdFunc != null?accessTokenContainer_GetFirstOrDefaultAppIdFunc() : null;  // AccessTokenContainer.GetFirstOrDefaultAppId();

                if (appId == null)
                {
                    throw new UnRegisterAppIdException(null,
                                                       "尚无已经注册的AppId,请先使用AccessTokenContainer.Register完成注册(全局执行一次即可)!");
                }
            }
            else if (ApiUtility.IsAppId(accessTokenOrAppId, platformType))
            {
                //if (!AccessTokenContainer.CheckRegistered(accessTokenOrAppId))
                if (!accessTokenContainer_CheckRegisteredFunc(accessTokenOrAppId))
                {
                    throw new UnRegisterAppIdException(accessTokenOrAppId, string.Format("此appId({0})尚未注册,请先使用AccessTokenContainer.Register完成注册(全局执行一次即可)!", accessTokenOrAppId));
                }

                appId = accessTokenOrAppId;
            }
            else
            {
                accessToken = accessTokenOrAppId;//accessToken
            }

            T result = null;

            try
            {
                if (accessToken == null)
                {
                    var accessTokenResult = accessTokenContainer_GetAccessTokenResultFunc(appId, false); //AccessTokenContainer.GetAccessTokenResult(appId, false);
                    accessToken = accessTokenResult.access_token;
                }
                result = fun(accessToken);
            }
            catch (ErrorJsonResultException ex)
            {
                if (retryIfFaild &&
                    appId != null
                    //&& ex.JsonResult.errcode == ReturnCode.获取access_token时AppSecret错误或者access_token无效)
                    && (int)ex.JsonResult.errcode == invalidCredentialValue)
                {
                    //尝试重新验证
                    var accessTokenResult = accessTokenContainer_GetAccessTokenResultFunc(appId, false);//AccessTokenContainer.GetAccessTokenResult(appId, true);
                    //强制获取并刷新最新的AccessToken
                    accessToken = accessTokenResult.access_token;
                    result      = TryCommonApiBase(platformType,
                                                   accessTokenContainer_GetFirstOrDefaultAppIdFunc,
                                                   accessTokenContainer_CheckRegisteredFunc,
                                                   accessTokenContainer_GetAccessTokenResultFunc,
                                                   invalidCredentialValue,
                                                   fun, appId, false);
                }
                else
                {
                    ex.AccessTokenOrAppId = accessTokenOrAppId;
                    throw;
                }
            }
            catch (WeixinException ex)
            {
                ex.AccessTokenOrAppId = accessTokenOrAppId;
                throw;
            }

            return(result);
        }
示例#60
0
 /// <summary>
 /// Gets the user info.
 /// </summary>
 /// <param name='type'>
 /// Type.
 /// </param>
 /// <param name='callback'>
 /// Callback.
 /// </param>
 public int GetUserInfo(PlatformType platform)
 {
     reqID++;
     shareSDKUtils.GetUserInfo(reqID, platform);
     return(reqID);
 }