コード例 #1
0
        /// <summary>
        /// Updates Web Part data with what the User has selected in the wp editor
        /// </summary>
        /// <returns></returns>
        public override bool ApplyChanges()
        {
            // sync with the new property changes here
            EnsureChildControls();
            DiscussionDashboard dashBoardToEdit = this.WebPartToEdit as DiscussionDashboard;

            if (discussionSelectionDropDownList.Items.Count > 0)
            {
                dashBoardToEdit.currentBoardWithMetadata = boardsWithMetadata[discussionSelectionDropDownList.SelectedIndex];
            }

            dashBoardToEdit.SaveChanges();
            return(true);
        }
コード例 #2
0
        /// <summary>
        /// Reads Web Part's data and updates wp editor
        /// </summary>
        public override void SyncChanges()
        {
            // sync with the new property changes here
            EnsureChildControls();
            DiscussionDashboard dashBoardToEdit = this.WebPartToEdit as DiscussionDashboard;

            if (dashBoardToEdit.currentBoardWithMetadata != null)
            {
                for (int i = 0; i < boardsWithMetadata.Count(); i++)
                {
                    if (boardsWithMetadata[i].boardID == dashBoardToEdit.currentBoardWithMetadata.boardID)
                    {
                        discussionSelectionDropDownList.SelectedIndex = i;
                    }
                }
            }


            //discussionSelectionDropDownList.SelectedIndex = boardsWithMetadata.IndexOf(dashBoardToEdit.currentBoardWithMetadata);
        }