Пример #1
0
        public override DMember Copy()
        {
            var horizonLine = new DHorizonLine()
            {
                FontColor = this.FontColor,
                WFont = this.WFont,
                Value = this.Value,
                IsBreakTail = this.IsBreakTail,
                Width = this.Width,
                Height = this.Height
            };

            return horizonLine;
        }
Пример #2
0
        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
 public override DHorizonLine CreateHorizonLine()
 {
     var dHorizonLine = new DHorizonLine();
     HangUpMember = dHorizonLine;
     UpdateDocument(MConstant.EventType.Write);
     Context.Invalidate(new Rectangle(CurrentPage.X, CurrentPage.Y, CurrentPage.Width,
                                      CurrentPage.Height));
     return dHorizonLine;
 }