System.Xml.Xsl.IlGen.StorageDescriptor.ToStack C# (CSharp) Method

ToStack() public method

Return copy of current descriptor, but change item's location to the stack.
public ToStack ( ) : StorageDescriptor
return StorageDescriptor
        public StorageDescriptor ToStack() {
            return Stack(this.itemStorageType, this.isCached);
        }

Usage Example

Esempio n. 1
0
        /// <summary>
        /// Ensure that the current item is pushed onto the stack.
        /// </summary>
        public void EnsureStack()
        {
            switch (_storage.Location)
            {
            case ItemLocation.Stack:
                // Already on the stack
                return;

            case ItemLocation.Parameter:
            case ItemLocation.Local:
            case ItemLocation.Current:
                PushValue();
                break;

            case ItemLocation.Global:
                // Call method that computes the value of this global value
                _helper.LoadQueryRuntime();
                _helper.Call(_storage.GlobalLocation);
                break;

            default:
                Debug.Assert(false, "Invalid location: " + _storage.Location);
                break;
            }

            _storage = _storage.ToStack();
        }