Add capability of a network URL for a puzzle

This commit is contained in:
Tim Young 2017-10-25 09:35:38 -05:00
parent 08ad0da346
commit 26404f3c2b
1 changed files with 11 additions and 0 deletions

View File

@ -35,6 +35,7 @@ namespace EduNetworkBuilder
}
public LanguageStrings NetMessage;
public LanguageStrings NetTitle;
public LanguageStrings NetURL;
List<NetworkComponent> NetComponents = new List<NetworkComponent>();
//should have background image
Image TheNetImage = new Bitmap(1024, 1024);
@ -80,11 +81,13 @@ namespace EduNetworkBuilder
PuzzleName = Name;
NetMessage = new LanguageStrings("message"); //Do not translate this string "message" It is an important word
NetTitle = new LanguageStrings("title"); //Do not translate this string "title". It is an important word
NetURL = new LanguageStrings("url"); //Do not translate this string "url". It is an important word
}
public Network() {
NetMessage = new LanguageStrings("message");
NetTitle = new LanguageStrings("title"); //Do not translate this string "title". It is an important word
NetURL = new LanguageStrings("url"); //Do not translate this string "url". It is an important word
} //simple constructor
private bool isDirty()
@ -121,6 +124,7 @@ namespace EduNetworkBuilder
dest.NetTests.Add(NetTest.Clone(NT));
}
dest.NetTitle = source.NetTitle;
dest.NetURL = source.NetURL;
dest.NetworkFilename = source.NetworkFilename;
dest.OptionShowLabels = source.OptionShowLabels;
//dest.PacketColors = source.PacketColors;
@ -297,6 +301,11 @@ namespace EduNetworkBuilder
{
NetTitle.Add(Individual);
}
else
if (Regex.IsMatch(Individual.Name.ToLower(), "url"))
{
NetURL.Add(Individual);
}
break;
}
@ -368,6 +377,8 @@ namespace EduNetworkBuilder
NetMessage.Save(writer);
if(NetTitle != null)
NetTitle.Save(writer);
if (NetURL != null)
NetURL.Save(writer);
writer.WriteElementString("height", myHeight.ToString());
writer.WriteElementString("width", myWidth.ToString());
writer.WriteElementString("itemsize", itemsize.ToString());