[Adapdev-commits] Adapdev/src/Adapdev.NVelocity/Context AbstractContext.cs,1.2,1.3 IContext.cs,1.2,1
Status: Beta
Brought to you by:
intesar66
From: Sean M. <int...@us...> - 2005-11-16 05:45:33
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.NVelocity/Context In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22005/src/Adapdev.NVelocity/Context Added Files: AbstractContext.cs IContext.cs InternalContextAdapter.cs InternalContextAdapterImpl.cs InternalContextBase.cs InternalEventContext.cs InternalHousekeepingContext.cs InternalWrapperContext.cs VMContext.cs Log Message: --- NEW FILE: InternalEventContext.cs --- namespace NVelocity.Context { using NVelocity.App.Events; /// <summary> /// Interface for event support. Note that this is a public internal /// interface, as it is something that will be accessed from outside /// of the .context package. /// </summary> public interface InternalEventContext { EventCartridge EventCartridge { get; } EventCartridge AttachEventCartridge(EventCartridge ec); } } --- NEW FILE: InternalContextBase.cs --- namespace NVelocity.Context { using System; using System.Collections; using NVelocity.App.Events; using NVelocity.Runtime.Resource; using NVelocity.Util.Introspection; /// <summary> class to encapsulate the 'stuff' for internal operation of velocity. /// We use the context as a thread-safe storage : we take advantage of the /// fact that it's a visitor of sorts to all nodes (that matter) of the /// AST during init() and render(). /// Currently, it carries the template name for namespace /// support, as well as node-local context data introspection caching. /// * /// Note that this is not a public class. It is for package access only to /// keep application code from accessing the internals, as AbstractContext /// is derived from this. /// * /// </summary> /// <author> <a href="mailto:ge...@op...">Geir Magnusson Jr.</a> /// </author> /// <version> $Id: InternalContextBase.cs,v 1.3 2005/11/16 05:45:22 intesar66 Exp $ /// /// </version> [Serializable] public class InternalContextBase : InternalHousekeepingContext, InternalEventContext { //, System.Runtime.Serialization.ISerializable { public InternalContextBase() { InitBlock(); } private void InitBlock() { introspectionCache = new Hashtable(33); templateNameStack = new Stack(); } public virtual String CurrentTemplateName { get { if ((templateNameStack.Count == 0)) return "<undef>"; else return (String) templateNameStack.Peek(); } } public virtual Object[] TemplateNameStack { get { return templateNameStack.ToArray(); } } public virtual Resource CurrentResource { get { return currentResource; } set { currentResource = value; } } public virtual EventCartridge EventCartridge { get { return eventCartridge; } } /// <summary> cache for node/context specific introspection information /// </summary> //UPGRADE_NOTE: The initialization of 'introspectionCache' was moved to method 'InitBlock'. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1005"' private Hashtable introspectionCache; /// <summary> Template name stack. The stack top contains the current template name. /// </summary> //UPGRADE_NOTE: The initialization of 'templateNameStack' was moved to method 'InitBlock'. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1005"' private Stack templateNameStack; /// <summary> EventCartridge we are to carry. Set by application /// </summary> private EventCartridge eventCartridge = null; /// <summary> Current resource - used for carrying encoding and other /// information down into the rendering process /// </summary> private Resource currentResource = null; /// <summary> set the current template name on top of stack /// * /// </summary> /// <param name="s">current template name /// /// </param> public virtual void PushCurrentTemplateName(String s) { Object temp_object; temp_object = s; Object generatedAux = temp_object; templateNameStack.Push(temp_object); return; } /// <summary> remove the current template name from stack /// </summary> public virtual void PopCurrentTemplateName() { templateNameStack.Pop(); return; } /// <summary> get the current template name /// * /// </summary> /// <returns>String current template name /// /// </returns> /// <summary> get the current template name stack /// * /// </summary> /// <returns>Object[] with the template name stack contents. /// /// </returns> /// <seealso cref=" IntrospectionCacheData) /// object if exists for the key /// * /// "/> /// <param name="key"> key to find in cache /// </param> /// <returns>cache object /// /// </returns> public virtual IntrospectionCacheData ICacheGet(Object key) { return (IntrospectionCacheData) introspectionCache[key]; } /// <seealso cref=" IntrospectionCacheData) /// element in the cache for specified key /// * /// "/> /// <param name="key"> key /// </param> /// <param name="o"> IntrospectionCacheData object to place in cache /// /// </param> public virtual void ICachePut(Object key, IntrospectionCacheData o) { introspectionCache[key] = o; } public virtual EventCartridge AttachEventCartridge(EventCartridge ec) { EventCartridge temp = eventCartridge; eventCartridge = ec; return temp; } } } --- NEW FILE: InternalWrapperContext.cs --- namespace NVelocity.Context { /// <summary> /// interface for internal context wrapping functionality /// </summary> /// <author> <a href="mailto:ge...@op...">Geir Magnusson Jr.</a></author> /// <version> $Id: InternalWrapperContext.cs,v 1.3 2005/11/16 05:45:22 intesar66 Exp $ </version> public interface InternalWrapperContext { /// <summary> /// returns the wrapped user context /// </summary> IContext InternalUserContext { get; } /// <summary> /// returns the base full context impl /// </summary> InternalContextAdapter BaseContext { get; } } } --- NEW FILE: AbstractContext.cs --- namespace NVelocity.Context { using System; /// <summary> This class is the abstract base class for all conventional /// Velocity Context implementations. Simply extend this class /// and implement the abstract routines that access your preferred /// storage method. /// * /// Takes care of context chaining. /// * /// Also handles / enforces policy on null keys and values : /// * /// <ul> /// <li> Null keys and values are accepted and basically dropped. /// <li> If you place an object into the context with a null key, it /// will be ignored and logged. /// <li> If you try to place a null into the context with any key, it /// will be dropped and logged. /// </ul> /// * /// The default implementation of this for application use is /// org.apache.velocity.VelocityContext. /// * /// All thanks to Fedor for the chaining idea. /// * /// </summary> /// <author> <a href="mailto:ge...@op...">Geir Magnusson Jr.</a> /// </author> /// <author> <a href="mailto:fed...@ho...">Fedor Karpelevitch</a> /// </author> /// <author> <a href="mailto:jv...@ap...">Jason van Zyl</a> /// </author> /// <version> $Id: AbstractContext.cs,v 1.3 2005/11/16 05:45:22 intesar66 Exp $ /// /// </version> [Serializable] public abstract class AbstractContext : InternalContextBase, IContext { //, System.Runtime.Serialization.ISerializable public virtual Object[] Keys { get { return InternalGetKeys(); } } public virtual IContext ChainedContext { get { return innerContext; } } /// <summary> the chained Context if any /// </summary> private IContext innerContext = null; /// /// <summary> Implement to return a value from the context storage. /// <br><br> /// The implementation of this method is required for proper /// operation of a Context implementation in general /// Velocity use. /// /// </summary> /// <param name="key">key whose associated value is to be returned /// </param> /// <returns>object stored in the context /// /// </returns> public abstract Object InternalGet(String key); /// /// <summary> Implement to put a value into the context storage. /// <br><br> /// The implementation of this method is required for /// proper operation of a Context implementation in /// general Velocity use. /// * /// </summary> /// <param name="key">key with which to associate the value /// </param> /// <param name="value">value to be associated with the key /// </param> /// <returns>previously stored value if exists, or null /// /// </returns> public abstract Object InternalPut(String key, Object value_Renamed); /// /// <summary> Implement to determine if a key is in the storage. /// <br><br> /// Currently, this method is not used internally by /// the Velocity core. /// * /// </summary> /// <param name="key">key to test for existance /// </param> /// <returns>true if found, false if not /// /// </returns> public abstract bool InternalContainsKey(Object key); /// /// <summary> Implement to return an object array of key /// strings from your storage. /// <br><br> /// Currently, this method is not used internally by /// the Velocity core. /// * /// </summary> /// <returns>array of keys /// /// </returns> public abstract Object[] InternalGetKeys(); /// /// <summary> I mplement to remove an item from your storage. /// <br><br> /// Currently, this method is not used internally by /// the Velocity core. /// * /// </summary> /// <param name="key">key to remove /// </param> /// <returns>object removed if exists, else null /// /// </returns> public abstract Object InternalRemove(Object key); /// <summary> default CTOR /// </summary> public AbstractContext() { } /// <summary> Chaining constructor accepts a Context argument. /// It will relay get() operations into this Context /// in the even the 'local' get() returns null. /// /// </summary> /// <param name="inner">context to be chained /// /// </param> public AbstractContext(IContext inner) { innerContext = inner; /* * now, do a 'forward pull' of event cartridge so * it's accessable, bringing to the top level. */ if (innerContext is InternalEventContext) { AttachEventCartridge(((InternalEventContext) innerContext).EventCartridge); } } /// <summary> Adds a name/value pair to the context. /// /// </summary> /// <param name="key"> The name to key the provided value with. /// </param> /// <param name="value">The corresponding value. /// </param> /// <returns>Object that was replaced in the the Context if /// applicable or null if not. /// /// </returns> public virtual Object Put(String key, Object value_Renamed) { /* * don't even continue if key or value is null */ if (key == null) { return null; } else if (value_Renamed == null) { return null; } return InternalPut(key, value_Renamed); } /// <summary> Gets the value corresponding to the provided key from the context. /// * /// Supports the chaining context mechanism. If the 'local' context /// doesn't have the value, we try to get it from the chained context. /// * /// </summary> /// <param name="key">The name of the desired value. /// </param> /// <returns> The value corresponding to the provided key or null if /// the key param is null. /// /// </returns> public virtual Object Get(String key) { /* * punt if key is null */ if (key == null) { return null; } /* * get the object for this key. If null, and we are chaining another Context * call the get() on it. */ Object o = InternalGet(key); if (o == null && innerContext != null) { o = innerContext.Get(key); } return o; } /// <summary> Indicates whether the specified key is in the context. Provided for /// debugging purposes. /// * /// </summary> /// <param name="key">The key to look for. /// </param> /// <returns>true if the key is in the context, false if not. /// /// </returns> public virtual bool ContainsKey(Object key) { if (key == null) { return false; } return InternalContainsKey(key); } /// <summary> Get all the keys for the values in the context /// </summary> /// <returns>Object[] of keys in the Context. Does not return /// keys in chained context. /// /// </returns> /// <summary> Removes the value associated with the specified key from the context. /// * /// </summary> /// <param name="key">The name of the value to remove. /// </param> /// <returns> The value that the key was mapped to, or <code>null</code> /// if unmapped. /// /// </returns> public virtual Object Remove(Object key) { if (key == null) { return null; } return InternalRemove(key); } /// <summary> returns innerContext if one is chained /// * /// </summary> /// <returns>Context if chained, <code>null</code> if not /// /// </returns> } } --- NEW FILE: InternalContextAdapterImpl.cs --- namespace NVelocity.Context { using System; using NVelocity.App.Events; using NVelocity.Runtime.Resource; using NVelocity.Util.Introspection; /// <summary> This adapter class is the container for all context types for internal /// use. The AST now uses this class rather than the app-level Context /// interface to allow flexibility in the future. /// * /// Currently, we have two context interfaces which must be supported : /// <ul> /// <li> Context : used for application/template data access /// <li> InternalHousekeepingContext : used for internal housekeeping and caching /// <li> InternalWrapperContext : used for getting root cache context and other /// such. /// <li> InternalEventContext : for event handling. /// </ul> /// * /// This class implements the two interfaces to ensure that all methods are /// supported. When adding to the interfaces, or adding more context /// functionality, the interface is the primary definition, so alter that first /// and then all classes as necessary. As of this writing, this would be /// the only class affected by changes to InternalContext /// * /// This class ensures that an InternalContextBase is available for internal /// use. If an application constructs their own Context-implementing /// object w/o subclassing AbstractContext, it may be that support for /// InternalContext is not available. Therefore, InternalContextAdapter will /// create an InternalContextBase if necessary for this support. Note that /// if this is necessary, internal information such as node-cache data will be /// lost from use to use of the context. This may or may not be important, /// depending upon application. /// /// * /// </summary> /// <author> <a href="mailto:ge...@op...">Geir Magnusson Jr.</a> /// </author> /// <version> $Id: InternalContextAdapterImpl.cs,v 1.3 2005/11/16 05:45:22 intesar66 Exp $ /// /// </version> //TODO: class was sealed public class InternalContextAdapterImpl : InternalContextAdapter { public virtual String CurrentTemplateName { get { return icb.CurrentTemplateName; } } public virtual Object[] TemplateNameStack { get { return icb.TemplateNameStack; } } public virtual Resource CurrentResource { get { return icb.CurrentResource; } set { icb.CurrentResource = value; } } public virtual Object[] Keys { get { return context.Keys; } } public virtual IContext InternalUserContext { get { return context; } } public virtual InternalContextAdapter BaseContext { get { return this; } } public virtual EventCartridge EventCartridge { get { if (iec != null) { return iec.EventCartridge; } return null; } } /// /// <summary> the user data Context that we are wrapping /// </summary> internal IContext context = null; /// /// <summary> the ICB we are wrapping. We may need to make one /// if the user data context implementation doesn't /// support one. The default AbstractContext-derived /// VelocityContext does, and it's recommended that /// people derive new contexts from AbstractContext /// rather than piecing things together /// </summary> internal InternalHousekeepingContext icb = null; /// <summary> The InternalEventContext that we are wrapping. If /// the context passed to us doesn't support it, no /// biggie. We don't make it for them - since its a /// user context thing, nothing gained by making one /// for them now /// </summary> internal InternalEventContext iec = null; /// <summary> CTOR takes a Context and wraps it, delegating all 'data' calls /// to it. /// /// For support of internal contexts, it will create an InternalContextBase /// if need be. /// </summary> public InternalContextAdapterImpl(IContext c) { context = c; if (!(c is InternalHousekeepingContext)) { icb = new InternalContextBase(); } else { icb = (InternalHousekeepingContext) context; } if (c is InternalEventContext) { iec = (InternalEventContext) context; } } /* --- InternalHousekeepingContext interface methods --- */ public void PushCurrentTemplateName(String s) { icb.PushCurrentTemplateName(s); } public void PopCurrentTemplateName() { icb.PopCurrentTemplateName(); } public IntrospectionCacheData ICacheGet(Object key) { return icb.ICacheGet(key); } public void ICachePut(Object key, IntrospectionCacheData o) { icb.ICachePut(key, o); } /* --- Context interface methods --- */ public Object Put(String key, Object value_Renamed) { return context.Put(key, value_Renamed); } public Object Get(String key) { return context.Get(key); } public bool ContainsKey(Object key) { return context.ContainsKey(key); } public Object Remove(Object key) { return context.Remove(key); } /* ---- InternalWrapperContext --- */ /// <summary> returns the user data context that /// we are wrapping /// </summary> /// <summary> Returns the base context that we are /// wrapping. Here, its this, but for other thing /// like VM related context contortions, it can /// be something else /// </summary> /* ----- InternalEventContext ---- */ public EventCartridge AttachEventCartridge(EventCartridge ec) { if (iec != null) { return iec.AttachEventCartridge(ec); } return null; } } } --- NEW FILE: VMContext.cs --- namespace NVelocity.Context { using System; using System.Collections; using NVelocity.App.Events; using NVelocity.Runtime; using NVelocity.Runtime.Directive; using NVelocity.Runtime.Resource; using NVelocity.Util.Introspection; /// <summary> This is a special, internal-use-only context implementation to be /// used for the new Velocimacro implementation. /// * /// The main distinguishing feature is the management of the VMProxyArg objects /// in the put() and get() methods. /// * /// Further, this context also supports the 'VM local context' mode, where /// any get() or put() of references that aren't args to the VM are considered /// local to the vm, protecting the global context. /// /// </summary> /// <author> <a href="mailto:ge...@op...">Geir Magnusson Jr.</a> /// </author> /// <version> $Id: VMContext.cs,v 1.3 2005/11/16 05:45:22 intesar66 Exp $ /// /// </version> public class VMContext : InternalContextAdapter { private void InitBlock() { vmproxyhash = new Hashtable(); localcontext = new Hashtable(); } public virtual IContext InternalUserContext { get { return innerContext.InternalUserContext; } } public virtual InternalContextAdapter BaseContext { get { return innerContext.BaseContext; } } public virtual Object[] Keys { get { // TODO //return vmproxyhash.keySet().toArray(); throw new NotImplementedException(); } } public virtual String CurrentTemplateName { get { return innerContext.CurrentTemplateName; } } public virtual Object[] TemplateNameStack { get { return innerContext.TemplateNameStack; } } public virtual EventCartridge EventCartridge { get { return innerContext.EventCartridge; } } public virtual Resource CurrentResource { get { return innerContext.CurrentResource; } set { innerContext.CurrentResource = value; } } /// <summary>container for our VMProxy Objects /// </summary> //UPGRADE_NOTE: The initialization of 'vmproxyhash' was moved to method 'InitBlock'. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1005"' internal Hashtable vmproxyhash; /// <summary>container for any local or constant VMProxy items /// </summary> //UPGRADE_NOTE: The initialization of 'localcontext' was moved to method 'InitBlock'. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1005"' internal Hashtable localcontext; /// <summary>the base context store. This is the 'global' context /// </summary> internal InternalContextAdapter innerContext = null; /// <summary>context that we are wrapping /// </summary> internal InternalContextAdapter wrappedContext = null; /// <summary>support for local context scope feature, where all references are local /// </summary> private bool localcontextscope = false; /// <summary> CTOR, wraps an ICA /// </summary> public VMContext(InternalContextAdapter inner, RuntimeServices rsvc) { InitBlock(); localcontextscope = rsvc.getBoolean(RuntimeConstants_Fields.VM_CONTEXT_LOCALSCOPE, false); wrappedContext = inner; innerContext = inner.BaseContext; } /// <summary> return the inner / user context /// </summary> /// <summary> Used to put VMProxyArgs into this context. It separates /// the VMProxyArgs into constant and non-constant types /// pulling out the value of the constant types so they can /// be modified w/o damaging the VMProxyArg, and leaving the /// dynamic ones, as they modify context rather than their own /// state /// </summary> /// <param name="vmpa">VMProxyArg to add /// /// </param> public virtual void AddVMProxyArg(VMProxyArg vmpa) { /* * ask if it's a constant : if so, get the value and put into the * local context, otherwise, put the vmpa in our vmproxyhash */ String key = vmpa.ContextReference; if (vmpa.isConstant()) { localcontext[key] = vmpa.getObject(wrappedContext); } else { vmproxyhash[key] = vmpa; } } /// <summary> Impl of the Context.put() method. /// * /// </summary> /// <param name="key">name of item to set /// </param> /// <param name="value">object to set to key /// </param> /// <returns>old stored object /// /// </returns> public virtual Object Put(String key, Object value_Renamed) { /* * first see if this is a vmpa */ VMProxyArg vmpa = (VMProxyArg) vmproxyhash[key]; if (vmpa != null) { return vmpa.setObject(wrappedContext, value_Renamed); } else { if (localcontextscope) { /* * if we have localcontextscope mode, then just * put in the local context */ return localcontext[key] = value_Renamed; } else { /* * ok, how about the local context? */ if (localcontext.ContainsKey(key)) { return localcontext[key] = value_Renamed; } else { /* * otherwise, let them push it into the 'global' context */ return innerContext.Put(key, value_Renamed); } } } } /// <summary> Impl of the Context.gut() method. /// * /// </summary> /// <param name="key">name of item to get /// </param> /// <returns> stored object or null /// /// </returns> public virtual Object Get(String key) { /* * first, see if it's a VMPA */ Object o = null; VMProxyArg vmpa = (VMProxyArg) vmproxyhash[key]; if (vmpa != null) { o = vmpa.getObject(wrappedContext); } else { if (localcontextscope) { /* * if we have localcontextscope mode, then just * put in the local context */ o = localcontext[key]; } else { /* * try the local context */ o = localcontext[key]; if (o == null) { /* * last chance */ o = innerContext.Get(key); } } } return o; } /// <summary> not yet impl /// </summary> public virtual bool ContainsKey(Object key) { return false; } /// <summary> impl badly /// </summary> /// <summary> impl badly /// </summary> public virtual Object Remove(Object key) { Object o = vmproxyhash[key]; vmproxyhash.Remove(key); return o; } public virtual void PushCurrentTemplateName(String s) { innerContext.PushCurrentTemplateName(s); } public virtual void PopCurrentTemplateName() { innerContext.PopCurrentTemplateName(); } public virtual IntrospectionCacheData ICacheGet(Object key) { return innerContext.ICacheGet(key); } public virtual void ICachePut(Object key, IntrospectionCacheData o) { innerContext.ICachePut(key, o); } public virtual EventCartridge AttachEventCartridge(EventCartridge ec) { return innerContext.AttachEventCartridge(ec); } } } --- NEW FILE: InternalContextAdapter.cs --- namespace NVelocity.Context { /// <summary> interface to bring all necessary internal and user contexts together. /// this is what the AST expects to deal with. If anything new comes /// along, add it here. /// * /// I will rename soon :) /// * /// </summary> /// <author> <a href="mailto:ge...@op...">Geir Magnusson Jr.</a> /// </author> /// <version> $Id: InternalContextAdapter.cs,v 1.3 2005/11/16 05:45:22 intesar66 Exp $ /// /// </version> public interface InternalContextAdapter : InternalHousekeepingContext, IContext, InternalWrapperContext, InternalEventContext { } } --- NEW FILE: InternalHousekeepingContext.cs --- namespace NVelocity.Context { using System; using NVelocity.Runtime.Resource; using NVelocity.Util.Introspection; /// <summary> /// interface to encapsulate the 'stuff' for internal operation of velocity. /// We use the context as a thread-safe storage : we take advantage of the /// fact that it's a visitor of sorts to all nodes (that matter) of the /// AST during init() and render(). /// /// Currently, it carries the template name for namespace /// support, as well as node-local context data introspection caching. /// </summary> /// <author> <a href="mailto:ge...@op...">Geir Magnusson Jr.</a></author> /// <author> <a href="mailto:Chr...@dl...">Christoph Reck</a></author> /// <version> $Id: InternalHousekeepingContext.cs,v 1.3 2005/11/16 05:45:22 intesar66 Exp $</version> public interface InternalHousekeepingContext { String CurrentTemplateName { get; } Object[] TemplateNameStack { get; } Resource CurrentResource { get; set; } /// <summary> /// set the current template name on top of stack /// </summary> /// <param name="s">current template name</param> void PushCurrentTemplateName(String s); /// <summary> /// remove the current template name from stack /// </summary> void PopCurrentTemplateName(); /// <summary> get the current template name /// * /// </summary> /// <returns>String current template name /// /// </returns> /// <summary> Returns the template name stack in form of an array. /// * /// </summary> /// <returns>Object[] with the template name stack contents. /// /// </returns> /// <seealso cref=" IntrospectionCacheData) /// object if exists for the key /// * /// "/> /// <param name="key"> key to find in cache /// </param> /// <returns>cache object /// /// </returns> IntrospectionCacheData ICacheGet(Object key); /// <seealso cref=" IntrospectionCacheData) /// element in the cache for specified key /// * /// "/> /// <param name="key"> key /// </param> /// <param name="o"> IntrospectionCacheData object to place in cache /// /// </param> void ICachePut(Object key, IntrospectionCacheData o); /// <summary> /// temporary fix to enable #include() to figure out /// current encoding. /// </summary> } } --- NEW FILE: IContext.cs --- namespace NVelocity.Context { using System; /// <summary> /// Interface describing the application data context. This set of /// routines is used by the application to set and remove 'named' data /// object to pass them to the template engine to use when rendering /// a template. /// /// This is the same set of methods supported by the original Context /// class /// </summary> /// <seealso cref="NVelocity.Context.AbstractContext"/> /// <seealso cref="NVelocity.VelocityContext"/> /// <author> <a href="mailto:jv...@ap...">Jason van Zyl</a></author> /// <author> <a href="mailto:ge...@op...">Geir Magnusson Jr.</a></author> public interface IContext { /// <summary> /// Adds a name/value pair to the context. /// </summary> /// <param name="key">The name to key the provided value with.</param> /// <param name="value">The corresponding value.</param> Object Put(String key, Object value); /// <summary> /// Gets the value corresponding to the provided key from the context. /// </summary> /// <param name="key">The name of the desired value.</param> /// <returns>The value corresponding to the provided key.</returns> Object Get(String key); /// <summary> /// Indicates whether the specified key is in the context. /// </summary> /// <param name="key">The key to look for.</param> /// <returns>Whether the key is in the context.</returns> Boolean ContainsKey(Object key); /// <summary> /// Get all the keys for the values in the context /// </summary> Object[] Keys { get; } /// <summary> /// Removes the value associated with the specified key from the context. /// </summary> /// <param name="key">The name of the value to remove.</param> /// <returns>The value that the key was mapped to, or <code>null</code> if unmapped.</returns> Object Remove(Object key); } } |