System.Runtime.Remoting.Contexts.Context.RemoveDynamicProperty C# (CSharp) Method

RemoveDynamicProperty() static private method

static private RemoveDynamicProperty ( Context ctx, String name ) : bool
ctx Context
name String
return bool
        internal static bool RemoveDynamicProperty(Context ctx, String name)
        {
            if (ctx != null)
            {
                return ctx.RemovePerContextDynamicProperty(name);
            }
            else
            {
                // We have to remove a global property
                return RemoveGlobalDynamicProperty(name);                        
            }
        }
    

Usage Example

        public static bool UnregisterDynamicProperty(String name, ContextBoundObject obj, Context ctx)
        {
            bool fUnregister = false;

            // name, obj, ctx arguments should be exactly the same as a previous
            // RegisterDynamicProperty call
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (obj != null && ctx != null)
            {
                throw new ArgumentException(Environment.GetResourceString("Argument_NonNullObjAndCtx"));
            }
            if (obj != null)
            {
                // ctx is ignored and must be null.
                fUnregister = IdentityHolder.RemoveDynamicProperty(obj, name);
            }
            else
            {
                // ctx may or may not be null
                fUnregister = Context.RemoveDynamicProperty(ctx, name);
            }

            return(fUnregister);
        }
All Usage Examples Of System.Runtime.Remoting.Contexts.Context::RemoveDynamicProperty