Example #1
0
 private void OnClear()
 {
     CommandCon.Clear();
     Scene.Clear();
     SignalsCon.Clear();
     Reset();
 }
Example #2
0
 private void AddSignal(WaveType waveType) => CommandCon.AppendSignal(new Signal
 {
     Name = NameSource.Names.First(
         name => Scene.Signals.FirstOrDefault(
             signal => signal.Name == name) == null),
     WaveType = waveType
 });
Example #3
0
 private void OnLoad()
 {
     WorldCon.ConnectCons(false);
     Scene.WorldCon = WorldCon;
     Scene.AttachShapes();
     CommandCon.Clear();
     WorldCon.ConnectCons(true);
     SceneCon.RecreateSceneControl();
     SignalsCon.Load();
     Reset();
 }
Example #4
0
        private void DeleteSelection()
        {
            if (ShapeSelection.IsEmpty)
            {
                return;
            }
            var indices = ShapeSelection.GetShapeIndices().OrderByDescending(p => p).ToList();

            foreach (var index in indices)
            {
                CommandCon.DeleteShape(index);
            }
            ShapeSelection.Clear();
        }
Example #5
0
        // Public methods

        public override void Connect(bool connect)
        {
            base.Connect(connect);
            if (connect)
            {
                ConnectEventHandlers(true);
                ConnectCons(true);
                CommandCon.Clear();
                Clock.Tick += Clock_Tick;
                ClockStartup();
            }
            else
            {
                ClockShutdown();
                Clock.Tick -= Clock_Tick;
                RenderCon.InvalidateProgram();
                CommandCon.Clear();
                ConnectCons(false);
                ConnectEventHandlers(false);
                AppCon.Remove(this);
            }
        }
Example #6
0
 private void OnSave()
 {
     CommandCon.Save();
     Reset();
 }
Example #7
0
 private void AddShape(Shape shape)
 {
     shape.Scene = Scene;
     CommandCon.AppendShape(shape);
     ShapeSelection.Set(new[] { shape });
 }