protected override void SwitcherOnInputStatusChanged(ISwitcher switcher, SwitcherInputStatusChangeEventArgs args) { var source = GetSourceWithInputNumber(args.Number); #if DEBUG Debug.WriteInfo("Switcher Input Status", "Input {0}, HasVideo = {1}", args.Number, args.HasVideo); #endif if (source == null || !AutoSourceSelectionEnabled) { return; } if (Source == source && !args.HasVideo && source.Type == SourceType.Laptop && Sources.OfSourceType(SourceType.AirMedia).Any()) { #if DEBUG Debug.WriteWarn("Current source is laptop... switching back to AirMedia"); #endif Source = Sources[SourceType.AirMedia]; } else if (Source == null && args.HasVideo && source.Type == SourceType.Laptop) { #if DEBUG Debug.WriteSuccess("System is off, switching to laptop"); #endif Source = source; } }
private void LocalSwitcherOnInputStatusChanged(ISwitcher switcher, SwitcherInputStatusChangeEventArgs args) { foreach (var source in Sources.Cast <ASource>()) { source.UpdateFromSwitcherVideoStatus(args.Number, args.HasVideo); } }
public TetrisController() { m_shapeQueueController = new ShapeQueueController(); m_shapePositionCoordinator = new ShapePositionCoordinator(); m_gridManager = new GridManager(); m_switcher = new Switcher(); m_shapeSpawner = GameObject.FindGameObjectWithTag("Spawner").GetComponent <IShapeSpawner>(); }
protected override void SwitcherOnInputStatusChanged(ISwitcher switcher, SwitcherInputStatusChangeEventArgs args) { }
public SwitcherInputStatusChangeEventArgs(ISwitcher switcher, uint number) { Switcher = switcher; Number = number; }
private void Construct(ISwitcher switcher) { this.switcher = switcher; }
public void MenuSwitchDevice(ISwitcher obj) { Console.WriteLine("Включить устройство. Введите 1"); Console.WriteLine("Выключить устройство. Введите 2"); }
public static void Main(string[] args) { var supportedVisualStudioVersions = ProjectSolutionMapping.GetAll() .Select(x => x.TargetVersion) .ToHashSet(); var supportedFrameworkVersions = FrameworkMapping.GetAll() .Select(x => x.CommandLineArg) .OrderBy(x => x) .ToArray(); var supportedTargetPlatformVersions = TargetPlatformMapping.GetAll() .Select(x => x.CommandLineArg) .OrderBy(x => x) .ToArray(); try { if (args.Length == 0) { Console.WriteLine(@"usage: SwitchVsVersion [folder] [{0}|{1}|{2}]", String.Join("|", supportedVisualStudioVersions.OrderBy(x => x).ToArray()), String.Join("|", supportedFrameworkVersions), String.Join("|", supportedTargetPlatformVersions) ); return; } string path; string version; if (args.Length == 1) { path = Environment.CurrentDirectory; version = args[0]; } else { path = args[0]; version = args[1]; } var switcher = new ISwitcher[] { new FrameworkSwitcher(), new TargetPlatformSwitcher(), new ProjectAndSolutionSwitcher() } .FirstOrDefault(x => x.IsMatch(version)); if (switcher != null) { switcher.Switch(path, version); return; } Console.WriteLine(@"Invalid version '{0}'. Use {1}, {2}, {3}", version, String.Join(", ", supportedVisualStudioVersions.ToArray()), String.Join(", ", supportedFrameworkVersions.ToArray()), String.Join(", ", supportedTargetPlatformVersions.ToArray()) ); } catch (Exception e) { Console.WriteLine(@"Error: " + e.Message); } finally { Console.WriteLine(@"Finished"); } }
// from unit test public Lyrics(string text, ISwitcher switcher) : this() { _text = text; _switcher = switcher; }
internal Context(IUIAssistantAPI api) { ThemeSwitcher = api.ThemeAPI.GetThemeSwitcher(); }
protected abstract void SwitcherOnInputStatusChanged(ISwitcher switcher, SwitcherInputStatusChangeEventArgs args);