internal object CreateAndInitializeHandle(Type handleType)
        {
            Fx.Assert(ActivityUtilities.IsHandle(handleType), "This should only be called with Handle subtypes.");

            object value = Activator.CreateInstance(handleType);

            ((Handle)value).Initialize(this);

            // If we have a scope, we need to add this new handle to the LocationEnvironment.
            if (this.scope != null)
            {
                this.scope.Environment.AddHandle((Handle)value);
            }
            // otherwise add it to the Executor.
            else
            {
                this.executor.AddHandle((Handle)value);
            }

            return(value);
        }
 public Variable()
 {
     base.IsHandle = ActivityUtilities.IsHandle(typeof(T));
 }