-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
041e8ae
commit 87fb0a1
Showing
10 changed files
with
142 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { Injectable } from "@angular/core"; | ||
import { Subject } from "rxjs"; | ||
import { RunningProcessService } from "./running.process.service"; | ||
import { AppDirectory } from "src/app/system-files/app.directory"; | ||
import { FileInfo } from "src/app/system-files/fileinfo"; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
|
||
export class TriggerProcessService{ | ||
|
||
private _runningProcessService:RunningProcessService; | ||
private _appDirectory:AppDirectory; | ||
private _TriggerList:FileInfo[]; | ||
|
||
startProcessNotify: Subject<string> = new Subject<string>(); | ||
appNotFoundNotify: Subject<string> = new Subject<string>(); | ||
appIsRunningNotify: Subject<string> = new Subject<string>(); | ||
|
||
constructor(runningProcessService:RunningProcessService){ | ||
this._runningProcessService = runningProcessService; | ||
this._appDirectory = new AppDirectory(); | ||
this._TriggerList = []; | ||
} | ||
|
||
startApplication(file:FileInfo):void{ | ||
|
||
if(this._appDirectory.appExist(file.getOpensWith)){ | ||
|
||
if(!this._runningProcessService.isProcessRunning(file.getOpensWith)){ | ||
this.startProcessNotify.next(file.getOpensWith); | ||
this._TriggerList.push(file); | ||
return | ||
} | ||
this.appNotFoundNotify.next(file.getOpensWith); | ||
return; | ||
} | ||
this.appNotFoundNotify.next(file.getOpensWith); | ||
return; | ||
} | ||
|
||
/** | ||
* Getting the last process from the Trigger, will remove it the TriggerList. | ||
*/ | ||
getLastProcessTrigger():FileInfo{ | ||
|
||
if(this._TriggerList.length > 0){ | ||
return this._TriggerList.pop() || new FileInfo; | ||
} | ||
|
||
return new FileInfo; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.