Exemple #1
0
        private void OnNewTrackType()
        {
            TrackTypeViewModel track = new TrackTypeViewModel(TrackType.New());

            this.TrackTypes.Add(track);
            this.SelectedTrackType = track;
        }
Exemple #2
0
        public static TrackViewModel CreateNew(TrackTypeViewModel trackTypeViewModel)
        {
            TrackGroup trackGroup = new TrackGroup
            {
            };

            return(new TrackGroupViewModel(trackTypeViewModel, trackGroup));
        }
Exemple #3
0
        public static TrackViewModel CreateNew(TrackTypeViewModel trackTypeViewModel)
        {
            TrackFlex trackFlex = new TrackFlex
            {
                Article  = string.Empty,
                LengthId = trackTypeViewModel.Lengths.First().Id
            };

            return(new TrackFlexViewModel(trackTypeViewModel, trackFlex));
        }
Exemple #4
0
        public static TrackViewModel CreateNew(TrackTypeViewModel trackTypeViewModel)
        {
            TrackStraight trackStraight = new TrackStraight
            {
                Article  = string.Empty,
                LengthId = trackTypeViewModel.Lengths.First().Id
            };

            return(new TrackStraightViewModel(trackTypeViewModel, trackStraight));
        }
Exemple #5
0
        public static TrackViewModel CreateNew(TrackTypeViewModel trackTypeViewModel)
        {
            TrackEndPiece trackEndPiece = new TrackEndPiece
            {
                Article  = string.Empty,
                LengthId = trackTypeViewModel.Lengths.First().Id
            };

            return(new TrackEndPieceViewModel(trackTypeViewModel, trackEndPiece));
        }
        public static TrackViewModel CreateNew(TrackTypeViewModel trackTypeViewModel)
        {
            TrackCurved trackCurved = new TrackCurved
            {
                Article  = string.Empty,
                RadiusId = trackTypeViewModel.Radii.First().Id,
                AngleId  = trackTypeViewModel.Angles.First().Id
            };

            return(new TrackCurvedViewModel(trackTypeViewModel, trackCurved));
        }
Exemple #7
0
        public static TrackViewModel CreateNew(TrackTypeViewModel trackTypeViewModel)
        {
            TrackDoubleSlipSwitch trackDoubleSlipSwitch = new TrackDoubleSlipSwitch
            {
                Article         = string.Empty,
                LengthId        = trackTypeViewModel.Lengths.First().Id,
                CrossingAngleId = trackTypeViewModel.Angles.First().Id,
                SlipRadiusId    = trackTypeViewModel.Radii.First().Id
            };

            return(new TrackDoubleSlipSwitchViewModel(trackTypeViewModel, trackDoubleSlipSwitch));
        }
        public static TrackViewModel CreateNew(TrackTypeViewModel trackTypeViewModel)
        {
            TrackDoubleCrossover trackDoubleCrossover = new TrackDoubleCrossover
            {
                Article         = string.Empty,
                LengthId        = trackTypeViewModel.Lengths.First().Id,
                LengthBId       = trackTypeViewModel.Lengths.First().Id,
                CrossingAngleId = trackTypeViewModel.Angles.First().Id,
            };

            return(new TrackDoubleCrossoverViewModel(trackTypeViewModel, trackDoubleCrossover));
        }
Exemple #9
0
        public static TrackViewModel CreateNew(TrackTypeViewModel trackTypeViewModel)
        {
            TrackTable trackTable = new TrackTable
            {
                Article              = string.Empty,
                DeckLengthId         = trackTypeViewModel.Lengths.First().Id,
                ConnectionLengthId   = trackTypeViewModel.Lengths.First().Id,
                ConnectionDistanceId = trackTypeViewModel.Lengths.First().Id
            };

            return(new TrackTableViewModel(trackTypeViewModel, trackTable));
        }
Exemple #10
0
        public static TrackViewModel CreateNew(TrackTypeViewModel trackTypeViewModel)
        {
            TrackCurvedTurnout trackCurvedTurnout = new TrackCurvedTurnout
            {
                Article       = string.Empty,
                InnerRadiusId = trackTypeViewModel.Radii.First().Id,
                InnerAngleId  = trackTypeViewModel.Angles.First().Id,
                OuterRadiusId = trackTypeViewModel.Radii.First().Id,
                OuterAngleId  = trackTypeViewModel.Angles.First().Id
            };

            return(new TrackCurvedTurnoutViewModel(trackTypeViewModel, trackCurvedTurnout));
        }
Exemple #11
0
        public static TrackViewModel CreateNew(TrackTypeViewModel trackTypeViewModel)
        {
            TrackCrossing trackCrossing = new TrackCrossing
            {
                Article         = string.Empty,
                CrossingType    = TrackCrossingType.Simple,
                LengthId        = trackTypeViewModel.Lengths.First().Id,
                LengthBId       = trackTypeViewModel.Lengths.First().Id,
                CrossingAngleId = trackTypeViewModel.Angles.First().Id
            };

            return(new TrackCrossingViewModel(trackTypeViewModel, trackCrossing));
        }
Exemple #12
0
        public static TrackViewModel CreateNew(TrackTypeViewModel trackTypeViewModel)
        {
            TrackTurnout trackTurnout = new TrackTurnout
            {
                Article              = string.Empty,
                LeftTurnoutRadiusId  = trackTypeViewModel.Radii.First().Id,
                LeftTurnoutAngleId   = trackTypeViewModel.Angles.First().Id,
                RightTurnoutRadiusId = trackTypeViewModel.Radii.First().Id,
                RightTurnoutAngleId  = trackTypeViewModel.Angles.First().Id,
                StraightLengthId     = trackTypeViewModel.Lengths.First().Id
            };

            return(new TrackTurnoutViewModel(trackTypeViewModel, trackTurnout));
        }
Exemple #13
0
        public static TrackViewModel Create(TrackTypeViewModel trackTypeViewModel, TrackBase track)
        {
            string typeName = track.GetType().Name;

            return(typeName switch
            {
                nameof(TrackStraight) => new TrackStraightViewModel(trackTypeViewModel, (TrackStraight)track),
                nameof(TrackCurved) => new TrackCurvedViewModel(trackTypeViewModel, (TrackCurved)track),
                nameof(TrackCrossing) => new TrackCrossingViewModel(trackTypeViewModel, (TrackCrossing)track),
                nameof(TrackEndPiece) => new TrackEndPieceViewModel(trackTypeViewModel, (TrackEndPiece)track),
                nameof(TrackFlex) => new TrackFlexViewModel(trackTypeViewModel, (TrackFlex)track),

                nameof(TrackTurnout) => new TrackTurnoutViewModel(trackTypeViewModel, (TrackTurnout)track),
                nameof(TrackCurvedTurnout) => new TrackCurvedTurnoutViewModel(trackTypeViewModel, (TrackCurvedTurnout)track),
                nameof(TrackDoubleSlipSwitch) => new TrackDoubleSlipSwitchViewModel(trackTypeViewModel, (TrackDoubleSlipSwitch)track),
                nameof(TrackDoubleCrossover) => new TrackDoubleCrossoverViewModel(trackTypeViewModel, (TrackDoubleCrossover)track),

                nameof(TrackTable) => new TrackTableViewModel(trackTypeViewModel, (TrackTable)track),

                nameof(TrackGroup) => new TrackGroupViewModel(trackTypeViewModel, (TrackGroup)track),
                _ => null
            });
Exemple #14
0
 public TrackEndPieceViewModel(TrackTypeViewModel trackTypeViewModel) : this(trackTypeViewModel, new TrackEndPiece())
 {
 }
Exemple #15
0
 public TrackTurnoutViewModel(TrackTypeViewModel trackTypeViewModel, TrackTurnout track) : base(trackTypeViewModel, track)
 {
     this.track = track;
 }
Exemple #16
0
 public TrackTurnoutViewModel(TrackTypeViewModel trackTypeViewModel) : this(trackTypeViewModel, new TrackTurnout())
 {
 }
Exemple #17
0
 private void OnDeleteTrackType(TrackTypeViewModel trackType)
 {
     this.TrackTypes.Remove(trackType);
 }
Exemple #18
0
 public TrackCrossingViewModel(TrackTypeViewModel trackTypeViewModel, TrackCrossing track) : base(trackTypeViewModel, track)
 {
     this.track = track;
 }
Exemple #19
0
 public TrackFlexViewModel(TrackTypeViewModel trackTypeViewModel) : this(trackTypeViewModel, new TrackFlex())
 {
 }
Exemple #20
0
 public TrackViewModel(TrackTypeViewModel trackTypeViewModel, TrackBase trackBase)
 {
     this.Track = trackBase;
     this.trackTypeViewModel = trackTypeViewModel;
 }
Exemple #21
0
 public TrackTableViewModel(TrackTypeViewModel trackTypeViewModel) : this(trackTypeViewModel, new TrackTable())
 {
 }
Exemple #22
0
 public TrackTableViewModel(TrackTypeViewModel trackTypeViewModel, TrackTable track) : base(trackTypeViewModel, track)
 {
     this.track = track;
 }
 public TrackCurvedViewModel(TrackTypeViewModel trackTypeViewModel, TrackCurved track) : base(trackTypeViewModel, track)
 {
     this.track = track;
 }
 public TrackCurvedViewModel(TrackTypeViewModel trackTypeViewModel) : this(trackTypeViewModel, new TrackCurved())
 {
 }
Exemple #25
0
 public TrackEndPieceViewModel(TrackTypeViewModel trackTypeViewModel, TrackEndPiece track) : base(trackTypeViewModel, track)
 {
     this.track = track;
 }
Exemple #26
0
 public TrackStraightViewModel(TrackTypeViewModel trackTypeViewModel) : this(trackTypeViewModel, new TrackStraight())
 {
 }
Exemple #27
0
 public TrackGroupViewModel(TrackTypeViewModel trackTypeViewModel, TrackGroup track) : base(trackTypeViewModel, track)
 {
     this.LoadGroupCommand = new DelegateCommand(OnLoadGroup);
     this.track            = track;
     this.Names            = new MultilanguageStringViewModel(this.track.GroupName);
 }
Exemple #28
0
 public TrackStraightViewModel(TrackTypeViewModel trackTypeViewModel, TrackStraight track) : base(trackTypeViewModel, track)
 {
     this.track = track;
 }
Exemple #29
0
 public TrackFlexViewModel(TrackTypeViewModel trackTypeViewModel, TrackFlex track) : base(trackTypeViewModel, track)
 {
     this.track = track;
 }
Exemple #30
0
 public TrackCrossingViewModel(TrackTypeViewModel trackTypeViewModel) : this(trackTypeViewModel, new TrackCrossing())
 {
 }