当前位置: 首页>>代码示例>>C#>>正文


C# ErrorCallback类代码示例

本文整理汇总了C#中ErrorCallback的典型用法代码示例。如果您正苦于以下问题:C# ErrorCallback类的具体用法?C# ErrorCallback怎么用?C# ErrorCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ErrorCallback类属于命名空间,在下文中一共展示了ErrorCallback类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreatePhysics

		private Physics CreatePhysics(ErrorCallback errorCallback = null)
		{
			if (Physics.Instantiated)
				Assert.Fail("Physics is still created");

			if (errorCallback == null)
				errorCallback = _errorLog = new ErrorLog();

			if (_physics != null)
			{
				_physics.Dispose();
				_physics = null;
			}
			if (_foundation != null)
			{
				_foundation.Dispose();
				_foundation = null;
			}

			_foundation = new Foundation(errorCallback);

			_physics = new Physics(_foundation, checkRuntimeFiles: true);

			return _physics;
		}
开发者ID:flair2005,项目名称:PhysX.Net,代码行数:25,代码来源:Test.cs

示例2: GetUserAccountInfo

		/// <summary>
		/// Retrieves the relevant details for a specified user, based upon a match against a supplied unique identifier
		/// </summary>
		public static void GetUserAccountInfo(LookupUserAccountInfoRequest request, GetUserAccountInfoCallback resultCallback, ErrorCallback errorCallback)
		{
			if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method");

			string serializedJSON = JsonConvert.SerializeObject(request, Util.JsonFormatting, Util.JsonSettings);
			Action<string,string> callback = delegate(string responseStr, string errorStr)
			{
				LookupUserAccountInfoResult result = null;
				PlayFabError error = null;
				ResultContainer<LookupUserAccountInfoResult>.HandleResults(responseStr, errorStr, out result, out error);
				if(error != null && errorCallback != null)
				{
					errorCallback(error);
				}
				if(result != null)
				{
					
					if(resultCallback != null)
					{
						resultCallback(result);
					}
				}
			};
			PlayFabHTTP.Post(PlayFabSettings.GetURL()+"/Admin/GetUserAccountInfo", serializedJSON, "X-SecretKey", PlayFabSettings.DeveloperSecretKey, callback);
		}
开发者ID:FaunaFace,项目名称:UnitySDK,代码行数:28,代码来源:PlayFabAdminAPI.cs

示例3: writeScore

        /**
         * Speichert den Score
         */
        public void writeScore(ErrorCallback ecb, string playerName, int score, int level, long time, int mode)
        {
            time /= 10000;
            this.ecb = ecb;
            XDocument doc = new XDocument(
                new XElement("scoreentry",
                    new XElement("playername", playerName),
                    new XElement("score", score),
                    new XElement("level", level),
                    new XElement("time", time),
                    new XElement("mode", mode)
                )
            );
            postData = doc.ToString();
            try
            {
                WebRequest request = WebRequest.Create(proxy);
                request.Method = "POST";

                request.ContentType = "text/xml";
                request.BeginGetRequestStream(new AsyncCallback(RequestReady), request);
            }
            catch (Exception e)
            { ecb(e.Message); }
        }
开发者ID:stas-bob,项目名称:Tetris,代码行数:28,代码来源:SQLClient.cs

示例4: InsertEntity

        private static object InsertEntity(object entity, DataStrategy dataStrategy, string tableName, ErrorCallback onError, bool resultRequired)
        {
            var dictionary = entity as IDictionary<string, object>;
            if (dictionary != null)
                return dataStrategy.Insert(tableName, dictionary, resultRequired);

            var list = entity as IEnumerable<IDictionary<string, object>>;
            if (list != null)
                return dataStrategy.InsertMany(tableName, list, onError, resultRequired);

            var entityList = entity as IEnumerable;
            if (entityList != null)
            {
                var array = entityList.Cast<object>().ToArray();
                var rows = new List<IDictionary<string, object>>();
                foreach (var o in array)
                {
                    dictionary = (o as IDictionary<string, object>) ?? o.ObjectToDictionary();
                    if (dictionary.Count == 0)
                    {
                        throw new SimpleDataException("Could not discover data in object.");
                    }
                    rows.Add(dictionary);
                }

                return dataStrategy.InsertMany(tableName, rows, onError, resultRequired);
            }

            dictionary = entity.ObjectToDictionary();
            if (dictionary.Count == 0)
                throw new SimpleDataException("Could not discover data in object.");
            return dataStrategy.Insert(tableName, dictionary, resultRequired);
        }
