Exemplo n.º 1
0
 private void UpdateCommands()
 {
     EditModCommand      = new EditModCommand(SelectedModTuple, null);
     DeleteModCommand    = new DeleteModCommand(SelectedModTuple);
     _setModImageCommand = new SetModImageCommand(SelectedModTuple);
     PublishModCommand   = new PublishModCommand(SelectedModTuple);
 }
Exemplo n.º 2
0
    private void UpdateCommands()
    {
        // Some operations like swapping order of 2 lists might fire a
        // event with SelectedMod == null, then select our mod again.
        // Setting up some commands (particularly ConfigureMod) can cause lag, so let's mitigate this.
        if (SelectedMod == null || SelectedMod == _cachedModEntry)
        {
            return;
        }

        OpenModFolderCommand      = new OpenModFolderCommand(SelectedMod.Tuple);
        EditModCommand            = new EditModCommand(SelectedMod.Tuple, null);
        PublishModCommand         = new PublishModCommand(SelectedMod.Tuple);
        VisitModProjectUrlCommand = new VisitModProjectUrlCommand(SelectedMod.Tuple);

        var userConfig = _userConfigService.ItemsById.GetValueOrDefault(SelectedMod.Tuple.Config.ModId);

        EditModUserConfigCommand    = new EditModUserConfigCommand(userConfig);
        OpenUserConfigFolderCommand = new OpenUserConfigFolderCommand(userConfig);
        ConfigureModCommand         = new ConfigureModCommand(SelectedMod.Tuple, userConfig, ApplicationTuple);
        _cachedModEntry             = SelectedMod;
    }