Ejemplo n.º 1
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")));
        }
Ejemplo n.º 2
0
        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;
            }
        }
        private void OnAdd(object parameter)
        {
            AuxiliaryApplication newAuxApp = new AuxiliaryApplication();

            newAuxApp.Name = "New Auxiliary Application";
            AuxiliaryApplicationViewModel newAuxAppViewModel = new AuxiliaryApplicationViewModel(newAuxApp);

            newAuxAppViewModel.IsExpanded = true;
            AuxiliaryApplications.Add(newAuxAppViewModel);
        }
Ejemplo n.º 4
0
        private void OnAdd(object parameter)
        {
            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);
        }
Ejemplo n.º 5
0
        private void OnRemove(object parameter)
        {
            switch (SelectedTab)
            {
            case 0:
                SelectedAuxApplication.StartRequest -= OnAuxAppStartRequest;
                SelectedAuxApplication.StopRequest  -= OnAuxAppStopRequest;
                AuxiliaryApplications.Remove(SelectedAuxApplication);
                break;

            case 1:
                DriveMaps.Remove(SelectedDriveMap);
                break;
            }
        }
Ejemplo n.º 6
0
 private bool CanSave(object parameter)
 {
     return(ServerPort > 0 && string.IsNullOrEmpty(Error) && !AuxiliaryApplications.Any(a => !string.IsNullOrEmpty(a.Error) || string.IsNullOrEmpty(a.Name)) && !DriveMaps.Any(dm => !string.IsNullOrEmpty(dm.Error) || string.IsNullOrEmpty(dm.ShareName) || string.IsNullOrEmpty(dm.DriveLetter)));
 }
Ejemplo n.º 7
0
 private void OnRemove(object parameter)
 {
     SelectedAuxApplication.StartRequest -= OnAuxAppStartRequest;
     SelectedAuxApplication.StopRequest  -= OnAuxAppStopRequest;
     AuxiliaryApplications.Remove(SelectedAuxApplication);
 }
 private void OnRemove(object parameter)
 {
     AuxiliaryApplications.Remove(SelectedAuxApplication);
 }