// Touch up event handler. private void OnTouchUpHandler(object sender, Windows7.Multitouch.TouchEventArgs e) { // Find the stroke in the collection of the strokes in drawing. Stroke stroke; if (_activeStrokes.TryGetValue(e.Id, out stroke)) { FinishStroke(stroke); // Request full redraw. Invalidate(); } }
public override int GetHashCode() { unchecked { var hashCode = (Test != null ? Test.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Suit != null ? Suit.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Linux.GetHashCode(); hashCode = (hashCode * 397) ^ Windows10.GetHashCode(); hashCode = (hashCode * 397) ^ Windows7.GetHashCode(); hashCode = (hashCode * 397) ^ Osx.GetHashCode(); return(hashCode); } }
internal static void Bridge() { Console.WriteLine("Bridge Pattern Demo"); Console.WriteLine("----------------------------"); ReaderApp appWindows7 = new Windows7(new NormalDisplay()) { Text = "This is a demo of Bridge" }; appWindows7.Display(); ReaderApp appWindows10 = new Windows10(new NormalDisplay()) { Text = "This is a demo of Bridge" }; appWindows10.Display(); Console.WriteLine(""); ReaderApp appWindows7Reverse = new Windows7(new ReverseDisplay()) { Text = "This is a demo of Bridge" }; appWindows7Reverse.Display(); ReaderApp appWindows10Reverse = new Windows10(new ReverseDisplay()) { Text = "This is a demo of Bridge" }; appWindows10Reverse.Display(); Console.WriteLine(""); Console.WriteLine(""); Console.WriteLine("Bridge Pattern Demo 2"); Console.WriteLine("----------------------------"); Employee developer = new Developer(new Email()); Console.WriteLine(developer.ToString()); Employee scrumMaster = new ScrumMaster(new PhoneCall()); Console.WriteLine(scrumMaster.ToString()); }
public void run() { byte[] rawBytes = readBytes(); bool is32bit = string.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432")); var controlSet = getControlSet(); var operatingSystem = getWindowsVersion(rawBytes, is32bit); IAppCompatCache appCache; if (operatingSystem == OperatingSystemVersion.Windows10) { appCache = new Windows10(rawBytes, controlSet); } else if (operatingSystem == OperatingSystemVersion.Windows10Creators) { appCache = new Windows10(rawBytes, controlSet); } else if (operatingSystem == OperatingSystemVersion.Windows7x86) { appCache = new Windows7(rawBytes, is32bit, controlSet); } else if (operatingSystem == OperatingSystemVersion.Windows7x64_Windows2008R2) { appCache = new Windows7(rawBytes, is32bit, controlSet); } else if (operatingSystem == OperatingSystemVersion.Windows80_Windows2012) { var os = OperatingSystemVersion.Windows80_Windows2012; appCache = new Windows8x(rawBytes, os, controlSet); } else if (operatingSystem == OperatingSystemVersion.Windows81_Windows2012R2) { var os = OperatingSystemVersion.Windows81_Windows2012R2; appCache = new Windows8x(rawBytes, os, controlSet); } else if (operatingSystem == OperatingSystemVersion.WindowsVistaWin2k3Win2k8) { appCache = new VistaWin2k3Win2k8(rawBytes, is32bit, controlSet); } else if (operatingSystem == OperatingSystemVersion.WindowsXP) { appCache = new WindowsXP(rawBytes, is32bit, controlSet); } return; }
/// <summary> /// Makes the windows nice. /// </summary> private static void MakeWindowsJuicy() { try { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); String appId = "EVEMon"; if (s_isDebugBuild) { appId = String.Format(CultureConstants.DefaultCulture, "{0}-DEBUG", appId); } Windows7.SetProcessAppID(appId); } catch (Exception ex) { // On some systems, a crash may occur here because of some skinning programs or others. ExceptionHandler.LogException(ex, true); } }
/// <summary> /// Makes the windows nice. /// </summary> private static void MakeWindowsJuicy() { try { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); string appId = "EVEMon"; if (EveMonClient.IsDebugBuild) { appId = $"{appId}-DEBUG"; } Windows7.SetProcessAppId(appId); } catch (InvalidOperationException ex) { // On some systems, a crash may occur here because of some skinning programs or others ExceptionHandler.LogException(ex, false); } }
// Touch down event handler. private void OnTouchDownHandler(object sender, Windows7.Multitouch.TouchEventArgs e) { // If there exist stroke with this ID, finish it. Stroke stroke; if(_activeStrokes.TryGetValue(e.Id, out stroke)) { FinishStroke(stroke); // Request redraw of the window. Invalidate(); return; } // Create new stroke, add point and assign a color to it. Stroke newStroke = new Stroke (); newStroke.Color = _touchColor.GetColor(e.IsPrimaryContact); newStroke.Id = e.Id; // Add new stroke to the collection of strokes in drawing. _activeStrokes[newStroke.Id] = newStroke; }
public void TransactionalFileSystemSupported() { Assert.That(Windows7.SupportTransactionalFileSystem()); }
//https://github.com/libyal/winreg-kb/wiki/Application-Compatibility-Cache-key //https://dl.mandiant.com/EE/library/Whitepaper_ShimCacheParser.pdf private IAppCompatCache Init(byte[] rawBytes, bool is32, int controlSet) { IAppCompatCache appCache = null; OperatingSystem = OperatingSystemVersion.Unknown; string signature; var sigNum = BitConverter.ToUInt32(rawBytes, 0); //TODO check minimum length of rawBytes and throw exception if not enough data signature = Encoding.ASCII.GetString(rawBytes, 128, 4); Log.Debug("**** Signature {Signature}, Sig num {SigNum}", signature, $"0x{sigNum:X}"); if (sigNum == 0xDEADBEEF) //DEADBEEF, WinXp { OperatingSystem = OperatingSystemVersion.WindowsXP; Log.Debug("**** Processing XP hive"); appCache = new WindowsXP(rawBytes, is32, controlSet); } else if (sigNum == 0xbadc0ffe) { OperatingSystem = OperatingSystemVersion.WindowsVistaWin2k3Win2k8; appCache = new VistaWin2k3Win2k8(rawBytes, is32, controlSet); } else if (sigNum == 0xBADC0FEE) //BADC0FEE, Win7 { if (is32) { OperatingSystem = OperatingSystemVersion.Windows7x86; } else { OperatingSystem = OperatingSystemVersion.Windows7x64_Windows2008R2; } appCache = new Windows7(rawBytes, is32, controlSet); } else if (signature == "00ts") { OperatingSystem = OperatingSystemVersion.Windows80_Windows2012; appCache = new Windows8x(rawBytes, OperatingSystem, controlSet); } else if (signature == "10ts") { OperatingSystem = OperatingSystemVersion.Windows81_Windows2012R2; appCache = new Windows8x(rawBytes, OperatingSystem, controlSet); } else { //is it windows 10? var offsetToEntries = BitConverter.ToInt32(rawBytes, 0); OperatingSystem = OperatingSystemVersion.Windows10; if (offsetToEntries == 0x34) { OperatingSystem = OperatingSystemVersion.Windows10Creators; } signature = Encoding.ASCII.GetString(rawBytes, offsetToEntries, 4); if (signature == "10ts") { appCache = new Windows10(rawBytes, controlSet); } } if (appCache == null) { throw new Exception( "Unable to determine operating system! Please send the hive to [email protected]"); } return(appCache); }
public void Win7x86ShouldFindEntries() { var a = new Windows7(Win7X86, true, null); Check.That(a.Entries.Count).Equals(91); }
public void Win7x64ShouldFindEntries() { var a = new Windows7(Win7X64, false, null); Check.That(a.Entries.Count).Equals(304); }
public void TransactionalFileSystemSupported() { Windows7.SupportTransactionalFileSystem().Should().BeTrue(); }
private void OnTouchUpHandler(object sender, Windows7.Multitouch.TouchEventArgs e) { PointF location = new PointF((float)e.Location.X, (float)e.Location.Y); m_currentScene.SetInputState(e.Id, InputStatus.Up, location); ignoreMouse = false; }
private void 能耗系数ToolStripMenuItem_Click(object sender, EventArgs e) { EnergyConsumptionAnalys = new Windows7(); EnergyConsumptionAnalys.MdiParent = this; EnergyConsumptionAnalys.Show(); }
// Touch move event handler. private void OnTouchMoveHandler(object sender, Windows7.Multitouch.TouchEventArgs e) { // Find the stroke in the collection of the strokes in drawing. Stroke stroke; if(_activeStrokes.TryGetValue(e.Id, out stroke)) { // Add contact point to the stroke stroke.Add(e.Location); // Partial redraw: only the last line segment Graphics g = this.CreateGraphics(); stroke.DrawLast(g); } }