Ejemplo n.º 1
0
 public bool Empty()
 {
     return((Left.Count() +
             Right.Count() +
             Up.Count() +
             Down.Count() +
             LP.Count() +
             MP.Count() +
             HP.Count() +
             PPP.Count() +
             LK.Count() +
             MK.Count() +
             HK.Count() +
             KKK.Count() +
             Clear.Count()
             ) == 0);
 }
Ejemplo n.º 2
0
        public MyCustomApplicationContext(string[] args)
        {
            Assembly _assembly  = Assembly.GetExecutingAssembly();
            Stream   iconStream = _assembly.GetManifestResourceStream("AlwaysOnTop.icon.ico");

            using (RegistryKey rkSettings = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\AlwaysOnTop", true))
            {
                if (rkSettings == null)
                {
                    Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AlwaysOnTop", RegistryKeyPermissionCheck.ReadWriteSubTree);
                }
            }

            RegistryKey regSettings = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\AlwaysOnTop", true);

            AoTBuild = Methods.TryRegString(regSettings, "Build", AlwaysOnTop.build, true);
            IP       = Methods.TryRegString(regSettings, "Installation Path", AoTPath, true);
            RaL      = Methods.TryRegInt(regSettings, "Run at Login", 0, false);
            UHK      = Methods.TryRegInt(regSettings, "Use Hot Key", 0, false);
            HK       = Methods.TryRegString(regSettings, "Hotkey", "", false);
            CT       = Methods.TryRegInt(regSettings, "Use Context Menu", 0, false);
            UPM      = Methods.TryRegInt(regSettings, "Use Permanent Windows", 0, false);
            PW       = Methods.TryRegString(regSettings, "Windows by Title", "", false);
            DBN      = Methods.TryRegInt(regSettings, "Disable Balloon Notify", 0, false);
            CUaS     = Methods.TryRegInt(regSettings, "Check for Updates at Start", 0, false);
            UFE      = Methods.TryRegInt(regSettings, "Update Frequency Enabled", 0, false);
            UF       = Methods.TryRegInt(regSettings, "Update Frequency", 0, false);
            //try
            //{
            //    LU = DateTime.Parse(Methods.TryRegString(regSettings, "Last check for Update", "na", false));
            //}
            //catch (Exception ex)
            //{ MessageBox.Show(ex.Message); }


            if (CUaS == 1)
            {
                Methods.GetReleases();
            }
            /*if (UFE == 1 && UF != 0) { }  ***********************************************************************/

            regSettings.Close();

            try
            {
                // Initialize Tray Icon
                TrayIcon.Icon        = new Icon(iconStream);
                TrayIcon.ContextMenu = new ContextMenu(new MenuItem[]
                {
                    new MenuItem("AlwaysOnTop", AoT),
                    new MenuItem("Settings", Settings),
                    new MenuItem("Help", HelpBox),
                    new MenuItem("About", AboutBox),
                    new MenuItem("Exit", Xit)
                });
                TrayIcon.Visible = true;

                TrayIcon.Click += TrayIcon_Click;

                if (DBN != 1)
                {
                    TrayIcon.ShowBalloonTip(5000, "AlwaysOnTop", "AlwaysOnTop is running in the background.", ToolTipIcon.Info);
                }


                if (CT == 1) /* call method to enabled titlebar context menu*/ } {
                if (UHK == 1 && HK != "")
                {
                    string   delim    = "+";
                    String[] sHK      = HK.Split(new string[] { delim }, StringSplitOptions.None);
                    string   modifier = sHK[0];
                    skey = sHK[1];
                    kMod = new Keys();

                    switch (modifier.ToLower())
                    {
                    case "ctrl":
                        kMod = Keys.Control;
                        break;

                    case "alt":
                        kMod = Keys.Alt;
                        break;

                    case "shift":
                        kMod = Keys.Shift;
                        break;

                    case "winkey":
                        kMod = Keys.LWin;
                        break;

                    default:
                        kMod = Keys.None;
                        break;
                    }

                    TypeConverter keysConverter = TypeDescriptor.GetConverter(typeof(Keys));
                    key = (Keys)keysConverter.ConvertFromString(skey);
                    GKH = new globalKeyboardHook();
                    GKH.HookedKeys.Add(kMod);
                    GKH.HookedKeys.Add(key);

                    GKH.KeyUp += new KeyEventHandler(keyup_hook);
                    GKH.hook();

                    if (DBN != 1)
                    {
                        TrayIcon.ShowBalloonTip(500, "Settings", kMod + "+" + key + " Hotkey registered", ToolTipIcon.Info);
                    }
                }
                else
                {
                    gkh = new globalKeyboardHook();
                }
                if (UPM == 1) /* call method to enabled titlebar context menu*/ } {
        }
Ejemplo n.º 3
0
 public override string ToString()
 {
     return(string.Format("\n Hanh khach: {0}  \n So hieu CB: {1} \n San bay di: {2}   \n San bay den: {3}  \n Gia: {4}", HK.ToString(), Sohieu, Sandi, Sanden, Gia));
 }
Ejemplo n.º 4
0
 public ActionResult HK(HK hk)
 {
     return(View("hk", hk));
 }
Ejemplo n.º 5
0
 public static HK <F, B> Map <F, A, B>(this Monad <F> m, HK <F, A> fa, Func <A, B> f)
 => m.FlatMap(fa, a => m.Pure(f(a)));
Ejemplo n.º 6
0
 public static HK <F, B> Ap <F, A, B>(this Monad <F> m, HK <F, Func <A, B> > ff, HK <F, A> fa)
 => m.FlatMap(ff, f => m.Map(fa, f));
Ejemplo n.º 7
0
 public static HK <F, A> Flatten <F, A>(this Monad <F> m, HK <F, HK <F, A> > ffa)
 => m.FlatMap(ffa, fa => fa);