예제 #1
0
        public void Fill(Material mat)
        {
            mMaterial = mat;

            OnyxProjectAsset matAsset = mat.LinkedProjectAsset;

            textBoxGuid.Text = matAsset.Guid.ToString();
            textBoxName.Text = matAsset.Name;

            tableLayoutPanelProperties.Controls.Clear();
            tableLayoutPanelProperties.RowCount = mat.Properties.Count + 2;
            tableLayoutPanelProperties.RowStyles.Clear();
            int currentRow = 0;

            foreach (KeyValuePair <string, MaterialProperty> prop in mat.Properties.OrderBy(prop => prop.Value.Order))
            {
                MaterialPropertyControl propControl = new MaterialPropertyControl();
                propControl.Fill(prop.Key, prop.Value);
                propControl.Dock = DockStyle.Fill;
                propControl.OnPropertyChanged += OnPropertyChangedListener;
                tableLayoutPanelProperties.Controls.Add(propControl, 0, currentRow);
                tableLayoutPanelProperties.RowStyles.Add(new RowStyle(SizeType.Absolute, propControl.Size.Height));
                currentRow++;
            }
        }
        public void Fill(Material mat)
        {
            tableLayoutPanelProperties.Controls.Clear();

            tableLayoutPanelProperties.RowCount = mat.Properties.Count;
            tableLayoutPanelProperties.RowStyles.Clear();
            int currentRow = 0;

            foreach (KeyValuePair <string, MaterialProperty> prop in mat.Properties)
            {
                MaterialPropertyControl propControl = new MaterialPropertyControl();
                propControl.Fill(prop.Key, prop.Value);
                propControl.Dock = DockStyle.Fill;
                propControl.OnPropertyChanged += OnPropertyChangedListener;
                tableLayoutPanelProperties.Controls.Add(propControl, 0, currentRow);
                tableLayoutPanelProperties.RowStyles.Add(new RowStyle(SizeType.Absolute, propControl.Size.Height));
                currentRow++;
            }
        }