Пример #1
0
        // Token: 0x060002E3 RID: 739 RVA: 0x000144D8 File Offset: 0x000126D8
        private void btnNewStyle_Click(object sender, EventArgs e)
        {
            GetKeyItemBook_ScrapStyle(out var keybook);
            var           cstyle = new CStyle();
            StyleEditForm styleEditForm2;
            var           styleEditForm = styleEditForm2 = new StyleEditForm(cstyle, keybook);

            try
            {
                styleEditForm.Text = "新建自动操作";
                var dialogResult = styleEditForm.ShowDialog();
                if (dialogResult == DialogResult.OK)
                {
                    cstyle.MakeStyleID();
                    listStyles.Items.Add(cstyle);
                    RefreshStyleList_Scrap();
                }
            }
            finally
            {
                if (styleEditForm2 != null)
                {
                    ((IDisposable)styleEditForm2).Dispose();
                }
            }
        }
Пример #2
0
        public void ApplyStyles(CStyle style, Point clickpoint)
        {
            if (!this.IsStyleApply)
            {
                if ((style != null && cacheInfo.styleID != style.StyleID) || cacheInfo.stylePoint != clickpoint)
                {
                    cacheInfo.styleID    = style == null ? 0 : style.StyleID;
                    cacheInfo.stylePoint = clickpoint;
                    ApplyCache();
                }

                this.StyleClickPoint = clickpoint;
                this.IsStyleApply    = true;
                this.StyleAppliIndex = 0;
                this.StyleItems      = style == null ? null : style.Items;
                if (this.StyleApplyTimer == null)
                {
                    this.StyleApplyTimer         = new Timer();
                    this.StyleApplyTimer.Enabled = false;
                    this.StyleApplyTimer.Tick   += new EventHandler(this.ApplyStyleItem);
                }
                this.StyleApplyTimer.Interval = 1;
                this.StyleApplyTimer.Start();
            }
        }
Пример #3
0
        void m_comboStyles_SelectedIndexChanged(object sender, EventArgs e)
        {
            CStyle style = (CStyle)m_comboExStyles.SelectedItem;

            if (style != null)
            {
                string strHtml = "<" + style.Balise + ">" + m_htmlEditor.SelectedHTML + "</" + style.Balise + ">";
                m_htmlEditor.InsertHtml(strHtml);
            }
        }
Пример #4
0
        public KeyItemBook GetKeyItemBook()
        {
            KeyItemBook book = new KeyItemBook();

            for (int i = 0; i < this.Styles.Count; i++)
            {
                CStyle style = this.Styles[i];
                book.AddKeyItem(style.KeyItems);
            }
            return(book);
        }
Пример #5
0
        public void WClickStyle(ScrapBase scrap, Point clickpoint)
        {
            int wClickStyleID = this._mainform.optSetuna.Scrap.WClickStyleID;

            if (wClickStyleID != 0)
            {
                CStyle style = this._mainform.optSetuna.FindStyle(wClickStyleID);
                if (style != null)
                {
                    style.Apply(ref scrap, clickpoint);
                }
            }
        }
Пример #6
0
        public void ScrapCreated(object sender, ScrapEventArgs e)
        {
            CStyle style = this.optSetuna.FindStyle(this.optSetuna.Scrap.CreateStyleID);

            if (style != null)
            {
                e.scrap.Initialized = false;
                style.Apply(ref e.scrap);
            }
            else
            {
                e.scrap.Initialized = true;
            }
        }
Пример #7
0
 public StyleEditForm(CStyle trgStyle, KeyItemBook keybook)
 {
     this.InitializeComponent();
     base.ResizeRedraw = true;
     this._trgStyle    = trgStyle;
     this._keybook     = keybook;
     this.cmKey        = Keys.None;
     if (this._trgStyle == null)
     {
         this._trgStyle = new CStyle();
     }
     this.txtStyleName.Text = this._trgStyle.GetName();
     this.RefreshStyleItemList();
     this.RefreshAllStyleItemList();
     this.RefreshKeyItemList();
     this.txtStyleName_TextChanged(this.txtStyleName, new EventArgs());
 }
Пример #8
0
        // Token: 0x060002F0 RID: 752 RVA: 0x00014938 File Offset: 0x00012B38
        private void SetStyleList_Menu(ListBox list)
        {
            var cstyle = new CStyle
            {
                StyleID   = 0,
                StyleName = ""
            };

            list.BeginUpdate();
            list.Items.Clear();
            for (var i = 0; i < listStyles.Items.Count; i++)
            {
                var item = (CStyle)listStyles.Items[i];
                list.Items.Add(item);
            }
            list.EndUpdate();
        }
Пример #9
0
        // Token: 0x060002D9 RID: 729 RVA: 0x00014108 File Offset: 0x00012308
        private void SetStyleList_Scrap(ComboBox combo, int defaultid)
        {
            var cstyle = new CStyle
            {
                StyleID   = 0,
                StyleName = ""
            };

            combo.BeginUpdate();
            combo.Items.Clear();
            combo.Items.Add(cstyle);
            for (var i = 0; i < listStyles.Items.Count; i++)
            {
                var cstyle2 = (CStyle)listStyles.Items[i];
                combo.Items.Add(cstyle2);
                if (cstyle2.StyleID == defaultid)
                {
                    combo.SelectedIndex = i;
                }
            }
            combo.EndUpdate();
        }
