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); }
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"); } }
protected void Page_Load(object sender, EventArgs e) { userMgr = ContextBoundObject.GetOwinContext().GetUserManager <ApplicationUserManager>(); roleMgr = ContextBoundObject.GetOwinContext().Get <ApplicationRoleManager>(); }
public static bool UnregisterDynamicProperty(string !name, ContextBoundObject obj, Context ctx) { CodeContract.Requires(name != null); CodeContract.Requires(obj == null || ctx == null); return(default(bool)); }
public static bool RegisterDynamicProperty(IDynamicProperty !prop, ContextBoundObject obj, Context ctx) { CodeContract.Requires(prop != null); CodeContract.Requires(obj == null || ctx == null); return(default(bool)); }
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); }
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); }
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)); }
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); }
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(); }
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); }
/// <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; }
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)); }
public MainTabAdapter(ContextBoundObject context, FragmentManager fragmentManager, TabLayout tabLayout) : base(fragmentManager) { _context = context; _tabLayout = tabLayout; }
public static bool UnregisterDynamicProperty (String name, ContextBoundObject obj, Context ctx) { // TODO return(false); }
public static bool RegisterDynamicProperty(IDynamicProperty prop, ContextBoundObject obj, Context ctx) { throw new NotImplementedException(); }
public static bool RegisterDynamicProperty (IDynamicProperty prop, ContextBoundObject obj, Context ctx) { // TODO return false; }
/// <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)); }
public static bool UnregisterDynamicProperty(string name, ContextBoundObject obj, Context ctx) { DynamicPropertyCollection col = GetDynamicPropertyCollection (obj, ctx); return col.UnregisterDynamicProperty (name); }
public static bool UnregisterDynamicProperty(string name, ContextBoundObject obj, Context ctx) { throw new NotImplementedException(); }
public static bool RegisterDynamicProperty(IDynamicProperty prop, ContextBoundObject obj, Context ctx) { DynamicPropertyCollection col = GetDynamicPropertyCollection (obj, ctx); return col.RegisterDynamicProperty (prop); }
public static bool RegisterDynamicProperty (IDynamicProperty prop, ContextBoundObject obj, Context ctx) { // TODO return(false); }
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"); }
public Repository(ContextBoundObject context) { this.context = context; }