public ShellViewModel()
        {
            Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;

            MySQLLaunchModels   = new ObservableCollection <MySQLLaunchModel>();
            MySQLInstanceModels = new ObservableCollection <MySQLInstanceModel>();

            _viewService                   = new ViewService();
            _launchCfgService              = new LaunchConfigService();
            _mySQLCfgService               = new MySQLConfigService();
            _mySQLService                  = new MySQLService();
            _mySQLService.NewInstaceFound += _mySQLService_NewInstaceFound;
            _mySQLService.InstanceLost    += _mySQLService_InstanceLost;

            _logService = new LogService();
            _logService.LogContentChanged += _logService_LogContentChanged;

            CommandCreateNew = new CommandImpl(OnRequestCreateNewLaunchModel);
            CommandCopyCurrentLaunchModel    = new CommandImpl(OnRequestCopyCurrentLaunchModel);
            CommandRenameSelectedModel       = new CommandImpl(OnRequestRenameSelectedModel);
            CommandDeleteSelectedLaunchModel = new CommandImpl(OnRequestDeleteSelectedLaunchModel);

            CommandInitMySQLDataDir = new CommandImpl(OnRequestInitMySQLDataDir);
            CommandStartMySQL       = new CommandImpl(OnRequestStartMySQL, CanStartMySQL);
            CommandStopMySQL        = new CommandImpl(OnRequestStopMySQL, CanStopMySQL);
            CommandReStartMySQL     = new CommandImpl(OnRequestReStartMySQL, CanReStartMySQL);

            CommandRefreshIni = new CommandImpl(OnRequestRefreshIni);
            CommandSaveIni    = new CommandImpl(OnRequestSaveIni);

            _ = LoadModels();
        }
Exemple #2
0
        public Command create_from(DiscreteCommand command)
        {
            var result = new CommandImpl(
                new NameConventionFilter(command),
                new TransactionDecorator(command));

            return(result);
        }
Exemple #3
0
        public MainWindowViewModel()
        {
            AddColumnCommand = new CommandImpl(AddColumnAction);
            AddRowCommand    = new CommandImpl(AddRowAction);

            DataSource = new DataTable();
            DataSource.Columns.Add("Column 1");
            DataSource.Columns.Add("Column 2");
        }
        public void Registry()
        {
            var _command_Type = typeof(ICommand);
            var impl          = new CommandImpl();

            foreach (var item in _command_Type.GetMethods())
            {
                RatelProxy.ProxyRegistry.AddRegistry(item.Name, impl);
            }
        }
        public void RunThread()
        {
            _thread1 = new Thread(() =>
            {
                while (true)
                {
                    Thread.Sleep(1000 * 3);
                    foreach (var item in Ratel.Node.ClustersNode.node
                             .Where(x => x.Value.me == false &&
                                    x.Value.ConnectionStatus == false))
                    {
                        string[] _ip = item.Value.host.Split(':');
                        ClustersNode(_ip[0], int.Parse(_ip[1]));
                    }
                }
            });

            _thread2 = new Thread(() =>
            {
                while (true)
                {
                    Thread.Sleep(1000 * 3);
                    foreach (var item in Ratel.Node.ClustersNode.node.Where(x => x.Value.me == false &&
                                                                            x.Value.channel != null &&
                                                                            x.Value.master == true))
                    {
                        var data = new RatelMessagePack()
                        {
                            command  = Command.Thread_DataLog,
                            Data     = CommandImpl.Get_Log_Id().SerializeProtobuf(),
                            conf_key = Ratel.YamlConfig.ServerConfSetting.serverSettingModel.Key,
                        };
                        var _byte     = data.SerializeProtobuf();
                        var _unpooled = Helios.Buffers.Unpooled.WrappedBuffer(_byte);
                        item.Value.channel.WriteAndFlushAsync(_unpooled);
                    }
                }
            });

            _thread1.IsBackground = true;
            _thread2.IsBackground = true;
            _thread1.Start();
            _thread2.Start();
        }
 public void CleanUp()
 {
     EditHouseCommand = null;
 }
 public HouseDetailViewModel() : base()
 {
     EditHouseCommand = new CommandImpl <string>(OnEditHouse, CanEditHouse);
 }
Exemple #8
0
 public MainViewModel()
 {
     NavToAbilities = new CommandImpl(OnNavRequest, CanNav);
 }
Exemple #9
0
 public PokemonViewModel()
 {
     SearchCommand   = new CommandImpl(OnSearch, CanSearch);
     DisplayElements = false;
     OnValidSearch   = true;
 }