/// <summary> /// Constructor. Add new limitation /// </summary> /// <param name="x1">limit variable X1</param> /// <param name="x2">limit variable X2</param> /// <param name="x1x2">limit variable X1/X2</param> public DataFormat(String x1, String x2, String x1x2) { varLimitations = new BlackBoxVarLimitation(); varLimitations.x1 = Convert.ToString(x1); varLimitations.x2 = Convert.ToString(x2); varLimitations.x1x2 = Convert.ToString(x1x2); varLimitations.blackBoxes = new List<BlackBoxParam>(); }
/// <summary> /// F*****g constructor /// </summary> public DataFormat() { varLimitations = new BlackBoxVarLimitation(); bbParams = new List<IBlackBox>(); }
/// <summary> /// F*****g constructor /// </summary> public DataFormat(String fileName) { varLimitations = new BlackBoxVarLimitation(); bbParams = new List<IBlackBox>(); this.fileName = fileName; OpenFile(fileName); }
/// <summary> /// Opening file, reading, and deserializationing it. Then transfering data in collection. /// </summary> /// <param name="filename">json file name</param> public void OpenFile(String filename) { String jsondata = OutFile(filename); System.Type typeofthis = this.GetType(); DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(BlackBoxVarLimitation)); byte[] byteArray = Encoding.ASCII.GetBytes(jsondata); MemoryStream stream = new MemoryStream(byteArray); varLimitations = (BlackBoxVarLimitation)ser.ReadObject(stream); }
/// <summary> /// F*****g constructor /// </summary> public DataFormat() { varLimitations = new BlackBoxVarLimitation(); bbParams = new List <IBlackBox>(); }