protected void OnPollSettingsChange(ClientPipelineArgs args) { if (CurrentPoll != null) { var fieldCollection = new NameValueCollection { { "fields", "Intro|Thank you|__Tracking" }, { "title", string.Format("Change settings for the poll: {0}", CurrentPoll.Name) }, { "icon", CurrentPoll.InnerItem.Appearance.Icon } }; CommandContext commandContext = new CommandContext(CurrentPoll.InnerItem); //start the Field Editor commandContext.Parameters.Add(fieldCollection); var fieldEditor = new PollFieldEditor(); fieldEditor.Execute(commandContext); } }
protected void OnPollOptionSettingsChange(ClientPipelineArgs args) { if (CurrentPoll != null) { int currentOptionIndex; if (!string.IsNullOrEmpty(CurrentOption) && int.TryParse(CurrentOption, out currentOptionIndex)) { var option = CurrentPoll[currentOptionIndex]; var fieldCollection = new NameValueCollection { { "fields", "__Tracking" }, { "title", string.Format("Change tracking setting for the poll option: {0}", option.Title) }, { "icon", option.InnerItem.Appearance.Icon } }; CommandContext commandContext = new CommandContext(option.InnerItem); //start the Field Editor commandContext.Parameters.Add(fieldCollection); var fieldEditor = new PollFieldEditor(); fieldEditor.Execute(commandContext); } } }