Ejemplo n.º 1
0
        public IControl this[string id]
        {
            get
            {
                Control ret = null;
                VirindiViewService.Controls.HudControl iret = myView[id];
                if (iret.GetType() == typeof(VirindiViewService.Controls.HudButton))
                {
                    ret = new Button();
                }
                if (iret.GetType() == typeof(VirindiViewService.Controls.HudCheckBox))
                {
                    ret = new CheckBox();
                }
                if (iret.GetType() == typeof(VirindiViewService.Controls.HudTextBox))
                {
                    ret = new TextBox();
                }
                if (iret.GetType() == typeof(VirindiViewService.Controls.HudCombo))
                {
                    ret = new Combo();
                }
                if (iret.GetType() == typeof(VirindiViewService.Controls.HudHSlider))
                {
                    ret = new Slider();
                }
                if (iret.GetType() == typeof(VirindiViewService.Controls.HudList))
                {
                    ret = new List();
                }
                if (iret.GetType() == typeof(VirindiViewService.Controls.HudStaticText))
                {
                    ret = new StaticText();
                }
                if (iret.GetType() == typeof(VirindiViewService.Controls.HudTabView))
                {
                    ret = new Notebook();
                }
                if (iret.GetType() == typeof(VirindiViewService.Controls.HudProgressBar))
                {
                    ret = new ProgressBar();
                }
                if (iret.GetType() == typeof(VirindiViewService.Controls.HudImageButton))
                {
                    ret = new ImageButton();
                }

                if (ret == null)
                {
                    return(null);
                }

                ret.myControl = iret;
                ret.myName    = id;
                ret.Initialize();
                allocatedcontrols.Add(ret);
                return(ret);
            }
        }
Ejemplo n.º 2
0
 public object this[int subval]
 {
     get
     {
         VirindiViewService.Controls.HudControl c = ((VirindiViewService.Controls.HudList)myList.myControl)[myRow][myCol];
         if (subval == 0)
         {
             if (c.GetType() == typeof(VirindiViewService.Controls.HudStaticText))
             {
                 return(((VirindiViewService.Controls.HudStaticText)c).Text);
             }
             if (c.GetType() == typeof(VirindiViewService.Controls.HudCheckBox))
             {
                 return(((VirindiViewService.Controls.HudCheckBox)c).Checked);
             }
         }
         else if (subval == 1)
         {
             if (c.GetType() == typeof(VirindiViewService.Controls.HudPictureBox))
             {
                 return(((VirindiViewService.Controls.HudPictureBox)c).Image.PortalImageID);
             }
         }
         return(null);
     }
     set
     {
         VirindiViewService.Controls.HudControl c = ((VirindiViewService.Controls.HudList)myList.myControl)[myRow][myCol];
         if (subval == 0)
         {
             if (c.GetType() == typeof(VirindiViewService.Controls.HudStaticText))
             {
                 ((VirindiViewService.Controls.HudStaticText)c).Text = (string)value;
             }
             if (c.GetType() == typeof(VirindiViewService.Controls.HudCheckBox))
             {
                 ((VirindiViewService.Controls.HudCheckBox)c).Checked = (bool)value;
             }
         }
         else if (subval == 1)
         {
             if (c.GetType() == typeof(VirindiViewService.Controls.HudPictureBox))
             {
                 ((VirindiViewService.Controls.HudPictureBox)c).Image = (int)value;
             }
         }
     }
 }