Ejemplo n.º 1
0
            private void OnClick(object sender, System.EventArgs e)
            {
                IResource    handler      = (IResource)_handlers[0];
                string       friendlyName = handler.GetPropText(ProtocolHandlersInResourceStore._propFriendlyName);
                string       message      = "Would you like to check on Omea startup that it is the default '" + friendlyName + "' ?";
                DialogResult result       =
                    MessageBox.Show(message, Core.ProductFullName, MessageBoxButtons.YesNoCancel,
                                    MessageBoxIcon.Question, MessageBoxDefaultButton.Button3);

                if (result == DialogResult.Cancel)
                {
                    return;
                }

                foreach (IResource protocol in _handlers)
                {
                    ProtocolHandlerManager.SetAsDefaultHandler(protocol, result == DialogResult.Yes);
                }
                string protocolName = handler.GetPropText(ProtocolHandlersInResourceStore._propProtocol);

                if (ProtocolHandlersInRegistry.IsDefaultHandler(protocolName))
                {
                    _defaultText.Text    = "Default";
                    _makeDefault.Visible = false;
                }
                else
                {
                    _defaultText.Text    = "Not Default";
                    _makeDefault.Visible = true;
                }
            }
Ejemplo n.º 2
0
        private void OnLoad(object sender, System.EventArgs e)
        {
            IResourceList handlers    = ProtocolHandlersInResourceStore.GetProtocolHandlersList();
            HashMap       protocolSet = ProtocolHandlerManager.GetProtocols(handlers);
            int           count       = 0;

            foreach (HashMap.Entry entry in protocolSet)
            {
                new ProtocolCtrl(this, entry.Value as ArrayList, count++);
            }
        }
Ejemplo n.º 3
0
        public static void SetAsDefaultHandler(IResource resProtocol, bool check)
        {
            ProtocolHandlerManager manager = Core.ProtocolHandlerManager as ProtocolHandlerManager;

            Guard.NullLocalVariable(manager, "manager");

            string protocol = resProtocol.GetPropText(_propProtocol);

            ProtocolHandlersInRegistry.SetAsDefaultHandler(protocol, resProtocol.GetPropText(_propFriendlyName));
            SetCheckNeeded(protocol, check);
            manager.InvokeMakeDefault(protocol);
        }