示例#1
0
        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;
            }
        }
示例#2
0
 private void LocalSwitcherOnInputStatusChanged(ISwitcher switcher, SwitcherInputStatusChangeEventArgs args)
 {
     foreach (var source in Sources.Cast <ASource>())
     {
         source.UpdateFromSwitcherVideoStatus(args.Number, args.HasVideo);
     }
 }
示例#3
0
        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>();
        }
示例#4
0
 protected override void SwitcherOnInputStatusChanged(ISwitcher switcher, SwitcherInputStatusChangeEventArgs args)
 {
 }
示例#5
0
文件: ISwitcher.cs 项目: uxav/lib2
 public SwitcherInputStatusChangeEventArgs(ISwitcher switcher, uint number)
 {
     Switcher = switcher;
     Number   = number;
 }
 private void Construct(ISwitcher switcher)
 {
     this.switcher = switcher;
 }
示例#7
0
 public void MenuSwitchDevice(ISwitcher obj)
 {
     Console.WriteLine("Включить устройство. Введите 1");
     Console.WriteLine("Выключить устройство. Введите 2");
 }
示例#8
0
        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");
            }
        }
示例#9
0
 // from unit test
 public Lyrics(string text, ISwitcher switcher) : this()
 {
     _text     = text;
     _switcher = switcher;
 }
示例#10
0
 internal Context(IUIAssistantAPI api)
 {
     ThemeSwitcher = api.ThemeAPI.GetThemeSwitcher();
 }
示例#11
0
 protected abstract void SwitcherOnInputStatusChanged(ISwitcher switcher, SwitcherInputStatusChangeEventArgs args);