Пример #1
0
        private void ShineLocatorBeacon(IMarker marker)
        {
            if (marker == null || marker.TextDocument == null || marker.TextDocument.ActiveView == null)
            {
                return;
            }

            if (_settings.ShowBeacon)
            {
                bool wasBeaconAnimated = false;

                var selectionMarker = marker as ISelectionMarker;
                if (selectionMarker != null && selectionMarker.HasSelection)
                {
                    if (_cornerBeacon == null)
                    {
                        _cornerBeacon = new DevExpress.CodeRush.PlugInCore.CornerBeacon();
                    }

                    if (_cornerBeacon.AccomplishedPercent > 0f)
                    {
                        _cornerBeacon.Stop();
                    }

                    _cornerBeacon.Color    = DxDwg.Color.ConvertFrom(_settings.BeaconColor);
                    _cornerBeacon.Duration = _settings.BeaconDuration;
                    var range = new SourceRange(selectionMarker.AnchorLine, selectionMarker.AnchorColumn, selectionMarker.Line, selectionMarker.Column);
                    _cornerBeacon.Start(marker.TextDocument.ActiveView, range.Top, range.Bottom, 0x1a);

                    wasBeaconAnimated = true;
                }

                if (!wasBeaconAnimated)
                {
                    if (_locatorBeacon == null)
                    {
                        _locatorBeacon = new DevExpress.CodeRush.PlugInCore.LocatorBeacon();
                    }

                    if (_locatorBeacon.AccomplishedPercent > 0f)
                    {
                        _locatorBeacon.Stop();
                    }
                    _locatorBeacon.Color    = DxDwg.Color.ConvertFrom(_settings.BeaconColor);
                    _locatorBeacon.Duration = _settings.BeaconDuration;
                    _locatorBeacon.Start(marker.TextDocument.ActiveView, marker.Line, marker.Column);
                }
            }
        }
    private void ShineLocatorBeacon(IMarker marker)
    {
      if ( marker == null || marker.TextDocument == null || marker.TextDocument.ActiveView == null )
        return;

      if ( _settings.ShowBeacon )
      {
        bool wasBeaconAnimated = false;

        var selectionMarker = marker as ISelectionMarker;
        if ( selectionMarker != null && selectionMarker.HasSelection )
        {
          if ( _cornerBeacon == null )
            _cornerBeacon = new DevExpress.CodeRush.PlugInCore.CornerBeacon();

          if ( _cornerBeacon.AccomplishedPercent > 0f )
            _cornerBeacon.Stop();

          _cornerBeacon.Color = DxDwg.Color.ConvertFrom(_settings.BeaconColor);
          _cornerBeacon.Duration = _settings.BeaconDuration;
          var range = new SourceRange(selectionMarker.AnchorLine, selectionMarker.AnchorColumn, selectionMarker.Line, selectionMarker.Column);
          _cornerBeacon.Start(marker.TextDocument.ActiveView, range.Top, range.Bottom, 0x1a);

          wasBeaconAnimated = true;
        }

        if ( !wasBeaconAnimated )
        {
          if ( _locatorBeacon == null )
            _locatorBeacon = new DevExpress.CodeRush.PlugInCore.LocatorBeacon();

          if ( _locatorBeacon.AccomplishedPercent > 0f )
            _locatorBeacon.Stop();
          _locatorBeacon.Color = DxDwg.Color.ConvertFrom(_settings.BeaconColor);
          _locatorBeacon.Duration = _settings.BeaconDuration;
          _locatorBeacon.Start(marker.TextDocument.ActiveView, marker.Line, marker.Column);
        }
      }
    }