public void Unregister()
 {
     using (var fa = FileAssociatorFactory.GetAppRegisterer(DocTypePrefix, ProgramName))
     {
         fa.Unregister();
     }
 }
 public bool ShowExternalUI()
 {
     using (var fa = FileAssociatorFactory.GetFileAssociator(DocTypePrefix, ProgramName))
     {
         return(fa.ShowExternalUI());
     }
 }
 public void SetStatus(IEnumerable <FileTypeItem> items)
 {
     using (var fa = FileAssociatorFactory.GetFileAssociator(DocTypePrefix, ProgramName))
     {
         foreach (var item in items)
         {
             item.Selected = fa.IsAssociated(Normalize(item.Extension));
         }
     }
 }
 public void Register(string regPath,
                      string defaultIcon,
                      string openCommand,
                      string localizedAppName,
                      string localizedAppDescription,
                      IEnumerable <DocTypeInfo> docTypes)
 {
     using (var fa = FileAssociatorFactory.GetAppRegisterer(DocTypePrefix, ProgramName))
     {
         fa.Register(regPath, defaultIcon, openCommand, localizedAppName, localizedAppDescription, docTypes);
     }
 }
        public void Associate(IEnumerable <FileTypeItem> items)
        {
            using (var fa = FileAssociatorFactory.GetFileAssociator(DocTypePrefix, ProgramName))
            {
                foreach (var item in items)
                {
                    var ext = Normalize(item.Extension);
                    if (item.Selected)
                    {
                        fa.Associate(ext);
                    }
                    else
                    {
                        fa.UnAssociate(ext);
                    }
                }

                fa.NotifyShell();
            }
        }