internal void PopulatePageFromXml(string associationXml, FormType type) { Workflow1Data workflow1Data = new Workflow1Data(); if (!string.IsNullOrEmpty(associationXml)) { XmlSerializer serializer = new XmlSerializer(typeof(Workflow1Data)); XmlTextReader reader = new XmlTextReader(new System.IO.StringReader(associationXml)); workflow1Data = (Workflow1Data)serializer.Deserialize(reader); } checkBox1.Checked = workflow1Data.FinanceManager; checkBox2.Checked = workflow1Data.TechnologyManager; checkBox3.Checked = workflow1Data.Superviser; }
internal string SerializePagetoXml(FormType type) { Workflow1Data data = new Workflow1Data(); /* ikarstein: Start your modifications here */ data.FinanceManager = checkBox1.Checked; data.TechnologyManager = checkBox1.Checked; data.Superviser = checkBox3.Checked; using (MemoryStream stream = new MemoryStream()) { XmlSerializer serializer = new XmlSerializer(typeof(Workflow1Data)); serializer.Serialize(stream, data); stream.Position = 0; byte[] bytes = new byte[stream.Length]; stream.Read(bytes, 0, bytes.Length); return Encoding.UTF8.GetString(bytes); } }