Example #1
0
        public void Export(string filename)
        {
            switch (Type)
            {
            case ExportType.TO_PDF:
            case ExportType.TO_ODT:
                Utils.PrintDebug("NOT IMPLEMENTED YET", "ExportType not implemented yet");
                break;

            case ExportType.TO_HTML:
                XmlDocument      ToExport = Parser.GetDocument();
                XsltArgumentList List     = new XsltArgumentList();
                List.AddParam("PageName", "", System.IO.Path.GetFileNameWithoutExtension(Parser.OpenedDocumentName));
                List.AddParam("Generated", "", System.DateTime.Today.ToLongDateString());
                List.AddParam("SortBy", "", "Page");
                List.AddParam("imdb_it", "", Preferences.GetPreference("imdb_it").ToString());
                List.AddParam("imdb_univ", "", Preferences.GetPreference("imdb_univ").ToString());
                List.AddParam("google", "", Preferences.GetPreference("google").ToString());
                List.AddParam("google_lang", "", Preferences.GetPreference("google_lang_str"));
                List.AddParam("catalogue_version", "", Utils.GetVersion(false));
                Transformer.Load(Utils.ExportHTMLPath());
                XmlWriter result = new XmlTextWriter(filename, System.Text.Encoding.UTF8);
                Transformer.Transform(ToExport, List, result);
                result.Flush();
                result.Close();
                break;
            }
        }
Example #2
0
        public CataloguePreferences()
        {
            this.Build();
            parser = new CataloguePreferencesParser();

            Response += OnResponse;

            IMDb_it.Active     = (bool)parser.GetPreference("imdb_it");
            IMDb_univ.Active   = (bool)parser.GetPreference("imdb_univ");
            Google.Active      = (bool)parser.GetPreference("google");
            glangbox.Sensitive = (bool)parser.GetPreference("google");

            glangbox.Active = (int)parser.GetPreference("google_lang") > glangbox.Model.IterNChildren() - 1 ?
                              glangbox.Model.IterNChildren() - 1 : (int)parser.GetPreference("google_lang");
        }