public ViewModel() { _applicationStateModel = new ApplicationStateModel(); _configurationManager = new ConfigurationManager(); _configurationModel = _configurationManager.Load(); if (_configurationModel.PresetCollection.Count == 0) { _configurationModel.PresetCollection.Add(new Preset() { Name = "New Preset" }); } _openFileManager = new OpenFileManager(); _soundManager = new SoundManager(_configurationModel); _shortcutManager = new ShortcutManager(_applicationStateModel, _configurationModel, _soundManager); _updateManager = new UpdateManager(); _presetConfigurationViewModel = new PresetConfigurationViewModel(_applicationStateModel, _configurationModel); _configurationModel.PropertyChanged += (sender, e) => _configurationManager.Save((ConfigurationModel)sender); _configurationModel.CounterShortcuts.Next.Command = NextCounterCommand; _configurationModel.CounterShortcuts.Previous.Command = PreviousCounterCommand; _configurationModel.CounterShortcuts.Increment.Command = IncrementCommand; _configurationModel.CounterShortcuts.Decrement.Command = DecrementCommand; _configurationModel.CounterShortcuts.Reset.Command = ResetCommand; _configurationModel.SoundShortcuts.Pause.Command = PauseCommand; _configurationModel.SoundShortcuts.Continue.Command = ContinueCommand; _configurationModel.SoundShortcuts.Stop.Command = StopCommand; Task.Run(() => _updateManager.AutoUpdateCheck(Version)); }
public ViewModel() { ApplicationStateModel = new ApplicationStateModel(); _configurationManager = new ConfigurationManager(); ConfigurationModel = _configurationManager.Load(); if (ConfigurationModel.PresetCollection.Count == 0) { ConfigurationModel.PresetCollection.Add(new Preset() { Name = "New Preset" }); } _openFileManager = new OpenFileManager(); _soundManager = new SoundManager(ConfigurationModel); _shortcutManager = new ShortcutManager(ApplicationStateModel, ConfigurationModel, _soundManager); _updateManager = new UpdateManager(); PresetConfigurationViewModel = new PresetConfigurationViewModel(ApplicationStateModel, ConfigurationModel); ConfigurationModel.PropertyChanged += (sender, e) => _configurationManager.Save((ConfigurationModel)sender); ConfigurationModel.SoundShortcuts.Pause.Command = PauseCommand; ConfigurationModel.SoundShortcuts.Continue.Command = ContinueCommand; ConfigurationModel.SoundShortcuts.Stop.Command = StopCommand; Task.Run(() => _updateManager.AutoUpdateCheck(Version)); }
public MultiSoundViewModel(ApplicationStateModel applicationStateModel, ConfigurationModel configurationModel) { ApplicationStateModel = applicationStateModel; ConfigurationModel = configurationModel; _openFileManager = new OpenFileManager(); _newSelectedSounds = new ObservableCollection <Sound>(); }
public ScreensWindow(MainWindowManager manager, string deathScreen, string endScreen) { InitializeComponent(); this.manager = manager; openFileManager = new OpenFileManager(); this.deathScreen = deathScreen; this.endScreen = endScreen; InitializeValues(); }
public PreviewImageWindowEnemy(Enemy enemy, bool edit) { InitializeComponent(); openFileManager = new OpenFileManager(); this.enemy = enemy; this.edit = edit; if (edit) { image = SetImageLabel(enemy.PreviewImage, PreviewImageLabel); } }
public PreviewImageWindowCharacter(Character character, bool edit) { InitializeComponent(); openFileManager = new OpenFileManager(); this.character = character; this.edit = edit; if (edit) { image = SetImageLabel(character.PreviewImage, PreviewImageLabel); } }
public WallWindow(MainWindowManager manager, bool edit, BackgroundItem bgItem) { InitializeComponent(); this.manager = manager; openFileManager = new OpenFileManager(); this.edit = edit; this.bgItem = bgItem; if (edit) { SetValues(); } }
public StageWindow(MainWindowManager manager, bool edit, Stage stage) { InitializeComponent(); this.manager = manager; openFileManager = new OpenFileManager(); this.edit = edit; this.stage = stage; if (edit) { SetValues(); } }
public NPCWindow(MainWindowManager manager, bool edit, NPC npc) { InitializeComponent(); this.manager = manager; openFileManager = new OpenFileManager(); this.edit = edit; this.npc = npc; if (edit) { SetValues(); } }
public ConsumableWindow(MainWindowManager manager, bool edit, Consumable consumable) { InitializeComponent(); this.manager = manager; openFileManager = new OpenFileManager(); this.edit = edit; this.consumable = consumable; if (edit) { SetValues(); } }
public DoorKeyWindow(MainWindowManager manager, bool edit, Door door, KeyItem key) { InitializeComponent(); this.manager = manager; openFileManager = new OpenFileManager(); this.edit = edit; this.door = door; this.key = key; if (edit) { SetValues(); } }
public AbilityWindow(MainWindowManager manager, bool edit, Ability ability) { InitializeComponent(); this.manager = manager; openFileManager = new OpenFileManager(); this.edit = edit; this.ability = ability; if (edit) { SetValues(); } InitializeValues(); }
private void TextBlock_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (e.ClickCount == 2) { string fullPath = ((Grid)((TextBlock)sender).Parent).ToolTip.ToString(); var openFileManager = OpenFileManager.GetInstance(); if (Directory.Exists(fullPath)) { openFileManager.OpenFileInExplorer(fullPath); } else { openFileManager.OpenFileInVisualStudio(fullPath); } } }
public WeaponWindow(MainWindowManager manager, bool edit, Weapon weapon) { InitializeComponent(); this.manager = manager; openFileManager = new OpenFileManager(); this.edit = edit; this.weapon = weapon; if (edit) { SetValues(); } InitializeValues(); }
public CharacterWindow(MainWindowManager manager, bool edit) { InitializeComponent(); this.manager = manager; openFileManager = new OpenFileManager(); this.edit = edit; InitializeLists(); if (edit) { SetValues(); } InitializeValues(); }
public EnemyWindow(MainWindowManager manager, bool edit, Enemy enemy) { InitializeComponent(); this.manager = manager; openFileManager = new OpenFileManager(); this.edit = edit; this.enemy = enemy; InitializeList(); if (edit) { SetValues(); } InitializeValues(); }
private void OpenInDefaultProgram_Click(object sender, RoutedEventArgs e) { MenuItem menuItem = sender as MenuItem; if (menuItem == null) { return; } ContextMenu parentContextMenu = menuItem.CommandParameter as ContextMenu; var grid = parentContextMenu?.PlacementTarget as Grid; if (grid == null) { return; } string fullPath = grid.ToolTip.ToString(); OpenFileManager.GetInstance().OpenInDefaultProgram(fullPath); }
/// <summary> /// Initialization of the package; this method is called right after the package is sited, so this is the place /// where you can put all the initialization code that rely on services provided by VisualStudio. /// </summary> protected override void Initialize() { Command.Initialize(this); base.Initialize(); OpenFileManager.CreateInstance(this); var extensionUtility = new ExtensionUtility(typeof(CommandPackage)); string extensionPath = extensionUtility.GetExtensionPath(); var everythingProcessManager = new EverythingProcessManager(extensionPath); bool serviceIsStartedNow = false; if (!everythingProcessManager.IsServiceInstalled()) { everythingProcessManager.InstallService(); serviceIsStartedNow = true; } else if (!everythingProcessManager.IsServiceRunning()) { everythingProcessManager.StartService(); serviceIsStartedNow = true; } // if only service is running if (everythingProcessManager.GetNumberOfEverythingProcess() <= 1) { if (serviceIsStartedNow) { // wait untill service will be fine System.Threading.Thread.Sleep(3000); } everythingProcessManager.StartClientInBackgroundMode(); } var everythingManager = new EverythingManager(); everythingManager.Init(extensionPath); EverythingSearchTask.CommandPackage = this; }
void Awake() { _instance = this; }