Inheritance: NiTextBuffer, INiTextLines
Example #1
0
        public override HResult Initialize()
        {
            try
            {
                var hr = base.Initialize();

                if (ErrorUtil.Failure(hr))
                {
                    return(hr);
                }

                // If we were provided an INiTextLines, perform its initialization
                // now. We clear the field to force correct initialization.

                if (_textLines != null)
                {
                    var textLines = _textLines;
                    _textLines = null;
                    return(SetBuffer(textLines));
                }

                return(HResult.OK);
            }
            catch (Exception ex)
            {
                return(ErrorUtil.GetHResult(ex));
            }
        }
Example #2
0
        public HResult SetBuffer(INiTextLines textBuffer)
        {
            try
            {
                if (textBuffer == null)
                {
                    throw new ArgumentNullException("textBuffer");
                }

                if (_textLines != null)
                {
                    _textLines.BeginUpdate -= _textLines_BeginUpdate;
                    _textLines.EndUpdate   -= _textLines_EndUpdate;
                }

                _textLines = (NiTextLines)textBuffer;

                if (_textLines != null)
                {
                    Control.Document = _textLines.Document;

                    _textLines.BeginUpdate += _textLines_BeginUpdate;
                    _textLines.EndUpdate   += _textLines_EndUpdate;
                }

                return(HResult.OK);
            }
            catch (Exception ex)
            {
                return(ErrorUtil.GetHResult(ex));
            }
        }
Example #3
0
        public NiTextMarker(NiTextLines owner, TextMarker marker)
        {
            if (owner == null)
                throw new ArgumentNullException("owner");
            if (marker == null)
                throw new ArgumentNullException("marker");

            _owner = owner;
            _marker = marker;
        }
Example #4
0
        public NiTextMarker(NiTextLines owner, TextMarker marker)
        {
            if (owner == null)
            {
                throw new ArgumentNullException("owner");
            }
            if (marker == null)
            {
                throw new ArgumentNullException("marker");
            }

            _owner  = owner;
            _marker = marker;
        }
Example #5
0
 public TextEditorWindow(INiTextLines textLines)
 {
     _textLines = (NiTextLines)textLines;
 }
Example #6
0
 public TextEditorWindow(INiTextLines textLines)
 {
     _textLines = (NiTextLines)textLines;
 }
Example #7
0
        public HResult SetBuffer(INiTextLines textBuffer)
        {
            try
            {
                if (textBuffer == null)
                    throw new ArgumentNullException("textBuffer");

                if (_textLines != null)
                {
                    _textLines.BeginUpdate -= _textLines_BeginUpdate;
                    _textLines.EndUpdate -= _textLines_EndUpdate;
                }

                _textLines = (NiTextLines)textBuffer;

                if (_textLines != null)
                {
                    Control.Document = _textLines.Document;

                    _textLines.BeginUpdate += _textLines_BeginUpdate;
                    _textLines.EndUpdate += _textLines_EndUpdate;
                }

                return HResult.OK;
            }
            catch (Exception ex)
            {
                return ErrorUtil.GetHResult(ex);
            }
        }
Example #8
0
        public override HResult Initialize()
        {
            try
            {
                var hr = base.Initialize();

                if (ErrorUtil.Failure(hr))
                    return hr;

                // If we were provided an INiTextLines, perform its initialization
                // now. We clear the field to force correct initialization.

                if (_textLines != null)
                {
                    var textLines = _textLines;
                    _textLines = null;
                    return SetBuffer(textLines);
                }

                return HResult.OK;
            }
            catch (Exception ex)
            {
                return ErrorUtil.GetHResult(ex);
            }
        }