Beispiel #1
0
        private void BtnGenerateCode_Click(object sender, RibbonControlEventArgs e)
        {
            Excel.Application app   = Globals.ThisAddIn.Application;
            Excel.Worksheet   sheet = app.ActiveSheet;

            if (sheet.UsedRange.Columns.Count < 2 || sheet.UsedRange.Rows.Count < 2)
            {
                Utils.ShowMessage("시트 데이터가 존재하지 않습니다. 시트 서식화 후 진행하세요.");
            }
            else
            {
                string fieldText, columnText;
                string code = ColumnGenerator.GenerateCode(sheet, out fieldText, out columnText);
                if (!String.IsNullOrEmpty(code))
                {
                    if (this.codeForm == null)
                    {
                        codeForm = new CodeForm();
                    }
                    codeForm.FieldInfo  = fieldText;
                    codeForm.ColumnInfo = columnText;
                    codeForm.SourceCode = code;
                    codeForm.ShowDialog();
                }
            }
        }
Beispiel #2
0
        private void BtnBuildForm_Click(object sender, RibbonControlEventArgs e)
        {
            Excel.Application app   = Globals.ThisAddIn.Application;
            Excel.Worksheet   sheet = app.ActiveSheet;
            String            input = app.InputBox("컬럼 헤더의 세로 개수를 입력하세요", "컬럼 헤더 높이", 1);
            int depth = int.Parse(input);

            ColumnGenerator.BuildForm(sheet, depth);
        }
Beispiel #3
0
 private void BtnApplyColumnWidth_Click(object sender, RibbonControlEventArgs e)
 {
     Excel.Application app   = Globals.ThisAddIn.Application;
     Excel.Worksheet   sheet = app.ActiveSheet;
     ColumnGenerator.ApplyWidth(sheet);
 }