Esempio n. 1
0
        private string GenerateComponentIndexPages(string lang)
        {
            var components        = DocPages.FindAll(x => x is ComponentDocumentationPage).Select(x => (ComponentDocumentationPage)x);
            var componentListCode = GenerateComponentTreeCode(components, lang);

            return(componentListCode);
        }
Esempio n. 2
0
        private void GetComponents(string lang)
        {
            var componentDocumentationPages = DocPages.FindAll(x => x is ComponentDocumentationPage).Select(x => (ComponentDocumentationPage)x);

            var query = from pages in componentDocumentationPages
                        orderby pages.Name
                        select pages;

            try
            {
                foreach (var page in query)
                {
                    var linkedLang = page.Localizations.ContainsKey(lang) ? lang : "en";
                    var pp         = (LocalizedComponentDocumentationPage)page.Localizations[linkedLang];
                    var pinfo      = pp.PluginType.GetPluginInfoAttribute();
                    FunctionListAttribute[] flas = (FunctionListAttribute[])pp.PluginType.GetCustomAttributes(typeof(FunctionListAttribute), false);

                    switch (page.Category)
                    {
                    case ComponentCategory.Undefined:
                        itemlist.Add(pp.Name, ItemType.Tutorial, Properties.Resources.FL_Tutorial + "\\ " + pp.Name);
                        foreach (var fla in flas)
                        {
                            fla.PluginType = pinfo.PluginType;
                            itemlist.Add(fla.Function, ItemType.Tutorial, Properties.Resources.FL_Tutorial + "\\ " + pp.Name + "\\ " + fla.Path);
                        }
                        break;

                    default:
                        string catpath = GetComponentCategory(page.Category) + "\\ " + pp.Name;
                        itemlist.Add(pp.Name, ItemType.Component, catpath);
                        foreach (var fla in flas)
                        {
                            fla.PluginType = pinfo.PluginType;
                            string path = (fla.Path != "") ? fla.Path : catpath;
                            itemlist.Add(fla.Function, ItemType.Component, path);
                        }
                        break;
                    }

                    foreach (var tmpl in pp.Templates.Templates)
                    {
                        var p = tmpl.CurrentLocalization.CategoryPath() + "\\ " + tmpl.CurrentLocalization.Name;
                        itemlist.Add(pp.Name, ItemType.Template, p);
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Esempio n. 3
0
        private void GenerateEditorIndexPages()
        {
            foreach (var lang in AvailableLanguages)
            {
                var cultureInfo = new CultureInfo(lang);
                Thread.CurrentThread.CurrentCulture   = cultureInfo;
                Thread.CurrentThread.CurrentUICulture = cultureInfo;

                var indexHtml = TagReplacer.ReplaceLanguageSwitchs(Properties.Resources.TemplateEditorIndex, lang);
                indexHtml = TagReplacer.ReplaceInstallVersionSwitchs(indexHtml, AssemblyHelper.InstallationType);
                var languageSelectionCode = GenerateIndexLanguageSelectionCode(AvailableLanguages, lang);
                indexHtml = TagReplacer.ReplaceLanguageSelectionTag(indexHtml, languageSelectionCode);
                var editorListCode = GenerateEditorListCode(DocPages.FindAll(x => x is EditorDocumentationPage).Select(x => (EditorDocumentationPage)x), lang);
                indexHtml = TagReplacer.ReplaceEditorList(indexHtml, editorListCode);

                var filename = OnlineHelp.GetEditorIndexFilename(lang);
                StoreIndexPage(indexHtml, filename);
            }
        }
Esempio n. 4
0
        private void GenerateCommonIndexPages()
        {
            foreach (var lang in AvailableLanguages)
            {
                var cultureInfo = new CultureInfo(lang);
                Thread.CurrentThread.CurrentCulture   = cultureInfo;
                Thread.CurrentThread.CurrentUICulture = cultureInfo;

                var commonHtml            = TagReplacer.ReplaceLanguageSwitchs(Properties.Resources.TemplateCommonIndex, lang);
                var languageSelectionCode = GenerateTemplatesPageLanguageSelectionCode(AvailableLanguages, lang);
                commonHtml = TagReplacer.ReplaceLanguageSelectionTag(commonHtml, languageSelectionCode);
                var commonListCode = GenerateCommonListCode(DocPages.FindAll(x => x is CommonDocumentationPage).Select(x => (CommonDocumentationPage)x), lang);
                commonHtml = TagReplacer.ReplaceCommonList(commonHtml, commonListCode);
                //var templatesListCode = GenerateTemplatesTree(lang);
                //templatesHtml = TagReplacer.ReplaceTemplatesList(templatesHtml, templatesListCode);

                var filename = OnlineHelp.GetCommonIndexFilename(lang);
                StoreIndexPage(commonHtml, filename);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Освободить все используемые ресурсы.
        /// </summary>
        /// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (this.PagePreview != null)
                {
                    this.PagePreview.SelectedIndexChanged -= PagePreviewSelectedIndexChanged;
                    this.PagePreview.Items.Clear();
                    if (InvokeRequired)
                    {
                        Invoke((MethodInvoker)(PagePreview.Dispose));
                    }
                    else
                    {
                        PagePreview.Dispose();
                    }
                    this.PagePreview = null;
                }

                if (PagePreviewImages != null)
                {
                    PagePreviewImages.Images.Clear();
                    if (InvokeRequired)
                    {
                        Invoke((MethodInvoker)(PagePreviewImages.Dispose));
                    }
                    else
                    {
                        PagePreviewImages.Dispose();
                    }
                    PagePreviewImages = null;
                }

                if (this.PageView != null)
                {
                    Subscribe_PageView_ClientSizeChanged(false);
                    if (InvokeRequired)
                    {
                        Invoke((MethodInvoker)(PageView.Dispose));
                    }
                    else
                    {
                        PageView.Dispose();
                    }
                    this.PageView = null;
                }

                if (DocPages != null)
                {
                    DocPages.Clear();
                }
            }

            System.GC.Collect();

            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }