Esempio n. 1
0
        private void ActivateIt()
        {
            using (RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Quizo\QTTabBar")) {
                if ((int)key.GetValue("FirstTime", 1) == 0)
                {
                    return;
                }

                object pvaTabBar    = new Guid("{d2bf470e-ed1c-487f-a333-2bd8835eb6ce}").ToString("B");
                object pvaButtonBar = new Guid("{d2bf470e-ed1c-487f-a666-2bd8835eb6ce}").ToString("B");
                object pvarShow     = true;
                object pvarSize     = null;
                try {
                    explorer.ShowBrowserBar(pvaTabBar, pvarShow, pvarSize);
                    explorer.ShowBrowserBar(pvaButtonBar, pvarShow, pvarSize);
                }
                catch (COMException) {
                    // TODO: Localize this
                    MessageForm.Show(IntPtr.Zero,
                                     "Warning:  Could not automatically enable QTTabBar.  " +
                                     "To enable it manually, press and release the Alt key, " +
                                     "then select QTTabBar from the View/Toolbars menu.",
                                     "Could not enable", MessageBoxIcon.Warning, 30000, false, true);
                }
                key.SetValue("FirstTime", 0);
            }
        }
Esempio n. 2
0
        private void ActivateIt()
        {
            //BandObjectLib.Logging.Add_DEBUG("ShowBrowserBar.log", "AutoLoader.SetSite.ActivateIt");
            BandObjectLib.Logging.Add_DEBUG("Constructor.log", "AutoLoader.SetSite.ActivateIt");
            string   installDateString;
            DateTime installDate;
            string   minDate = DateTime.MinValue.ToString();

            using (RegistryKey key = Registry.LocalMachine.OpenSubKey(RegConst.Root)) {
                installDateString = key == null ? minDate : (string)key.GetValue("InstallDate", minDate);
                installDate       = DateTime.Parse(installDateString);
            }
            using (RegistryKey key = Registry.CurrentUser.CreateSubKey(RegConst.Root)) {
                DateTime lastActivation = DateTime.Parse((string)key.GetValue("ActivationDate", minDate));
                if (installDate.CompareTo(lastActivation) <= 0)
                {
                    return;
                }

                object pvaTabBar    = new Guid("{d2bf470e-ed1c-487f-a333-2bd8835eb6ce}").ToString("B");
                object pvaButtonBar = new Guid("{d2bf470e-ed1c-487f-a666-2bd8835eb6ce}").ToString("B");
                object pvarShow     = true;
                object pvarSize     = null;
                try {
                    explorer.ShowBrowserBar(pvaTabBar, pvarShow, pvarSize);
                    explorer.ShowBrowserBar(pvaButtonBar, pvarShow, pvarSize);
                }
                catch (COMException) {
                    MessageForm.Show(
                        IntPtr.Zero,
                        QTUtility.TextResourcesDic["ErrorDialogs"][2],
                        QTUtility.TextResourcesDic["ErrorDialogs"][3],
                        MessageBoxIcon.Warning,
                        30000,
                        false,
                        true
                        );
                }
                key.SetValue("ActivationDate", installDateString);
            }
        }
Esempio n. 3
0
        private void ActivateIt()
        {
            string   installDateString;
            DateTime installDate;
            string   minDate = DateTime.MinValue.ToString();

            using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"Software\Quizo\QTTabBar")) {
                installDateString = key == null ? minDate : (string)key.GetValue("InstallDate", minDate);
                installDate       = DateTime.Parse(installDateString);
            }
            using (RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Quizo\QTTabBar")) {
                DateTime lastActivation = DateTime.Parse((string)key.GetValue("ActivationDate", minDate));
                if (installDate.CompareTo(lastActivation) <= 0)
                {
                    return;
                }

                object pvaTabBar    = new Guid("{d2bf470e-ed1c-487f-a333-2bd8835eb6ce}").ToString("B");
                object pvaButtonBar = new Guid("{d2bf470e-ed1c-487f-a666-2bd8835eb6ce}").ToString("B");
                object pvarShow     = true;
                object pvarSize     = null;
                try {
                    explorer.ShowBrowserBar(pvaTabBar, pvarShow, pvarSize);
                    explorer.ShowBrowserBar(pvaButtonBar, pvarShow, pvarSize);
                }
                catch (COMException) {
                    // TODO: Localize this
                    MessageForm.Show(IntPtr.Zero,
                                     "Warning:  Could not automatically enable QTTabBar.  " +
                                     "To enable it manually, press and release the Alt key, " +
                                     "then select QTTabBar from the View/Toolbars menu.",
                                     "Could not enable", MessageBoxIcon.Warning, 30000, false, true);
                }
                key.SetValue("ActivationDate", installDateString);
            }
        }
 public void ShowBrowserBar(ref object pvaClsid, ref object pvarShow, ref object pvarSize)
 {
     _EmbeddedWebBrowserAsIWebBrowser2.ShowBrowserBar(ref pvaClsid, ref pvarShow, ref pvarSize);
 }