예제 #1
0
        /// <summary>
        /// Construction for Form
        /// </summary>
        public BackgroundPropertiesForm(PresenterModel model)
        {
            this.m_Model = model;

            this.SuspendLayout();
            this.ClientSize      = new Size(320, 320);
            this.Font            = ViewerStateModel.FormFont;
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox     = false;
            this.Name            = "BackgroundPropertiesForm";
            this.Text            = Strings.BackgroundPropertiesFormTitle;

            //Get the BackgroundTemplate Model
            using (this.m_Model.Workspace.Lock())
            {
                DeckTraversalModel traversal = this.m_Model.Workspace.CurrentDeckTraversal;
                if (traversal != null)
                {
                    using (Synchronizer.Lock(traversal.SyncRoot))
                    {
                        if (this.m_ApplyToCurrentSlideOnly)
                        {
                            SlideModel current = traversal.Current.Slide;
                            if (current != null)
                            {
                                using (Synchronizer.Lock(traversal.Current.Slide.SyncRoot))
                                {
                                    if (traversal.Current.Slide.BackgroundTemplate != null)
                                    {
                                        this.m_Template = traversal.Current.Slide.BackgroundTemplate.Clone();
                                    }
                                }
                            }
                        }
                        else
                        {
                            DeckModel deck = traversal.Deck;
                            using (Synchronizer.Lock(deck.SyncRoot))
                            {
                                if (deck.DeckBackgroundTemplate != null)
                                {
                                    this.m_Template = deck.DeckBackgroundTemplate.Clone();
                                }
                            }
                        }
                    }
                }
            }

            this.m_BkgTemplateSelectionGroup = new BkgTemplateSelectionGroup(this, this.m_Template, new Point(20, 10), new Size(280, 50), 0);
            this.Controls.Add(this.m_BkgTemplateSelectionGroup);

            this.m_BkgTemplatePreviewGroup = new BkgTemplatePreviewGroup(this, new Point(20, 70), new Size(280, 210), 1);
            this.Controls.Add(this.m_BkgTemplatePreviewGroup);

            this.Controls.Add(new PropertiesOKButton(this, this.m_Model, new Point(80, 285), 2));
            this.Controls.Add(new PropertiesCancelButton(this, this.m_Model, this.m_Template, new Point(180, 285), 3));

            this.ResumeLayout();
        }
        /// <summary>
        /// Construction for Form
        /// </summary>
        public BackgroundPropertiesForm(PresenterModel model)
        {
            this.m_Model = model;

            this.SuspendLayout();
            this.ClientSize = new Size(320, 320);
            this.Font = ViewerStateModel.FormFont;
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.Name = "BackgroundPropertiesForm";
            this.Text = Strings.BackgroundPropertiesFormTitle;

            //Get the BackgroundTemplate Model
            using (this.m_Model.Workspace.Lock())
            {
                DeckTraversalModel traversal = this.m_Model.Workspace.CurrentDeckTraversal;
                if (traversal != null)
                {
                    using (Synchronizer.Lock(traversal.SyncRoot))
                    {
                        if (this.m_ApplyToCurrentSlideOnly)
                        {
                            SlideModel current = traversal.Current.Slide;
                            if (current != null)
                            {
                                using (Synchronizer.Lock(traversal.Current.Slide.SyncRoot))
                                {
                                    if (traversal.Current.Slide.BackgroundTemplate != null)
                                    {
                                        this.m_Template = traversal.Current.Slide.BackgroundTemplate.Clone();
                                    }
                                }
                            }
                        }
                        else
                        {
                            DeckModel deck = traversal.Deck;
                            using (Synchronizer.Lock(deck.SyncRoot))
                            {
                                if (deck.DeckBackgroundTemplate != null)
                                    this.m_Template = deck.DeckBackgroundTemplate.Clone();
                            }
                        }
                    }
                }
            }

            this.m_BkgTemplateSelectionGroup = new BkgTemplateSelectionGroup(this, this.m_Template, new Point(20, 10), new Size(280, 50), 0);
            this.Controls.Add(this.m_BkgTemplateSelectionGroup);

            this.m_BkgTemplatePreviewGroup = new BkgTemplatePreviewGroup(this, new Point(20, 70), new Size(280, 210), 1);
            this.Controls.Add(this.m_BkgTemplatePreviewGroup);

            this.Controls.Add(new PropertiesOKButton(this, this.m_Model, new Point(80, 285), 2));
            this.Controls.Add(new PropertiesCancelButton(this, this.m_Model, this.m_Template, new Point(180, 285), 3));

            this.ResumeLayout();
        }