public HackerNewsScraper( SystemWrapper systemWrapper, DataService dataService, JsonWrapper jsonWrapper) { this.systemWrapper = systemWrapper; this.dataService = dataService; this.jsonWrapper = jsonWrapper; }
public static void Main(string[] args) { var systemWrapper = new SystemWrapper(); var dataService = new DataService(new HtmlWebWrapper(), new PostFactory()); var jsonWrapper = new JsonWrapper(); new HackerNewsScraper(systemWrapper, dataService, jsonWrapper).Run(args); #if DEBUG Console.ReadLine(); #endif }
void Activity_KeyPress(Object sender, View.KeyEventArgs e) { if (e.Event.Action == KeyEventActions.Multiple) { if (e.Event.KeyCode == Keycode.Unknown) { for (Int32 idx = 0; idx < e.Event.Characters.Length; ++idx) { SystemWrapper.OnKey(e.Event.Characters [idx]); } } else { Char c = (Char)e.Event.UnicodeChar; SystemWrapper.OnKey(c); } return; } if (e.Event.Action == KeyEventActions.Up && e.Event.KeyCode == Keycode.Back) { InputHandler.Current.EscapePressed = true; return; } if (e.Event.Action == KeyEventActions.Up && e.Event.KeyCode == Keycode.Menu) { InputHandler.Current.MenuPressed = true; return; } if (e.Event.Action == KeyEventActions.Up && e.Event.KeyCode == Keycode.Del) { SystemWrapper.OnKey('\b'); return; } if (e.Event.Action == KeyEventActions.Up) { Char c = (Char)e.Event.UnicodeChar; SystemWrapper.OnKey(c); } }
public override void OnOrientationChanged(Int32 orientation) { if (!CanDetectOrientation() || orientation < 0) { return; } Vector2 up = new Vector2(0, 1); up = Vector2.Transform(up, Matrix.CreateRotationZ((Single)orientation / 180.0f * (Single)Math.PI)); Orientation newValue = _current; if (Math.Abs(up.X) > Math.Abs(up.Y) * 4) { if (up.X > 0) { newValue = Orientation.LandscapeLeft; } else { newValue = Orientation.LandscapeRight; } } if (Math.Abs(up.Y) > Math.Abs(up.X) * 4 && up.Y > 0) { newValue = Orientation.Portrait; } if (newValue != _current) { _current = newValue; SystemWrapper.OnOrientationChanged(_current); } }
} //File Association mode private void SharedStartup() { saveWorkflowPreviewToolStripMenuItem.Enabled = false; SystemWrapper.SetBrowserFeatureControl(); AddTabControls(); }