コード例 #1
0
ファイル: Main.cs プロジェクト: adamtal3/PunchClock
        public Main()
        {
            InitializeComponent();

            // Material
            var materialSkinManager = MaterialSkinManager.Instance;

            materialSkinManager.AddFormToManage(this);
            materialSkinManager.Theme       = MaterialSkinManager.Themes.LIGHT;
            materialSkinManager.ColorScheme = new ColorScheme(Primary.BlueGrey800, Primary.BlueGrey900, Primary.BlueGrey500, Accent.LightBlue200, TextShade.WHITE);

            // Notify icon
            niNotifyIcon.ContextMenu = new ContextMenu(new[] {
                new MenuItem("Show", (sender, args) => { this.niNotifyIcon_MouseDoubleClick(sender, null); }),
                new MenuItem("-"),
                new MenuItem("Exit", (sender, args) => { this.Close(); })
            });

            // Scroll Lock handler
            ScrollLockInterceptor.ScrollLockChange += ScrollLockInterceptorOnScrollLockChange;

            _timer = new Timer {
                Interval = 10000
            };
            _timer.Tick += (sender, args) => ScrollLockInterceptor.InvokeScrollLockChange();
            _timer.Start();

            _timeCounter = new TimeCounter();
        }
コード例 #2
0
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     ScrollLockInterceptor.SetHook();
     Application.Run(new Main());
     ScrollLockInterceptor.UnhookWindowsHookEx();
 }
コード例 #3
0
ファイル: Main.cs プロジェクト: adamtal3/PunchClock
        private async Task InvokeScrollLockChangeSoon()
        {
            await Task.Delay(1000);

            ScrollLockInterceptor.InvokeScrollLockChange();
        }