Пример #10
0
        private CSheet createSheet_bando(SpreadsheetDocument spreadsheetDoc, CWorkbook workbook, string sheetName, List <CMS_Maps_LayTatCa_Result> data)
        {
            CSheet      sheet      = new CSheet(spreadsheetDoc, sheetName, workbook._sheets);
            List <uint> styleIndex = new List <uint>();
            CStyle      cStyle     = new CStyle();

            cStyle.fontBold            = true;
            cStyle.alignmentHorizontal = HorizontalAlignmentValues.Center;
            cStyle.SetBorderStyle(BorderStyleValues.None, BorderStyleValues.None, BorderStyleValues.None, BorderStyleValues.None);
            cStyle.fontName = "Times New Roman";
            cStyle.fontSize = 12;
            cStyle.CreateStyle();
            styleIndex.Add(cStyle.GetStyleIndex(workbook._workbookPart));

            uint rowIndex = 1;
            uint colindex = 1;

            #region HEADER
            string header     = "BỘ TÀI NGUYÊN VÀ MÔI TRƯỜNG";
            uint   rowHeader  = rowIndex + 1;
            uint   colHeader  = colindex + 1;
            int    textHeader = sheet.InsertSharedStringItem(header, workbook._sharedStringTablePart);
            Cell   cellHeader = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colHeader), rowHeader, 1, textHeader, null);
            cellHeader.StyleIndex = styleIndex[styleIndex.Count - 1];
            ExcelUtils.MergeTwoCells(sheet._worksheetPart.Worksheet, sheetName, ExcelUtils.GetColumnNameByIndex(colHeader) + rowHeader.ToString(), ExcelUtils.GetColumnNameByIndex(colHeader + 1) + (rowHeader).ToString());

            cStyle                     = new CStyle();
            cStyle.fontBold            = true;
            cStyle.alignmentHorizontal = HorizontalAlignmentValues.Center;
            cStyle.SetBorderStyle(BorderStyleValues.None, BorderStyleValues.None, BorderStyleValues.None, BorderStyleValues.None);
            cStyle.fontName = "Times New Roman";
            cStyle.fontSize = 13;
            cStyle.CreateStyle();
            styleIndex.Add(cStyle.GetStyleIndex(workbook._workbookPart));
            header                = "Cục công nghệ thông tin và DLTNMT";
            rowHeader             = rowIndex + 2;
            colHeader             = colindex + 1;
            textHeader            = sheet.InsertSharedStringItem(header, workbook._sharedStringTablePart);
            cellHeader            = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colHeader), rowHeader, 1, textHeader, null);
            cellHeader.StyleIndex = styleIndex[styleIndex.Count - 1];
            ExcelUtils.MergeTwoCells(sheet._worksheetPart.Worksheet, sheetName, ExcelUtils.GetColumnNameByIndex(colHeader) + rowHeader.ToString(), ExcelUtils.GetColumnNameByIndex(colHeader + 1) + (rowHeader).ToString());

            cStyle.fontSize       = 17;
            header                = "Thống kê bản đồ";
            rowHeader             = rowIndex + 4;
            colHeader             = colindex + 1;
            textHeader            = sheet.InsertSharedStringItem(header, workbook._sharedStringTablePart);
            cellHeader            = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colHeader), rowHeader, 1, textHeader, null);
            cellHeader.StyleIndex = styleIndex[styleIndex.Count - 1];
            ExcelUtils.MergeTwoCells(sheet._worksheetPart.Worksheet, sheetName, ExcelUtils.GetColumnNameByIndex(colHeader) + rowHeader.ToString(), ExcelUtils.GetColumnNameByIndex(colHeader + 6) + (rowHeader).ToString());

            //cStyle = new CStyle();
            //cStyle.fontBold = true;
            //cStyle.fontItalic = true;
            //cStyle.alignmentHorizontal = HorizontalAlignmentValues.Center;
            //cStyle.SetBorderStyle(BorderStyleValues.None, BorderStyleValues.None, BorderStyleValues.None, BorderStyleValues.None);
            //cStyle.fontName = "Times New Roman";
            //cStyle.fontSize = 13;
            //cStyle.CreateStyle();
            //styleIndex.Add(cStyle.GetStyleIndex(workbook._workbookPart));
            //header = "(Từ ngày " + listLH[0].ngay + " đến ngày " + listLH[listLH.Count - 1].ngay + ")";
            //rowHeader = rowIndex + 5;
            //colHeader = colindex + 1;
            //textHeader = sheet.InsertSharedStringItem(header, workbook._sharedStringTablePart);
            //cellHeader = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colHeader), rowHeader, 1, textHeader, null);
            //cellHeader.StyleIndex = styleIndex[styleIndex.Count - 1];
            //ExcelUtils.MergeTwoCells(sheet._worksheetPart.Worksheet, sheetName, ExcelUtils.GetColumnNameByIndex(colHeader) + rowHeader.ToString(), ExcelUtils.GetColumnNameByIndex(colHeader + 6) + (rowHeader).ToString());
            #endregion



            #region headerTable
            rowIndex                   = rowIndex + 6;
            cStyle                     = new CStyle();
            cStyle.fontBold            = true;
            cStyle.alignmentHorizontal = HorizontalAlignmentValues.Center;
            cStyle.SetBorderStyle(BorderStyleValues.Thin, BorderStyleValues.Thin, BorderStyleValues.Thin, BorderStyleValues.Thin);
            cStyle.fontName = "Times New Roman";
            cStyle.fontSize = 13;
            cStyle.CreateStyle();
            styleIndex.Add(cStyle.GetStyleIndex(workbook._workbookPart));

            string title           = "STT";
            uint   rowindexHeader  = rowIndex + 1;
            uint   colindexHeader  = colindex + 1;
            int    textIndexHeader = sheet.InsertSharedStringItem(title, workbook._sharedStringTablePart);
            Cell   cellSTT         = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colindexHeader), rowindexHeader, 1, textIndexHeader, null);
            cellSTT.StyleIndex = styleIndex[styleIndex.Count - 1];

            title           = "Tên";
            rowindexHeader  = rowIndex + 1;
            colindexHeader  = colindex + 2;
            textIndexHeader = sheet.InsertSharedStringItem(title, workbook._sharedStringTablePart);
            Cell cellLanhDaoVu = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colindexHeader), rowindexHeader, 1, textIndexHeader, null);
            cellLanhDaoVu.StyleIndex = styleIndex[styleIndex.Count - 1];

            title           = "Loại bản đồ";
            rowindexHeader  = rowIndex + 1;
            colindexHeader  = colindex + 3;
            textIndexHeader = sheet.InsertSharedStringItem(title, workbook._sharedStringTablePart);
            Cell cellChuyenVien = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colindexHeader), rowindexHeader, 1, textIndexHeader, null);
            cellChuyenVien.StyleIndex = styleIndex[styleIndex.Count - 1];

            title           = "Mô tả";
            rowindexHeader  = rowIndex + 1;
            colindexHeader  = colindex + 4;
            textIndexHeader = sheet.InsertSharedStringItem(title, workbook._sharedStringTablePart);
            Cell cellLanhDaoBo = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colindexHeader), rowindexHeader, 1, textIndexHeader, null);
            cellLanhDaoBo.StyleIndex = styleIndex[styleIndex.Count - 1];

            #endregion
            rowIndex++;
            cStyle = new CStyle();
            cStyle.alignmentHorizontal = HorizontalAlignmentValues.Center;
            cStyle.SetBorderStyle(BorderStyleValues.Thin, BorderStyleValues.Thin, BorderStyleValues.Thin, BorderStyleValues.Thin);
            cStyle.fontName = "Times New Roman";
            cStyle.fontBold = false;
            cStyle.fontSize = 13;
            cStyle.CreateStyle();
            styleIndex.Add(cStyle.GetStyleIndex(workbook._workbookPart));

            cStyle = new CStyle();
            cStyle.alignmentHorizontal = HorizontalAlignmentValues.Left;
            cStyle.SetBorderStyle(BorderStyleValues.Thin, BorderStyleValues.Thin, BorderStyleValues.Thin, BorderStyleValues.Thin);
            cStyle.fontName = "Times New Roman";
            cStyle.fontBold = false;
            cStyle.fontSize = 13;
            cStyle.CreateStyle();
            styleIndex.Add(cStyle.GetStyleIndex(workbook._workbookPart));
            uint index = 0;
            foreach (var item in data)
            {
                string titleBody     = (index + 1).ToString();
                uint   rowindexBody  = rowIndex + index + 1;
                uint   colIndexBody  = colindex + 1;
                int    textIndexBody = sheet.InsertSharedStringItem(titleBody, workbook._sharedStringTablePart);
                cellSTT            = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colIndexBody), rowindexBody, 1, textIndexBody, titleBody);
                cellSTT.StyleIndex = styleIndex[styleIndex.Count - 2];
                //ExcelUtils.MergeTwoCells(sheet._worksheetPart.Worksheet, sheetName, ExcelUtils.GetColumnNameByIndex(colIndexBody) + rowindexBody.ToString(), ExcelUtils.GetColumnNameByIndex(colIndexBody) + (rowindexBody + item.data.Count() - 1).ToString());

                titleBody                = item.Name;
                rowindexBody             = rowIndex + index + 1;
                colIndexBody             = colindex + 2;
                textIndexBody            = sheet.InsertSharedStringItem(titleBody, workbook._sharedStringTablePart);
                cellLanhDaoVu            = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colIndexBody), rowindexBody, 1, textIndexBody, titleBody);
                cellLanhDaoVu.StyleIndex = styleIndex[styleIndex.Count - 1];

                titleBody                 = item.LoaiBanDo;
                rowindexBody              = rowIndex + index + 1;
                colIndexBody              = colindex + 3;
                textIndexBody             = sheet.InsertSharedStringItem(titleBody, workbook._sharedStringTablePart);
                cellChuyenVien            = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colIndexBody), rowindexBody, 1, textIndexBody, titleBody);
                cellChuyenVien.StyleIndex = styleIndex[styleIndex.Count - 1];

                titleBody                = item.Description;
                rowindexBody             = rowIndex + index + 1;
                colIndexBody             = colindex + 4;
                textIndexBody            = sheet.InsertSharedStringItem(titleBody, workbook._sharedStringTablePart);
                cellLanhDaoBo            = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colIndexBody), rowindexBody, 1, textIndexBody, titleBody);
                cellLanhDaoBo.StyleIndex = styleIndex[styleIndex.Count - 1];
                index++;
            }
            #region ChinhDoRongChoTungCotSheetThietBi
            //Chỉnh độ rộng cho từng cột
            ExcelUtils.UpdateColumnWidth(sheet._worksheetPart, 1, 5);
            ExcelUtils.UpdateColumnWidth(sheet._worksheetPart, 2, 10); //STT
            ExcelUtils.UpdateColumnWidth(sheet._worksheetPart, 3, 30); //Tiêu đề
            ExcelUtils.UpdateColumnWidth(sheet._worksheetPart, 4, 20); //Thể loại
            ExcelUtils.UpdateColumnWidth(sheet._worksheetPart, 5, 20); //Mô tả
            #endregion
            //Set page setup cho sheet
            //ExcelUtils.PageSetupUpdate(sheet._worksheetPart, OrientationValues.Landscape, 0.590, 0.157, 0.66, 0.49, 0.2, 0.2, true, 0, 1, (UInt32Value)(int)PaperSize.A4, "", "", "", "", "");
            return(sheet);
        }
