コード例 #1
0
        public void SerializeCheck()
        {
            if (modelXLDCont != null && modelXLDCont.IsInitialized())
            {
                modelXLDCont.Dispose();
            }
            if (modelXLDContAffine != null && modelXLDContAffine.IsInitialized())
            {
                modelXLDContAffine.Dispose();
            }

            modelXLDCont       = null;
            modelXLDContAffine = null;

            if (hShapeModel != null && !hShapeModel.IsInitialized())
            {
                hShapeModel = null;
            }
            if (modelRegion != null && !modelRegion.IsInitialized())
            {
                modelRegion = null;
            }

            using (Stream objectStream = new MemoryStream())
            {
                System.Runtime.Serialization.IFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
                formatter.Serialize(objectStream, this);
            }
        }
コード例 #2
0
ファイル: ShapeModel.cs プロジェクト: wb2856385025/Simulation
 public void SetModelOrigin(double row, double col)
 {
     if (shapeModel != null && shapeModel.IsInitialized() && ModelRegion != null && ModelRegion.IsInitialized())
     {
         shapeModel.SetShapeModelOrigin(row - ModelRegion.Row, col - ModelRegion.Column);
         ModelImgRow = (float)row;
         ModelImgCol = (float)col;
     }
 }