public object this[int subval] { get { HudControl control = ((HudList)this.a.a).get_Item(this.b).get_Item(this.c); if (subval == 0) { if (control.GetType() == typeof(HudStaticText)) { return(((HudStaticText)control).get_Text()); } if (control.GetType() == typeof(HudCheckBox)) { return(((HudCheckBox)control).get_Checked()); } } else if ((subval == 1) && (control.GetType() == typeof(HudPictureBox))) { return(((HudPictureBox)control).get_Image().get_PortalImageID()); } return(null); } set { HudControl control = ((HudList)this.a.a).get_Item(this.b).get_Item(this.c); if (subval == 0) { if (control.GetType() == typeof(HudStaticText)) { ((HudStaticText)control).set_Text((string)value); } if (control.GetType() == typeof(HudCheckBox)) { ((HudCheckBox)control).set_Checked((bool)value); } } else if ((subval == 1) && (control.GetType() == typeof(HudPictureBox))) { int num = (int)value; if (num == 0) { ((HudPictureBox)control).set_Image(null); } else { ((HudPictureBox)control).set_Image((ACImage)num); } } } }
public IControl this[string id] { get { if (this.b.ContainsKey(id)) { return(this.b[id]); } Control item = null; HudControl control2 = this.a.get_Item(id); if (control2.GetType() == typeof(HudButton)) { item = new Button(); } if (control2.GetType() == typeof(HudCheckBox)) { item = new CheckBox(); } if (control2.GetType() == typeof(HudTextBox)) { item = new TextBox(); } if (control2.GetType() == typeof(HudCombo)) { item = new Combo(); } if (control2.GetType() == typeof(HudHSlider)) { item = new Slider(); } if (control2.GetType() == typeof(HudList)) { item = new List(); } if (control2.GetType() == typeof(HudStaticText)) { item = new StaticText(); } if (control2.GetType() == typeof(HudTabView)) { item = new Notebook(); } if (control2.GetType() == typeof(HudProgressBar)) { item = new ProgressBar(); } if (control2.GetType() == typeof(HudImageButton)) { item = new ImageButton(); } if (item == null) { return(null); } item.a = control2; item.b = id; item.Initialize(); this.d.Add(item); this.b[id] = item; return(item); } }