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); } }
internal IList Deserialize(IServiceProvider serviceProvider) { IList list2; DesignerSerializationManager manager = new LocalDesignerSerializationManager(this, serviceProvider); using (manager.CreateSession()) { EventHandler <WorkflowMarkupElementEventArgs> handler = null; ArrayList list = new ArrayList(); WorkflowMarkupSerializationManager xomlSerializationManager = new WorkflowMarkupSerializationManager(manager); XmlTextReader reader = new XmlTextReader(this.serializedXmlString, XmlNodeType.Element, null); reader.MoveToElement(); Label_0042: if (!reader.Read()) { list2 = list; } else { if (handler == null) { handler = delegate(object sender, WorkflowMarkupElementEventArgs eventArgs) { if ((eventArgs.XmlReader.LookupNamespace(eventArgs.XmlReader.Prefix) == "http://schemas.microsoft.com/winfx/2006/xaml") && (xomlSerializationManager.Context.Current is Activity)) { WorkflowMarkupSerializationHelpers.ProcessDefTag(xomlSerializationManager, eventArgs.XmlReader, xomlSerializationManager.Context.Current as Activity, true, string.Empty); } }; } xomlSerializationManager.FoundDefTag += handler; object obj2 = new WorkflowMarkupSerializer().DeserializeObject(xomlSerializationManager, reader); if (obj2 == null) { throw new InvalidOperationException(DR.GetString("InvalidOperationDeserializationReturnedNonActivity", new object[0])); } if (obj2 is Activity) { (obj2 as Activity).UserData.Remove(UserDataKeys.CustomActivity); } list.Add(obj2); goto Label_0042; } } return(list2); }