Пример #1
0
        internal static BreakpointProvider CreateBreakpointProviderInternal(TextBuffer textBuffer)
        {
            if (textBuffer == null)
            {
                throw new ArgumentNullException("textBuffer");
            }
            BreakpointProvider property = null;
            IPropertyOwner     owner    = textBuffer;

            if (!owner.TryGetProperty <BreakpointProvider>("BreakpointProvider", out property))
            {
                property = new BreakpointProvider(textBuffer);
                owner.AddProperty("BreakpointProvider", property);
            }
            return(property);
        }
Пример #2
0
        internal static ToolTipProvider GetToolTipProviderInternal(ITextArea textView)
        {
            if (textView == null)
            {
                throw new ArgumentNullException("textView");
            }

            ToolTipProvider property = null;
            IPropertyOwner  owner    = textView;

            if (!owner.TryGetProperty <ToolTipProvider>("ToolTipProvider", out property))
            {
                property = new ToolTipProvider(textView);
                owner.AddProperty("ToolTipProvider", property);
            }
            return(property);
        }
Пример #3
0
        private static TextMarkerProvider CreateTextMarkerProvider(ITextArea textView)
        {
            if (textView == null)
            {
                throw new ArgumentNullException("textView");
            }

            TextMarkerProvider property = null;
            IPropertyOwner     owner    = textView;

            if (!owner.TryGetProperty <TextMarkerProvider>("TextMarkerProvider", out property))
            {
                property = new TextMarkerProvider(textView);
                owner.AddProperty("TextMarkerProvider", property);
            }
            return(property);
        }
Пример #4
0
        public static ITextStructureNavigator GetTextStructureNavigator(TextBuffer textBuffer)
        {
            if (textBuffer == null)
            {
                throw new ArgumentNullException("textBuffer");
            }

            IPropertyOwner          owner    = textBuffer;
            ITextStructureNavigator property = null;

            if (!owner.TryGetProperty <ITextStructureNavigator>("ITextStructureNavigatorCache", out property))
            {
                property = new NaturalLanguageNavigator(textBuffer);
                owner.AddProperty("ITextStructureNavigatorCache", property);
            }

            return(property);
        }
Пример #5
0
        public static IAdornmentProvider GetAdornmentAggregator(ITextArea textView)
        {
            if (textView == null)
            {
                throw new ArgumentNullException("textView");
            }

            IPropertyOwner     owner    = textView;
            IAdornmentProvider property = null;

            if (!owner.TryGetProperty <IAdornmentProvider>("IAdornmentAggregatorCache", out property))
            {
                property = new AdornmentAggregator(textView);
                owner.AddProperty("IAdornmentAggregatorCache", property);
            }

            return(property);
        }
Пример #6
0
        public static IEditorCommands CreateEditorCommands(ITextArea textView)
        {
            if (textView == null)
            {
                throw new ArgumentNullException("textView");
            }

            IPropertyOwner  owner    = textView;
            IEditorCommands property = null;

            if (!owner.TryGetProperty <IEditorCommands>("IEditorCommandsProvider", out property))
            {
                property = new EditorCommands(textView);
                owner.AddProperty("IEditorCommandsProvider", property);
            }

            return(property);
        }
Пример #7
0
        public static IClassifier GetClassifierAggregator(TextBuffer textBuffer)
        {
            ClassifierAggregator aggregator;

            if (textBuffer == null)
            {
                throw new ArgumentNullException("textBuffer");
            }

            IPropertyOwner owner = textBuffer;

            if (!owner.TryGetProperty <ClassifierAggregator>("IClassifierAggregatorProvider", out aggregator))
            {
                aggregator = new ClassifierAggregator(textBuffer);
                owner.AddProperty("IClassifierAggregatorProvider", aggregator);
            }

            return(aggregator);
        }
Пример #8
0
        public static IAdornmentSurfaceManager GetAdornmentSurfaceManager(IAdornmentSurfaceHost surfaceHost)
        {
            AdornmentSurfaceManager manager;

            if (surfaceHost == null)
            {
                throw new ArgumentNullException("surfaceHost");
            }

            if (surfaceHost.TextView == null)
            {
                throw new ArgumentException("The specified surfaceHost isn't valid.");
            }

            IPropertyOwner textView = surfaceHost.TextView;

            if (!textView.TryGetProperty <AdornmentSurfaceManager>("IAdornmentSurfaceManagerFactory", out manager))
            {
                manager = new AdornmentSurfaceManager(surfaceHost);
                textView.AddProperty("IAdornmentSurfaceManagerFactory", manager);
            }

            return(manager);
        }