public void Deserialize(IAfxObjectReader serializer, IServiceProvider services) { this.SourceOperator = new Guid(serializer.ReadObject<string>("SourceOperator")); this.SourceEndpoint = new Guid(serializer.ReadObject<string>("SourceEndpoint")); this.TargetOperator = new Guid(serializer.ReadObject<string>("TargetOperator")); this.TargetEndpoint = new Guid(serializer.ReadObject<string>("TargetEndpoint")); }
public void Deserialize(IAfxObjectReader serializer, IServiceProvider services) { serializer.ReadObject<Collection<AfxComponent>>("Components", components => { foreach(var component in components) { _components.Add(component); } }); serializer.ReadObject<Collection<AfxConnector>>("Connectors", connectors => { foreach(var connector in connectors) { _connectors.Add(connector); } }); }
public void Deserialize(IAfxObjectReader serializer, IServiceProvider services) { this.Title = serializer.ReadObject<string>("Title"); this.Properties = serializer.ReadObject<Dictionary<string, string>>("Properties"); var prototype = serializer.ReadObject<string>("Prototype"); if(!string.IsNullOrEmpty(prototype)) { var componentCatalog = services.GetService(typeof(IAfxComponentCatalog)) as IAfxComponentCatalog; if(componentCatalog != null) { this.Template = componentCatalog.GetComponentTemplate(new Guid(prototype)); this.Instance = CreateInstance(this.Template); } } }