Пример #11
0
        private CSheet createSheet(SpreadsheetDocument spreadsheetDoc, CWorkbook workbook, string sheetName, List <CMS_Documents_LayTatCa_Result> data)
        {
            CSheet      sheet      = new CSheet(spreadsheetDoc, sheetName, workbook._sheets);
            List <uint> styleIndex = new List <uint>();
            CStyle      cStyle     = new CStyle();

            cStyle.fontBold            = true;
            cStyle.alignmentHorizontal = HorizontalAlignmentValues.Center;
            cStyle.SetBorderStyle(BorderStyleValues.None, BorderStyleValues.None, BorderStyleValues.None, BorderStyleValues.None);
            cStyle.fontName = "Times New Roman";
            cStyle.fontSize = 12;
            cStyle.CreateStyle();
            styleIndex.Add(cStyle.GetStyleIndex(workbook._workbookPart));

            uint rowIndex = 1;
            uint colindex = 1;

            #region HEADER
            string header     = "BỘ TÀI NGUYÊN VÀ MÔI TRƯỜNG";
            uint   rowHeader  = rowIndex + 1;
            uint   colHeader  = colindex + 1;
            int    textHeader = sheet.InsertSharedStringItem(header, workbook._sharedStringTablePart);
            Cell   cellHeader = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colHeader), rowHeader, 1, textHeader, null);
            cellHeader.StyleIndex = styleIndex[styleIndex.Count - 1];
            ExcelUtils.MergeTwoCells(sheet._worksheetPart.Worksheet, sheetName, ExcelUtils.GetColumnNameByIndex(colHeader) + rowHeader.ToString(), ExcelUtils.GetColumnNameByIndex(colHeader + 1) + (rowHeader).ToString());

            cStyle                     = new CStyle();
            cStyle.fontBold            = true;
            cStyle.alignmentHorizontal = HorizontalAlignmentValues.Center;
            cStyle.SetBorderStyle(BorderStyleValues.None, BorderStyleValues.None, BorderStyleValues.None, BorderStyleValues.None);
            cStyle.fontName = "Times New Roman";
            cStyle.fontSize = 13;
            cStyle.CreateStyle();
            styleIndex.Add(cStyle.GetStyleIndex(workbook._workbookPart));
            header                = "Cục công nghệ thông tin và DLTNMT";
            rowHeader             = rowIndex + 2;
            colHeader             = colindex + 1;
            textHeader            = sheet.InsertSharedStringItem(header, workbook._sharedStringTablePart);
            cellHeader            = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colHeader), rowHeader, 1, textHeader, null);
            cellHeader.StyleIndex = styleIndex[styleIndex.Count - 1];
            ExcelUtils.MergeTwoCells(sheet._worksheetPart.Worksheet, sheetName, ExcelUtils.GetColumnNameByIndex(colHeader) + rowHeader.ToString(), ExcelUtils.GetColumnNameByIndex(colHeader + 1) + (rowHeader).ToString());

            cStyle.fontSize       = 17;
            header                = "Thống kê văn bản";
            rowHeader             = rowIndex + 4;
            colHeader             = colindex + 1;
            textHeader            = sheet.InsertSharedStringItem(header, workbook._sharedStringTablePart);
            cellHeader            = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colHeader), rowHeader, 1, textHeader, null);
            cellHeader.StyleIndex = styleIndex[styleIndex.Count - 1];
            ExcelUtils.MergeTwoCells(sheet._worksheetPart.Worksheet, sheetName, ExcelUtils.GetColumnNameByIndex(colHeader) + rowHeader.ToString(), ExcelUtils.GetColumnNameByIndex(colHeader + 6) + (rowHeader).ToString());

            //cStyle = new CStyle();
            //cStyle.fontBold = true;
            //cStyle.fontItalic = true;
            //cStyle.alignmentHorizontal = HorizontalAlignmentValues.Center;
            //cStyle.SetBorderStyle(BorderStyleValues.None, BorderStyleValues.None, BorderStyleValues.None, BorderStyleValues.None);
            //cStyle.fontName = "Times New Roman";
            //cStyle.fontSize = 13;
            //cStyle.CreateStyle();
            //styleIndex.Add(cStyle.GetStyleIndex(workbook._workbookPart));
            //header = "(Từ ngày " + listLH[0].ngay + " đến ngày " + listLH[listLH.Count - 1].ngay + ")";
            //rowHeader = rowIndex + 5;
            //colHeader = colindex + 1;
            //textHeader = sheet.InsertSharedStringItem(header, workbook._sharedStringTablePart);
            //cellHeader = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colHeader), rowHeader, 1, textHeader, null);
            //cellHeader.StyleIndex = styleIndex[styleIndex.Count - 1];
            //ExcelUtils.MergeTwoCells(sheet._worksheetPart.Worksheet, sheetName, ExcelUtils.GetColumnNameByIndex(colHeader) + rowHeader.ToString(), ExcelUtils.GetColumnNameByIndex(colHeader + 6) + (rowHeader).ToString());
            #endregion



            #region headerTable
            rowIndex                   = rowIndex + 6;
            cStyle                     = new CStyle();
            cStyle.fontBold            = true;
            cStyle.alignmentHorizontal = HorizontalAlignmentValues.Center;
            cStyle.SetBorderStyle(BorderStyleValues.Thin, BorderStyleValues.Thin, BorderStyleValues.Thin, BorderStyleValues.Thin);
            cStyle.fontName = "Times New Roman";
            cStyle.fontSize = 13;
            cStyle.CreateStyle();
            styleIndex.Add(cStyle.GetStyleIndex(workbook._workbookPart));

            string title           = "STT";
            uint   rowindexHeader  = rowIndex + 1;
            uint   colindexHeader  = colindex + 1;
            int    textIndexHeader = sheet.InsertSharedStringItem(title, workbook._sharedStringTablePart);
            Cell   cellSTT         = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colindexHeader), rowindexHeader, 1, textIndexHeader, null);
            cellSTT.StyleIndex = styleIndex[styleIndex.Count - 1];

            title           = "Số hiệu";
            rowindexHeader  = rowIndex + 1;
            colindexHeader  = colindex + 2;
            textIndexHeader = sheet.InsertSharedStringItem(title, workbook._sharedStringTablePart);
            Cell cellLanhDaoVu = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colindexHeader), rowindexHeader, 1, textIndexHeader, null);
            cellLanhDaoVu.StyleIndex = styleIndex[styleIndex.Count - 1];

            title           = "Trích yếu";
            rowindexHeader  = rowIndex + 1;
            colindexHeader  = colindex + 3;
            textIndexHeader = sheet.InsertSharedStringItem(title, workbook._sharedStringTablePart);
            Cell cellChuyenVien = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colindexHeader), rowindexHeader, 1, textIndexHeader, null);
            cellChuyenVien.StyleIndex = styleIndex[styleIndex.Count - 1];

            title           = "Loại văn bản";
            rowindexHeader  = rowIndex + 1;
            colindexHeader  = colindex + 4;
            textIndexHeader = sheet.InsertSharedStringItem(title, workbook._sharedStringTablePart);
            Cell cellLanhDaoBo = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colindexHeader), rowindexHeader, 1, textIndexHeader, null);
            cellLanhDaoBo.StyleIndex = styleIndex[styleIndex.Count - 1];

            title           = "Lĩnh vực";
            rowindexHeader  = rowIndex + 1;
            colindexHeader  = colindex + 5;
            textIndexHeader = sheet.InsertSharedStringItem(title, workbook._sharedStringTablePart);
            Cell cellGio = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colindexHeader), rowindexHeader, 1, textIndexHeader, null);
            cellGio.StyleIndex = styleIndex[styleIndex.Count - 1];

            title           = "Ngày ban hành";
            rowindexHeader  = rowIndex + 1;
            colindexHeader  = colindex + 6;
            textIndexHeader = sheet.InsertSharedStringItem(title, workbook._sharedStringTablePart);
            Cell cellNoiDung = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colindexHeader), rowindexHeader, 1, textIndexHeader, null);
            cellNoiDung.StyleIndex = styleIndex[styleIndex.Count - 1];

            title           = "Ngày hiệu lực";
            rowindexHeader  = rowIndex + 1;
            colindexHeader  = colindex + 7;
            textIndexHeader = sheet.InsertSharedStringItem(title, workbook._sharedStringTablePart);
            Cell cellDiaDiem = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colindexHeader), rowindexHeader, 1, textIndexHeader, null);
            cellDiaDiem.StyleIndex = styleIndex[styleIndex.Count - 1];

            #endregion
            rowIndex++;
            cStyle = new CStyle();
            cStyle.alignmentHorizontal = HorizontalAlignmentValues.Center;
            cStyle.SetBorderStyle(BorderStyleValues.Thin, BorderStyleValues.Thin, BorderStyleValues.Thin, BorderStyleValues.Thin);
            cStyle.fontName = "Times New Roman";
            cStyle.fontBold = false;
            cStyle.fontSize = 13;
            cStyle.CreateStyle();
            styleIndex.Add(cStyle.GetStyleIndex(workbook._workbookPart));

            cStyle = new CStyle();
            cStyle.alignmentHorizontal = HorizontalAlignmentValues.Left;
            cStyle.SetBorderStyle(BorderStyleValues.Thin, BorderStyleValues.Thin, BorderStyleValues.Thin, BorderStyleValues.Thin);
            cStyle.fontName = "Times New Roman";
            cStyle.fontBold = false;
            cStyle.fontSize = 13;
            cStyle.CreateStyle();
            styleIndex.Add(cStyle.GetStyleIndex(workbook._workbookPart));
            uint index = 0;
            foreach (var item in data)
            {
                string titleBody     = (index + 1).ToString();
                uint   rowindexBody  = rowIndex + index + 1;
                uint   colIndexBody  = colindex + 1;
                int    textIndexBody = sheet.InsertSharedStringItem(titleBody, workbook._sharedStringTablePart);
                cellSTT            = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colIndexBody), rowindexBody, 1, textIndexBody, titleBody);
                cellSTT.StyleIndex = styleIndex[styleIndex.Count - 2];
                //ExcelUtils.MergeTwoCells(sheet._worksheetPart.Worksheet, sheetName, ExcelUtils.GetColumnNameByIndex(colIndexBody) + rowindexBody.ToString(), ExcelUtils.GetColumnNameByIndex(colIndexBody) + (rowindexBody + item.data.Count() - 1).ToString());

                titleBody                = item.DocumentNumber;
                rowindexBody             = rowIndex + index + 1;
                colIndexBody             = colindex + 2;
                textIndexBody            = sheet.InsertSharedStringItem(titleBody, workbook._sharedStringTablePart);
                cellLanhDaoVu            = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colIndexBody), rowindexBody, 1, textIndexBody, titleBody);
                cellLanhDaoVu.StyleIndex = styleIndex[styleIndex.Count - 1];

                titleBody                 = item.Abstract;
                rowindexBody              = rowIndex + index + 1;
                colIndexBody              = colindex + 3;
                textIndexBody             = sheet.InsertSharedStringItem(titleBody, workbook._sharedStringTablePart);
                cellChuyenVien            = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colIndexBody), rowindexBody, 1, textIndexBody, titleBody);
                cellChuyenVien.StyleIndex = styleIndex[styleIndex.Count - 1];

                titleBody                = item.LoaiVanBan;
                rowindexBody             = rowIndex + index + 1;
                colIndexBody             = colindex + 4;
                textIndexBody            = sheet.InsertSharedStringItem(titleBody, workbook._sharedStringTablePart);
                cellLanhDaoBo            = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colIndexBody), rowindexBody, 1, textIndexBody, titleBody);
                cellLanhDaoBo.StyleIndex = styleIndex[styleIndex.Count - 1];

                titleBody          = item.LinhVuc;
                rowindexBody       = rowIndex + index + 1;
                colIndexBody       = colindex + 5;
                textIndexBody      = sheet.InsertSharedStringItem(titleBody, workbook._sharedStringTablePart);
                cellGio            = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colIndexBody), rowindexBody, 1, textIndexBody, titleBody);
                cellGio.StyleIndex = styleIndex[styleIndex.Count - 1];

                string content = Convert.ToDateTime(item.IssuedDate).ToString("dd/MM/yyyy");
                string html    = HttpUtility.HtmlDecode(content);
                titleBody              = Regex.Replace(html, "<.*?>", String.Empty);
                rowindexBody           = rowIndex + index + 1;
                colIndexBody           = colindex + 6;
                textIndexBody          = sheet.InsertSharedStringItem(titleBody, workbook._sharedStringTablePart);
                cellNoiDung            = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colIndexBody), rowindexBody, 1, textIndexBody, titleBody);
                cellNoiDung.StyleIndex = styleIndex[styleIndex.Count - 2];

                titleBody              = Convert.ToDateTime(item.EffectiveDate).ToString("dd/MM/yyyy");
                rowindexBody           = rowIndex + index + 1;
                colIndexBody           = colindex + 7;
                textIndexBody          = sheet.InsertSharedStringItem(titleBody, workbook._sharedStringTablePart);
                cellDiaDiem            = sheet.InsertCellInWorksheet(ExcelUtils.GetColumnNameByIndex(colIndexBody), rowindexBody, 1, textIndexBody, titleBody);
                cellDiaDiem.StyleIndex = styleIndex[styleIndex.Count - 2];
                index++;
            }
            #region ChinhDoRongChoTungCotSheetThietBi
            //Chỉnh độ rộng cho từng cột
            ExcelUtils.UpdateColumnWidth(sheet._worksheetPart, 1, 5);
            ExcelUtils.UpdateColumnWidth(sheet._worksheetPart, 2, 10); //STT
            ExcelUtils.UpdateColumnWidth(sheet._worksheetPart, 3, 30); //Số hiệu
            ExcelUtils.UpdateColumnWidth(sheet._worksheetPart, 4, 35); //Trích yêu
            ExcelUtils.UpdateColumnWidth(sheet._worksheetPart, 5, 20); //Loại văn bản
            ExcelUtils.UpdateColumnWidth(sheet._worksheetPart, 6, 15); //Lĩnh vực
            ExcelUtils.UpdateColumnWidth(sheet._worksheetPart, 7, 25); //Ngày ban hành
            ExcelUtils.UpdateColumnWidth(sheet._worksheetPart, 8, 25); //Ngày hiệu lực
            #endregion
            //Set page setup cho sheet
            //ExcelUtils.PageSetupUpdate(sheet._worksheetPart, OrientationValues.Landscape, 0.590, 0.157, 0.66, 0.49, 0.2, 0.2, true, 0, 1, (UInt32Value)(int)PaperSize.A4, "", "", "", "", "");
            return(sheet);
        }
