protected override void SetPropertyBagValue(object sender, PropertySpecEventArgs e) { base.SetPropertyBagValue(sender, e); switch (e.Property.Name) { case "Operation": this.operatorType = (BasicMathOperator)e.Value; break; case "OutputType": this.outputType = (AutomataDataType)e.Value; break; } }
/// <summary> /// Deserialization constructor /// </summary> /// <param name="info"></param> /// <param name="context"></param> protected Operator(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.operand1Connector = info.GetValue("operand1Connector", typeof(Connector)) as Connector; this.operand1Connector.BelongsTo = this; this.Connectors.Add(operand1Connector); this.operand2Connector = info.GetValue("operand2Connector", typeof(Connector)) as Connector; this.operand2Connector.BelongsTo = this; this.Connectors.Add(operand2Connector); this.OperatorType = (BasicMathOperator)info.GetValue("operatorType", typeof(BasicMathOperator)); this.outputType = (AutomataDataType)info.GetValue("outputType", typeof(AutomataDataType)); }
/// <summary> /// Deserialization constructor /// </summary> /// <param name="info"></param> /// <param name="context"></param> protected RandomGenerator(SerializationInfo info, StreamingContext context) : base(info, context) { outConnector = (Connector)info.GetValue("outConnector", typeof(Connector)); outConnector.BelongsTo = this; Connectors.Add(outConnector); outDataType = (AutomataDataType)info.GetValue("outDataType", typeof(AutomataDataType)); positive = info.GetBoolean("positive"); amplitude = info.GetInt32("amplitude"); grayScale = info.GetBoolean("grayScale"); arraySize = info.GetInt32("arraySize"); once = info.GetBoolean("once"); }
/// <summary> /// Sets the values of the propertygrid properties /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected override void SetPropertyBagValue(object sender, PropertySpecEventArgs e) { base.SetPropertyBagValue(sender, e); switch (e.Property.Name) { case "Amplitude": this.amplitude = (int)e.Value; break; case "DataType": this.outDataType = (AutomataDataType)e.Value; break; case "Positive": this.positive = (bool)e.Value; break; case "GrayScale": this.grayScale = (bool)e.Value; break; case "ArraySize": this.arraySize = (int)e.Value; break; } }