Exemple #1
0
        ///	<summary>
        ///	Called by the tool pane to apply property changes to the selected Web Part.
        ///	</summary>
        public override void ApplyChanges()
        {
            try
            {
                EnsureChildControls();
                // apply property values here
                ListMarquee wp = this.ParentToolPane.SelectedWebPart as ListMarquee;

                wp.TitleFieldName   = this.TitleFieldNameTextBox.Text;
                wp.BodyFieldName    = this.BodyFieldNameTextBox.Text;
                wp.MarqueeDelay     = int.Parse(this.MarqueeSpeedTextBox.Text);
                wp.MarqueeAmount    = int.Parse(this.MarqueeStepSizeTextBox.Text);
                wp.MarqueeDirection = (MarqueeDirections)Enum.Parse(typeof(MarqueeDirections), this.MarqueeDirectionListBox.SelectedValue, true);
                wp.LinkTarget       = (LinkTargets)Enum.Parse(typeof(LinkTargets), this.MarqueeLinkTargetListBox.SelectedValue, true);
            }
            catch (Exception ex) { System.Diagnostics.Debug.Write(ex.ToString()); }
        }
Exemple #2
0
        /// <summary>
        /// Loads the values fro mth eweb part.
        /// Use force=true to force replace of view state values.
        /// </summary>
        /// <param name="force">Override values</param>
        void LoadWebPartProperties(bool force)
        {
            this.EnsureChildControls();

            if (force || ViewState["MarqueeToolPartLoaded" + this.Qualifier] == null || (bool)ViewState["MarqueeToolPartLoaded" + this.Qualifier] != true)
            {
                ViewState["MarqueeToolPartLoaded" + this.Qualifier] = true;

                ListMarquee wp = this.ParentToolPane.SelectedWebPart as ListMarquee;

                if (force || this.TitleFieldNameTextBox.Text == string.Empty)
                {
                    this.TitleFieldNameTextBox.Text = wp.TitleFieldName;
                }
                if (force || this.BodyFieldNameTextBox.Text == string.Empty)
                {
                    this.BodyFieldNameTextBox.Text = wp.BodyFieldName;
                }
                if (force || this.MarqueeSpeedTextBox.Text == string.Empty)
                {
                    this.MarqueeSpeedTextBox.Text = wp.MarqueeDelay.ToString();
                }
                if (force || this.MarqueeStepSizeTextBox.Text == string.Empty)
                {
                    this.MarqueeStepSizeTextBox.Text = wp.MarqueeAmount.ToString();
                }
                if (force || this.MarqueeDirectionListBox.Items.Count == 0)
                {
                    LoadMarqueeDirectionListBox(wp.MarqueeDirection);
                }
                if (force || this.MarqueeLinkTargetListBox.Items.Count == 0)
                {
                    LoadMarqueeLinkTargetListBox(wp.LinkTarget);
                }
            }
        }