示例#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;
		}
示例#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;
		}
示例#3
0
		public OutputChain(Sandbox sb, string name)
		{
			sandbox = sb;
			_first = new OutputChainBuffer(sb, null);
			_last = _first;
			Name = name;
		}
示例#4
0
 public OutputChain(Sandbox sb, string name)
 {
     sandbox = sb;
     _first  = new OutputChainBuffer(sb, null);
     _last   = _first;
     Name    = name;
 }
示例#5
0
        public OutputChainBuffer AddArticleBuffer()
        {
            // If the last buffer is empty, just replace it.
            var b = _last = new OutputChainArticleBuffer(sandbox, _last);

            return(b);
        }
示例#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);
		}
示例#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);
        }
示例#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;
        }
示例#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();
		}
示例#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;
        }
示例#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();
        }
示例#12
0
		public OutputChainBuffer AddArticleBuffer()
		{
			// If the last buffer is empty, just replace it.
			var b = _last = new OutputChainArticleBuffer(sandbox, _last);
			return b;
		}
示例#13
0
		public OutputChainBuffer AddBuffer()
		{
			return _last = new OutputChainBuffer(sandbox, _last);
		}
 public OutputChainArticleBuffer(Sandbox sb, OutputChainBuffer prev, OutputChainBuffer targetOrigin) : base(sb, prev, targetOrigin)
 {
     Initialize();
 }
示例#15
0
 public OutputChainBuffer AddBuffer()
 {
     return(_last = new OutputChainBuffer(sandbox, _last));
 }
示例#16
0
		public OutputChainArticleBuffer(Sandbox sb, OutputChainBuffer prev) : base(sb, prev)
		{
			Initialize();
		}
示例#17
0
		public OutputChainArticleBuffer(Sandbox sb, OutputChainBuffer prev, OutputChainBuffer targetOrigin) : base(sb, prev, targetOrigin)
		{
			Initialize();
		}
 public OutputChainArticleBuffer(Sandbox sb, OutputChainBuffer prev) : base(sb, prev)
 {
     Initialize();
 }