Пример #1
0
        /// <summary>
        ///		Sample type verifier. The signature of this method is important.
        /// </summary>
        /// <param name="context">The context which has information of deserializing type.</param>
        /// <returns>True for accepting; otherwise, false.</returns>
        public static bool Verify(PolymorphicTypeVerificationContext context)
        {
            // You should put type verification logic to prevent unexpected code execution via specified type.
            // 1. Check context.LoadingAssemblyName here to verify the assembly is known for you.
            // 2. Check context.LoadingTypeFullName here to verify the type name is known for you.

            // Note: You should not get Assembly, Type, or related reflection related objects here
            //       to prevent potentially malicous code execution in its type initializer etc.

            // True for accepting; otherwise, false.
            return(true);
        }
Пример #2
0
		/// <summary>
		///		Sample type verifier. The signature of this method is important.
		/// </summary>
		/// <param name="context">The context which has information of deserializing type.</param>
		/// <returns>True for accepting; otherwise, false.</returns>
		public static bool Verify( PolymorphicTypeVerificationContext context )
		{
			// You should put type verification logic to prevent unexpected code execution via specified type.
			// 1. Check context.LoadingAssemblyName here to verify the assembly is known for you.
			// 2. Check context.LoadingTypeFullName here to verify the type name is known for you.

			// Note: You should not get Assembly, Type, or related reflection related objects here
			//       to prevent potentially malicous code execution in its type initializer etc.

			// True for accepting; otherwise, false.
			return true;
		}