Example #1
0
        public static Nullable <int> GetIntNullable(SetPropertyEventArgs args)
        {
            if (args == null)
            {
                throw new ArgumentNullException("args");
            }
            SetIntPropertyEventArgs intAgrs = args as SetIntPropertyEventArgs;

            if (intAgrs == null)
            {
                throw new ArgumentException("Parameter args type " + args.GetType().FullName + " is not " + typeof(SetIntPropertyEventArgs));
            }
            return(intAgrs.NewValue);
        }
Example #2
0
        public static string GetString(SetPropertyEventArgs args)
        {
            if (args == null)
            {
                throw new ArgumentNullException("args");
            }
            SetStringPropertyEventArgs stringArgs = args as SetStringPropertyEventArgs;

            if (stringArgs == null)
            {
                throw new ArgumentException("Parameter args type " + args.GetType().FullName + " is not " + typeof(SetStringPropertyEventArgs));
            }
            return(stringArgs.NewValue);
        }