Ejemplo n.º 1
0
        private void Convert_Click(object sender, EventArgs e)
        {
            lblUpdate.Text = string.Format("Converting and downloading: 0/{0}", listCount);
            EnableConvert(false);
            flpDestination.Enabled = false;

            foreach (VideoInfos url in urlList)
                workingList.Add(url);

            urlList.Clear();
            flpSettings.Enabled = false;

            Parameter param;

            if (chkAudio.Checked)
            {
                commandsList.AddCommand(Com.ExtractAudio);
                commandsList.AddCommand(Com.AudioQuality, new Parameter(0));

                param = new Parameter(AudioFormats.GetAudioFormat(cmbOptions.SelectedItem.ToString()));
            }
            else
                param = new Parameter(VideoFormats.GetVideoFormat(cmbOptions.SelectedItem.ToString()));

            commandsList.AddCommand(chkVideo.Checked ? Com.VideoFormat : Com.AudioFormat, param);

            // Output
            commandsList.AddCommand(Com.Output, new Parameter(destinationPath));

            Thread thread = new Thread(Download);
            thread.Start();
        }
Ejemplo n.º 2
0
        public CalculatorVModel()
        {
            resultText = "0";
            expression = new Expression();
            evaluator  = new Evaluator();
            pageActive = new bool[] { true, false };

            Commands = new CommandList();
            Commands.AddCommand("NUM", new DelegateCommand <string>(new Action <string>(Cmd_Num)));
            Commands.AddCommand("NUM2", new DelegateCommand <string>(new Action <string>(Cmd_Num2)));
            Commands.AddCommand("SWITCH", new DelegateCommand(new Action(Cmd_Switch)));
        }
Ejemplo n.º 3
0
        public SettingsViewModel()
        {
            ChildViewModels = new List <ISettingsViewModel>();

            GeneralViewModel generalViewModel = new GeneralViewModel();

            ChildViewModels.Add(generalViewModel);

            ILSConfigurationViewModel ilsConfViewModel = new ILSConfigurationViewModel();

            ChildViewModels.Add(ilsConfViewModel);

            RestoreDefaultValuesCommand = commands.AddCommand(ExecuteRestoreDefaultValues, CanExecuteRestoreDefaultValues);
            SaveCommand = commands.AddCommand(ExecuteSaveCommand, CanExecuteSaveCommand);
        }
Ejemplo n.º 4
0
        public MainWindowViewModel()
        {
            DARPResults       = null;
            ILSEvolution      = null;
            AlgorithmSummary  = null;
            ChartsViewModel   = null;
            VNSOperators      = null;
            ProblemsInput     = null;
            SolutionsData     = null;
            DARPProblems      = new List <string>();
            DARPSelected      = null;
            HeuristicExecuted = false;
            TabSelected       = 0;

            //Inicializate Commands
            LoadInput       = commands.AddAsyncCommand(ExecuteLoadProblems, CanExecuteLoadProblems);
            SettingsCommand = commands.AddCommand(ExecuteOpenSettings, CanExecuteOpenSettings);
            RunHeuristic    = commands.AddAsyncCommand(ExecuteRunHeuristic, CanExecuteRunHeuristic);
            ExportCSV       = commands.AddAsyncCommand(ExecuteExportCSV, CanExecuteExportCSV);

            //Load Settings
            Context.Instance.Settings = DARP.Settings.CheckDeserializeSettings(LoadLasSettings());

            //Inicializate controllers.
            var controllers = ViewModelControllers.Instance;

            windowController  = controllers.WindowController;
            processController = ProcessController.Instance;
            splashController  = controllers.SplashController;
        }
Ejemplo n.º 5
0
        static int Main(string[] args)
        {
            int         retval = 0;
            CommandList cl     = new CommandList(true);

            cl.AddCommand(new DatabaseQueryCommand());
            retval = cl.DoCommand(args);
            return(retval);
        }
Ejemplo n.º 6
0
 public void AddFireCommandWithAllPossibleTrigger()
 {
     commandList.AddCommand("Fire");
     Assert.AreEqual(1, commandList.NumberOfCommands);
     commandList.AddTrigger("Fire", MouseButton.Left, State.Pressed);
     commandList.AddTrigger("Fire", Key.B, State.Pressed);
     commandList.AddTrigger("Fire", GamePadButton.B, State.Pressed);
     commandList.AddTrigger("Fire", State.Pressed);
     Assert.AreEqual(4, commandList.GetNumberOfTriggers("Fire"));
 }
        public PredictionPriceViewModel(string brand, string model, List <string> engines)
        {
            BrandSelected = brand;
            ModelSelected = model;
            EngineItems   = new ObservableCollection <string>(engines);
            var t = Enumerable.Range(1990, (DateTime.Now.Year - 1990) + 1);

            YearsItems     = new ObservableCollection <string>(t.Select(r => r.ToString()));
            YearSelected   = null;
            EngineSelected = null;
            OKCommand      = commands.AddCommand(ExecuteOKCommand, CanExecuteOKCommand);
        }
Ejemplo n.º 8
0
    private void RightClickTest()
    {
        Command cmd = TestCommand.StaticCreate();

        mCommandList.AddCommand(cmd);
    }
Ejemplo n.º 9
0
 public GeneralViewModel()
 {
     GeneralSettings         = new GeneralSettings(Context.Instance.Settings.GeneralSettings ?? GeneralSettings.CreateDefaults());
     BrowserFolders          = commands.AddCommand(ExecuteOpenFolderDialog, CanExecuteOpenFolderDialog);
     BrowserFoldersSolutions = commands.AddCommand(ExecuteOpenFolderDialogSolutions, CanExecuteOpenFolderDialog);
 }