internal string SerializePagetoXml() { NotifyContributorsWFData data = new NotifyContributorsWFData() { Contributors = string.Join(";", contributors.Select(c => c.LoginName).ToArray()) }; using (MemoryStream stream = new MemoryStream()) { XmlSerializer serializer = new XmlSerializer(typeof(NotifyContributorsWFData)); serializer.Serialize(stream, data); stream.Position = 0; byte[] bytes = new byte[stream.Length]; stream.Read(bytes, 0, bytes.Length); return Encoding.UTF8.GetString(bytes); } }
private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e) { using (StringReader stringReader = new StringReader(workflowProperties.InitiationData)) { using (XmlReader reader = XmlReader.Create(stringReader)) { XmlSerializer serializer = new XmlSerializer(typeof(NotifyContributorsWFData)); WorkflowData = (NotifyContributorsWFData)serializer.Deserialize(reader); } } SetAgendaTitle(); notifyAgendaOwner.Action = "Complete"; notifyAgendaOwner.Source = "Paperless Board"; notifyAgendaOwner.TaskTitle = string.Format("Edit documents for '{0}', and then start the Initial Review Workflow.", AgendaTitle); notifyAgendaOwner.TaskDescription = string.Format("The Content Contributor workflow has been completed for Agenda {0}. The owner/sponsor of this agenda item now needs to start the Review Agenda workflow for this agenda.", AgendaTitle); notifyAgendaOwner.TaskDueDate = DateTime.Today.AddDays(1); SPUser originator = GetSPUser(this.workflowProperties.Item, "Sponsor"); notifyAgendaOwner.TaskAssignedTo = originator.LoginName; }