private void OnAdd(object parameter)
        {
            switch (SelectedTab)
            {
            case 0:
                AuxiliaryApplication newAuxApp = new AuxiliaryApplication();
                newAuxApp.Name = "New Auxiliary Application";
                AuxiliaryApplicationViewModel newAuxAppViewModel = new AuxiliaryApplicationViewModel(newAuxApp, this);
                newAuxAppViewModel.StartRequest        += OnAuxAppStartRequest;
                newAuxAppViewModel.StopRequest         += OnAuxAppStopRequest;
                newAuxAppViewModel.CheckRunningRequest += OnAuxAppCheckRunRequest;
                newAuxAppViewModel.IsExpanded           = true;
                AuxiliaryApplications.Add(newAuxAppViewModel);
                break;

            case 1:
                DriveMap          newDriveMap          = new DriveMap(@"\\computer\share", "Z");
                DriveMapViewModel newDriveMapViewModel = new DriveMapViewModel(newDriveMap);
                DriveMaps.Add(newDriveMapViewModel);
                break;

            default:
                break;
            }
        }
Exemple #2
0
        public MockSettingsViewModel() : base(new PlexServiceCommon.Settings(), "Dark Amber")
        {
            ServerPort = 8787;

            AutoRemount      = true;
            AutoRemountCount = 2;
            AutoRestart      = true;

            //add some mock data
            AuxiliaryApplications.Add(new AuxiliaryApplicationViewModel(new PlexServiceCommon.AuxiliaryApplication()
            {
                Name          = "My Aux Application",
                FilePath      = @"C:\Something\execute_me.exe",
                LogOutput     = true,
                Argument      = "-i someExtraInfo",
                KeepAlive     = true,
                WorkingFolder = @"C:\Something",
                Url           = "https://auxiliaryapps.com"
            }, this));

            AuxiliaryApplications.Add(new AuxiliaryApplicationViewModel(new PlexServiceCommon.AuxiliaryApplication()
            {
                Name          = "Another Aux Application",
                FilePath      = @"C:\Something\dont_execute_me.exe",
                LogOutput     = true,
                Argument      = "--help",
                KeepAlive     = false,
                WorkingFolder = @"C:\Something",
                Url           = "https://bad.com"
            }, this));

            DriveMaps.Add(new DriveMapViewModel(new PlexServiceCommon.DriveMap(@"\\myserver\media", @"M")));
            DriveMaps.Add(new DriveMapViewModel(new PlexServiceCommon.DriveMap(@"\\myserver\photos", @"P")));
        }