-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved some stuff around, added PSRunspace backport.
Closes #7
- Loading branch information
1 parent
7679cf2
commit e142852
Showing
15 changed files
with
379 additions
and
342 deletions.
There are no files selected for viewing
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.Diagnostics; | ||
|
||
namespace SuperLTI | ||
{ | ||
public static class Logger | ||
{ | ||
public static void WriteEventLog(string logText, EventLogEntryType messageType) | ||
{ | ||
EventLog eventLog = new EventLog("Application") | ||
{ | ||
Source = "SuperLTI" | ||
}; | ||
if (!EventLog.SourceExists(eventLog.Source)) | ||
{ | ||
EventLog.CreateEventSource("SuperLTI", "Application"); | ||
} | ||
eventLog.WriteEntry(logText, messageType); | ||
} | ||
} | ||
} |
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 @@ | ||
using System; | ||
using System.Windows.Forms; | ||
|
||
namespace SuperLTI | ||
{ | ||
/// <summary> | ||
/// The PowerShell runspace passed to the "install engine's" PowerShell instance. | ||
/// This allows the PowerShell script to access these properties and methods from PowerShell. | ||
/// </summary> | ||
public class PSRunspace | ||
{ | ||
/// <summary> | ||
/// Get / set the title of the main window. | ||
/// </summary> | ||
public string WindowTitle | ||
{ | ||
get | ||
{ | ||
return Program.MainForm.ProgressDialog.Title; | ||
} | ||
set | ||
{ | ||
Program.MainForm.BeginInvoke(new Action(() => { | ||
Program.MainForm.ProgressDialog.Title = value; | ||
})); | ||
} | ||
} | ||
/// <summary> | ||
/// Gets / sets the TopMost status of the main window. True means that the main window is always on top. | ||
/// </summary> | ||
public bool WindowTopMost | ||
{ | ||
get | ||
{ | ||
return Program.MainForm.TopMost; | ||
} | ||
set | ||
{ | ||
Program.MainForm.Invoke(new Action(() => { | ||
Program.MainForm.TopMost = value; | ||
})); | ||
} | ||
} | ||
/// <summary> | ||
/// Gets the raw SuperLTI arguments that were passed to SuperLTI on launch. | ||
/// </summary> | ||
public string[] RawArguments | ||
{ | ||
get | ||
{ | ||
return Program.Arguments; | ||
} | ||
} | ||
} | ||
} |
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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
SuperLTI/ProgressDialogHost.Designer.cs → SuperLTI/Main.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.