Ejemplo n.º 1
0
        public FormUpdateIntermediateStructure(CSSLTemplate template, IntermediateStructure target)
        {
            InitializeComponent();

            this.template     = template;
            this.clonedTarget = target.Clone() as IntermediateStructure;
        }
Ejemplo n.º 2
0
 private void cmbType_SelectedIndexChanged(object sender, EventArgs e)
 {
     IntermediateStructure structure = this.cmbType.SelectedItem as IntermediateStructure;
     if (structure != null)
     {
         this.txtValue.Text = structure.DefaultValue;
     }
 }
Ejemplo n.º 3
0
        public object Clone()
        {
            IntermediateStructure result = new IntermediateStructure();

            result.Name      = this.Name;
            result.FieldList = this.FieldList.Clone() as StructureFieldList;

            return(result);
        }
Ejemplo n.º 4
0
 private void RemoveFieldStructure_Click(object sender, EventArgs e)
 {
     if (this.lstStructure.SelectedIndex >= 0)
     {
         IntermediateStructure field = this.lstStructure.SelectedItem as IntermediateStructure;
         this.currentFile.StrutureList.Remove(field);
         this.lstStructure.Items.Remove(field);
     }
 }
Ejemplo n.º 5
0
        private void addIntermediateStructure_Click(object sender, EventArgs e)
        {
            var dlg = new FormInsertIntermediateStructure(this.currentFile);

            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                IntermediateStructure field = dlg.Result;
                this.lstStructure.Items.Add(field);
                this.currentFile.StrutureList.Add(field);
            }
        }
Ejemplo n.º 6
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            this.clonedTarget.Name = this.txtName.Text;
            foreach (var item in this.lstField.Items)
            {
                this.clonedTarget.FieldList.Add(item as StructureField);
            }

            this.Result = this.clonedTarget;

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
Ejemplo n.º 7
0
        public static IntermediateStructure Parse(XElement element)
        {
            if (element.Name != typeof(IntermediateStructure).Name)
            {
                throw new NotImplementedException();
            }

            IntermediateStructure result = new IntermediateStructure();

            result.Name      = element.Attribute(strName).Value;
            result.FieldList = StructureFieldList.Parse(element.Element(typeof(StructureFieldList).Name));

            return(result);
        }
        private void btnOK_Click(object sender, EventArgs e)
        {
            var result = new IntermediateStructure()
            {
                Name = this.txtName.Text,
            };

            foreach (var item in this.lstField.Items)
            {
                result.FieldList.Add(item as StructureField);
            }
            this.Result = result;

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
Ejemplo n.º 9
0
 private void Map2Template(CSSLTemplate cSSLTemplate)
 {
     this.currentFile.ShaderName  = this.txtShaderName.Text;
     this.currentFile.ProgramType = (ShaderProgramType)(this.cmbShaderProgramType.SelectedItem);
     {
         this.currentFile.VertexShaderFieldList.Clear();
         foreach (var item in this.lstVertexShaderField.Items)
         {
             ShaderField shaderField = item as ShaderField;
             this.currentFile.VertexShaderFieldList.Add(shaderField);
         }
     }
     {
         this.currentFile.GeometryShaderFieldList.Clear();
         foreach (var item in this.lstGeometryShaderField.Items)
         {
             ShaderField shaderField = item as ShaderField;
             this.currentFile.GeometryShaderFieldList.Add(shaderField);
         }
     }
     {
         this.currentFile.FragmentShaderFieldList.Clear();
         foreach (var item in this.lstFragmentShaderField.Items)
         {
             ShaderField shaderField = item as ShaderField;
             this.currentFile.FragmentShaderFieldList.Add(shaderField);
         }
     }
     {
         this.currentFile.StrutureList.Clear();
         foreach (var item in this.lstStructure.Items)
         {
             IntermediateStructure structure = item as IntermediateStructure;
             this.currentFile.StrutureList.Add(structure);
         }
     }
 }