public virtual void Paint(XMLPaintArten paintArt, int offSetX, int offSetY, PaintEventArgs e) { if (this._disposed || this._xmlNode == null || this._xmlEditor == null) { return; } if (paintArt == XMLPaintArten.Vorberechnen) { this._merkeStartPaintPos = this._paintPos.Clone(); } else { this._paintPos = this._merkeStartPaintPos.Clone(); } this._startX = this._paintPos.PosX; this._startY = this._paintPos.PosY; if (paintArt == XMLPaintArten.Vorberechnen) { this.MausklickBereicheBufferLeeren(); this._cursorStrichPos = new Point(this._startX, this._startY); } this._wirdGeradeGezeichnet = true; this.NodeZeichnenStart(paintArt, offSetX, offSetY, e); this.UnternodesZeichnen(paintArt, offSetX, offSetY, e); this.NodeZeichnenAbschluss(paintArt, offSetX, offSetY, e); this._wirdGeradeGezeichnet = false; }
protected virtual void NodeZeichnenStart( XMLPaintArten paintArt, int offSetX, int offSetY, PaintEventArgs e) { }
private void AttributeZeichnen(XMLPaintArten paintArt, PaintEventArgs e) { XmlAttributeCollection attributes = this.XMLNode.Attributes; if (attributes == null || (uint)attributes.Count <= 0U) { return; } StringBuilder stringBuilder = new StringBuilder(); for (int index = 0; index < attributes.Count; ++index) { stringBuilder.AppendFormat(" {0}=\"{1}\"", (object)attributes[index].Name, (object)attributes[index].Value); } int breite = (int)((double)XMLElement_StandardNode._breiteProBuchstabeAttribute * (double)stringBuilder.Length); int buchstabeNodeName = XMLElement_StandardNode._hoeheProBuchstabeNodeName; if ((uint)paintArt > 0U) { this.zeichneRahmenNachGroesse(this._paintPos.PosX, this._paintPos.PosY + 2, breite, buchstabeNodeName, 2, this._farbeAttributeHintergrund, this._farbeAttributeRand, e); using (SolidBrush solidBrush = new SolidBrush(this._farbeAttributeSchrift)) e.Graphics.DrawString(stringBuilder.ToString(), XMLElement_StandardNode._drawFontAttribute, (Brush)solidBrush, (float)(this._paintPos.PosX + 1), (float)(this._paintPos.PosY + 2), XMLElement_StandardNode._drawFormat); } this._paintPos.PosX += breite + 4; }
private void FarbenSetzen(XMLPaintArten paintArt) { if (this._xmlEditor.CursorOptimiert.IstNodeInnerhalbDerSelektion(this._xmlNode)) { this._farbeRahmenHintergrund = this._xmlEditor.Regelwerk.NodeFarbe(this._xmlNode, true); this._farbeNodeNameSchrift = Color.White; this._farbePfeil = Color.Black; this._farbeAttributeHintergrund = Color.Transparent; this._farbeAttributeSchrift = Color.White; } else { this._farbeRahmenHintergrund = this._xmlEditor.Regelwerk.NodeFarbe(this._xmlNode, false); this._farbeNodeNameSchrift = Color.Black; this._farbePfeil = Color.LightGray; this._farbeAttributeHintergrund = Color.White; this._farbeAttributeSchrift = Color.Black; } this._farbeAttributeRand = Color.FromArgb(225, 225, 225); this._farbeRahmenRand = Color.FromArgb(100, 100, 150); if (paintArt != XMLPaintArten.AllesNeuZeichnenMitFehlerHighlighting || this._xmlEditor.Regelwerk.DTDPruefer.IstXmlNodeOk(this._xmlNode, false)) { return; } this._farbeNodeNameSchrift = Color.Red; this._farbePfeil = Color.Red; this._farbeRahmenRand = Color.Red; }
protected override void NodeZeichnenStart(XMLPaintArten paintArt, int offSetX, int offSetY, PaintEventArgs e) { int num = 2; int num2 = 0; if (paintArt == XMLPaintArten.Vorberechnen) { int invertiertStart = -1; int invertiertLaenge = 0; this.StartUndEndeDerSelektionBestimmen(ref invertiertStart, ref invertiertLaenge); int maxLaengeProZeile = (int)((float)(base._paintPos.ZeilenEndeX - base._paintPos.ZeilenStartX) / XMLElement_TextNode._breiteProBuchstabe); int bereitsLaengeDerZeile = (int)((float)base._paintPos.PosX / XMLElement_TextNode._breiteProBuchstabe); TextTeiler textTeiler = new TextTeiler(this.AktuellerInhalt, invertiertStart, invertiertLaenge, maxLaengeProZeile, bereitsLaengeDerZeile, this.ZeichenZumUmbrechen); this._textTeile = textTeiler.TextTeile; } else { foreach (TextTeil item in this._textTeile) { using (SolidBrush brush = new SolidBrush(this.GetHintergrundFarbe(item.Invertiert))) { e.Graphics.FillRectangle(brush, item.Rechteck); } } } foreach (TextTeil item2 in this._textTeile) { int num3 = (int)(XMLElement_TextNode._breiteProBuchstabe * (float)item2.Text.Length); if (item2.IstNeueZeile) { base._paintPos.PosY += base._xmlEditor.Regelwerk.AbstandYZwischenZeilen + base._paintPos.HoeheAktZeile; base._paintPos.PosX = base._paintPos.ZeilenStartX; base._paintPos.HoeheAktZeile = XMLElement_TextNode._hoeheProBuchstabe + num * 2; } if (paintArt == XMLPaintArten.Vorberechnen) { item2.Rechteck = new Rectangle(base._paintPos.PosX, base._paintPos.PosY, (int)(XMLElement_TextNode._breiteProBuchstabe * (float)item2.Text.Length), XMLElement_TextNode._hoeheProBuchstabe + num * 2); if (base._xmlNode == base._xmlEditor.CursorOptimiert.StartPos.AktNode && base._xmlEditor.CursorOptimiert.StartPos.PosAmNode == XMLCursorPositionen.CursorInnerhalbDesTextNodes && base._xmlEditor.CursorOptimiert.StartPos.PosImTextnode >= num2 && base._xmlEditor.CursorOptimiert.StartPos.PosImTextnode <= num2 + item2.Text.Length) { int val = base._paintPos.PosX + (int)((float)(base._xmlEditor.CursorOptimiert.StartPos.PosImTextnode - num2) * XMLElement_TextNode._breiteProBuchstabe); val = Math.Max(base._paintPos.PosX, val); base._cursorStrichPos = new Point(val, base._paintPos.PosY); } num2 += item2.Text.Length; base._klickBereiche.Add(item2.Rechteck); } else { e.Graphics.DrawString(item2.Text, XMLElement_TextNode._drawFont, this.GetZeichenFarbe(item2.Invertiert), (float)item2.Rechteck.X, (float)(item2.Rechteck.Y + num), XMLElement_TextNode._drawFormat); } base._paintPos.BisherMaxX = Math.Max(base._paintPos.BisherMaxX, item2.Rechteck.X + item2.Rechteck.Width); base._paintPos.HoeheAktZeile = Math.Max(base._paintPos.HoeheAktZeile, XMLElement_TextNode._hoeheProBuchstabe + num + num); base._paintPos.PosX += num3; } if (base._xmlNode == base._xmlEditor.CursorOptimiert.StartPos.AktNode && base._xmlEditor.CursorOptimiert.StartPos.PosAmNode == XMLCursorPositionen.CursorHinterDemNode) { base._cursorStrichPos = new Point(base._paintPos.PosX - 1, base._paintPos.PosY); } }
protected override void NodeZeichnenStart( XMLPaintArten paintArt, int offSetX, int offSetY, PaintEventArgs e) { int num1 = 2; int num2 = 0; if (paintArt == XMLPaintArten.Vorberechnen) { int selektionStart = -1; int selektionLaenge = 0; this.StartUndEndeDerSelektionBestimmen(ref selektionStart, ref selektionLaenge); int maxLaengeProZeile = (int)((double)(this._paintPos.ZeilenEndeX - this._paintPos.ZeilenStartX) / (double)XMLElement_TextNode._breiteProBuchstabe); int bereitsLaengeDerZeile = (int)((double)this._paintPos.PosX / (double)XMLElement_TextNode._breiteProBuchstabe); this._textTeile = new TextTeiler(this.AktuellerInhalt, selektionStart, selektionLaenge, maxLaengeProZeile, bereitsLaengeDerZeile, this.ZeichenZumUmbrechen).TextTeile; } else { foreach (TextTeil textTeil in this._textTeile) { using (SolidBrush solidBrush = new SolidBrush(this.GetHintergrundFarbe(textTeil.Invertiert))) e.Graphics.FillRectangle((Brush)solidBrush, textTeil.Rechteck); } } foreach (TextTeil textTeil in this._textTeile) { int num3 = (int)((double)XMLElement_TextNode._breiteProBuchstabe * (double)textTeil.Text.Length); if (textTeil.IstNeueZeile) { this._paintPos.PosY += this._xmlEditor.Regelwerk.AbstandYZwischenZeilen + this._paintPos.HoeheAktZeile; this._paintPos.PosX = this._paintPos.ZeilenStartX; this._paintPos.HoeheAktZeile = XMLElement_TextNode._hoeheProBuchstabe + num1 * 2; } if (paintArt == XMLPaintArten.Vorberechnen) { textTeil.Rechteck = new Rectangle(this._paintPos.PosX, this._paintPos.PosY, (int)((double)XMLElement_TextNode._breiteProBuchstabe * (double)textTeil.Text.Length), XMLElement_TextNode._hoeheProBuchstabe + num1 * 2); if (this._xmlNode == this._xmlEditor.CursorOptimiert.StartPos.AktNode && this._xmlEditor.CursorOptimiert.StartPos.PosAmNode == XMLCursorPositionen.CursorInnerhalbDesTextNodes && (this._xmlEditor.CursorOptimiert.StartPos.PosImTextnode >= num2 && this._xmlEditor.CursorOptimiert.StartPos.PosImTextnode <= num2 + textTeil.Text.Length)) { this._cursorStrichPos = new Point(Math.Max(this._paintPos.PosX, this._paintPos.PosX + (int)((double)(this._xmlEditor.CursorOptimiert.StartPos.PosImTextnode - num2) * (double)XMLElement_TextNode._breiteProBuchstabe)), this._paintPos.PosY); } num2 += textTeil.Text.Length; this._klickBereiche.Add(textTeil.Rechteck); } else { e.Graphics.DrawString(textTeil.Text, XMLElement_TextNode._drawFont, (Brush)this.GetZeichenFarbe(textTeil.Invertiert), (float)textTeil.Rechteck.X, (float)(textTeil.Rechteck.Y + num1), XMLElement_TextNode._drawFormat); } this._paintPos.BisherMaxX = Math.Max(this._paintPos.BisherMaxX, textTeil.Rechteck.X + textTeil.Rechteck.Width); this._paintPos.HoeheAktZeile = Math.Max(this._paintPos.HoeheAktZeile, XMLElement_TextNode._hoeheProBuchstabe + num1 + num1); this._paintPos.PosX += num3; } if (this._xmlNode != this._xmlEditor.CursorOptimiert.StartPos.AktNode || this._xmlEditor.CursorOptimiert.StartPos.PosAmNode != XMLCursorPositionen.CursorHinterDemNode) { return; } this._cursorStrichPos = new Point(this._paintPos.PosX - 1, this._paintPos.PosY); }
protected virtual void NodeZeichnenAbschluss( XMLPaintArten paintArt, int offSetX, int offSetY, PaintEventArgs e) { this.ZeichneCursorStrich(e); }
private void AttributeZeichnen(XMLPaintArten paintArt, PaintEventArgs e) { XmlAttributeCollection attributes = base.XMLNode.Attributes; if (attributes != null && attributes.Count != 0) { StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < attributes.Count; i++) { stringBuilder.AppendFormat(" {0}=\"{1}\"", attributes[i].Name, attributes[i].Value); } int num = (int)(XMLElement_StandardNode._breiteProBuchstabeAttribute * (float)stringBuilder.Length); int hoeheProBuchstabeNodeName = XMLElement_StandardNode._hoeheProBuchstabeNodeName; if (paintArt != 0) { this.zeichneRahmenNachGroesse(base._paintPos.PosX, base._paintPos.PosY + 2, num, hoeheProBuchstabeNodeName, 2, this._farbeAttributeHintergrund, this._farbeAttributeRand, e); using (SolidBrush brush = new SolidBrush(this._farbeAttributeSchrift)) { e.Graphics.DrawString(stringBuilder.ToString(), XMLElement_StandardNode._drawFontAttribute, brush, (float)(base._paintPos.PosX + 1), (float)(base._paintPos.PosY + 2), XMLElement_StandardNode._drawFormat); } } base._paintPos.PosX += num + 4; } }
protected virtual void UnternodesZeichnen( XMLPaintArten paintArt, int offSetX, int offSetY, PaintEventArgs e) { if (this._xmlNode is XmlText) { return; } if (this._xmlNode == null) { throw new ApplicationException("UnternodesZeichnen:XMLNode ist leer"); } this._paintPos.PosX += this._xmlEditor.Regelwerk.AbstandFliessElementeX; switch (this._xmlEditor.Regelwerk.DarstellungsArt(this._xmlNode)) { case DarstellungsArten.EigeneZeile: this._paintPos.ZeilenStartX = this._paintPos.PosX; break; } for (int index = 0; index < this._xmlNode.ChildNodes.Count; ++index) { XMLElement element; if (index >= this._childElemente.Count) { element = this._xmlEditor.createElement(this._xmlNode.ChildNodes[index]); this._childElemente.Add((object)element); } else { element = (XMLElement)this._childElemente[index]; if (element == null) { throw new ApplicationException(string.Format("UnternodesZeichnen:childElement ist leer: PaintArt:{0} outerxml:{1} >> innerxml {2}", (object)paintArt, (object)this._xmlNode.OuterXml, (object)this._xmlNode.InnerXml)); } if (element.XMLNode != this._xmlNode.ChildNodes[index] && paintArt == XMLPaintArten.Vorberechnen) { element.Dispose(); element = this._xmlEditor.createElement(this._xmlNode.ChildNodes[index]); this._childElemente[index] = (object)element; } } switch (this._xmlEditor.Regelwerk.DarstellungsArt(element.XMLNode)) { case DarstellungsArten.Fliesselement: if (this._paintPos.PosX > this._paintPos.ZeilenEndeX) { this._paintPos.PosY += this._paintPos.HoeheAktZeile + this._xmlEditor.Regelwerk.AbstandYZwischenZeilen; this._paintPos.HoeheAktZeile = 0; this._paintPos.PosX = this._paintPos.ZeilenStartX; } XMLEditorPaintPos xmlEditorPaintPos1 = new XMLEditorPaintPos() { ZeilenStartX = this._paintPos.ZeilenStartX, ZeilenEndeX = this._paintPos.ZeilenEndeX, PosX = this._paintPos.PosX, PosY = this._paintPos.PosY, HoeheAktZeile = this._paintPos.HoeheAktZeile }; element.PaintPos = xmlEditorPaintPos1; element.Paint(paintArt, offSetX, offSetY, e); break; case DarstellungsArten.EigeneZeile: this._paintPos.PosY += this._xmlEditor.Regelwerk.AbstandYZwischenZeilen + this._paintPos.HoeheAktZeile; this._paintPos.HoeheAktZeile = 0; this._paintPos.PosX = this._startX + this._xmlEditor.Regelwerk.ChildEinrueckungX; XMLEditorPaintPos xmlEditorPaintPos2 = new XMLEditorPaintPos() { ZeilenStartX = this._paintPos.ZeilenStartX, ZeilenEndeX = this._paintPos.ZeilenEndeX, PosX = this._paintPos.PosX, PosY = this._paintPos.PosY, HoeheAktZeile = this._paintPos.HoeheAktZeile }; if ((uint)paintArt > 0U) { using (Pen pen1 = new Pen(Color.Gray, 1f)) { pen1.DashStyle = DashStyle.Dash; pen1.StartCap = LineCap.SquareAnchor; pen1.EndCap = LineCap.NoAnchor; Graphics graphics1 = e.Graphics; Pen pen2 = pen1; Point ankerPos = this.AnkerPos; int x1 = ankerPos.X; ankerPos = this.AnkerPos; int y1 = ankerPos.Y; ankerPos = this.AnkerPos; int x2 = ankerPos.X; ankerPos = element.AnkerPos; int y2 = ankerPos.Y; graphics1.DrawLine(pen2, x1, y1, x2, y2); pen1.StartCap = LineCap.NoAnchor; pen1.EndCap = LineCap.SquareAnchor; Graphics graphics2 = e.Graphics; Pen pen3 = pen1; ankerPos = this.AnkerPos; int x3 = ankerPos.X; ankerPos = element.AnkerPos; int y3 = ankerPos.Y; ankerPos = element.AnkerPos; int x4 = ankerPos.X; ankerPos = element.AnkerPos; int y4 = ankerPos.Y; graphics2.DrawLine(pen3, x3, y3, x4, y4); } } element.PaintPos = xmlEditorPaintPos2; element.Paint(paintArt, offSetX, offSetY, e); break; default: int num = (int)MessageBox.Show("undefiniert"); break; } this._paintPos.PosX = element.PaintPos.PosX; this._paintPos.PosY = element.PaintPos.PosY; this._paintPos.HoeheAktZeile = element.PaintPos.HoeheAktZeile; this._paintPos.BisherMaxX = Math.Max(this._paintPos.BisherMaxX, element.PaintPos.BisherMaxX); } while (this._xmlNode.ChildNodes.Count < this._childElemente.Count) { XMLElement xmlElement = (XMLElement)this._childElemente[this._childElemente.Count - 1]; this._childElemente.Remove(this._childElemente[this._childElemente.Count - 1]); xmlElement.Dispose(); this._childElemente.TrimToSize(); } }
protected override void NodeZeichnenStart( XMLPaintArten paintArt, int offSetX, int offSetY, PaintEventArgs e) { if (paintArt == XMLPaintArten.Vorberechnen && this._xmlEditor.CursorOptimiert.StartPos.AktNode == this._xmlNode && this._xmlEditor.CursorOptimiert.StartPos.PosAmNode == XMLCursorPositionen.CursorVorDemNode) { this._cursorStrichPos = new Point(this._paintPos.PosX + 1, this._paintPos.PosY); } int num = (int)ToolboxUsercontrols.MeasureDisplayStringWidth(e.Graphics, this._xmlNode.Name, XMLElement_StandardNode._drawFontNodeName, XMLElement_StandardNode._drawFormat); if (paintArt != XMLPaintArten.Vorberechnen) { this.FarbenSetzen(paintArt); this.zeichneRahmenNachGroesse(this._paintPos.PosX, this._paintPos.PosY, this._rahmenBreite, this._rahmenHoehe, 3, this._farbeRahmenHintergrund, this._farbeRahmenRand, e); } using (SolidBrush solidBrush1 = new SolidBrush(this._farbeNodeNameSchrift)) { this._paintPos.PosX += 4; if (paintArt != XMLPaintArten.Vorberechnen) { e.Graphics.DrawString(this._xmlNode.Name, XMLElement_StandardNode._drawFontNodeName, (Brush)solidBrush1, (float)this._paintPos.PosX, (float)(this._paintPos.PosY + 2), XMLElement_StandardNode._drawFormat); } this._paintPos.PosX += num + 4; this.AttributeZeichnen(paintArt, e); this._rahmenBreite = this._paintPos.PosX - this._startX; this._rahmenHoehe = XMLElement_StandardNode._hoeheProBuchstabeNodeName + 2 + 2; ++this._paintPos.PosX; if (this._xmlEditor.Regelwerk.IstSchliessendesTagSichtbar(this._xmlNode)) { if ((uint)paintArt > 0U) { using (SolidBrush solidBrush2 = new SolidBrush(this._farbePfeil)) { int posX = this._paintPos.PosX; int y = this._paintPos.PosY + this._ankerEinzugY; Point[] points = new Point[3] { new Point(posX, y - 7), new Point(posX + 7, y), new Point(posX, y + 7) }; e.Graphics.FillPolygon((Brush)solidBrush2, points); this._pfeilBereichLinks = new Rectangle(posX, y - 7, 7, 14); } } this._paintPos.PosX += 7; } else { this._pfeilBereichLinks = new Rectangle(0, 0, 0, 0); } if (paintArt == XMLPaintArten.Vorberechnen && this._xmlEditor.CursorOptimiert.StartPos.AktNode == this._xmlNode && this._xmlEditor.CursorOptimiert.StartPos.PosAmNode == XMLCursorPositionen.CursorInDemLeeremNode) { this._cursorStrichPos = new Point(this._paintPos.PosX - 1, this._paintPos.PosY); } this._paintPos.HoeheAktZeile = Math.Max(this._paintPos.HoeheAktZeile, this._rahmenHoehe); if (paintArt == XMLPaintArten.Vorberechnen) { this._tagBereichLinks = new Rectangle(this._startX, this._startY, this._paintPos.PosX - this._startX, this._rahmenHoehe); this._klickBereiche.Add(this._tagBereichLinks); if (!this._xmlEditor.Regelwerk.IstSchliessendesTagSichtbar(this._xmlNode) && this._xmlEditor.CursorOptimiert.StartPos.AktNode == this._xmlNode && this._xmlEditor.CursorOptimiert.StartPos.PosAmNode == XMLCursorPositionen.CursorHinterDemNode) { this._cursorStrichPos = new Point(this._paintPos.PosX - 1, this._paintPos.PosY); } } this._paintPos.BisherMaxX = Math.Max(this._paintPos.BisherMaxX, this._paintPos.PosX); } }
protected override void NodeZeichnenAbschluss( XMLPaintArten paintArt, int offSetX, int offSetY, PaintEventArgs e) { if (e != null) { if (this._xmlEditor.Regelwerk.IstSchliessendesTagSichtbar(this._xmlNode)) { int posX1 = this._paintPos.PosX; if ((uint)paintArt > 0U) { using (SolidBrush solidBrush = new SolidBrush(this._farbePfeil)) { int posX2 = this._paintPos.PosX; int y = this._paintPos.PosY + this._ankerEinzugY; Point[] points = new Point[3] { new Point(posX2 + 7, y - 7), new Point(posX2, y), new Point(posX2 + 7, y + 7) }; e.Graphics.FillPolygon((Brush)solidBrush, points); this._pfeilBereichRechts = new Rectangle(posX2, y - 7, 7, 14); } } this._paintPos.PosX += 7; int num = XMLElement_StandardNode._hoeheProBuchstabeNodeName + 4; int width = (int)e.Graphics.MeasureString(this._xmlNode.Name, XMLElement_StandardNode._drawFontNodeName, 64000, XMLElement_StandardNode._drawFormat).Width; if ((uint)paintArt > 0U) { this.zeichneRahmenNachGroesse(this._paintPos.PosX, this._paintPos.PosY, width + 8, num, 3, this._farbeRahmenHintergrund, this._farbeRahmenRand, e); } this._paintPos.PosX += 4; if ((uint)paintArt > 0U) { using (SolidBrush solidBrush = new SolidBrush(this._farbeNodeNameSchrift)) e.Graphics.DrawString(this._xmlNode.Name, XMLElement_StandardNode._drawFontNodeName, (Brush)solidBrush, (float)this._paintPos.PosX, (float)(this._paintPos.PosY + 2), XMLElement_StandardNode._drawFormat); } this._paintPos.PosX += width + 4; ++this._paintPos.PosX; if (paintArt == XMLPaintArten.Vorberechnen) { this._tagBereichRechts = new Rectangle(posX1, this._paintPos.PosY, this._paintPos.PosX - posX1, num); this._klickBereiche.Add(this._tagBereichRechts); if (this._xmlEditor.CursorOptimiert.StartPos.AktNode == this._xmlNode && this._xmlEditor.CursorOptimiert.StartPos.PosAmNode == XMLCursorPositionen.CursorHinterDemNode) { this._cursorStrichPos = new Point(this._paintPos.PosX - 1, this._paintPos.PosY); } } this._paintPos.BisherMaxX = Math.Max(this._paintPos.BisherMaxX, this._paintPos.PosX); } else { this._pfeilBereichRechts = new Rectangle(0, 0, 0, 0); this._tagBereichRechts = new Rectangle(0, 0, 0, 0); } } base.NodeZeichnenAbschluss(paintArt, offSetX, offSetY, e); }
protected virtual void UnternodesZeichnen(XMLPaintArten paintArt, int offSetX, int offSetY, PaintEventArgs e) { if (!(this._xmlNode is XmlText)) { if (this._xmlNode == null) { throw new ApplicationException("UnternodesZeichnen:XMLNode ist leer"); } this._paintPos.PosX += this._xmlEditor.Regelwerk.AbstandFliessElementeX; switch (this._xmlEditor.Regelwerk.DarstellungsArt(this._xmlNode)) { case DarstellungsArten.EigeneZeile: this._paintPos.ZeilenStartX = this._paintPos.PosX; break; } for (int i = 0; i < this._xmlNode.ChildNodes.Count; i++) { XMLElement xMLElement; if (i >= this._childElemente.Count) { xMLElement = this._xmlEditor.createElement(this._xmlNode.ChildNodes[i]); this._childElemente.Add(xMLElement); } else { xMLElement = (XMLElement)this._childElemente[i]; if (xMLElement == null) { throw new ApplicationException(string.Format("UnternodesZeichnen:childElement ist leer: PaintArt:{0} outerxml:{1} >> innerxml {2}", paintArt, this._xmlNode.OuterXml, this._xmlNode.InnerXml)); } if (xMLElement.XMLNode != this._xmlNode.ChildNodes[i] && paintArt == XMLPaintArten.Vorberechnen) { xMLElement.Dispose(); xMLElement = this._xmlEditor.createElement(this._xmlNode.ChildNodes[i]); this._childElemente[i] = xMLElement; } } switch (this._xmlEditor.Regelwerk.DarstellungsArt(xMLElement.XMLNode)) { case DarstellungsArten.Fliesselement: { if (this._paintPos.PosX > this._paintPos.ZeilenEndeX) { this._paintPos.PosY += this._paintPos.HoeheAktZeile + this._xmlEditor.Regelwerk.AbstandYZwischenZeilen; this._paintPos.HoeheAktZeile = 0; this._paintPos.PosX = this._paintPos.ZeilenStartX; } XMLEditorPaintPos obj = new XMLEditorPaintPos { ZeilenStartX = this._paintPos.ZeilenStartX, ZeilenEndeX = this._paintPos.ZeilenEndeX, PosX = this._paintPos.PosX, PosY = this._paintPos.PosY, HoeheAktZeile = this._paintPos.HoeheAktZeile }; XMLEditorPaintPos paintPos = xMLElement.PaintPos = obj; xMLElement.Paint(paintArt, offSetX, offSetY, e); break; } case DarstellungsArten.EigeneZeile: { this._paintPos.PosY += this._xmlEditor.Regelwerk.AbstandYZwischenZeilen + this._paintPos.HoeheAktZeile; this._paintPos.HoeheAktZeile = 0; this._paintPos.PosX = this._startX + this._xmlEditor.Regelwerk.ChildEinrueckungX; XMLEditorPaintPos paintPos = new XMLEditorPaintPos { ZeilenStartX = this._paintPos.ZeilenStartX, ZeilenEndeX = this._paintPos.ZeilenEndeX, PosX = this._paintPos.PosX, PosY = this._paintPos.PosY, HoeheAktZeile = this._paintPos.HoeheAktZeile }; if (paintArt != 0) { using (Pen pen = new Pen(Color.Gray, 1f)) { pen.DashStyle = DashStyle.Dash; pen.StartCap = LineCap.SquareAnchor; pen.EndCap = LineCap.NoAnchor; Graphics graphics = e.Graphics; Pen pen2 = pen; Point ankerPos = this.AnkerPos; int x = ankerPos.X; ankerPos = this.AnkerPos; int y = ankerPos.Y; ankerPos = this.AnkerPos; int x2 = ankerPos.X; ankerPos = xMLElement.AnkerPos; graphics.DrawLine(pen2, x, y, x2, ankerPos.Y); pen.StartCap = LineCap.NoAnchor; pen.EndCap = LineCap.SquareAnchor; Graphics graphics2 = e.Graphics; Pen pen3 = pen; ankerPos = this.AnkerPos; int x3 = ankerPos.X; ankerPos = xMLElement.AnkerPos; int y2 = ankerPos.Y; ankerPos = xMLElement.AnkerPos; int x4 = ankerPos.X; ankerPos = xMLElement.AnkerPos; graphics2.DrawLine(pen3, x3, y2, x4, ankerPos.Y); } } xMLElement.PaintPos = paintPos; xMLElement.Paint(paintArt, offSetX, offSetY, e); break; } default: MessageBox.Show("undefiniert"); break; } this._paintPos.PosX = xMLElement.PaintPos.PosX; this._paintPos.PosY = xMLElement.PaintPos.PosY; this._paintPos.HoeheAktZeile = xMLElement.PaintPos.HoeheAktZeile; this._paintPos.BisherMaxX = Math.Max(this._paintPos.BisherMaxX, xMLElement.PaintPos.BisherMaxX); } while (this._xmlNode.ChildNodes.Count < this._childElemente.Count) { XMLElement xMLElement = (XMLElement)this._childElemente[this._childElemente.Count - 1]; this._childElemente.Remove(this._childElemente[this._childElemente.Count - 1]); xMLElement.Dispose(); this._childElemente.TrimToSize(); } } }
protected override void NodeZeichnenAbschluss(XMLPaintArten paintArt, int offSetX, int offSetY, PaintEventArgs e) { if (e != null) { if (base._xmlEditor.Regelwerk.IstSchliessendesTagSichtbar(base._xmlNode)) { int num = 0; int posX = base._paintPos.PosX; int num2 = 0; if (paintArt != 0) { using (SolidBrush brush = new SolidBrush(this._farbePfeil)) { int posX2 = base._paintPos.PosX; int num3 = base._paintPos.PosY + this._ankerEinzugY; Point point = new Point(posX2 + 7, num3 - 7); Point point2 = new Point(posX2, num3); Point point3 = new Point(posX2 + 7, num3 + 7); Point[] points = new Point[3] { point, point2, point3 }; e.Graphics.FillPolygon(brush, points); this._pfeilBereichRechts = new Rectangle(posX2, num3 - 7, 7, 14); } } base._paintPos.PosX += 7; num2 = XMLElement_StandardNode._hoeheProBuchstabeNodeName + 4; num = (int)e.Graphics.MeasureString(base._xmlNode.Name, XMLElement_StandardNode._drawFontNodeName, 64000, XMLElement_StandardNode._drawFormat).Width; if (paintArt != 0) { this.zeichneRahmenNachGroesse(base._paintPos.PosX, base._paintPos.PosY, num + 8, num2, 3, this._farbeRahmenHintergrund, this._farbeRahmenRand, e); } base._paintPos.PosX += 4; if (paintArt != 0) { using (SolidBrush brush2 = new SolidBrush(this._farbeNodeNameSchrift)) { e.Graphics.DrawString(base._xmlNode.Name, XMLElement_StandardNode._drawFontNodeName, brush2, (float)base._paintPos.PosX, (float)(base._paintPos.PosY + 2), XMLElement_StandardNode._drawFormat); } } base._paintPos.PosX += num + 4; base._paintPos.PosX++; if (paintArt == XMLPaintArten.Vorberechnen) { this._tagBereichRechts = new Rectangle(posX, base._paintPos.PosY, base._paintPos.PosX - posX, num2); base._klickBereiche.Add(this._tagBereichRechts); if (base._xmlEditor.CursorOptimiert.StartPos.AktNode == base._xmlNode && base._xmlEditor.CursorOptimiert.StartPos.PosAmNode == XMLCursorPositionen.CursorHinterDemNode) { base._cursorStrichPos = new Point(base._paintPos.PosX - 1, base._paintPos.PosY); } } base._paintPos.BisherMaxX = Math.Max(base._paintPos.BisherMaxX, base._paintPos.PosX); } else { this._pfeilBereichRechts = new Rectangle(0, 0, 0, 0); this._tagBereichRechts = new Rectangle(0, 0, 0, 0); } } base.NodeZeichnenAbschluss(paintArt, offSetX, offSetY, e); }