コード例 #1
0
 private void DragCompleted()
 {
     // Hack, one of these ends up null and I'm not sure why
     try
     {
         if (_adorner == null || _adorner.Parent == null)
         {
             return;
         }
         Canvas.SetLeft(this, _adorner.LeftOffset);
         Canvas.SetTop(this, _adorner.TopOffset);
         ((AdornerLayer)_adorner.Parent).Remove(_adorner);
         _adorner = null;
         //var marker = (Marker)DataContext;
         //ushort count = _takeAll ? marker.Count : (ushort)1;
         //var e = new MarkerEventArgs(this, marker, count);
         //Mouse.DirectlyOver.RaiseEvent(e);
         //if (Keyboard.IsKeyUp(Key.LeftAlt) && !e.Handled)
         //    marker.Count -= count;
     }
     catch (Exception ex)
     {
         Log.Warn("DragCompleted", ex);
     }
 }
コード例 #2
0
 private void DragCompleted()
 {
     // Hack, one of these ends up null and I'm not sure why
     try
     {
         if (_adorner == null || _adorner.Parent == null)
         {
             return;
         }
         ((AdornerLayer)_adorner.Parent).Remove(_adorner);
         _adorner = null;
         var    marker = (Marker)DataContext;
         ushort count  = _takeAll ? marker.Count : (ushort)1;
         var    e      = new MarkerEventArgs(this, marker, count);
         Mouse.DirectlyOver.RaiseEvent(e);
         if (Keyboard.IsKeyUp(Key.LeftAlt) && !e.Handled)
         {
             Program.Client.Rpc.RemoveMarkerReq(marker.Card, marker.Model.Id, marker.Model.Name, count, marker.Count, false);
             marker.Card.RemoveMarker(marker, count);
         }
     }
     catch (Exception ex)
     {
         Log.Warn("DragCompleted", ex);
     }
 }
コード例 #3
0
        private void DragStarted()
        {
            // Hides the card view
            //RaiseEvent(new CardEventArgs(CardControl.CardHoveredEvent, this));

            UIElement adorned = this;//_takeAll ? this : (UIElement)img1;

            _mouseOffset    = TranslatePoint(_mousePt, adorned);
            _mouseOffset.X -= adorned.DesiredSize.Width / 2;
            _mouseOffset.Y -= adorned.DesiredSize.Height / 2;
            _adorner        = new Adorners.DragAdorner(adorned);
            AdornerLayer.GetAdornerLayer(_adorner.AdornedElement).Add(_adorner);
        }
コード例 #4
0
        private void DragCompleted()
        {
            ((AdornerLayer)_adorner.Parent).Remove(_adorner);
            _adorner = null;
            var    marker = (Marker)DataContext;
            ushort count  = _takeAll ? marker.Count : (ushort)1;
            var    e      = new MarkerEventArgs(this, marker, count);

            Mouse.DirectlyOver.RaiseEvent(e);
            if (Keyboard.IsKeyUp(Key.LeftAlt) && !e.Handled)
            {
                marker.Count -= count;
            }
        }
コード例 #5
0
        private void DragCompleted()
        {
            // Hack, one of these ends up null and I'm not sure why
            if (_adorner == null || _adorner.Parent == null)
            {
                return;
            }
            ((AdornerLayer)_adorner.Parent).Remove(_adorner);
            _adorner = null;
            var    marker = (Marker)DataContext;
            ushort count  = _takeAll ? marker.Count : (ushort)1;
            var    e      = new MarkerEventArgs(this, marker, count);

            Mouse.DirectlyOver.RaiseEvent(e);
            if (Keyboard.IsKeyUp(Key.LeftAlt) && !e.Handled)
            {
                marker.Count -= count;
            }
        }
コード例 #6
0
 private void DragCompleted()
 {
     // Hack, one of these ends up null and I'm not sure why
     try
     {
         if (_adorner == null || _adorner.Parent == null) return;
         ((AdornerLayer)_adorner.Parent).Remove(_adorner);
         _adorner = null;
         var marker = (Marker)DataContext;
         ushort count = _takeAll ? marker.Count : (ushort)1;
         var e = new MarkerEventArgs(this, marker, count);
         Mouse.DirectlyOver.RaiseEvent(e);
         if (Keyboard.IsKeyUp(Key.LeftAlt) && !e.Handled)
         {
             Program.Client.Rpc.RemoveMarkerReq(marker.Card, marker.Model.Id, marker.Model.Name, count, marker.Count, false);
             marker.Card.RemoveMarker(marker, count);
         }
     }
     catch (Exception ex)
     {
         Log.Warn("DragCompleted",ex);
     }
 }
コード例 #7
0
        private void DragStarted()
        {
            // Hides the card view
            RaiseEvent(new CardEventArgs(CardControl.CardHoveredEvent, this));

            _takeAll = Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift);
            UIElement adorned = _takeAll ? this : (UIElement) img1;
            _mouseOffset = TranslatePoint(_mousePt, adorned);
            _mouseOffset.X -= adorned.DesiredSize.Width/2;
            _mouseOffset.Y -= adorned.DesiredSize.Height/2;
            _adorner = new Adorners.DragAdorner(adorned);
            AdornerLayer.GetAdornerLayer(_adorner.AdornedElement).Add(_adorner);
        }
コード例 #8
0
ファイル: AdhocPileControl.xaml.cs プロジェクト: Keterr/OCTGN
        private void DragCompleted()
        {
            // Hack, one of these ends up null and I'm not sure why
            try
            {
                if (_adorner == null || _adorner.Parent == null) return;
                Canvas.SetLeft(this, _adorner.LeftOffset);
                Canvas.SetTop(this, _adorner.TopOffset);
                ((AdornerLayer)_adorner.Parent).Remove(_adorner);
                _adorner = null;
                //var marker = (Marker)DataContext;
                //ushort count = _takeAll ? marker.Count : (ushort)1;
                //var e = new MarkerEventArgs(this, marker, count);
                //Mouse.DirectlyOver.RaiseEvent(e);
                //if (Keyboard.IsKeyUp(Key.LeftAlt) && !e.Handled)
                //    marker.Count -= count;

            }
            catch (Exception ex)
            {
                Log.Warn("DragCompleted", ex);
            }
        }
コード例 #9
0
 private void DragCompleted()
 {
     // Hack, one of these ends up null and I'm not sure why
     if (_adorner == null || _adorner.Parent == null) return;
     ((AdornerLayer) _adorner.Parent).Remove(_adorner);
     _adorner = null;
     var marker = (Marker) DataContext;
     ushort count = _takeAll ? marker.Count : (ushort) 1;
     var e = new MarkerEventArgs(this, marker, count);
     Mouse.DirectlyOver.RaiseEvent(e);
     if (Keyboard.IsKeyUp(Key.LeftAlt) && !e.Handled)
         marker.Count -= count;
 }
コード例 #10
0
ファイル: MarkerControl.xaml.cs プロジェクト: TriAdX/OCTGN
 private void DragCompleted()
 {
     ((AdornerLayer) _adorner.Parent).Remove(_adorner);
     _adorner = null;
     var marker = (Marker) DataContext;
     ushort count = _takeAll ? marker.Count : (ushort) 1;
     var e = new MarkerEventArgs(this, marker, count);
     Mouse.DirectlyOver.RaiseEvent(e);
     if (Keyboard.IsKeyUp(Key.LeftAlt) && !e.Handled)
         marker.Count -= count;
 }