Esempio n. 1
0
        internal void SendItemDropped(Section section, Cell cell)
        {
            var eventArgs = new DropEventArgs(section, cell);

            ItemDropped?.Invoke(this, eventArgs);
            ItemDroppedCommand?.Execute(eventArgs);
        }
        void panelTrackName_DragDrop(object sender, DragEventArgs e)
        {
            var d = e.GetDropObject <PEMidiTrack>();

            if (d != null && d != this)
            {
                ItemDropped.IfObjectNotNull(x => x(this, e));
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Commits the drag &amp; drop transaction.
        /// </summary>
        /// <param name="dropZoneName">Dropzone name that is the source of the drag operation.</param>
        /// <returns>A task that represents the asynchronous operation.</returns>
        public async Task CommitTransaction(string dropZoneName)
        {
            await transaction.Commit();

            await ItemDropped.InvokeAsync(new DraggableDroppedEventArgs <TItem>(transaction.Item, dropZoneName));

            TransactionEnded?.Invoke(this, EventArgs.Empty);

            transaction = null;
        }
Esempio n. 4
0
        public virtual async Task DropItemAsync(IGame game, IItem item)
        {
            await Map.AddItemAsync(item);

            _items.Remove(item);
            await item.MarkAsDroppedAsync(this);

            if (ItemDropped != null)
            {
                await ItemDropped.Invoke(item, this);
            }
        }
Esempio n. 5
0
        protected override void OnExternalObjectsDropped(GoInputEventArgs evt)
        {
            if (Selection.Primary is KanbanItem node &&
                node.Document is GoDocument doc)
            {
                RemoveItem?.Invoke(node.Item);

                AddNode(node);
                ItemDropped?.Invoke(node.Item);
                node.Container = ContainerId;
                RefreshNodes();
            }
        }
Esempio n. 6
0
        /// <summary>
        /// Pushes an item onto the stack.
        /// </summary>
        /// <param name="item">The new item.</param>
        public void Push(T item)
        {
            // if the stack is full notify that the bottom item is being dropped.
            if (m_count == m_items.Length)
            {
                ItemDropped?.Invoke(m_items[m_top]);
            }
            else
            {
                m_count++;
            }

            m_items[m_top] = item;
            m_top          = (m_top + 1) % m_items.Length;
        }
Esempio n. 7
0
        public async Task CommitTransaction(string dropzoneIdentifier, bool reorderIsAllowed)
        {
            await _transaction.Commit();

            var index = -1;

            if (reorderIsAllowed == true)
            {
                index = GetTransactionIndex() + 1;
                if (_transaction.SourceZoneIdentifier == _transaction.CurrentZone && IsItemMovedDownwards() == true)
                {
                    index -= 1;
                }
            }

            await ItemDropped.InvokeAsync(new MudItemDropInfo <T>(_transaction.Item, dropzoneIdentifier, index));

            TransactionEnded?.Invoke(this, new MudDragAndDropTransactionFinishedEventArgs <T>(dropzoneIdentifier, true, _transaction));
            _transaction = null;
        }
Esempio n. 8
0
 public Schema()
     : base()
 {
     InstanceType = typeof(__SoPersonOb__);
     ClassName    = "PersonObj";
     Properties.ClearExposed();
     FirstName = Add <__TString__>("FirstName");
     FirstName.DefaultValue = "";
     FirstName.SetCustomAccessors((_p_) => { return(((__SoPersonOb__)_p_).__bf__FirstName__); }, (_p_, _v_) => { ((__SoPersonOb__)_p_).__bf__FirstName__ = (System.String)_v_; }, false);
     LastName = Add <__TString__>("LastName");
     LastName.DefaultValue = "";
     LastName.SetCustomAccessors((_p_) => { return(((__SoPersonOb__)_p_).__bf__LastName__); }, (_p_, _v_) => { ((__SoPersonOb__)_p_).__bf__LastName__ = (System.String)_v_; }, false);
     SortOrder = Add <__TLong__>("SortOrder");
     SortOrder.DefaultValue = 0L;
     SortOrder.SetCustomAccessors((_p_) => { return(((__SoPersonOb__)_p_).__bf__SortOrder__); }, (_p_, _v_) => { ((__SoPersonOb__)_p_).__bf__SortOrder__ = (System.Int64)_v_; }, false);
     MoveUp = Add <__TLong__>("MoveUp$");
     MoveUp.DefaultValue = 0L;
     MoveUp.Editable     = true;
     MoveUp.SetCustomAccessors((_p_) => { return(((__SoPersonOb__)_p_).__bf__MoveUp__); }, (_p_, _v_) => { ((__SoPersonOb__)_p_).__bf__MoveUp__ = (System.Int64)_v_; }, false);
     MoveUp.AddHandler((Json pup, Property <Int64> prop, Int64 value) => { return(new Input.MoveUp()
         {
             App = (PersonObj)pup, Template = (TLong)prop, Value = value
         }); }, (Json pup, Starcounter.Input <Int64> input) => { ((PersonObj)pup).Handle((Input.MoveUp)input); });
     MoveDown = Add <__TLong__>("MoveDown$");
     MoveDown.DefaultValue = 0L;
     MoveDown.Editable     = true;
     MoveDown.SetCustomAccessors((_p_) => { return(((__SoPersonOb__)_p_).__bf__MoveDown__); }, (_p_, _v_) => { ((__SoPersonOb__)_p_).__bf__MoveDown__ = (System.Int64)_v_; }, false);
     MoveDown.AddHandler((Json pup, Property <Int64> prop, Int64 value) => { return(new Input.MoveDown()
         {
             App = (PersonObj)pup, Template = (TLong)prop, Value = value
         }); }, (Json pup, Starcounter.Input <Int64> input) => { ((PersonObj)pup).Handle((Input.MoveDown)input); });
     ItemDropped = Add <__TLong__>("ItemDropped$");
     ItemDropped.DefaultValue = 0L;
     ItemDropped.Editable     = true;
     ItemDropped.SetCustomAccessors((_p_) => { return(((__SoPersonOb__)_p_).__bf__ItemDropped__); }, (_p_, _v_) => { ((__SoPersonOb__)_p_).__bf__ItemDropped__ = (System.Int64)_v_; }, false);
     ItemDropped.AddHandler((Json pup, Property <Int64> prop, Int64 value) => { return(new Input.ItemDropped()
         {
             App = (PersonObj)pup, Template = (TLong)prop, Value = value
         }); }, (Json pup, Starcounter.Input <Int64> input) => { ((PersonObj)pup).Handle((Input.ItemDropped)input); });
 }
Esempio n. 9
0
 /// <summary>
 /// Invoked after an item has been dropped.
 /// </summary>
 /// <param name="ev">The <see cref="ItemDroppedEventArgs"/> instance.</param>
 public static void OnItemDropped(ItemDroppedEventArgs ev) => ItemDropped.InvokeSafely(ev);
Esempio n. 10
0
 public void Clear()
 {
     inventory.Clear();
     HasItems = false;
     ItemDropped?.Invoke();
 }
Esempio n. 11
0
 public static void OnItemDropped(InventoryItem drop) => ItemDropped?.Invoke(drop);
Esempio n. 12
0
 /// <summary>
 /// Allow a given type, and its children, to be dropped on the <see cref="UIElement"/>s.
 /// </summary>
 /// <param name="type">The type to allow</param>
 /// <param name="method">The callback method to invoke on a drop</param>
 public void AllowType(Type type, ItemDropped method)
 {
     _allowedTypes.Add(type, method);
 }
Esempio n. 13
0
 /// <summary>
 /// Allows a given type, and its children, to be dropped on the <see cref="UIElement"/>s.
 /// </summary>
 /// <typeparam name="T">The type to allow</typeparam>
 /// <param name="method">The callback method to invoke on a drop</param>
 public void AllowType <T>(ItemDropped <T> method)
 {
     _allowedTypes.Add(typeof(T), method);
 }