Inheritance: System.Windows.Forms.Form
Exemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var frmSelectType = new FormUniformVariableType();

            if (frmSelectType.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Type   type = frmSelectType.SelectedType;
                object obj  = Activator.CreateInstance(type, frmSelectType.VarNameInShader);
                this.lstMember.Items.Add(obj);
                this.propertyGrid.SelectedObject = obj;
            }
        }
 private void btnAdd_Click(object sender, EventArgs e)
 {
     var frmSelectType = new FormUniformVariableType();
     if (frmSelectType.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         Type type = frmSelectType.SelectedType;
         try
         {
             var obj = Activator.CreateInstance(type, frmSelectType.VarNameInShader) as UniformVariable;
             this.lstMember.Items.Add(obj);
             this.list.Add(obj);
             this.propertyGrid.SelectedObject = obj;
         }
         catch (Exception ex)
         {
             Debug.WriteLine(ex.ToString());
             MessageBox.Show(ex.Message,
                 string.Format("Error when Adding instance of [{0}]!", type.Name));
         }
     }
 }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var frmSelectType = new FormUniformVariableType();

            if (frmSelectType.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Type type = frmSelectType.SelectedType;
                try
                {
                    var obj = Activator.CreateInstance(type, frmSelectType.VarNameInShader) as UniformVariable;
                    this.lstMember.Items.Add(obj);
                    this.list.Add(obj);
                    this.propertyGrid.SelectedObject = obj;
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.ToString());
                    MessageBox.Show(ex.Message,
                                    string.Format("Error when Adding instance of [{0}]!", type.Name));
                }
            }
        }