public UcSlot(ModelClasses.Units FilteredUnits, int number, ModelClasses.Unit existingUnit) { InitializeComponent(); PossibleUnits = FilteredUnits; this.number = number; CreatedUnit = existingUnit; IsFilled = true; }
private void LoadExistingUnits() { FileStream fs = null; try { XmlSerializer serializer = new XmlSerializer(typeof(ModelClasses.Units)); fs = new FileStream(unitsFile, FileMode.Open); existingUnits = (ModelClasses.Units)serializer.Deserialize(fs); fs.Close(); } catch (Exception excp) { if (fs != null) { fs.Dispose(); } } }
public UcSlot(ModelClasses.Units FilteredUnits, int number) { InitializeComponent(); PossibleUnits = FilteredUnits; this.number = number; }