AddDynamicProperty() 정적인 개인적인 메소드

static private AddDynamicProperty ( Context ctx, IDynamicProperty prop ) : bool
ctx Context
prop IDynamicProperty
리턴 bool
예제 #1
0
        public static bool RegisterDynamicProperty(IDynamicProperty prop, ContextBoundObject obj, Context ctx)
        {
            bool fRegistered = false;

            if (prop == null || prop.Name == null || !(prop is IContributeDynamicSink))
            {
                throw new ArgumentNullException("prop");
            }
            if (obj != null && ctx != null)
            {
                // Exactly one of these is allowed to be non-null.
                throw new ArgumentException(Environment.GetResourceString("Argument_NonNullObjAndCtx"));
            }
            if (obj != null)
            {
                // ctx is ignored and must be null.
                fRegistered = IdentityHolder.AddDynamicProperty(obj, prop);
            }
            else
            {
                // ctx may or may not be null
                fRegistered = Context.AddDynamicProperty(ctx, prop);
            }

            return(fRegistered);
        }
예제 #2
0
 public static bool RegisterDynamicProperty(IDynamicProperty prop, ContextBoundObject obj, Context ctx)
 {
     if (prop == null || prop.Name == null || !(prop is IContributeDynamicSink))
     {
         throw new ArgumentNullException("prop");
     }
     if (obj != null && ctx != null)
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_NonNullObjAndCtx"));
     }
     return(obj == null?Context.AddDynamicProperty(ctx, prop) : IdentityHolder.AddDynamicProperty((MarshalByRefObject)obj, prop));
 }