Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
 private static void SaveProtocolSettings(ResourceProxy proxy, string friendlyName, Default defProtocol)
 {
     CheckRegistration();
     proxy.AsyncPriority = JobPriority.Immediate;
     proxy.SetProp(_propFriendlyName, friendlyName);
     if (defProtocol != Default.NoChanges)
     {
         proxy.SetProp(_propDefault, defProtocol == Default.Yes);
     }
     proxy.EndUpdate();
     if (proxy.Resource.HasProp(_propDefault))
     {
         ProtocolHandlersInRegistry.SetAsDefaultHandler(proxy.Resource.GetPropText(_propProtocol), friendlyName);
     }
 }