LoadOption() public method

public LoadOption ( IEditorOptions options, string optionName ) : bool
options IEditorOptions
optionName string
return bool
        public MarkMarginElement(IWpfTextView textView, IVerticalScrollBar scrollbar, OverviewMarkMarginProvider provider)
        {
            provider.LoadOption(textView.Options, DefaultOverviewMarginOptions.MarkMarginId.Name);
            provider.LoadOption(textView.Options, MarkMarginWidthId.Name);

            _markPen = new Pen(Brushes.DimGray, 1.0);
            _markPen.Freeze();

            _textView        = textView;
            _scrollBar       = scrollbar;
            _editorFormatMap = provider.EditorFormatMapService.GetEditorFormatMap(_textView);

            _factories = new List <IOverviewMarkFactory>();
            foreach (var markProvider in provider.MarkProviders)
            {
                IEnumerable <string> providerRoles = markProvider.Metadata.TextViewRoles;
                if (_textView.Roles.ContainsAny(providerRoles))
                {
                    IOverviewMarkFactory factory = markProvider.Value.GetOverviewMarkFactory(textView);
                    if (factory != null)
                    {
                        _factories.Add(factory);
                        factory.MarksChanged += delegate
                        {
                            this.AsynchInvalidateVisual();
                        };
                    }
                }
            }

            //Make our width big enough to see, but not so big that it consumes a lot of
            //real-estate.
            this.Width = textView.Options.GetOptionValue(MarkMarginWidthId);

            this.OnOptionsChanged(null, null);
            textView.Options.OptionChanged += this.OnOptionsChanged;

            this.IsVisibleChanged += delegate(object sender, DependencyPropertyChangedEventArgs e)
            {
                if ((bool)e.NewValue)
                {
                    //Hook up to the various events we need to keep the caret margin current.
                    _scrollBar.TrackSpanChanged += OnTrackSpanChanged;

                    //Force the margin to be rerendered since things might have changed while the margin was hidden.
                    this.AsynchInvalidateVisual();
                }
                else
                {
                    _scrollBar.TrackSpanChanged -= OnTrackSpanChanged;
                }
            };
        }