internal IList Deserialize(IServiceProvider serviceProvider) { DesignerSerializationManager serializationManager = new LocalDesignerSerializationManager(this, serviceProvider); using (serializationManager.CreateSession()) { ArrayList objects = new ArrayList(); WorkflowMarkupSerializationManager xomlSerializationManager = new WorkflowMarkupSerializationManager(serializationManager); XmlTextReader reader = new XmlTextReader(this.serializedXmlString, XmlNodeType.Element, null) { DtdProcessing = DtdProcessing.Prohibit }; reader.MoveToElement(); do { if (!reader.Read()) { return(objects); } xomlSerializationManager.FoundDefTag += delegate(object sender, WorkflowMarkupElementEventArgs eventArgs) { if (eventArgs.XmlReader.LookupNamespace(eventArgs.XmlReader.Prefix) == StandardXomlKeys.Definitions_XmlNs && xomlSerializationManager.Context.Current is Activity ) { WorkflowMarkupSerializationHelpers.ProcessDefTag(xomlSerializationManager, eventArgs.XmlReader, xomlSerializationManager.Context.Current as Activity, true, string.Empty); } }; WorkflowMarkupSerializer xomlSerializer = new WorkflowMarkupSerializer(); object activityDecl = xomlSerializer.DeserializeObject(xomlSerializationManager, reader); if (activityDecl == null) { throw new InvalidOperationException(DR.GetString(DR.InvalidOperationDeserializationReturnedNonActivity)); } if (activityDecl is Activity) { (activityDecl as Activity).UserData.Remove(UserDataKeys.CustomActivity); } objects.Add(activityDecl); } while (true); } }