コード例 #1
0
ファイル: EditorDocument.cs プロジェクト: bensenplus/breeze
 public override DComboBox CreateComboBox()
 {
     var comboBox = new DComboBox();
     HangUpMember = comboBox;
     UpdateDocument(MConstant.EventType.Write);
     Context.Invalidate(new Rectangle(CurrentPage.X, CurrentPage.Y, CurrentPage.Width,
                                      CurrentPage.Height));
     return comboBox;
 }
コード例 #2
0
ファイル: XmlUtils.cs プロジェクト: bensenplus/breeze
        private static void ImportMember(XmlNodeList memberElements, DDocRow row)
        {
            foreach (XmlElement memberElement in memberElements)
            {
                switch (memberElement.Name)
                {
                    case "textChar":
                        var color = memberElement.GetAttribute("fontColor");
                        var fontColor = Color.Black;
                        if (!string.IsNullOrEmpty(color))
                        {
                            fontColor = System.Drawing.ColorTranslator.FromHtml(color);
                        }
                        var fontName = memberElement.GetAttribute("fontName");
                        var fontSize = Convert.ToSingle(memberElement.GetAttribute("fontSize"));
                        var fontStyle = memberElement.GetAttribute("fontStyle");

                        var text = memberElement.InnerText;
                        var singleTexts = text.ToCharArray();
                        foreach (var singleText in singleTexts)
                        {
                            var textChar = MDocument.CreateTextChar(Convert.ToString(singleText), fontName, fontSize,
                                                                    fontColor, GetFontStyle(fontStyle));
                            row.AddMember(textChar);
                        }
                        break;
                    case "textInput":
                        var textInput = new DTextInput();
                        row.AddMember(textInput.Xml2Object(memberElement, MDocument));
                        break;
                    case "table":
                        break;
                    case "image":
                        var content = memberElement.InnerText;
                        var image = new DImage(ConvertToImage(content));
                        row.AddMember(image);
                        break;
                    case "checkBox":
                        var checkBox = new DCheckBox
                            {
                                IsChecked = "True".Equals(memberElement.GetAttribute("isChecked")) ? true : false,
                                Value = memberElement.InnerText
                            };
                        row.AddMember(checkBox);
                        break;
                    case "comboBox":
                        var comboBox = new DComboBox();
                        row.AddMember(comboBox.Xml2Object(memberElement, MDocument));
                        break;
                    case "horizonLine":
                        var hLine = new DHorizonLine
                            {
                                Width = Convert.ToInt32(memberElement.GetAttribute("width")),
                                Height = Convert.ToInt32(memberElement.GetAttribute("height"))
                            };
                        break;
                }
            }
        }
コード例 #3
0
ファイル: DComboBox.cs プロジェクト: bensenplus/breeze
        public override DMember Copy()
        {
            var comboBox = new DComboBox()
            {
                FontColor = this.FontColor,
                WFont = this.WFont,
                Value = this.Value,
                IsBreakTail = this.IsBreakTail,
                DisplayMember = this.DisplayMember,
                ValueMember = this.ValueMember,
                Width = this.Width,
                Height = this.Height
            };

            comboBox.Items.AddRange(this.Items);

            return comboBox;
        }