コード例 #1
0
ファイル: context.cs プロジェクト: SSCLI/sscli_20021101
        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);
        }
コード例 #2
0
 static DynamicPropertyCollection GetDynamicPropertyCollection(ContextBoundObject obj, Context ctx)
 {
     if (ctx == null && obj != null)
     {
         if (RemotingServices.IsTransparentProxy(obj))
         {
             RealProxy rp = RemotingServices.GetRealProxy(obj);
             return(rp.ObjectIdentity.ClientDynamicProperties);
         }
         else
         {
             return(obj.ObjectIdentity.ServerDynamicProperties);
         }
     }
     else if (ctx != null && obj == null)
     {
         if (ctx.context_dynamic_properties == null)
         {
             ctx.context_dynamic_properties = new DynamicPropertyCollection();
         }
         return(ctx.context_dynamic_properties);
     }
     else if (ctx == null && obj == null)
     {
         if (global_dynamic_properties == null)
         {
             global_dynamic_properties = new DynamicPropertyCollection();
         }
         return(global_dynamic_properties);
     }
     else
     {
         throw new ArgumentException("Either obj or ctx must be null");
     }
 }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            userMgr =
                ContextBoundObject.GetOwinContext().GetUserManager <ApplicationUserManager>();

            roleMgr = ContextBoundObject.GetOwinContext().Get <ApplicationRoleManager>();
        }
コード例 #4
0
        public static bool UnregisterDynamicProperty(string !name, ContextBoundObject obj, Context ctx)
        {
            CodeContract.Requires(name != null);
            CodeContract.Requires(obj == null || ctx == null);

            return(default(bool));
        }
コード例 #5
0
        public static bool RegisterDynamicProperty(IDynamicProperty !prop, ContextBoundObject obj, Context ctx)
        {
            CodeContract.Requires(prop != null);
            CodeContract.Requires(obj == null || ctx == null);

            return(default(bool));
        }
コード例 #6
0
ファイル: context.cs プロジェクト: SSCLI/sscli_20021101
        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);
        }
コード例 #7
0
        static void ContextBoundObjectInterceptor(ContextBoundObject instance)
        {
            //Context bound object interceptor
            var interceptor  = new ContextBoundObjectInterceptor();
            var canIntercept = interceptor.CanIntercept(instance);
            var myProxy      = interceptor.Intercept(instance, null, new MyHandler()) as IMyType;
            //var proxy = myProxy as IInterceptionProxy;
            //var otherInterceptor = proxy.Interceptor;
            var result = myProxy.MyMethod();

            Assert.AreEqual(20, result);
        }
コード例 #8
0
ファイル: context.cs プロジェクト: wwkkww1983/ZJCredit
 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));
 }
コード例 #9
0
ファイル: context.cs プロジェクト: wwkkww1983/ZJCredit
 public static bool UnregisterDynamicProperty(string name, ContextBoundObject obj, Context ctx)
 {
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     if (obj != null && ctx != null)
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_NonNullObjAndCtx"));
     }
     return(obj == null?Context.RemoveDynamicProperty(ctx, name) : IdentityHolder.RemoveDynamicProperty((MarshalByRefObject)obj, name));
 }
        public static IInterceptionHandler GetInterceptor(ContextBoundObject instance)
        {
            foreach (var @int in interceptors)
            {
                if (@int.Key == instance)
                {
                    return(@int.Value);
                }
            }

            return(null);
        }
コード例 #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            /* if (!Request.IsSecureConnection)
             * {
             *   string url = ConfigurationManagger.AppSetings["UnSeurePath"]
             + "CreateRole.aspx";
             +   Response.Redirect(url);
             + }*/
            var ctx = ContextBoundObject.GetOwinContext();


            createRolesandUsers();
        }
コード例 #12
0
        public static bool UnregisterDynamicProperty(string name, ContextBoundObject obj, Context ctx)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (obj != null && ctx != null)
            {
                throw new ArgumentException(Environment.GetResourceString("Argument_NonNullObjAndCtx"));
            }
            bool result;

            if (obj != null)
            {
                result = IdentityHolder.RemoveDynamicProperty(obj, name);
            }
            else
            {
                result = Context.RemoveDynamicProperty(ctx, name);
            }
            return(result);
        }
コード例 #13
0
        /// <summary>Registers a dynamic property implementing the <see cref="T:System.Runtime.Remoting.Contexts.IDynamicProperty" /> interface with the remoting service.</summary>
        /// <returns>true if the property was successfully registered; otherwise, false.</returns>
        /// <param name="prop">The dynamic property to register. </param>
        /// <param name="obj">The object/proxy for which the <paramref name="property" /> is registered. </param>
        /// <param name="ctx">The context for which the <paramref name="property" /> is registered. </param>
        /// <exception cref="T:System.ArgumentNullException">Either <paramref name="prop" /> or its name is null, or it is not dynamic (it does not implement <see cref="T:System.Runtime.Remoting.Contexts.IDynamicProperty" />). </exception>
        /// <exception cref="T:System.ArgumentException">Both an object as well as a context are specified (both <paramref name="obj" /> and <paramref name="ctx" /> are not null). </exception>
        /// <PermissionSet>
        ///   <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
        /// </PermissionSet>
        public static bool RegisterDynamicProperty(IDynamicProperty prop, ContextBoundObject obj, Context ctx)
        {
            DynamicPropertyCollection dynamicPropertyCollection = Context.GetDynamicPropertyCollection(obj, ctx);

            return(dynamicPropertyCollection.RegisterDynamicProperty(prop));
        }
 public InterceptionMessageSink(ContextBoundObject target, IMessageSink next)
 {
     this.Target   = target;
     this.NextSink = next;
 }
