Ejemplo n.º 1
1
		public OutputChainBuffer(Sandbox sb, OutputChainBuffer prev, OutputChainBuffer targetOrigin)
		{
			_prevItem = prev;

			if (prev != null)
			{
				prev._nextItem = this;
				_caps = prev is OutputChainArticleBuffer && prev.Caps == Capitalization.First ? Capitalization.None : prev._caps;
			}

			_buffer = targetOrigin._buffer;
			sandbox = sb;
		}
Ejemplo n.º 2
1
		public OutputChainBuffer(Sandbox sb, OutputChainBuffer prev)
		{
			_prevItem = prev;

			if (prev != null)
			{
				prev._nextItem = this;
				_caps = prev is OutputChainArticleBuffer && prev.Caps == Capitalization.First ? Capitalization.None : prev._caps;
				_numberFormatter.BinaryFormat = prev.NumberFormatter.BinaryFormat;
				_numberFormatter.BinaryFormatDigits = prev.NumberFormatter.BinaryFormatDigits;
				_numberFormatter.Endianness = prev.NumberFormatter.Endianness;
				_numberFormatter.NumberFormat = prev.NumberFormatter.NumberFormat;
			}

			_isTarget = true;
			_buffer = new StringBuilder(InitialCapacity);
			sandbox = sb;
		}
Ejemplo n.º 3
0
		public OutputChain(Sandbox sb, string name)
		{
			sandbox = sb;
			_first = new OutputChainBuffer(sb, null);
			_last = _first;
			Name = name;
		}
Ejemplo n.º 4
0
 public OutputChain(Sandbox sb, string name)
 {
     sandbox = sb;
     _first  = new OutputChainBuffer(sb, null);
     _last   = _first;
     Name    = name;
 }
Ejemplo n.º 5
0
        public OutputChainBuffer AddArticleBuffer()
        {
            // If the last buffer is empty, just replace it.
            var b = _last = new OutputChainArticleBuffer(sandbox, _last);

            return(b);
        }
Ejemplo n.º 6
0
		public void PrintToTarget(string targetName, string value)
		{
			OutputChainBuffer buffer;
			if (!targets.TryGetValue(targetName, out buffer))
			{
				buffer = targets[targetName] = new OutputChainBuffer(sandbox, null);
			}

			buffer.Print(value);
		}
Ejemplo n.º 7
0
        public void PrintToTarget(string targetName, string value)
        {
            OutputChainBuffer buffer;

            if (!targets.TryGetValue(targetName, out buffer))
            {
                buffer = targets[targetName] = new OutputChainBuffer(sandbox, null);
            }

            buffer.Print(value);
        }
Ejemplo n.º 8
0
        public OutputChainBuffer(Sandbox sb, OutputChainBuffer prev, OutputChainBuffer targetOrigin)
        {
            _prevItem = prev;

            if (prev != null)
            {
                prev._nextItem = this;
                _caps          = prev is OutputChainArticleBuffer && prev.Caps == Capitalization.First ? Capitalization.None : prev._caps;
            }

            _buffer = targetOrigin._buffer;
            sandbox = sb;
        }
Ejemplo n.º 9
0
		public void InsertTarget(string targetName)
		{
			// Check if the buffer was already created
			OutputChainBuffer buffer;
			if (!targets.TryGetValue(targetName, out buffer))
			{
				// If not, make a new one and insert it
				buffer = targets[targetName] = AddBuffer();
			}
			else
			{
				// If it does exist, just create a new instance of it with the same buffer and add it in.
				_last = new OutputChainBuffer(sandbox, _last, buffer);
			}

			// Then add an empty buffer after it so we don't start printing onto the target.
			AddBuffer();
		}
Ejemplo n.º 10
0
        public OutputChainBuffer(Sandbox sb, OutputChainBuffer prev)
        {
            _prevItem = prev;

            if (prev != null)
            {
                prev._nextItem = this;
                _caps          = prev is OutputChainArticleBuffer && prev.Caps == Capitalization.First ? Capitalization.None : prev._caps;
                _numberFormatter.BinaryFormat       = prev.NumberFormatter.BinaryFormat;
                _numberFormatter.BinaryFormatDigits = prev.NumberFormatter.BinaryFormatDigits;
                _numberFormatter.Endianness         = prev.NumberFormatter.Endianness;
                _numberFormatter.NumberFormat       = prev.NumberFormatter.NumberFormat;
            }

            _isTarget = true;
            _buffer   = new StringBuilder(InitialCapacity);
            sandbox   = sb;
        }
Ejemplo n.º 11
0
        public void InsertTarget(string targetName)
        {
            // Check if the buffer was already created
            OutputChainBuffer buffer;

            if (!targets.TryGetValue(targetName, out buffer))
            {
                // If not, make a new one and insert it
                buffer = targets[targetName] = AddBuffer();
            }
            else
            {
                // If it does exist, just create a new instance of it with the same buffer and add it in.
                _last = new OutputChainBuffer(sandbox, _last, buffer);
            }

            // Then add an empty buffer after it so we don't start printing onto the target.
            AddBuffer();
        }
Ejemplo n.º 12
0
		public OutputChainBuffer AddArticleBuffer()
		{
			// If the last buffer is empty, just replace it.
			var b = _last = new OutputChainArticleBuffer(sandbox, _last);
			return b;
		}
Ejemplo n.º 13
0
		public OutputChainBuffer AddBuffer()
		{
			return _last = new OutputChainBuffer(sandbox, _last);
		}
Ejemplo n.º 14
0
 public OutputChainArticleBuffer(Sandbox sb, OutputChainBuffer prev, OutputChainBuffer targetOrigin) : base(sb, prev, targetOrigin)
 {
     Initialize();
 }
Ejemplo n.º 15
0
 public OutputChainBuffer AddBuffer()
 {
     return(_last = new OutputChainBuffer(sandbox, _last));
 }
Ejemplo n.º 16
0
		public OutputChainArticleBuffer(Sandbox sb, OutputChainBuffer prev) : base(sb, prev)
		{
			Initialize();
		}
Ejemplo n.º 17
0
		public OutputChainArticleBuffer(Sandbox sb, OutputChainBuffer prev, OutputChainBuffer targetOrigin) : base(sb, prev, targetOrigin)
		{
			Initialize();
		}
Ejemplo n.º 18
0
 public OutputChainArticleBuffer(Sandbox sb, OutputChainBuffer prev) : base(sb, prev)
 {
     Initialize();
 }