Esempio n. 1
0
 public SelectionUIProperties(MultiSelectionBrokerFactory factory, MultiSelectionBroker broker, SelectionTransformer transformer)
 {
     _factory     = factory;
     _broker      = broker;
     _options     = _factory.EditorOptionsFactoryService.GetOptions(_broker.TextView);
     _transformer = transformer;
 }
        public SelectionTransformer(MultiSelectionBroker multiSelectionBroker, Selection selection)
        {
            _broker    = multiSelectionBroker;
            _selection = selection;

            // This can be any of the points on the selection, since they are validated to be the same in the selection constructor.
            _currentSnapshot = _selection.InsertionPoint.Position.Snapshot;
            if (_currentSnapshot != _broker.CurrentSnapshot)
            {
                throw new ArgumentException("The provided selection is on a different snapshot than the broker.", nameof(selection));
            }

            CapturePreferredReferencePoint();
        }