示例#1
0
        /// <summary>
        /// Initializes bookmarks service.
        /// </summary>
        private bool InitializeServices(bool throwOnError)
        {
            if (this.BookmarksService == null)
            {
                this.BookmarksService = _serviceProvider.GetService <IBookmarksService>(throwOnError);
                if (this.BookmarksService != null)
                {
                    this.BookmarksService.Changed += BookmarksService_Changed;
                }
            }

            if (!this.CallbackRegistered && (_buffer != null) && (this.BookmarksService != null))
            {
                var fileName = GetFileName();
                if (!string.IsNullOrEmpty(fileName))
                {
                    this.BookmarksService.RegisterCallback(this, fileName);
                    this.CallbackRegistered = true;
                }
            }

            if (_log == null)
            {
                _log = _serviceProvider.GetService <ILog>(throwOnError);
            }

            return(this.BookmarksService != null);
        }