示例#1
0
 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"));
 }
示例#2
0
        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);
                }
            });
        }
示例#3
0
        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);
                }
            }
        }