Beispiel #1
0
        public override string GetResourceAbsolutePath(string picId)
        {
            SdsiteXmlDocument      sdDoc   = Service.Sdsite.CurrentDocument;
            AnyXmlElement          anyEle  = sdDoc.GetElementById(picId);
            FileSimpleExXmlElement fileEle = anyEle as FileSimpleExXmlElement;

            return(fileEle.AbsoluteFilePath);
        }
Beispiel #2
0
        private void openDocumentBtn_Click(object sender, EventArgs e)
        {
            string resourceId = SiteResourceService.SelectResource(MediaFileType.Pic, this);

            if (!string.IsNullOrEmpty(resourceId))
            {
                SdsiteXmlDocument      doc     = Service.Sdsite.CurrentDocument;
                FileSimpleExXmlElement fileEle = doc.GetElementById(resourceId) as FileSimpleExXmlElement;
                picLinkPathTextBox.Text = fileEle.RelativeFilePath;
            }
        }
Beispiel #3
0
        public void SetFormedioPathChange(MediaFileType mediaType)
        {
            string resourceId = SiteResourceService.SelectResource(mediaType, this);

            if (resourceId != null)
            {
                SdsiteXmlDocument      doc     = Service.Sdsite.CurrentDocument;
                FileSimpleExXmlElement fileEle = doc.GetElementById(resourceId) as FileSimpleExXmlElement;
                pathTextBox.Text = fileEle.AbsoluteFilePath;
                try
                {
                    flashInfo = new FlashInfo(fileEle.AbsoluteFilePath);
                }
                catch
                { }
                if (flashInfo != null)
                {
                    widthNumUpDown.Value  = flashInfo.Width;
                    heightNumUpDown.Value = flashInfo.Height;
                    ratio = widthNumUpDown.Value / heightNumUpDown.Value;
                    limitScaleCheckBox.Visible = true;
                    limitScaleCheckBox.Enabled = true;
                }
                else
                {
                    widthNumUpDown.Value       = 100;
                    heightNumUpDown.Value      = 100;
                    limitScaleCheckBox.Visible = false;
                }
                widthUintComboBox.SelectedIndex = heightUintComboBox.SelectedIndex = 0;

                //设置窗体的一些默认值
                this.widthCheckBox.Checked    = true;
                this.heightCheckBox.Checked   = true;
                this.loopCheckBox.Checked     = true;
                this.autoPlayCheckBox.Checked = true;

                this.MediaID = resourceId;
            }
        }
Beispiel #4
0
        private void picPathBtn_Click(object sender, EventArgs e)
        {
            string resourceId = SiteResourceService.SelectResource(MediaFileType.Pic, this);

            if (!string.IsNullOrEmpty(resourceId))
            {
                SdsiteXmlDocument      doc     = Service.Sdsite.CurrentDocument;
                FileSimpleExXmlElement fileEle = doc.GetElementById(resourceId) as FileSimpleExXmlElement;
                picPathTextBox.Text = fileEle.AbsoluteFilePath;
                Size sizeofpic = GetSizeOfPic(picPathTextBox.Text.Trim());
                PicWidthNumericUpDown.Value  = sizeofpic.Width;
                PicHeightNumericUpDown.Value = sizeofpic.Height;
                ratio = Convert.ToDecimal(sizeofpic.Width) / Convert.ToDecimal(sizeofpic.Height);
                widthUnitComBox.SelectedIndex = heightUnitComboBox.SelectedIndex = 0;

                this.widthCheckBox.Checked  = true;
                this.heightCheckBox.Checked = true;
                this.limitCheckBox.Enabled  = true;
                this.limitCheckBox.Checked  = true;

                this.MediaID = resourceId;
            }
        }