protected override void SetPropertyBagValue(object sender, PropertySpecEventArgs e) { base.SetPropertyBagValue(sender, e); switch (e.Property.Name) { case "InitialState": this.initialState = (AutomataInitialState)e.Value; break; case "RuleNumber": this.ruleNumber = (int)e.Value; break; } }
/// <summary> /// Deserialization constructor /// </summary> /// <param name="info"></param> /// <param name="context"></param> protected WolframAutomaton(SerializationInfo info, StreamingContext context) : base(info, context) { this.outConnector = info.GetValue("outConnector", typeof(Connector)) as Connector; this.outConnector.BelongsTo = this; this.Connectors.Add(outConnector); this.inConnector = info.GetValue("inConnector", typeof(Connector)) as Connector; this.inConnector.BelongsTo = this; this.Connectors.Add(inConnector); this.ruleNumber = info.GetInt32("ruleNumber"); this.arraySize = info.GetInt32("arraySize"); this.initialState = (AutomataInitialState)info.GetValue("initialState", typeof(AutomataInitialState)); }