コード例 #1
0
    private void TransferSaveVals(SaverClass sv)
    {
        AllCurves = sv.AllCurveData;
        AllFiles = sv.AllFileData;
        BrScale.Value = sv.BrScaleVal;
        PrevCountSpin.Value = sv.PrevCountSpintVal;
        PrevIndexSpin.Value = sv.PrevIndexSpinVal;
        MySettings.Program = sv.Program;
        MySettings.Save();
        BrightnessCalculated = sv.BrightnessCalculated;
        MainPP3 = sv.MainPP3;
        MovePoint = sv.MovePoint;
        PPfileOpened = sv.PPfileOpened;
        Workpath = sv.Workpath;

        //maybe use as a check
        //ProjectInfo.FullVersion = sv.Version;
    }
コード例 #2
0
    private string SaveProject(string tmpdirectorypath)
    {
        string tmpsavepath = System.IO.Path.Combine(tmpdirectorypath, "main");
        BinaryFormatter bin = new BinaryFormatter();

        if (!Directory.Exists(tmpdirectorypath)) { Directory.CreateDirectory(tmpdirectorypath); }

        using (FileStream stream = new FileStream(tmpsavepath, FileMode.Create))
        {
            SaverClass sv = new SaverClass();
            SetSaveVals(sv);
            bin.Serialize(stream, sv);
        }

        return tmpsavepath;
    }
コード例 #3
0
 private void SetSaveVals(SaverClass sv)
 {
     sv.AllCurveData = AllCurves;
     sv.AllFileData = AllFiles;
     sv.BrScaleVal = BrScale.Value;
     sv.PrevCountSpintVal = PrevCountSpin.Value;
     sv.PrevIndexSpinVal = PrevIndexSpin.Value;
     sv.Program = MySettings.Program;
     sv.Version = ProjectInfo.FullVersion;
     sv.BrightnessCalculated = BrightnessCalculated;
     sv.MainPP3 = MainPP3;
     sv.MovePoint = MovePoint;
     sv.PPfileOpened = PPfileOpened;
     sv.Workpath = Workpath;
 }
コード例 #4
0
 private void ReadMainProject(MemoryStream MemStream)
 {
     BinaryFormatter bin = new BinaryFormatter();
     SaverClass sv = new SaverClass();
     sv = (SaverClass)bin.Deserialize(MemStream);
     TransferSaveVals(sv);
 }