예제 #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;
 }
예제 #6
0
 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);