コード例 #1
0
        /// <summary>
        /// Sets the specified array as the items of the collection.
        /// </summary>
        /// <param name="editValue">The collection to edit.</param>
        /// <param name="value">An array of objects to set as the collection items.</param>
        /// <returns>The newly created collection object or, otherwise, the collection indicated by the editValue parameter.</returns>
        protected override object SetItems(object editValue, object[] value)
        {
            CommandBarEntryCollection commandBarEntryCollection = (CommandBarEntryCollection)editValue;

            commandBarEntryCollection.Clear();
            foreach (CommandBarEntry commandBarEntry in value)
            {
                commandBarEntryCollection.Add(commandBarEntry);
            }
            return(commandBarEntryCollection);
        }