コード例 #1
0
        private static void storageError(
            object sender,
            PersistentPairStorageErrorEventArgs args)
        {
            if (args.RetryCount <= 2)
            {
                Application.DoEvents();
                Thread.Sleep(0);

                args.Result = CheckHandleExceptionResult.Retry;
            }
            else
            {
                args.Result = CheckHandleExceptionResult.Ignore;
            }

            /*
             * if ( e.Exception == null )
             * {
             *      e.Cancel = false;
             * }
             * else
             * {
             *      // 2009-06-22, Uwe Keim:
             *      // http://zeta-producer.de/Pages/AdvancedForumIndex.aspx?DataID=9514
             *      LogCentral.Current.LogWarn(
             *              @"PersistentPairStorageException occurred.", e.Exception );
             *
             *      if ( e.Exception.InnerException == null )
             *      {
             *              e.Cancel = true;
             *      }
             *      else
             *      {
             *              if ( e.Exception.InnerException is UnauthorizedAccessException ||
             *                      e.Exception.InnerException is IOException )
             *              {
             *                      e.Cancel = false;
             *              }
             *              else
             *              {
             *                      e.Cancel = true;
             *              }
             *      }
             * }*/
        }
コード例 #2
0
ファイル: Host.cs プロジェクト: iraychen/ZetaResourceEditor
		private static void storageError(
			object sender,
			PersistentPairStorageErrorEventArgs args )
		{
			if (args.RetryCount <= 2)
			{
				Application.DoEvents();
				Thread.Sleep(0);

				args.Result = CheckHandleExceptionResult.Retry;
			}
			else
			{
				args.Result = CheckHandleExceptionResult.Ignore;
			}

			/*
			if ( e.Exception == null )
			{
				e.Cancel = false;
			}
			else
			{
				// 2009-06-22, Uwe Keim:
				// http://zeta-producer.de/Pages/AdvancedForumIndex.aspx?DataID=9514
				LogCentral.Current.LogWarn(
					@"PersistentPairStorageException occurred.", e.Exception );

				if ( e.Exception.InnerException == null )
				{
					e.Cancel = true;
				}
				else
				{
					if ( e.Exception.InnerException is UnauthorizedAccessException ||
						e.Exception.InnerException is IOException )
					{
						e.Cancel = false;
					}
					else
					{
						e.Cancel = true;
					}
				}
			}*/
		}