public override bool Read(GH_IO.Serialization.GH_IReader reader) { _mode = (FoldMode)reader.GetInt32("Mode"); _disp = (DisplayValue)reader.GetInt32("Display"); slider = reader.GetBoolean("slider"); noDigits = reader.GetInt32("noDec"); MaxValue = reader.GetDouble("valMax"); MinValue = reader.GetDouble("valMin"); Value = reader.GetDouble("val"); dropdowncontents = new List <List <string> >(); dropdowncontents.Add(dropdownitems); if (_mode == FoldMode.Displacement) { dropdowncontents.Add(dropdowndisplacement); } if (_mode == FoldMode.Stress) { dropdowncontents.Add(dropdownstress); } selections = new List <string>(); selections.Add(dropdowncontents[0][(int)_mode]); selections.Add(dropdowncontents[1][(int)_disp]); first = false; this.CreateAttributes(); return(base.Read(reader)); }
public override bool Read(GH_IO.Serialization.GH_IReader reader) { string roomInstancesListString = reader.GetString("TargetObjectList"); writerTargetObjectsListString = roomInstancesListString.Split('@'); // roomInstancesListString.Remove(roomInstancesListString.Length - 1); (Owner as RoomInstance).RoomName = reader.GetString("RoomName"); //, (Owner as RoomInstance).RoomName); // (Owner as RoomInstance).RoomId = (uint)reader.GetInt32("RoomId");//, (int)(Owner as RoomInstance).RoomId); (Owner as RoomInstance).RoomArea = (int)Math.Floor(reader.GetDouble("RoomArea")); //, (Owner as RoomInstance).RoomArea); RoomInstance.entranceIds = new List <int>(); string temp = ""; try { temp = reader.GetString("EntranceIds"); } catch (Exception e) { } if (temp != null && temp.Length > 0) { string[] tempList = temp.Split('&'); foreach (string s in tempList) { RoomInstance.entranceIds.Add(Int32.Parse(s)); } } Owner.ExpireSolution(true); return(base.Read(reader)); }
public override bool Read(GH_IO.Serialization.GH_IReader reader) { Factor = reader.GetDouble("MultiplierFactor"); _targetIds.Clear(); _targetObjs.Clear(); int targetCount = reader.GetInt32("TargetCount"); for (int i = 0; i < targetCount; i++) { Guid id = Guid.Empty; if (reader.TryGetGuid("TargetID", i, ref id)) { AddTarget(id); } } return(base.Read(reader)); }