コード例 #15
0
	public static bool UnregisterDynamicProperty
				(String name, ContextBoundObject obj, Context ctx)
			{
				// TODO
				return false;
			}
 public static bool RegisterDynamicProperty(IDynamicProperty prop, ContextBoundObject obj, System.Runtime.Remoting.Contexts.Context ctx)
 {
     return(default(bool));
 }
コード例 #17
0
 public MainTabAdapter(ContextBoundObject context, FragmentManager fragmentManager, TabLayout tabLayout) : base(fragmentManager)
 {
     _context   = context;
     _tabLayout = tabLayout;
 }
コード例 #18
0
ファイル: Context.cs プロジェクト: ForNeVeR/pnet
 public static bool UnregisterDynamicProperty
     (String name, ContextBoundObject obj, Context ctx)
 {
     // TODO
     return(false);
 }
コード例 #19
0
ファイル: Context.cs プロジェクト: PlumpMath/CIL2Java
 public static bool RegisterDynamicProperty(IDynamicProperty prop, ContextBoundObject obj, Context ctx)
 {
     throw new NotImplementedException();
 }
コード例 #20
0
	public static bool RegisterDynamicProperty
				(IDynamicProperty prop, ContextBoundObject obj, Context ctx)
			{
				// TODO
				return false;
			}
コード例 #21
0
        /// <summary>Unregisters a dynamic property implementing the <see cref="T:System.Runtime.Remoting.Contexts.IDynamicProperty" /> interface.</summary>
        /// <returns>true if the object was successfully unregistered; otherwise, false.</returns>
        /// <param name="name">The name of the dynamic property to unregister. </param>
        /// <param name="obj">The object/proxy for which the <paramref name="property" /> is registered. </param>
        /// <param name="ctx">The context for which the <paramref name="property" /> is registered. </param>
        /// <exception cref="T:System.ArgumentNullException">The <paramref name="name" /> parameter is null. </exception>
        /// <exception cref="T:System.ArgumentException">Both an object as well as a context are specified (both <paramref name="obj" /> and <paramref name="ctx" /> are not null). </exception>
        /// <PermissionSet>
        ///   <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
        /// </PermissionSet>
        public static bool UnregisterDynamicProperty(string name, ContextBoundObject obj, Context ctx)
        {
            DynamicPropertyCollection dynamicPropertyCollection = Context.GetDynamicPropertyCollection(obj, ctx);

            return(dynamicPropertyCollection.UnregisterDynamicProperty(name));
        }
コード例 #22
0
ファイル: Context.cs プロジェクト: psni/mono
		public static bool UnregisterDynamicProperty(string name, ContextBoundObject obj, Context ctx)
		{
			DynamicPropertyCollection col = GetDynamicPropertyCollection (obj, ctx);
			return col.UnregisterDynamicProperty (name);
		}
コード例 #23
0
ファイル: Context.cs プロジェクト: PlumpMath/CIL2Java
 public static bool UnregisterDynamicProperty(string name, ContextBoundObject obj, Context ctx)
 {
     throw new NotImplementedException();
 }
コード例 #24
0
ファイル: Context.cs プロジェクト: psni/mono
		public static bool RegisterDynamicProperty(IDynamicProperty prop, ContextBoundObject obj, Context ctx)
		{
			DynamicPropertyCollection col = GetDynamicPropertyCollection (obj, ctx);
			return col.RegisterDynamicProperty (prop);
		}
コード例 #25
0
ファイル: Context.cs プロジェクト: ForNeVeR/pnet
 public static bool RegisterDynamicProperty
     (IDynamicProperty prop, ContextBoundObject obj, Context ctx)
 {
     // TODO
     return(false);
 }
コード例 #26
0
ファイル: Context.cs プロジェクト: psni/mono
		static DynamicPropertyCollection GetDynamicPropertyCollection(ContextBoundObject obj, Context ctx)
		{
			if (ctx == null && obj != null)
			{
				if (RemotingServices.IsTransparentProxy(obj))
				{
					RealProxy rp = RemotingServices.GetRealProxy (obj);
					return rp.ObjectIdentity.ClientDynamicProperties;
				}
				else
				{
#if FEATURE_REMOTING
					return obj.ObjectIdentity.ServerDynamicProperties;
#else
					throw new NotSupportedException ();
#endif					
				}
			}
			else if (ctx != null && obj == null)
			{
				if (ctx.context_dynamic_properties == null) ctx.context_dynamic_properties = new DynamicPropertyCollection ();
				return ctx.context_dynamic_properties;
			}
			else if (ctx == null && obj == null)
			{
				if (global_dynamic_properties == null) global_dynamic_properties = new DynamicPropertyCollection ();
				return global_dynamic_properties;
			}
			else
				throw new ArgumentException ("Either obj or ctx must be null");
		}
コード例 #27
0
 public Repository(ContextBoundObject context)
 {
     this.context = context;
 }