开发者ID:hlach,项目名称:Simple.Data,代码行数:33,代码来源:InsertCommand.cs

示例5: PlayerLeft

		/// <summary>
		/// Informs the PlayFab game server hosting service that the indicated user has left the Game Server Instance specified
		/// </summary>
		public static void PlayerLeft(PlayerLeftRequest request, PlayerLeftCallback resultCallback, ErrorCallback errorCallback, object customData = null)
		{
			if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method");

			string serializedJSON = JsonConvert.SerializeObject(request, Util.JsonFormatting, Util.JsonSettings);
			Action<string,PlayFabError> callback = delegate(string responseStr, PlayFabError pfError)
			{
				PlayerLeftResponse result = null;
				ResultContainer<PlayerLeftResponse>.HandleResults(responseStr, ref pfError, out result);
				if(pfError != null && errorCallback != null)
				{
					errorCallback(pfError);
				}
				if(result != null)
				{
					
					result.CustomData = customData;
					result.Request = request;
					if(resultCallback != null)
					{
						resultCallback(result);
					}
				}
			};
			PlayFabHTTP.Post(PlayFabSettings.GetURL()+"/Matchmaker/PlayerLeft", serializedJSON, "X-SecretKey", PlayFabSettings.DeveloperSecretKey, callback);
		}
开发者ID:noxplague,项目名称:UnitySDK,代码行数:29,代码来源:PlayFabMatchmakerAPI.cs

示例6: BaseRequest

		public BaseRequest (String method, String url, SuccessCallback successCallback, ErrorCallback errorCallback):base(method, url)
		{
			this.completedCallback = delegate(Request request) { onCompleteCallback(request); };;
			this.successCallback = successCallback;
			this.errorCallback = errorCallback;

			form = AddParams();
		}
开发者ID:SonGit,项目名称:NailGame,代码行数:8,代码来源:BaseRequest.cs

示例7: SubmitScoreRequest

		public SubmitScoreRequest (String url, String score, SuccessCallback successCallback, ErrorCallback errorCallback): base(Method.POST, url, successCallback, errorCallback)
		{
			Hashtable hashtable = new Hashtable ();
			string json = Json.Serialize(hashtable );
			
			this.form.AddField( GameConstants.REQUEST_KEY_PARAMS, Encryption.Encrypt(json) );
			this.AddWWWForm(this.form);
		}
开发者ID:SonGit,项目名称:NailGame,代码行数:8,代码来源:SubmitScoreRequest.cs

示例8: LoginFacebookRequest

		public LoginFacebookRequest (String url, string token, SuccessCallback successCallback, ErrorCallback errorCallback) : base(Method.POST, url, successCallback, errorCallback) 
		{
			Hashtable hashtable = new Hashtable ();
			hashtable.Add( GameConstants.REQUEST_KEY_TOKEN, token );

			string json = Json.Serialize(hashtable );
			
			this.form.AddField( GameConstants.REQUEST_KEY_PARAMS, Encryption.Encrypt(json) );
			this.AddWWWForm(this.form);
		}
开发者ID:SonGit,项目名称:NailGame,代码行数:10,代码来源:LoginFacebookRequest.cs

示例9: GetHighScoresRequest

		public GetHighScoresRequest (String url, String sessionKey, String level, SuccessCallback successCallback, ErrorCallback errorCallback): base(Method.POST, url, successCallback, errorCallback)
		{
			Hashtable hashtable = new Hashtable ();
			hashtable.Add( GameConstants.REQUEST_KEY_SESSION_KEY, sessionKey );
			hashtable.Add( GameConstants.REQUEST_KEY_LEVEL, level );
			string json = Json.Serialize(hashtable );
			
			this.form.AddField( GameConstants.REQUEST_KEY_PARAMS, Encryption.Encrypt(json) );
			this.AddWWWForm(this.form);
		}
开发者ID:SonGit,项目名称:NailGame,代码行数:10,代码来源:GetHighScoresRequest.cs

