private GraphicsObject drawText(int x, int y, string text, Pen pen)
 {
     gObject = new GraphicsObject("text");
     gObject.x1 = x; gObject.y1 = y; gObject.text = text;
     if (gObject.Create())
     {
         g.DrawPath(pen, gObject.gPath);
         return gObject;
     }
     else
     {
         MessageBox.Show("Не указан текст!");
         typeEdit = null;
         return null;
     }
 }
 private GraphicsObject drawLineAndText(int x1, int y1, int x2, int y2, string text, Pen pen)
 {
     gObject = new GraphicsObject("lineAndText");
     gObject.x1 = x1; gObject.y1 = y1; gObject.x2 = x2; gObject.y2 = y2; gObject.text = text;
     if (gObject.Create())
     {
         g.DrawPath(pen, gObject.gPath);
         return gObject;
     }
     else
     {
         MessageBox.Show("Не указан текст!");
         typeEdit = null;
         return null;
     }
 }
 private GraphicsObject drawRetangle(int x, int y, Pen pen)
 {
     gObject = new GraphicsObject("retangle", x, y, (int)retLength.Value, (int)retHeight.Value);
     if (gObject.Create())
     {
        // Debug1.setInfo(gObject.zoneX1, gObject.zoneX11, gObject.zoneY1, gObject.zoneY11);
         g.DrawPath(pen, gObject.gPath);
         return gObject;
     }
     else return null;
 }
        // загрузчик моделей
        private string binaryLoad(string fileName)
        {
            FileStream myStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
            BinaryReader BR = new BinaryReader(myStream);
            GraphicsObject sgo;
            listGObject.Clear();
            string typeModel = BR.ReadString(); // читает тип модели
            label2.Text = BR.ReadString();
            label3.Text = BR.ReadString();
            label4.Text = BR.ReadString();
            while(BR.PeekChar() != - 1)
            {
                sgo = new GraphicsObject();
                sgo.type = BR.ReadString();
                sgo.text = BR.ReadString();
                sgo.x1 = BR.ReadInt32();
                sgo.x2 = BR.ReadInt32();
                sgo.y1 = BR.ReadInt32();
                sgo.y2 = BR.ReadInt32();
                sgo.Create();
                listGObject.Add(sgo);

            }

            BR.Close();
            myStream.Close();
            g.Clear(foneColor);
            drawCollection(listGObject, blackPen);
              //  MessageBox.Show(typeModel);
            return typeModel;
        }
 private GraphicsObject drawLine(int x1, int y1, int x2, int y2, Pen pen)
 {
     gObject = new GraphicsObject("line", x1 ,y1, x2, y2);
        // gObject.x1 = x1; gObject.x2 = x2; gObject.y1 = y1; gObject.y2 = y2;
     if (gObject.Create())
     {
         g.DrawPath(pen, gObject.gPath);
         return gObject;
     }
     else return null;
 }