public void DragOver(IDropInfo dropInfo)
        {
            SequenceItemViewModel sourceItem = dropInfo.Data as SequenceItemViewModel;
            SequenceItemViewModel targetItem = dropInfo.TargetItem as SequenceItemViewModel;

            if (sourceItem != null)
            {
                dropInfo.Effects = DragDropEffects.Move;
            }
        }
        private void OnDuplicateSequence(SequenceItemViewModel x)
        {
            Log($"Duplicating sequence {x.Sequence.SeqType}", Category.Debug);

            var seqbase = x.Sequence;

            if (seqbase != null)
            {
                this.Sequences.Add(new SequenceItemViewModel(seqbase.DeepClone()));
            }
        }
Beispiel #3
0
        private string GenerateYamlStruct(Content content)
        {
            string yamlStruct;

            if (content != null)
            {
                var layer      = content.GetNotNullContentLayer();
                var vmLayer    = new SequenceItemViewModel(layer);
                var yamlStrObj = _skeletonGameSerializer.ConvertToJson(vmLayer);
                yamlStruct = ReplaceType(yamlStrObj, layer.SeqType);
            }
            else
            {
                var yamlObj = _skeletonGameSerializer.ConvertToJson(SelectedSequence);
                yamlStruct = ReplaceType(yamlObj, SelectedSequence.Sequence.SeqType);
            }

            return(yamlStruct);
        }
        /// <summary>
        /// Performs a drag drop on the Sequences. User can then order the sequences.
        /// </summary>
        /// <param name="dropInfo">Information about the drop.</param>
        public void Drop(IDropInfo dropInfo)
        {
            SequenceItemViewModel sourceItem = dropInfo.Data as SequenceItemViewModel;
            SequenceItemViewModel targetItem = dropInfo.TargetItem as SequenceItemViewModel;

            var srcIndex  = dropInfo.DragInfo.SourceIndex;
            var destIndex = dropInfo.InsertIndex - 1;

            //Remove and insert the vm item.
            this.Sequences.RemoveAt(srcIndex);

            if (destIndex < 0)
            {
                destIndex = 0;
            }
            else if (destIndex > this.Sequences.Count - 1)
            {
                destIndex = Sequences.Count;
            }

            this.Sequences.Insert(destIndex, sourceItem);
        }