Example #1
0
        public override bool DeleteProperty(string name)
        {
            VerifyNotDisposed();

            return(engine.ScriptInvoke(() =>
            {
                var field = target.GetField(name, BindingFlags.Default);
                if (field != null)
                {
                    target.RemoveMember(field);
                    return true;
                }

                var property = target.GetProperty(name, BindingFlags.Default);
                if (property != null)
                {
                    target.RemoveMember(property);
                    return true;
                }

                return false;
            }));
        }
 private static void RemoveProperty(IExpando expando, PropertyInfo property)
 {
     expando.RemoveMember(property);
 }