Beispiel #1
0
 public UICameraPreview(CameraOptions options, SpeedOptions sOptions, string fileUrl, CameraModes mode)
 {
     cameraOptions = options;
     speedOptions  = sOptions;
     CameraMode    = mode;
     IsPreviewing  = false;
     fileUrl       = FileUrl;
     Initialize();
     //SetupUserInterface();
 }
Beispiel #2
0
        public void ChangeSpeed(SpeedOptions speed)
        {
            int timeGap;

            if (speed == SpeedOptions.Slow)
            {
                timeGap = 600;
            }
            else if (speed == SpeedOptions.Medium)
            {
                timeGap = 400;
            }
            else
            {
                timeGap = 200;
            }
            myTimer.Interval = timeGap;
        }
Beispiel #3
0
        public JLinkSettingsFormViewModel(IProject model) : base(model)
        {
            settings = JLinkDebugAdaptor.GetSettings(model);

            interfaceSelectedIndex = (int)settings.Interface;
            interfaceType          = settings.Interface;

            speedSelectedIndex = SpeedOptions.IndexOf(settings.SpeedkHz.ToString());

            speed = settings.SpeedkHz.ToString();

            string devPath = Path.Combine(JLinkDebugAdaptor.BaseDirectory, "devices.csv");

            deviceList = new ObservableCollection <JLinkTargetDeviceViewModel>();

            if (System.IO.File.Exists(devPath))
            {
                LoadDeviceList(devPath);
            }
        }
        public JLinkSettingsFormViewModel(IProject model) : base(model)
        {
            settings = model.GetDebuggerSettings <JLinkSettings>();

            interfaceSelectedIndex = (int)settings.Interface;
            interfaceType          = settings.Interface;
            _download          = settings.Download;
            _reset             = settings.Reset;
            _useRemote         = settings.UseRemote;
            _ipAddress         = settings.RemoteIPAddress;
            _postDownloadReset = settings.PostDownloadReset;
            _run = settings.Run;

            speedSelectedIndex = SpeedOptions.IndexOf(settings.SpeedkHz.ToString());

            speed = settings.SpeedkHz.ToString();

            string devPath = Path.Combine(JLinkDebugger.BaseDirectory, "devices.csv");

            deviceList = new ObservableCollection <JLinkTargetDeviceViewModel>();

            LoadDeviceList(devPath);
        }
Beispiel #5
0
        public SnakeModel(SpeedOptions speedSet)
        {
            _headDirection = Directions.right;
            HeadX          = 0;
            HeadY          = 3;
            TailX          = 0;
            TailY          = 0;
            Length         = 4;
            Speed          = speedSet;
            #region setTimeGap
            int timeGap;
            if (Speed == SpeedOptions.Slow)
            {
                timeGap = 300;
            }
            else if (Speed == SpeedOptions.Medium)
            {
                timeGap = 200;
            }
            else
            {
                timeGap = 100;
            }
            #endregion setTimeGap
            myTimer = new Timer(timeGap);
            for (int i = 0; i <= maxIndex; i++)
            {
                for (int j = 0; j <= maxIndex; j++)
                {
                    _pos[i, j] = false;
                }
            }
            #region setGameGrid
            _gameGrid = new Grid
            {
                Name = "gameGrid"
            };
            NameScope.SetNameScope(_gameGrid, new NameScope());
            for (int i = 0; i <= maxIndex; i++)
            {
                var newRow = new RowDefinition
                {
                    Height = new GridLength(14),
                    Name   = $"gameGridRow{i}"
                };
                _gameGrid.RowDefinitions.Add(newRow);

                var newColumn = new ColumnDefinition
                {
                    Width = new GridLength(14),
                    Name  = $"gameGridColumn{i}"
                };
                _gameGrid.ColumnDefinitions.Add(newColumn);
            }
            for (int x = 0; x <= maxIndex; x++)
            {
                for (int y = 0; y <= maxIndex; y++)
                {
                    Border border = new Border
                    {
                        Background = new SolidColorBrush(Colors.Transparent)
                    };
                    _gameGrid.RegisterName($"gameBorderR{x}C{y}", border);
                    _gameGrid.Children.Add(border);
                    Grid.SetRow(border, x);
                    Grid.SetColumn(border, y);
                }
            }
            #endregion setGameGrid
            _pos[0, 0] = _pos[0, 1] = _pos[0, 2] = _pos[0, 3] = true;
            SetBlack(0, 0);
            SetBlack(0, 1);
            SetBlack(0, 2);
            SetBlack(0, 3);
            _queueDirections.Enqueue(Directions.right);
            _queueDirections.Enqueue(Directions.right);
            _queueDirections.Enqueue(Directions.right);
        }
Beispiel #6
0
 public Player(Player player)
 {
     name  = player.name;
     score = player.score;
     speed = player.speed;
 }
Beispiel #7
0
 public Player(string playerName, int playerScore, SpeedOptions playerSpeed)
 {
     name  = playerName;
     score = playerScore;
     speed = playerSpeed;
 }
Beispiel #8
0
 public Player(SpeedOptions playerSpeed) : this()
 {
     speed = playerSpeed;
 }