Ejemplo n.º 1
0
 public SortableVm(
     SortableVmStyle sortableVmStyle,
     int order,
     SortableItemVm[] currentSortableItemVms,
     SortableItemVm[] pastSortableItemVms,
     StageVmStep stageVmStep,
     double animationPct)
 {
     SortableVmStyle        = sortableVmStyle;
     Order                  = order;
     CurrentSortableItemVms = currentSortableItemVms;
     PastSortableItemVms    = pastSortableItemVms;
     StageVmStep            = stageVmStep;
     AnimationPct           = animationPct;
 }
Ejemplo n.º 2
0
        public static StageVm SwitchBlocksToStageVm(
            this core.Sorting.ISwitch[][] switchBlocks,
            int stageIndex,
            StageVmStyle stageVmStyle,
            int order,
            SortableItemVm[] sortableVms,
            StageVmStep stageVmStep)
        {
            var kpVms = switchBlocks.ToKeyPairVms(stageIndex, stageVmStyle);

            return(new StageVm(
                       stageVmStep: stageVmStep,
                       stageIndex: stageIndex,
                       stageVmStyle: stageVmStyle,
                       order: order,
                       keyPairVms: kpVms,
                       sortableItemVms: sortableVms,
                       sortableItemVmsOld: null
                       ));
        }
Ejemplo n.º 3
0
        public static StageVmStep ToNextStep(this StageVmStep stageVmStep)
        {
            switch (stageVmStep)
            {
            case StageVmStep.Left:
                return(StageVmStep.Presort);

            case StageVmStep.Presort:
                return(StageVmStep.PostSort);

            case StageVmStep.PostSort:
                return(StageVmStep.Right);

            case StageVmStep.Right:
                return(StageVmStep.None);

            case StageVmStep.None:
                return(StageVmStep.None);

            default:
                throw new System.Exception($"{stageVmStep} not handled");
            }
        }
Ejemplo n.º 4
0
 public StageVm(
     int stageIndex,
     StageVmStep stageVmStep,
     StageVmStyle stageVmStyle,
     int order,
     IEnumerable <KeyPairVm> keyPairVms,
     SortableItemVm[] sortableItemVms,
     SortableItemVm[] sortableItemVmsOld
     )
 {
     StageIndex         = stageIndex;
     StageVmStep        = stageVmStep;
     StageVmStyle       = stageVmStyle;
     Order              = order;
     _keyPairVms        = keyPairVms.ToList();
     SortableItemVms    = sortableItemVms;
     SortableItemVmsOld = sortableItemVmsOld;
     SectionCount       = _keyPairVms.Max(vm => vm.StageSection) + 1;
     VmWidth            = StageVmStyle.StageRightMargin +
                          StageVmStyle.SwitchHSpacing * SectionCount;
     VmHeight = 2 * StageVmStyle.VPadding +
                StageVmStyle.KeyLineHeight * Order +
                StageVmStyle.KeyLineHeight;
 }