コード例 #1
0
ファイル: EditCommand.cs プロジェクト: aldialimucaj/lego
        public bool CanExecute(object parameter)
        {
            if (parameter == null || LegoViewModel.IsCollecting) return false;

            Config = (LgConfig)parameter;

            return Config.IsRunningAny;
        }
コード例 #2
0
        public void Execute(object parameter)
        {
            Trace.WriteLine("executed");
            LegoViewModel.IsCollecting = true;

            LgConfig config = new LgConfig();
            LegoViewModel.Manager = new IOManager(config);
            LegoViewModel.Manager.Start();
        }
コード例 #3
0
        /// <summary>
        /// Get all saved configurations
        /// </summary>
        /// <returns></returns>
        public static List <LgConfig> GetAllConfigs()
        {
            List <LgConfig> configs = new List <LgConfig>();
            List <string>   files   = Directory.GetFiles(CONFIGS_PATH).ToList <string>();

            files.ForEach((f) => {
                LgConfig c = LgConfig.FromFile(f);
                if (c != null)
                {
                    configs.Add(c);
                }
            }
                          );

            return(configs);
        }
コード例 #4
0
ファイル: IOManager.cs プロジェクト: aldialimucaj/lego
 public IOManager(LgConfig config)
 {
     _proc = HookCallback;
     Config = config;
 }
コード例 #5
0
ファイル: MainWindow.xaml.cs プロジェクト: aldialimucaj/lego
 private void btnRecord_Click(object sender, RoutedEventArgs e)
 {
     LgConfig c = new LgConfig();
     io = new IOManager(c);
     io.Start();
 }