Condividi tramite


Command Class

Command class that all Business Logic commands derive from. Each command implementation should implement an Execute method that performs the actual work for this command.

Inheritance Hierarchy

System.Object
  Microsoft.TeamFoundation.Framework.Server.Command

Namespace:  Microsoft.TeamFoundation.Framework.Server
Assembly:  Microsoft.TeamFoundation.Framework.Server (in Microsoft.TeamFoundation.Framework.Server.dll)

Syntax

'Declaration
Public MustInherit Class Command _
    Implements ICommand, IDisposable
public abstract class Command : ICommand, 
    IDisposable
public ref class Command abstract : ICommand, 
    IDisposable
[<AbstractClass>]
type Command =  
    class 
        interface ICommand 
        interface IDisposable 
    end
public abstract class Command implements ICommand, IDisposable

The Command type exposes the following members.

Constructors

  Name Description
Protected method Command All Commands have an ICommandContext that enables them to communicate with the calling application.

Top

Properties

  Name Description
Public propertyStatic member CommandCacheLimit Get/Set Global Command cache size limit.
Public property IsCacheFull IsCacheFull returns True if the command cache is over the limit.
Protected property IsCanceled IsStopped returns true if the command has been stopped for any reason.
Public property MaxCacheSize Get/Set command instance cache size limit.
Public property Name Return the type name of this command.
Protected property RequestContext Context this command is executing.
Public property TotalResultSize The TotalResultSize is the sum of all data sent that was ever added to the command cache. This gives an approximate representation the size of the response for the command.

Top

Methods

  Name Description
Public method ContinueExecution Derived classes can override ContinueExecution when the initial call to Execute returns partial results. This will allow the command to continue with the operation and retrieve more data for the response. If the command always returns completed results from the Execute method it does not have to implement this method.
Public method DecrementCacheUsage DecrementCacheUsage is used to notify the command that data is being dropped from the cache, usually by returning it to the application.
Public method Dispose() IDisposable implementation. When an ICommandContext ends, it will dispose each command that has been registered with it.
Protected method Dispose(Boolean)
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize (Overrides Object.Finalize().)
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method IncrementCacheUsage IncrementCacheUsage is used to notify the command that data is being cached that can be sent to the client. Once the command caches enough data, this method returns True to the caller telling them that it has exceeded the maximum requested cache size. If the caller can stop execution and return its current data, it should do so at this point.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.TeamFoundation.Framework.Server Namespace