-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from FlyTechVideos/new-bluescreens
Added new bluescreens
- Loading branch information
Showing
38 changed files
with
1,990 additions
and
339 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 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,38 @@ | ||
using System; | ||
using System.Reflection; | ||
using System.Windows; | ||
using BluescreenSimulator.ViewModels; | ||
|
||
namespace BluescreenSimulator | ||
{ | ||
[AttributeUsage(AttributeTargets.Class, Inherited = false)] | ||
public class BluescreenViewAttribute : Attribute | ||
{ | ||
public Type WindowType { get; set; } | ||
public BluescreenViewAttribute(Type windowType) | ||
{ | ||
WindowType = windowType; | ||
} | ||
} | ||
|
||
public static class BluescreenExtensions | ||
{ | ||
public static void ShowView(this IBluescreenViewModel bluescreen) | ||
{ | ||
var attribute = bluescreen.GetType().GetCustomAttribute<BluescreenViewAttribute>(); | ||
if (attribute is null) throw new InvalidOperationException("No BluescreenViewAttribute has been found"); | ||
var type = attribute.WindowType; | ||
|
||
void DispatcherWindowShow() | ||
{ | ||
Application.Current.Dispatcher.Invoke(() => | ||
{ | ||
var window = (Window) Activator.CreateInstance(type, bluescreen); | ||
window.Show(); | ||
return window; | ||
}); | ||
} | ||
bluescreen.ExecuteCommand.Execute((Action)DispatcherWindowShow); | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
BluescreenSimulator/Converters/EqualsVisibilityConverter.cs
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; | ||
using System.Globalization; | ||
using System.Windows; | ||
using System.Windows.Data; | ||
|
||
namespace BluescreenSimulator.Converters | ||
{ | ||
public class EqualsVisibilityConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return value == parameter ? Visibility.Visible : Visibility.Collapsed; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return value != parameter ? Visibility.Visible : Visibility.Collapsed; | ||
} | ||
} | ||
} |
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,18 @@ | ||
using System.Windows.Media; | ||
|
||
namespace BluescreenSimulator | ||
{ | ||
public class BluescreenBase | ||
{ | ||
public string CmdCommand { get; set; } = null; | ||
|
||
public virtual Color BackgroundColor { get; set; } = Color.FromRgb(10, 112, 169); | ||
|
||
public virtual Color ForegroundColor { get; set; } = Colors.White; | ||
|
||
public int Delay { get; set; } = 0; | ||
public bool EnableUnsafe { get; set; } = false; | ||
|
||
public bool RainbowMode { get; set; } = false; | ||
} | ||
} |
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,25 @@ | ||
using System.Windows.Media; | ||
using Strings = BluescreenSimulator.Properties.Windows10BluescreenResources; | ||
namespace BluescreenSimulator | ||
{ | ||
public class Windows10Bluescreen : BluescreenBase | ||
{ | ||
public string Emoticon { get; set; } = Strings.Emoticon; | ||
|
||
public string MainText1 { get; set; } = Strings.MainText1; | ||
|
||
public string MainText2 { get; set; } = Strings.MainText2; | ||
|
||
public string Complete { get; set; } = Strings.Complete; | ||
|
||
public string MoreInfo { get; set; } = Strings.MoreInfo; | ||
|
||
public string SupportPerson { get; set; } = Strings.SupportPerson; | ||
|
||
public string StopCode { get; set; } = Strings.StopCode; | ||
|
||
public bool HideQR { get; set; } = false; | ||
|
||
public bool UseOriginalQR { get; set; } | ||
} | ||
} |
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,26 @@ | ||
using System.Windows.Media; | ||
using Strings = BluescreenSimulator.Properties.Windows7BluescreenResources; | ||
namespace BluescreenSimulator | ||
{ | ||
public class Windows7Bluescreen : BluescreenBase | ||
{ | ||
public string Header { get; set; } = Strings.Header; | ||
|
||
public string ErrorCode { get; set; } = Strings.ErrorCode; | ||
|
||
public string StepsHeader { get; set; } = Strings.StepsHeader; | ||
|
||
public string Steps { get; set; } = Strings.Steps; | ||
|
||
public string TechnicalInfoHeader { get; set; } = Strings.TechnicalInfoHeader; | ||
public string StopCode { get; set; } = Strings.StopCode; | ||
public string DumpStart { get; set; } = Strings.DumpStart; | ||
|
||
public string DumpProgress { get; set; } = Strings.DumpProgress; | ||
|
||
public string DumpComplete { get; set; } = Strings.DumpComplete; | ||
|
||
|
||
public override Color BackgroundColor { get; set; } = Colors.DarkBlue; | ||
} | ||
} |
Oops, something went wrong.