private void radioButtonCoatingRight_CheckedChanged(object sender, EventArgs e)
 {
     if (radioButtonCoatingRight.Checked)
     {
         SheetDescription.RedrawDescription();
     }
 }
        //private members
        private void SheetDescriptionForm_Load(object sender, EventArgs e)
        {
            dataGridViewMaterials.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            dataGridViewMaterials.MultiSelect   = false;

            ReadMaterialsCsv();

            Settings.Default.SHD_HasCoating = checkBoxDrawCoating.Checked;

            checkBoxDrawCoating.Checked    = true;
            radioButtonCoatingLeft.Checked = true;

            #region Load Layers
            // Load layers
            //Editor Ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
            Database Db = Application.DocumentManager.MdiActiveDocument.Database;

            using (Transaction Tr = Db.TransactionManager.StartTransaction())
            {
                LayerTable       LayerTable = (LayerTable)Tr.GetObject(Db.LayerTableId, OpenMode.ForRead);
                LayerTableRecord LayerRecord;

                comboBoxCoatingLayer.Sorted = true;
                comboBoxCoatingLayer.Items.Add("Current Layer");

                foreach (ObjectId LayerId in LayerTable)
                {
                    LayerRecord = (LayerTableRecord)Tr.GetObject(LayerId, OpenMode.ForWrite);
                    comboBoxCoatingLayer.Items.Add(LayerRecord.Name);
                    if (LayerRecord.Name == Settings.Default.SHD_CoatingLayer)
                    {
                        comboBoxCoatingLayer.SelectedText = LayerRecord.Name;
                    }
                }
                Tr.Commit();
            }
            #endregion

            #region Load Colors

            System.Drawing.Color color = System.Drawing.Color.FromName("ByLayer");

            comboBoxCoatingColor.SortAlphabetically = true;
            comboBoxCoatingColor.Items.Insert(0, color);

            for (int i = 0; i < comboBoxCoatingColor.Items.Count; i++)
            {
                if ((System.Drawing.Color)comboBoxCoatingColor.Items[i] == Settings.Default.SHD_CoatingColor)
                {
                    comboBoxCoatingColor.SelectedIndex = i;
                }
            }

            #endregion

            SheetDescription.RedrawDescription( );
        }
 private void buttonCancel_Click(object sender, EventArgs e)
 {
     SheetDescription.Clear();
 }
 private void checkBoxDrawCoating_CheckedChanged(object sender, EventArgs e)
 {
     SheetDescription.RedrawDescription( );
 }
 private void comboBoxCoatingColor_SelectedIndexChanged(object sender, EventArgs e)
 {
     SheetDescription.RedrawColor();
 }
 private void dataGridViewMaterials_SelectionChanged(object sender, EventArgs e)
 {
     SheetDescription.RedrawDescription( );
 }