public SerializableCalculator(Calculator Calculator) { if (Calculator is CosXCalculator) { OperationElementsArray = new double[2]; OperationElementsArray[0] = ((CosXCalculator)Calculator).a; OperationElementsArray[1] = ((CosXCalculator)Calculator).b; Type = TypeOfCalculator.COS; } else if (Calculator is SinXCalculator) { OperationElementsArray = new double[2]; OperationElementsArray[0] = ((SinXCalculator)Calculator).a; OperationElementsArray[1] = ((SinXCalculator)Calculator).b; Type = TypeOfCalculator.SIN; } else if (Calculator is NDividedXCalculator) { OperationElementsArray = new double[2]; OperationElementsArray[0] = ((NDividedXCalculator)Calculator).a; OperationElementsArray[1] = ((NDividedXCalculator)Calculator).b; Type = TypeOfCalculator.NDIVEDX; } else if (Calculator is XExpNCalculator) { OperationElementsArray = new double[2]; OperationElementsArray[0] = ((XExpNCalculator)Calculator).a; OperationElementsArray[1] = ((XExpNCalculator)Calculator).b; Type = TypeOfCalculator.XEXPN; } else if (Calculator is NExpXCalculator) { OperationElementsArray = new double[2]; OperationElementsArray[0] = ((NExpXCalculator)Calculator).a; OperationElementsArray[1] = ((NExpXCalculator)Calculator).b; Type = TypeOfCalculator.NEXPX; } else if (Calculator is X1Calculator) { OperationElementsArray = new double[2]; OperationElementsArray[0] = ((X1Calculator)Calculator).a; OperationElementsArray[1] = ((X1Calculator)Calculator).b; Type = TypeOfCalculator.X1; } else if (Calculator is X2Calculator) { OperationElementsArray = new double[3]; OperationElementsArray[0] = ((X2Calculator)Calculator).a; OperationElementsArray[1] = ((X2Calculator)Calculator).b; OperationElementsArray[2] = ((X2Calculator)Calculator).c; Type = TypeOfCalculator.X2; } }
public SerializableCalculator(double[] OperationElementsArray, TypeOfCalculator Type) { this.OperationElementsArray = OperationElementsArray; this.Type = Type; }