//Constructor sets the CalcInfo and sets up the MethodInfo[] Methods public Kalkylator(Calcinfo CCI) { CI = CCI; var DLL = Assembly.LoadFrom("WinCalc.dll"); var TH = DLL.GetType("WinCalc.Räknare"); Methods = TH.GetMethods(); }
//Constructor sets the CalcInfo and sets up the MethodInfo[] Methods public Kalkylator(Calcinfo CCI) { CI = CCI; var DLL = Assembly.LoadFrom("WinCalc.dll"); var TH = DLL.GetType("WinCalc.Räknare"); Methods = TH.GetMethods(); }/// <summary>
//Deserializes "Restore1.bin" and load it into The CalcInfo public void LoadCurrentCalc() { //If the file exist... if (File.Exists("Restore1.bin")) { strömmen = File.Open("Restore1.bin", FileMode.Open, FileAccess.Read); //...and if the streamLength isn't 0 if (!(strömmen.Length == 0)) { //then the stream is deserialzed into CI CI = (Calcinfo)binForm.Deserialize(strömmen); } //Some textbox updates textBoxCalculations.Text = CI.Calculations; textBoxOutput.Text = CI.Output; strömmen.Close(); } }
//Deserializes "Restore1.bin" and load it into The CalcInfo public void LoadCurrentCalc() { //If the file exist... if (File.Exists("Restore1.bin")) { strömmen = File.Open("Restore1.bin", FileMode.Open, FileAccess.Read); //...and if the streamLength isn't 0 if (!(strömmen.Length==0)) { //then the stream is deserialzed into CI CI = (Calcinfo)binForm.Deserialize(strömmen); } //Some textbox updates textBoxCalculations.Text = CI.Calculations; textBoxOutput.Text = CI.Output; strömmen.Close(); } }