Show / Hide Table of Contents

Class JobManager

Singleton class that manages a list of JobModel instances. Ensures only one instance of JobManager exists throughout the application.

Inheritance
object
JobManager
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: EasySave_Project.Manager
Assembly: .dll
Syntax
public sealed class JobManager

Properties

| Edit this page View Source

Jobs

List containing all backup jobs.

Declaration
public List<JobModel> Jobs { get; }
Property Value
Type Description
List<JobModel>

Methods

| Edit this page View Source

AddJob(JobModel)

Adds a new job to the job list.

Declaration
public void AddJob(JobModel jobModel)
Parameters
Type Name Description
JobModel jobModel

The job to add.

| Edit this page View Source

CreateAndAddJob(string, string, string, JobSaveTypeEnum)

Creates a new job using the JobFactory and adds it to the job list.

Declaration
public JobModel CreateAndAddJob(string name, string fileSource, string fileTarget, JobSaveTypeEnum jobSaveTypeEnum)
Parameters
Type Name Description
string name

Job name.

string fileSource

Source directory.

string fileTarget

Target directory.

JobSaveTypeEnum jobSaveTypeEnum

Type of backup (complete or differential).

Returns
Type Description
JobModel

The created job, or null if an error occurs.

| Edit this page View Source

Destroy()

Declaration
public static void Destroy()
| Edit this page View Source

GetAll()

Retrieves all jobs from the list. If the job list is empty, it displays a message and initializes the list.

Declaration
public List<JobModel> GetAll()
Returns
Type Description
List<JobModel>

List of all jobs.

| Edit this page View Source

GetInstance()

Retrieves the single instance of JobManager. If the instance does not exist, it is created.

Declaration
public static JobManager GetInstance()
Returns
Type Description
JobManager

The singleton instance of JobManager.

| Edit this page View Source

GetJobById(int)

Declaration
public JobModel? GetJobById(int jobId)
Parameters
Type Name Description
int jobId
Returns
Type Description
JobModel
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX