示例#1
0
        protected override void OnHandleDestroyed(EventArgs e)
        {
            base.OnHandleDestroyed(e);

            if (_nativeWindow != null)
            {
                _nativeWindow.Dispose();
                _nativeWindow = null;
            }
        }
示例#2
0
        /// <summary>
        /// Creation and initialization of <see cref="CodeEditorWindow"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="allowModal">if set to <c>true</c> [allow modal].</param>
        protected virtual void Init(IAnkhServiceProvider context, bool allowModal)
        {
            if (context == null)
                throw new ArgumentNullException("context");

            _context = context;
            try
            {
                _nativeWindow = new CodeEditorWindow(_context, this);

                // Set init only values
                _nativeWindow.EnableSplitter = EnableSplitter;
                _nativeWindow.EnableNavigationBar = EnableNavigationBar;

                _nativeWindow.Init(allowModal, ForceLanguageService);

                _nativeWindow.ShowHorizontalScrollBar = !HideHorizontalScrollBar;
                _nativeWindow.SetWordWrapDisabling(DisableWordWrap);
                _nativeWindow.Size = ClientSize;
                _nativeWindow.SetReadOnly(_readOnly);
            }
            catch
            {
                _nativeWindow = null;
                throw;
            }
        }