Пример #12
0
 // Token: 0x06000331 RID: 817 RVA: 0x0001556E File Offset: 0x0001376E
 public ToolStripStyleButton(CStyle style, Image image) : base(style.StyleName, image)
 {
     _style = style;
     _image = image;
 }
Пример #13
0
 private void OptionApply()
 {
     try
     {
         this.UpdateTopMostTimer();
         this.keyBook = this.optSetuna.GetKeyItemBook();
         if (this.optSetuna.Setuna.DustBoxEnable)
         {
             this.scrapBook.DustBoxCapacity = (short)this.optSetuna.Setuna.DustBoxCapacity;
         }
         else
         {
             this.scrapBook.DustBoxCapacity = 0;
         }
         if (!this.optSetuna.RegistHotKey(base.Handle))
         {
             this.optSetuna.ScrapHotKeyEnable = false;
             new HotkeyMsg {
                 HotKey = (Keys)this.optSetuna.ScrapHotKey
             }.ShowDialog();
         }
         if (this.optSetuna.Setuna.AppType == SetunaOption.SetunaOptionData.ApplicationType.ApplicationMode)
         {
             base.ShowInTaskbar      = true;
             this.setunaIcon.Visible = false;
             base.MinimizeBox        = true;
             base.Visible            = true;
         }
         else
         {
             this.setunaIcon.Visible = true;
             base.ShowInTaskbar      = false;
             base.MinimizeBox        = false;
             base.WindowState        = FormWindowState.Normal;
             base.Visible            = this.optSetuna.Setuna.ShowMainWindow;
         }
         this.subMenu.Items.Clear();
         foreach (int num in this.optSetuna.Scrap.SubMenuStyles)
         {
             if (num >= 0)
             {
                 foreach (CStyle style in this.optSetuna.Styles)
                 {
                     if (style.StyleID == num)
                     {
                         this.subMenu.Items.Add(style.GetToolStrip(this.scrapBook));
                     }
                 }
             }
             else
             {
                 CStyle preStyle = CPreStyles.GetPreStyle(num);
                 if (preStyle != null)
                 {
                     this.subMenu.Items.Add(preStyle.GetToolStrip(this.scrapBook));
                 }
             }
         }
         if (this.optSetuna.Setuna.ClickCapture)
         {
             if (this.frmClickCapture == null)
             {
                 this.frmClickCapture = new ClickCapture(this.optSetuna.Setuna.ClickCaptureValue);
                 this.frmClickCapture.ClickCaptureEvent += new ClickCapture.ClipCaptureDelegate(this.frmClickCapture_ClickCaptureEvent);
                 this.frmClickCapture.Show();
             }
             else
             {
                 this.frmClickCapture.ClickFlags = this.optSetuna.Setuna.ClickCaptureValue;
                 this.frmClickCapture.Restart();
             }
         }
         else if (this.frmClickCapture != null)
         {
             this.frmClickCapture.Close();
             this.frmClickCapture.Dispose();
             this.frmClickCapture = null;
         }
     }
     catch (Exception exception)
     {
         Console.WriteLine("Mainform OptionApply Exception:" + exception.Message);
     }
 }
