コード例 #1
0
        public WebPageExportForm()
        {
            InitializeComponent();

            int selectedIndex = 0;
            int index = 0;
            string scanFolder = Project.GetWebPageTemplatesFolderBase();
            DirectoryInfo dir = new DirectoryInfo(scanFolder);
            foreach(DirectoryInfo subdir in dir.GetDirectories())
            {
                if(!subdir.Name.StartsWith("_"))
                {
                    templateNames.Add(subdir.Name);
                    if(Project.webPageTemplate.Equals(subdir.Name))
                    {
                        selectedIndex = index;
                    }
                }
                index++;
            }
            templateComboBox.DataSource = templateNames;
            templateComboBox.SelectedIndex = selectedIndex;

            string filename = Path.Combine(Project.GetWebPageTemplatesFolderBase(), @"_common\Dictionary.xml");

            commonDictionaryEditorControl = new DictionaryEditorControl(filename);

            this.commonDictionaryPanel.Controls.AddRange(new System.Windows.Forms.Control[] { this.commonDictionaryEditorControl});
            //
            // commonDictionaryEditorControl
            //
            this.commonDictionaryEditorControl.Dock = System.Windows.Forms.DockStyle.Fill;
            this.commonDictionaryEditorControl.Name = "commonDictionaryEditorControl";
            this.commonDictionaryEditorControl.TabIndex = 1;

            if(Project.photoGalleryPictureSize >= Project.photoGalleryPictureSizes.Length)
            {
                Project.photoGalleryPictureSize = 2;
            }
            pictureSizeComboBox.SelectedIndex = Project.photoGalleryPictureSize;

            this.webStorageTextBox.Text = Project.webPagePhotoStorageUrlBase;

            if(Project.webPageLinksUsePopup)
            {
                this.linksAsPopupsRadioButton.Checked = true;
            }
            else
            {
                this.linksAsSamePageRadioButton.Checked = true;
            }

            this.linksAsSamePageRadioButton.CheckedChanged += new System.EventHandler(this.linksRadioButton_CheckedChanged);
            this.linksAsPopupsRadioButton.CheckedChanged += new System.EventHandler(this.linksRadioButton_CheckedChanged);

            setTemplateDictionaryControl();

            Project.setDlgIcon(this);
        }
コード例 #2
0
        private void setTemplateDictionaryControl()
        {
            if(templateDictionaryEditorControl != null)
            {
                templateDictionaryEditorControl.lastChanceToSave(false);
                this.templateDictionaryPanel.Controls.Clear();
                templateDictionaryEditorControl.Dispose();
            }

            string filename = Path.Combine(Project.GetWebPageTemplatesFolderBase(), templateComboBox.Text + @"\Dictionary.xml");

            templateDictionaryEditorControl = new DictionaryEditorControl(filename);

            this.templateDictionaryPanel.Controls.AddRange(new System.Windows.Forms.Control[] { this.templateDictionaryEditorControl});
            //
            // templateDictionaryEditorControl
            //
            this.templateDictionaryEditorControl.Dock = System.Windows.Forms.DockStyle.Fill;
            this.templateDictionaryEditorControl.Name = "templateDictionaryEditorControl";
            this.templateDictionaryEditorControl.TabIndex = 1;
        }