Esempio n. 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);
        }
Esempio n. 2
0
        public static IAdornmentSurfaceSpaceManager GetAdornmentSurfaceSpaceManager(IEditorArea editorArea)
        {
            IAdornmentSurfaceSpaceManager manager;

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

            IPropertyOwner owner = editorArea;

            if (!owner.TryGetProperty <IAdornmentSurfaceSpaceManager>("IAdornmentSurfaceSpaceManagerMap", out manager))
            {
                throw new ArgumentException("The specified editorArea doesn't have a space manager.");
            }
            return(manager);
        }
Esempio n. 3
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);
        }
Esempio n. 4
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);
        }
Esempio n. 5
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);
        }
Esempio n. 6
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);
        }
Esempio n. 7
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);
        }
Esempio n. 8
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);
        }
Esempio n. 9
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);
        }