Пример #14
0
        // Token: 0x06000241 RID: 577 RVA: 0x0000BC18 File Offset: 0x00009E18
        public static SetunaOption GetDefaultOption()
        {
            var setunaOption = new SetunaOption();
            var num          = 1;

            setunaOption.Setuna.AppType               = SetunaOption.SetunaOptionData.ApplicationType.ApplicationMode;
            setunaOption.Setuna.ShowMainWindow        = true;
            setunaOption.Setuna.DupType               = SetunaOption.SetunaOptionData.OpeningType.Normal;
            setunaOption.Setuna.DustBoxCapacity       = 5;
            setunaOption.Setuna.DustBoxEnable         = true;
            setunaOption.Setuna.SelectAreaTransparent = 80;
            setunaOption.Setuna.SelectBackColorR      = Color.DarkBlue.R;
            setunaOption.Setuna.SelectBackColorG      = Color.DarkBlue.G;
            setunaOption.Setuna.SelectBackColorB      = Color.DarkBlue.B;
            setunaOption.Setuna.SelectLineColorR      = Color.Blue.R;
            setunaOption.Setuna.SelectLineColorG      = Color.Blue.G;
            setunaOption.Setuna.SelectLineColorB      = Color.Blue.B;
            setunaOption.Setuna.ShowSplashWindow      = true;
            setunaOption.Setuna.SelectLineSolid       = false;
            setunaOption.ScrapHotKeyDatas             = new Keys[(int)HotKeyID.__Count__] {
                Keys.Control | Keys.D1, Keys.Control | Keys.D2
            };
            setunaOption.ScrapHotKeyEnable          = true;
            setunaOption.Scrap.InactiveAlphaChange  = true;
            setunaOption.Scrap.InactiveAlphaValue   = 10;
            setunaOption.Scrap.MouseOverAlphaChange = true;
            setunaOption.Scrap.MouseOverAlphaValue  = 90;


            setunaOption.Setuna.TopMostEnabled               = false;
            setunaOption.Setuna.CursorEnabled                = false;
            setunaOption.Setuna.FullscreenCursor             = false;
            setunaOption.Setuna.MagnifierEnabled             = false;
            setunaOption.Setuna.FullscreenCursorSolid        = true;
            setunaOption.Setuna.FullscreenCursorColorR       = Color.Orange.R;
            setunaOption.Setuna.FullscreenCursorColorG       = Color.Orange.G;
            setunaOption.Setuna.FullscreenCursorColorB       = Color.Orange.B;
            setunaOption.Setuna.BackgroundTransparentEnabled = false;


            var cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "复制"
            };

            cstyle.AddStyle(new CCopyStyleItem
            {
                CopyFromSource = true
            });
            cstyle.AddKeyItem((Keys)131139);
            var styleID = cstyle.StyleID;

            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "复制(有边框)"
            };
            cstyle.AddStyle(new CCopyStyleItem
            {
                CopyFromSource = false
            });
            cstyle.AddKeyItem((Keys)196675);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "剪切"
            };
            cstyle.AddStyle(new CCopyStyleItem
            {
                CopyFromSource = true
            });
            cstyle.AddStyle(new CCloseStyleItem());
            cstyle.AddKeyItem((Keys)131160);
            var styleID2 = cstyle.StyleID;

            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "剪切(有边框)"
            };
            cstyle.AddStyle(new CCopyStyleItem
            {
                CopyFromSource = false
            });
            cstyle.AddStyle(new CCloseStyleItem());
            cstyle.AddKeyItem((Keys)196696);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "粘贴"
            };
            var newCi = new CPasteStyleItem();

            cstyle.AddStyle(newCi);
            cstyle.AddKeyItem((Keys)131158);
            var styleID3 = cstyle.StyleID;

            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "保存"
            };
            cstyle.AddStyle(new CImagePngStyleItem
            {
                Quality      = 100,
                ShowPreview  = true,
                FileNameType = CImageStyleItem.EnumFileName.SaveAs,
                HaveMargin   = false
            });
            cstyle.AddKeyItem((Keys)131155);
            var styleID4 = cstyle.StyleID;

            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "保存(有边框)"
            };
            cstyle.AddStyle(new CImagePngStyleItem
            {
                Quality      = 100,
                ShowPreview  = true,
                FileNameType = CImageStyleItem.EnumFileName.SaveAs,
                HaveMargin   = true
            });
            cstyle.AddKeyItem((Keys)196691);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "旋转90度"
            };
            cstyle.AddStyle(new CRotateStyleItem
            {
                Rotate = 90
            });
            cstyle.AddKeyItem(Keys.R);
            var styleID5 = cstyle.StyleID;

            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "垂直翻转"
            };
            cstyle.AddStyle(new CRotateStyleItem
            {
                VerticalReflection = true
            });
            cstyle.AddKeyItem((Keys)262230);
            var styleID6 = cstyle.StyleID;

            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "水平翻转"
            };
            cstyle.AddStyle(new CRotateStyleItem
            {
                HorizonReflection = true
            });
            cstyle.AddKeyItem((Keys)262216);
            var styleID7 = cstyle.StyleID;

            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "扩大"
            };
            cstyle.AddStyle(new CScaleStyleItem
            {
                Value   = 10,
                SetType = CScaleStyleItem.ScaleSetType.Increment
            });
            cstyle.AddKeyItem(Keys.RButton | Keys.MButton | Keys.Space | Keys.Alt);
            var styleID8 = cstyle.StyleID;

            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "扩大(微调)"
            };
            cstyle.AddStyle(new CScaleStyleItem
            {
                Value   = 1,
                SetType = CScaleStyleItem.ScaleSetType.Increment
            });
            cstyle.AddKeyItem(Keys.RButton | Keys.MButton | Keys.Space | Keys.Shift | Keys.Alt);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "缩小"
            };
            cstyle.AddStyle(new CScaleStyleItem
            {
                Value   = -10,
                SetType = CScaleStyleItem.ScaleSetType.Increment
            });
            cstyle.AddKeyItem(Keys.Back | Keys.Space | Keys.Alt);
            var styleID9 = cstyle.StyleID;

            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "缩小(微调)"
            };
            cstyle.AddStyle(new CScaleStyleItem
            {
                Value   = -1,
                SetType = CScaleStyleItem.ScaleSetType.Increment
            });
            cstyle.AddKeyItem(Keys.Back | Keys.Space | Keys.Shift | Keys.Alt);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "增加透明度"
            };
            cstyle.AddStyle(new COpacityStyleItem
            {
                Absolute = false,
                Opacity  = 10
            });
            cstyle.AddKeyItem(Keys.LButton | Keys.MButton | Keys.Space | Keys.Alt);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "增加透明度(微调)"
            };
            cstyle.AddStyle(new COpacityStyleItem
            {
                Absolute = false,
                Opacity  = 1
            });
            cstyle.AddKeyItem(Keys.LButton | Keys.MButton | Keys.Space | Keys.Shift | Keys.Alt);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "降低透明度"
            };
            cstyle.AddStyle(new COpacityStyleItem
            {
                Absolute = false,
                Opacity  = -10
            });
            cstyle.AddKeyItem(Keys.LButton | Keys.RButton | Keys.MButton | Keys.Space | Keys.Alt);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "降低透明度(微调)"
            };
            cstyle.AddStyle(new COpacityStyleItem
            {
                Absolute = false,
                Opacity  = -1
            });
            cstyle.AddKeyItem(Keys.LButton | Keys.RButton | Keys.MButton | Keys.Space | Keys.Shift | Keys.Alt);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "向上移动"
            };
            cstyle.AddStyle(new CMoveStyleItem
            {
                Top = -50
            });
            cstyle.AddKeyItem(Keys.RButton | Keys.MButton | Keys.Space | Keys.Shift);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "向上移动(微调)"
            };
            cstyle.AddStyle(new CMoveStyleItem
            {
                Top = -1
            });
            cstyle.AddKeyItem(Keys.Up);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "向下移动"
            };
            cstyle.AddStyle(new CMoveStyleItem
            {
                Top = 50
            });
            cstyle.AddKeyItem(Keys.Back | Keys.Space | Keys.Shift);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "向下移动(微调)"
            };
            cstyle.AddStyle(new CMoveStyleItem
            {
                Top = 1
            });
            cstyle.AddKeyItem(Keys.Down);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "向左移动"
            };
            cstyle.AddStyle(new CMoveStyleItem
            {
                Left = -50
            });
            cstyle.AddKeyItem(Keys.LButton | Keys.MButton | Keys.Space | Keys.Shift);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "向左移动(微调)"
            };
            cstyle.AddStyle(new CMoveStyleItem
            {
                Left = -1
            });
            cstyle.AddKeyItem(Keys.Left);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "向右移动"
            };
            cstyle.AddStyle(new CMoveStyleItem
            {
                Left = 50
            });
            cstyle.AddKeyItem(Keys.LButton | Keys.RButton | Keys.MButton | Keys.Space | Keys.Shift);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "向右移动(微调)"
            };
            cstyle.AddStyle(new CMoveStyleItem
            {
                Left = 1
            });
            cstyle.AddKeyItem(Keys.Right);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "缩放为50%"
            };
            cstyle.AddStyle(new CScaleStyleItem
            {
                SetType = CScaleStyleItem.ScaleSetType.Fixed,
                Value   = 50
            });
            cstyle.AddKeyItem(Keys.D5);
            var styleID10 = cstyle.StyleID;

            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "缩放为60%"
            };
            cstyle.AddStyle(new CScaleStyleItem
            {
                SetType = CScaleStyleItem.ScaleSetType.Fixed,
                Value   = 60
            });
            cstyle.AddKeyItem(Keys.D6);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "缩放为70%"
            };
            cstyle.AddStyle(new CScaleStyleItem
            {
                SetType = CScaleStyleItem.ScaleSetType.Fixed,
                Value   = 70
            });
            cstyle.AddKeyItem(Keys.D7);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "缩放为80%"
            };
            cstyle.AddStyle(new CScaleStyleItem
            {
                SetType = CScaleStyleItem.ScaleSetType.Fixed,
                Value   = 80
            });
            cstyle.AddKeyItem(Keys.D8);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "缩放为90%"
            };
            cstyle.AddStyle(new CScaleStyleItem
            {
                SetType = CScaleStyleItem.ScaleSetType.Fixed,
                Value   = 90
            });
            cstyle.AddKeyItem(Keys.D9);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "缩放为100%"
            };
            cstyle.AddStyle(new CScaleStyleItem
            {
                SetType = CScaleStyleItem.ScaleSetType.Fixed,
                Value   = 100
            });
            cstyle.AddKeyItem(Keys.D0);
            var styleID11 = cstyle.StyleID;

            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "缩放为150%"
            };
            cstyle.AddStyle(new CScaleStyleItem
            {
                SetType = CScaleStyleItem.ScaleSetType.Fixed,
                Value   = 150
            });
            var styleID12 = cstyle.StyleID;

            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "立体边框"
            };
            cstyle.AddStyle(new CMarginStyleItem
            {
                BorderStyle = 0
            });
            cstyle.AddKeyItem(Keys.D1);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "单色边框"
            };
            cstyle.AddStyle(new CMarginStyleItem
            {
                BorderStyle      = 1,
                MarginColorRed   = byte.MaxValue,
                MarginColorGreen = 128,
                MarginColorBlue  = 64,
                MarginSize       = 1
            });
            cstyle.AddKeyItem(Keys.D2);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "窗口化"
            };
            cstyle.AddStyle(new CMarginStyleItem
            {
                BorderStyle = 2
            });
            cstyle.AddKeyItem(Keys.D3);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "无边框"
            };
            cstyle.AddStyle(new CMarginStyleItem
            {
                BorderStyle = 1,
                MarginSize  = 0
            });
            cstyle.AddKeyItem(Keys.L);
            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "关闭"
            };
            var newCi2 = new CCloseStyleItem();

            cstyle.AddStyle(newCi2);
            cstyle.AddKeyItem(Keys.Q);
            var styleID13 = cstyle.StyleID;

            setunaOption.Styles.Add(cstyle);
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "基本自动操作"
            };
            cstyle.AddStyle(new CMarginStyleItem
            {
                BorderStyle = 0
            });
            cstyle.AddStyle(new COpacityStyleItem
            {
                Absolute = true,
                Opacity  = 95
            });
            setunaOption.Styles.Add(cstyle);
            setunaOption.Scrap.CreateStyleID = cstyle.StyleID;
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "收缩"
            };
            cstyle.AddStyle(new CCompactStyleItem
            {
                Opacity   = 80,
                SoldLine  = false,
                LineColor = Color.Blue.ToArgb()
            });
            setunaOption.Styles.Add(cstyle);
            setunaOption.Scrap.WClickStyleID = cstyle.StyleID;
            cstyle = new CStyle
            {
                StyleID   = num++,
                StyleName = "修剪"
            };
            var newCi3 = new CTrimStyleItem();

            cstyle.AddStyle(newCi3);
            cstyle.AddKeyItem(Keys.T);
            setunaOption.Styles.Add(cstyle);
            setunaOption.Scrap.SubMenuStyles.Add(styleID13);
            setunaOption.Scrap.SubMenuStyles.Add(new CSeparatorStyle().StyleID);
            setunaOption.Scrap.SubMenuStyles.Add(new CScrapListStyle().StyleID);
            setunaOption.Scrap.SubMenuStyles.Add(new CDustBoxStyle().StyleID);
            setunaOption.Scrap.SubMenuStyles.Add(new CDustEraseStyle().StyleID);
            setunaOption.Scrap.SubMenuStyles.Add(new COptionStyle().StyleID);
            setunaOption.Scrap.SubMenuStyles.Add(new CShowVersionStyle().StyleID);
            setunaOption.Scrap.SubMenuStyles.Add(new CSeparatorStyle().StyleID);
            setunaOption.Scrap.SubMenuStyles.Add(styleID);
            setunaOption.Scrap.SubMenuStyles.Add(styleID2);
            setunaOption.Scrap.SubMenuStyles.Add(styleID3);
            setunaOption.Scrap.SubMenuStyles.Add(styleID4);
            setunaOption.Scrap.SubMenuStyles.Add(new CSeparatorStyle().StyleID);
            setunaOption.Scrap.SubMenuStyles.Add(styleID10);
            setunaOption.Scrap.SubMenuStyles.Add(styleID11);
            setunaOption.Scrap.SubMenuStyles.Add(styleID12);
            setunaOption.Scrap.SubMenuStyles.Add(styleID9);
            setunaOption.Scrap.SubMenuStyles.Add(styleID8);
            setunaOption.Scrap.SubMenuStyles.Add(new CSeparatorStyle().StyleID);
            setunaOption.Scrap.SubMenuStyles.Add(styleID5);
            setunaOption.Scrap.SubMenuStyles.Add(styleID6);
            setunaOption.Scrap.SubMenuStyles.Add(styleID7);
            return(setunaOption);
        }