示例10: GenerateAnonymousAcountRequest

		public GenerateAnonymousAcountRequest (String url, string deviceId, SuccessCallback successCallback, ErrorCallback errorCallback) : base(Method.POST, url, successCallback, errorCallback) 
		{
			Hashtable hashtable = new Hashtable ();
			hashtable.Add( GameConstants.REQUEST_KEY_DEVICE_ID, deviceId );
			
			string json = Json.Serialize(hashtable );
			
			this.form.AddField( GameConstants.REQUEST_KEY_PARAMS, Encryption.Encrypt(json) );
			this.AddWWWForm(this.form);
		}
开发者ID:SonGit,项目名称:NailGame,代码行数:10,代码来源:GenerateAnonymousAcountRequest.cs

示例11: SubmitRequestAcceptRequest

		public SubmitRequestAcceptRequest (String url, string sessionKey, string requestIds, SuccessCallback successCallback, ErrorCallback errorCallback) : base(Method.POST, url, successCallback, errorCallback) 
		{
			Hashtable hashtable = new Hashtable ();
			hashtable.Add( GameConstants.REQUEST_KEY_SESSION_KEY, sessionKey );
			hashtable.Add( GameConstants.REQUEST_KEY_REQUEST_IDS, requestIds );

			string json = Json.Serialize(hashtable );
			
			this.form.AddField( GameConstants.REQUEST_KEY_PARAMS, Encryption.Encrypt(json) );
			this.AddWWWForm(this.form);
		}
开发者ID:SonGit,项目名称:NailGame,代码行数:11,代码来源:SubmitRequestAcceptRequest.cs

示例12: CreatePhysics

		private Physics CreatePhysics(ErrorCallback errorCallback = null)
		{
			if (Physics.Instantiated)
				Assert.Fail("Physics is still created");

			var foundation = new Foundation(errorCallback);

			var physics = new Physics(foundation, checkRuntimeFiles: true);

			return physics;
		}
开发者ID:zwagoth,项目名称:PhysX.net,代码行数:11,代码来源:Test.cs

示例13: UpsertByKeyFields

        internal static object UpsertByKeyFields(string tableName, DataStrategy dataStrategy, object entity, IEnumerable<string> keyFieldNames, bool isResultRequired, ErrorCallback errorCallback)
        {
            var record = UpdateCommand.ObjectToDictionary(entity);
            var list = record as IList<IDictionary<string, object>>;
            if (list != null) return dataStrategy.UpsertMany(tableName, list, keyFieldNames, isResultRequired, errorCallback);

            var dict = record as IDictionary<string, object>;
            var criteria = GetCriteria(keyFieldNames, dict);
            var criteriaExpression = ExpressionHelper.CriteriaDictionaryToExpression(tableName, criteria);
            return dataStrategy.Upsert(tableName, dict, criteriaExpression, isResultRequired);
        }
开发者ID:hlach,项目名称:Simple.Data,代码行数:11,代码来源:UpsertByCommand.cs

示例14: LoginRequest

		public LoginRequest (String url, string userName, string password, SuccessCallback successCallback, ErrorCallback errorCallback) : base(Method.POST, url, successCallback, errorCallback) 
		{
			Hashtable hashtable = new Hashtable ();
			hashtable.Add( GameConstants.REQUEST_KEY_USER_NAME, userName );
			hashtable.Add( GameConstants.REQUEST_KEY_PASSWORD, password );

			string json = Json.Serialize(hashtable );

			this.form.AddField( GameConstants.REQUEST_KEY_PARAMS, Encryption.Encrypt(json) );
			this.AddWWWForm(this.form);
		}
开发者ID:SonGit,项目名称:NailGame,代码行数:11,代码来源:LoginRequest.cs

示例15: ShareStoryRequest

		public ShareStoryRequest (String url, string uid, string type, string data, SuccessCallback successCallback, ErrorCallback errorCallback) : base(Method.POST, url, successCallback, errorCallback) 
		{
			Hashtable hashtable = new Hashtable ();
			hashtable.Add( GameConstants.REQUEST_KEY_UID, uid );
			hashtable.Add( GameConstants.REQUEST_KEY_TYPE, type );
			hashtable.Add( GameConstants.RESPONE_KEY_DATA, data );
			
			string json = Json.Serialize(hashtable );
			
			this.form.AddField( GameConstants.REQUEST_KEY_PARAMS, Encryption.Encrypt(json) );
			this.AddWWWForm(this.form);
		}
开发者ID:SonGit,项目名称:NailGame,代码行数:12,代码来源:ShareStoryRequest.cs


注:本文中的ErrorCallback类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。