Example #1
0
        // ReSharper disable once InconsistentNaming
        public void OK()
        {
            //string progFilename = Directory.GetCurrentDirectory() + @"\EpubViwer.exe";
            string progFilename    = Environment.CurrentDirectory + @"\EpubViewer.exe";
            string type            = "epub";
            string typeDescription = "epub电子书";
            string mimeType        = "application/epub+zip";
            string ico             = Environment.CurrentDirectory + @"\rc4net.dll,1";

            if (EpubChecked)
            {
                Assoc.AssocType(progFilename, type, typeDescription, mimeType, ico);
            }
            else
            {
                Assoc.UnAssocType(type);
            }
            type            = "epub3";
            typeDescription = "epub3电子书";
            if (Epub3Checked)
            {
                Assoc.AssocType(progFilename, type, typeDescription, mimeType, ico);
            }
            else
            {
                Assoc.UnAssocType(type);
            }
            Assoc.Refresh();
            Close();
        }
Example #2
0
        internal ConfigViewModel()
        {
            string progFilename = Environment.CurrentDirectory + @"\EpubViewer.exe";

            EpubChecked  = Assoc.IsAssoced(progFilename, "epub");
            Epub3Checked = Assoc.IsAssoced(progFilename, "epub3");
        }