Пример #15
0
        public static SetunaOption GetDefaultOption()
        {
            SetunaOption option = new SetunaOption();
            int          num    = 1;

            option.Setuna.AppType               = SetunaOptionData.ApplicationType.ApplicationMode;
            option.Setuna.ShowMainWindow        = true;
            option.Setuna.DupType               = SetunaOptionData.OpeningType.Normal;
            option.Setuna.DustBoxCapacity       = 5;
            option.Setuna.DustBoxEnable         = true;
            option.Setuna.SelectAreaTransparent = 80;
            option.Setuna.SelectBackColorR      = 0;
            option.Setuna.SelectBackColorG      = 0;
            option.Setuna.SelectBackColorB      = 0x8b;
            option.Setuna.SelectLineColorR      = 0;
            option.Setuna.SelectLineColorG      = 0;
            option.Setuna.SelectLineColorB      = 0;
            option.Setuna.ShowSplashWindow      = true;
            option.Setuna.SelectLineSolid       = false;
            option.ScrapHotKeyData              = Keys.Control | Keys.Alt | Keys.A;
            option.ScrapHotKeyEnable            = true;
            option.Scrap.InactiveAlphaChange    = true;
            option.Scrap.InactiveAlphaValue     = 10;
            option.Scrap.MouseOverAlphaChange   = true;
            option.Scrap.MouseOverAlphaValue    = 90;

            option.mDpi1          = DPIUtils.defaultDpi1;
            option.mDpi2          = 1.0F;
            option.mDpi3          = 1.0F;
            option.mDpi4          = 1.0F;
            option.mAlwaysTopmost = false;

            CStyle style = new CStyle
            {
                StyleID   = num++,
                StyleName = "复制"
            };
            CCopyStyleItem newCi = new CCopyStyleItem
            {
                CopyFromSource = true
            };

            style.AddStyle(newCi);
            style.AddKeyItem(Keys.Control | Keys.C);
            int styleID = style.StyleID;

            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "复制(有边框)"
            };
            CCopyStyleItem item2 = new CCopyStyleItem
            {
                CopyFromSource = false
            };

            style.AddStyle(item2);
            style.AddKeyItem(Keys.Control | Keys.Shift | Keys.C);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "剪切"
            };
            CCopyStyleItem item3 = new CCopyStyleItem
            {
                CopyFromSource = true
            };

            style.AddStyle(item3);
            style.AddStyle(new CCloseStyleItem());
            style.AddKeyItem(Keys.Control | Keys.X);
            int item = style.StyleID;

            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "剪切(有边框)"
            };
            CCopyStyleItem item4 = new CCopyStyleItem
            {
                CopyFromSource = false
            };

            style.AddStyle(item4);
            style.AddStyle(new CCloseStyleItem());
            style.AddKeyItem(Keys.Control | Keys.Shift | Keys.X);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "粘贴"
            };
            CPasteStyleItem item5 = new CPasteStyleItem();

            style.AddStyle(item5);
            style.AddKeyItem(Keys.Control | Keys.V);
            int num5 = style.StyleID;

            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "保存"
            };
            CImageJpegStyleItem item6 = new CImageJpegStyleItem
            {
                Quality      = 100,
                ShowPreview  = true,
                FileNameType = CImageStyleItem.EnumFileName.SaveAs,
                HaveMargin   = false
            };

            style.AddStyle(item6);
            style.AddKeyItem(Keys.Control | Keys.S);
            int num6 = style.StyleID;

            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "保存(有边框)"
            };
            CImageJpegStyleItem item7 = new CImageJpegStyleItem
            {
                Quality      = 100,
                ShowPreview  = true,
                FileNameType = CImageStyleItem.EnumFileName.SaveAs,
                HaveMargin   = true
            };

            style.AddStyle(item7);
            style.AddKeyItem(Keys.Control | Keys.Shift | Keys.S);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "旋转90度"
            };
            CRotateStyleItem item8 = new CRotateStyleItem
            {
                Rotate = 90
            };

            style.AddStyle(item8);
            style.AddKeyItem(Keys.R);
            int num12 = style.StyleID;

            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "垂直翻转"
            };
            CRotateStyleItem item9 = new CRotateStyleItem
            {
                VerticalReflection = true
            };

            style.AddStyle(item9);
            style.AddKeyItem(Keys.Alt | Keys.V);
            int num13 = style.StyleID;

            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "水平翻转"
            };
            CRotateStyleItem item10 = new CRotateStyleItem
            {
                HorizonReflection = true
            };

            style.AddStyle(item10);
            style.AddKeyItem(Keys.Alt | Keys.H);
            int num14 = style.StyleID;

            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "扩大"
            };
            CScaleStyleItem item11 = new CScaleStyleItem
            {
                Value   = 10,
                SetType = CScaleStyleItem.ScaleSetType.Increment
            };

            style.AddStyle(item11);
            style.AddKeyItem(Keys.Alt | Keys.Up);
            int num11 = style.StyleID;

            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "扩大(微调)"
            };
            CScaleStyleItem item12 = new CScaleStyleItem
            {
                Value   = 1,
                SetType = CScaleStyleItem.ScaleSetType.Increment
            };

            style.AddStyle(item12);
            style.AddKeyItem(Keys.Alt | Keys.Shift | Keys.Up);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "缩小"
            };
            CScaleStyleItem item13 = new CScaleStyleItem
            {
                Value   = -10,
                SetType = CScaleStyleItem.ScaleSetType.Increment
            };

            style.AddStyle(item13);
            style.AddKeyItem(Keys.Alt | Keys.Down);
            int num10 = style.StyleID;

            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "缩小(微调)"
            };
            CScaleStyleItem item14 = new CScaleStyleItem
            {
                Value   = -1,
                SetType = CScaleStyleItem.ScaleSetType.Increment
            };

            style.AddStyle(item14);
            style.AddKeyItem(Keys.Alt | Keys.Shift | Keys.Down);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "增加透明度"
            };
            COpacityStyleItem item15 = new COpacityStyleItem
            {
                Absolute = false,
                Opacity  = 10
            };

            style.AddStyle(item15);
            style.AddKeyItem(Keys.Alt | Keys.Left);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "增加透明度(微调)"
            };
            COpacityStyleItem item16 = new COpacityStyleItem
            {
                Absolute = false,
                Opacity  = 1
            };

            style.AddStyle(item16);
            style.AddKeyItem(Keys.Alt | Keys.Shift | Keys.Left);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "降低透明度"
            };
            COpacityStyleItem item17 = new COpacityStyleItem
            {
                Absolute = false,
                Opacity  = -10
            };

            style.AddStyle(item17);
            style.AddKeyItem(Keys.Alt | Keys.Right);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "降低透明度(微调)"
            };
            COpacityStyleItem item18 = new COpacityStyleItem
            {
                Absolute = false,
                Opacity  = -1
            };

            style.AddStyle(item18);
            style.AddKeyItem(Keys.Alt | Keys.Shift | Keys.Right);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "向上移动"
            };
            CMoveStyleItem item19 = new CMoveStyleItem
            {
                Top = -50
            };

            style.AddStyle(item19);
            style.AddKeyItem(Keys.Shift | Keys.Up);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "向上移动(微调)"
            };
            CMoveStyleItem item20 = new CMoveStyleItem
            {
                Top = -1
            };

            style.AddStyle(item20);
            style.AddKeyItem(Keys.Up);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "向下移动"
            };
            CMoveStyleItem item21 = new CMoveStyleItem
            {
                Top = 50
            };

            style.AddStyle(item21);
            style.AddKeyItem(Keys.Shift | Keys.Down);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "向下移动(微调)"
            };
            CMoveStyleItem item22 = new CMoveStyleItem
            {
                Top = 1
            };

            style.AddStyle(item22);
            style.AddKeyItem(Keys.Down);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "向左移动"
            };
            CMoveStyleItem item23 = new CMoveStyleItem
            {
                Left = -50
            };

            style.AddStyle(item23);
            style.AddKeyItem(Keys.Shift | Keys.Left);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "向左移动(微调)"
            };
            CMoveStyleItem item24 = new CMoveStyleItem
            {
                Left = -1
            };

            style.AddStyle(item24);
            style.AddKeyItem(Keys.Left);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "向右移动"
            };
            CMoveStyleItem item25 = new CMoveStyleItem
            {
                Left = 50
            };

            style.AddStyle(item25);
            style.AddKeyItem(Keys.Shift | Keys.Right);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "向右移动(微调)"
            };
            CMoveStyleItem item26 = new CMoveStyleItem
            {
                Left = 1
            };

            style.AddStyle(item26);
            style.AddKeyItem(Keys.Right);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "缩放为50%"
            };
            CScaleStyleItem item27 = new CScaleStyleItem
            {
                SetType = CScaleStyleItem.ScaleSetType.Fixed,
                Value   = 50
            };

            style.AddStyle(item27);
            style.AddKeyItem(Keys.D5);
            int num8 = style.StyleID;

            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "缩放为60%"
            };
            CScaleStyleItem item28 = new CScaleStyleItem
            {
                SetType = CScaleStyleItem.ScaleSetType.Fixed,
                Value   = 60
            };

            style.AddStyle(item28);
            style.AddKeyItem(Keys.D6);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "缩放为70%"
            };
            CScaleStyleItem item29 = new CScaleStyleItem
            {
                SetType = CScaleStyleItem.ScaleSetType.Fixed,
                Value   = 70
            };

            style.AddStyle(item29);
            style.AddKeyItem(Keys.D7);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "缩放为80%"
            };
            CScaleStyleItem item30 = new CScaleStyleItem
            {
                SetType = CScaleStyleItem.ScaleSetType.Fixed,
                Value   = 80
            };

            style.AddStyle(item30);
            style.AddKeyItem(Keys.D8);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "缩放为90%"
            };
            CScaleStyleItem item31 = new CScaleStyleItem
            {
                SetType = CScaleStyleItem.ScaleSetType.Fixed,
                Value   = 90
            };

            style.AddStyle(item31);
            style.AddKeyItem(Keys.D9);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "缩放为100%"
            };
            CScaleStyleItem item32 = new CScaleStyleItem
            {
                SetType = CScaleStyleItem.ScaleSetType.Fixed,
                Value   = 100
            };

            style.AddStyle(item32);
            style.AddKeyItem(Keys.D0);
            int num7 = style.StyleID;

            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "缩放为150%"
            };
            CScaleStyleItem item33 = new CScaleStyleItem
            {
                SetType = CScaleStyleItem.ScaleSetType.Fixed,
                Value   = 150
            };

            style.AddStyle(item33);
            int num9 = style.StyleID;

            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "立体边框"
            };
            CMarginStyleItem item34 = new CMarginStyleItem
            {
                BorderStyle = 0
            };

            style.AddStyle(item34);
            style.AddKeyItem(Keys.D1);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "单色边框"
            };
            CMarginStyleItem item35 = new CMarginStyleItem
            {
                BorderStyle      = 1,
                MarginColorRed   = 0xff,
                MarginColorGreen = 0x80,
                MarginColorBlue  = 0x40,
                MarginSize       = 1
            };

            style.AddStyle(item35);
            style.AddKeyItem(Keys.D2);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "窗口化"
            };
            CMarginStyleItem item36 = new CMarginStyleItem
            {
                BorderStyle = 2
            };

            style.AddStyle(item36);
            style.AddKeyItem(Keys.D3);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "无边框"
            };
            CMarginStyleItem item37 = new CMarginStyleItem
            {
                BorderStyle = 1,
                MarginSize  = 0
            };

            style.AddStyle(item37);
            style.AddKeyItem(Keys.L);
            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "关闭"
            };
            CCloseStyleItem item38 = new CCloseStyleItem();

            style.AddStyle(item38);
            style.AddKeyItem(Keys.Q);
            int num2 = style.StyleID;

            option.Styles.Add(style);
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "基本自动操作"
            };
            CMarginStyleItem item39 = new CMarginStyleItem
            {
                BorderStyle = 0
            };

            style.AddStyle(item39);
            COpacityStyleItem item40 = new COpacityStyleItem
            {
                Absolute = true,
                Opacity  = 95
            };

            style.AddStyle(item40);
            option.Styles.Add(style);
            option.Scrap.CreateStyleID = style.StyleID;
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "收缩"
            };
            CCompactStyleItem item41 = new CCompactStyleItem
            {
                Opacity   = 80,
                SoldLine  = false,
                LineColor = Color.Blue.ToArgb()
            };

            style.AddStyle(item41);
            option.Styles.Add(style);
            option.Scrap.WClickStyleID = style.StyleID;
            style = new CStyle
            {
                StyleID   = num++,
                StyleName = "修剪"
            };
            CTrimStyleItem item42 = new CTrimStyleItem();

            style.AddStyle(item42);
            style.AddKeyItem(Keys.T);
            option.Styles.Add(style);
            option.Scrap.SubMenuStyles.Add(num2);
            option.Scrap.SubMenuStyles.Add(new CSeparatorStyle().StyleID);
            option.Scrap.SubMenuStyles.Add(new CScrapListStyle().StyleID);
            option.Scrap.SubMenuStyles.Add(new CDustBoxStyle().StyleID);
            option.Scrap.SubMenuStyles.Add(new CDustEraseStyle().StyleID);
            option.Scrap.SubMenuStyles.Add(new COptionStyle().StyleID);
            option.Scrap.SubMenuStyles.Add(new CShowVersionStyle().StyleID);
            option.Scrap.SubMenuStyles.Add(new CSeparatorStyle().StyleID);
            option.Scrap.SubMenuStyles.Add(styleID);
            option.Scrap.SubMenuStyles.Add(item);
            option.Scrap.SubMenuStyles.Add(num5);
            option.Scrap.SubMenuStyles.Add(num6);
            option.Scrap.SubMenuStyles.Add(new CSeparatorStyle().StyleID);
            option.Scrap.SubMenuStyles.Add(num8);
            option.Scrap.SubMenuStyles.Add(num7);
            option.Scrap.SubMenuStyles.Add(num9);
            option.Scrap.SubMenuStyles.Add(num10);
            option.Scrap.SubMenuStyles.Add(num11);
            option.Scrap.SubMenuStyles.Add(new CSeparatorStyle().StyleID);
            option.Scrap.SubMenuStyles.Add(num12);
            option.Scrap.SubMenuStyles.Add(num13);
            option.Scrap.SubMenuStyles.Add(num14);
            return(option);
        }
Пример #16
0
 public KeyItem(Keys key, CStyle parentStyle)
 {
     this._keycode = key;
     this._parent  = parentStyle;
     this.addKeyItemListener(parentStyle);
 }
Пример #17
0
 // Token: 0x06000330 RID: 816 RVA: 0x00015559 File Offset: 0x00013759
 public ToolStripStyleButton(CStyle style) : base(style.StyleName)
 {
     _style = style;
 }