コード例 #1
0
ファイル: DocumentSequence.cs プロジェクト: dox0/DotNet471RS3
        //--------------------------------------------------------------------
        //
        // Public Methods
        //
        //---------------------------------------------------------------------

        #region IServiceProvider Members

        /// <summary>
        /// <see cref="IServiceProvider.GetService" />
        /// </summary>
        object IServiceProvider.GetService(Type serviceType)
        {
            if (serviceType == null)
            {
                throw new ArgumentNullException("serviceType");
            }

            if (serviceType == typeof(ITextContainer))
            {
                return(this.TextContainer);
            }

            if (serviceType == typeof(RubberbandSelector))
            {
                // create this on demand, but not through the property, only through the
                // service, so it is only created when it's actually used
                if (_rubberbandSelector == null)
                {
                    _rubberbandSelector = new RubberbandSelector();
                }
                return(_rubberbandSelector);
            }

            return(null);
        }
コード例 #2
0
 internal void UpdateRubberbandSelection(RubberbandSelector selector)
 {
     _rubberbandSelector = selector;
     InvalidateHighlights();
 }
コード例 #3
0
        //--------------------------------------------------------------------
        //
        // Public Methods
        //
        //---------------------------------------------------------------------

        #region IServiceProvider Members

        /// <summary>
        /// <see cref="IServiceProvider.GetService" />
        /// </summary>
        object IServiceProvider.GetService(Type serviceType)
        {
            if (serviceType == null)
            {
                throw new ArgumentNullException("serviceType");
            }

            if (serviceType == typeof(ITextContainer))
            {
                return this.TextContainer;
            }

            if (serviceType == typeof(RubberbandSelector))
            {
                // create this on demand, but not through the property, only through the
                // service, so it is only created when it's actually used
                if (_rubberbandSelector == null)
                {
                    _rubberbandSelector = new RubberbandSelector();
                }
                return _rubberbandSelector;
            }

            return null;
        }
コード例 #4
0
 internal void UpdateRubberbandSelection(RubberbandSelector selector)
 {
     _rubberbandSelector = selector;
     InvalidateHighlights();
 }