aVertex [i] .IsStart == true) suffix += » Raquo ;; (aVertex [i] .IsFinish == true) suffix += « Raquo ;; (aVertex [i] .IsPartOfPath == true)
{
((SolidBrush) dcBrush) .Color=Color.FromArgb (200, 200, 200);
} (aVertex [i] .Selected == true)
{. Width=2;
//малюємо квадратик за який можна тягати вершину
dc.FillRectangle (dcBrush, aVertex [i] .X - dSize, aVertex [i] .Y - dSize, 2 *
dSize, 2 * dSize) ;. DrawRectangle (dcPen, aVertex [i] .X - dSize, aVertex [i] .Y - dSize, 2 *
dSize, 2 * dSize);
//напис на вершінеx=aVertex [i] .X;
int y=aVertex [i] .Y; textSize=TextRenderer.MeasureText (aVertex [i] .Title + suffix,
textFontBold); -=textSize.Width/2; -=textSize.Height/2; textRect=new Rectangle (x, y, textSize.Width, textSize.Height) ;. FillRectangle (dcBrush, textRect) ;. DrawRectangle (dcPen, textRect) ;. DrawText (this.dc, aVertex [i] .Title + suffix, textFontBold,
textRect, Color.Black);
}
{. Width=1;
//малюємо квадратик за який можна тягати вершину
dc.FillRectangle (dcBrush, aVertex [i] .X - dSize, aVertex [i] .Y - dSize, 2 *
dSize, 2 * dSize) ;. DrawRectangle (dcPen, aVertex [i] .X - dSize, aVertex [i] .Y - dSize, 2 *
dSize, 2 * dSize);
//напис на вершінеx=aVertex [i] .X;
int y=aVertex [i] .Y; textSize=TextRenderer.MeasureText (aVertex [i] .Title + suffix,
textFontNormal); -=textSize.Width/2; -=textSize.Height/2; textRect=new Rectangle (x, y, textSize.Width, textSize.Height) ;. FillRectangle (dcBrush, textRect) ;. DrawRectangle (dcPen, textRect) ;. DrawText (this.dc, aVertex [i] .Title + suffix, textFontNormal,
textRect, Color.Black);
}
//оновлюємо картинку т.к. перерісовалі.pb.Refresh ();
ДОДАТОК Б
Властивість, що реалізує ознака видимості графа
new public bool Visible
{
{base.Visible;
}
{. Visible=value;
//наслідувати властивість видимості всім належним графу
вершин
for (int i=0; i lt; this.iVertex.Count; i ++)
{. aVertex [this.iVertex [i]]. Visible=value;
}
}
}
ДОДАТОК В
Властивість, що реалізує ознака видимості вершини
new public bool Visible
{
{base.Visible;
}
{. Visible=value;
//наслідувати властивість видимості суміжним ребрам
for (int i=0; i lt; this.iEdge.Count; i ++)
{. aEdge [this.iEdge [i]]. Visible=value;
}
}
}
ДОДАТОК Г
Властивість базового класу, що реалізує властивість видимості
public bool Visible
{
{this.visible;
}
{. visible=value;
}
}
ДОДАТОК Д
Опції для збереження/завантаження транспортної мережі
private void menuItemСохраніть_Click (object sender, EventArgs e)
{(saveFileDialogTN.ShowDialog () == DialogResult.OK)
{
//екземпляр xmlSer класу XmlSerializer потрібен для серіалізациі
XmlSerializer xmlSer=new
XmlSerializer (typeof (TransportNetworkSerialization));
//ім'я файлу в який буде зберігатися результат серіалізациі
//string fileName=System.Environment.CurrentDirectory + tst.xml raquo ;; fileName=saveFileDialogTN.FileName;
//потік fileStream для створення XML-файлаfileStream=new FileStream (fileName, FileMode.Create); tns=new TransportNetworkSerialization () ;. PreSerialize (tns);