internal bool OnOk()
        {
            ModelProperty contentProperty = this.ModelItem.Properties["Content"];

            if (this.editingMode == EditingMode.Parameter)
            {
                contentProperty.SetValue(new TParameter());
                DynamicArgumentDesigner.WrapperCollectionToModelItem(this.DynamicArguments,
                                                                     contentProperty.Value.Properties["Parameters"].Value,
                                                                     this.IsDictionary, this.UnderlyingArgumentType);
            }
            else
            {
                if (this.DeclaredMessageType == null && this.MessageExpression == null)
                {
                    contentProperty.SetValue(null);
                }
                else
                {
                    contentProperty.SetValue(new TMessage());
                    contentProperty.Value.Properties["Message"].SetValue(this.MessageExpression);
                    contentProperty.Value.Properties["DeclaredMessageType"].SetValue(this.DeclaredMessageType);
                }
            }

            return(true);
        }
        void InitializeMessageAndParameterData()
        {
            ModelItem        parameterModelItem;
            ModelTreeManager modelTreeManager = (this.ModelItem as IModelTreeItem).ModelTreeManager;

            ModelItem contentModelItem = this.ModelItem.Properties["Content"].Value;

            if (contentModelItem == null)
            {
                this.messageExpression   = modelTreeManager.WrapAsModelItem(new TMessage()).Properties["Message"].Value;
                this.declaredMessageType = null;
                parameterModelItem       = modelTreeManager.WrapAsModelItem(new TParameter()).Properties["Parameters"].Value;
            }
            else
            {
                if (contentModelItem.ItemType == typeof(TMessage))
                {
                    this.editingMode         = EditingMode.Message;
                    this.messageExpression   = contentModelItem.Properties["Message"].Value;
                    this.declaredMessageType = (Type)contentModelItem.Properties["DeclaredMessageType"].ComputedValue;
                    parameterModelItem       = modelTreeManager.WrapAsModelItem(new TParameter()).Properties["Parameters"].Value;
                }
                else
                {
                    this.editingMode         = EditingMode.Parameter;
                    this.messageExpression   = modelTreeManager.WrapAsModelItem(new TMessage()).Properties["Message"].Value;
                    this.declaredMessageType = null;
                    parameterModelItem       = contentModelItem.Properties["Parameters"].Value;
                }
            }

            bool isDictionary;
            Type underlyingArgumentType;

            this.DynamicArguments = DynamicArgumentDesigner.ModelItemToWrapperCollection(
                parameterModelItem,
                out isDictionary,
                out underlyingArgumentType);

            this.IsDictionary           = isDictionary;
            this.UnderlyingArgumentType = underlyingArgumentType;
        }