FindMyFiles

FindMyFiles.ViewModels

ServiceManagerViewModel Class

Supports all classes in the .NET Framework class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all classes in the .NET Framework; it is the root of the type hierarchy.

public sealed class ServiceManagerViewModel : CommunityToolkit.Mvvm.ComponentModel.ObservableObject

Inheritance System.ObjectCommunityToolkit.Mvvm.ComponentModel.ObservableObject → ServiceManagerViewModel

Constructors

ServiceManagerViewModel(ServiceProvisioner) Constructor

Locates fmf-service.exe once (bundle or dev tree); the dialog should call Refresh() on open to fill the state line.

public ServiceManagerViewModel(FindMyFiles.Services.ServiceProvisioner? provisioner=null);

Parameters

provisioner ServiceProvisioner

The post-register wait+relaunch steps; defaults to Real (tests inject a fake).

Properties

ServiceManagerViewModel.HasResult Property

Whether the result InfoBar has anything to show (FindMyFiles.ViewModels.ServiceManagerViewModel.ResultText non-empty).

public bool HasResult { get; }

Property Value

System.Boolean

ServiceManagerViewModel.NotBusy Property

Buttons stay enabled only while idle — an in-flight UAC action greys the whole row (visibility is still driven by the Is*/Can* flags).

public bool NotBusy { get; }

Property Value

System.Boolean

Methods

ServiceManagerViewModel.Refresh() Method

Re-read the SCM state and recompute which actions apply. Cheap read-only P/Invoke (no elevation) — safe on the UI thread.

public void Refresh();

ServiceManagerViewModel.RegisterAsync() Method

install (idempotent) + restart in one elevated step (the fmf-service `setup` verb). The daily user's SID is forwarded so OTS elevation — a *different* admin account at the UAC prompt — does not lock this user out of the pipe (docs/SECURITY.md threat 1). The app is unelevated here, so CurrentUserSid is exactly that daily user.

public System.Threading.Tasks.Task RegisterAsync();

Returns

System.Threading.Tasks.Task
A task that completes when the elevated setup verb finishes.

ServiceManagerViewModel.RestartApp() Method

Plain (unelevated) relaunch so the fresh instance connects to the now-running service over the pipe.

public void RestartApp();

ServiceManagerViewModel.RestartAsync() Method

Restart the running service (one elevated restart verb).

public System.Threading.Tasks.Task RestartAsync();

Returns

System.Threading.Tasks.Task
A task that completes when the elevated restart verb finishes.

ServiceManagerViewModel.StartAsync() Method

Start the stopped service (one elevated start verb).

public System.Threading.Tasks.Task StartAsync();

Returns

System.Threading.Tasks.Task
A task that completes when the elevated start verb finishes.

ServiceManagerViewModel.StopAsync() Method

Stop the running service (one elevated stop verb).

public System.Threading.Tasks.Task StopAsync();

Returns

System.Threading.Tasks.Task
A task that completes when the elevated stop verb finishes.

ServiceManagerViewModel.UninstallAsync() Method

Uninstall the service (one elevated uninstall verb), adding --purge-data when FindMyFiles.ViewModels.ServiceManagerViewModel.PurgeData is set.

public System.Threading.Tasks.Task UninstallAsync();

Returns

System.Threading.Tasks.Task
A task that completes when the elevated uninstall verb finishes.