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

        #region IServiceProvider
        /// <summary>
        /// Returns service objects associated with this control.
        /// </summary>
        /// <param name="serviceType">
        /// Specifies the type of service object to get.
        /// </param>
        object IServiceProvider.GetService(Type serviceType)
        {
            if (serviceType == null)
            {
                throw new ArgumentNullException("serviceType");
            }

            if (serviceType == typeof(ITextView))
            {
                if (_textView == null)
                {
                    _textView = new DocumentSequenceTextView(this);
                }
                return(_textView);
            }
            return(null);
        }
コード例 #2
0
        //--------------------------------------------------------------------
        //
        // Public  Methods
        //
        //---------------------------------------------------------------------

        #region IServiceProvider
        /// <summary>
        /// Returns service objects associated with this control.
        /// </summary>
        /// <param name="serviceType">
        /// Specifies the type of service object to get.
        /// </param>
        object IServiceProvider.GetService(Type serviceType)
        {
            if (serviceType == null)
            {
                throw new ArgumentNullException("serviceType");
            }

            if (serviceType == typeof(ITextView))
            {
                if (_textView == null)
                {
                    _textView = new DocumentSequenceTextView(this);
                }
                return _textView;
            }
            return null;
        }