Files
ZuneShell.dll/UIX/Microsoft/Iris/ViewItems/TextRunData.cs
T

62 lines
1.7 KiB
C#
Raw Normal View History

// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ViewItems.TextRunData
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Drawing;
using Microsoft.Iris.Render;
namespace Microsoft.Iris.ViewItems
{
internal class TextRunData
{
private TextRun _textRun;
private Text _textViewItem;
private Point _position;
private Size _size;
private bool _isOnLastLine;
private int _lineNumber;
public TextRunData(
TextRun textRun,
bool isOnLastLine,
Text textViewItem,
int lineAlignmentOffset)
{
2021-04-02 19:10:51 -05:00
_textRun = textRun;
_size = textRun.Size;
_position = textRun.Position;
_position.X += lineAlignmentOffset;
_lineNumber = textRun.Line;
_isOnLastLine = isOnLastLine;
_textViewItem = textViewItem;
}
2021-04-02 19:10:51 -05:00
public Point Position => _position;
2021-04-02 19:10:51 -05:00
public Size Size => _size;
2021-04-02 19:10:51 -05:00
public Color Color => _textRun == null ? new Color(0U) : _textRun.Color;
2021-04-02 19:10:51 -05:00
public int LineNumber => _lineNumber;
2021-04-02 19:10:51 -05:00
public TextRun Run => _textRun;
2021-04-02 19:10:51 -05:00
public Text TextViewItem => _textViewItem;
2021-04-02 19:10:51 -05:00
public bool IsOnLastLine => _isOnLastLine;
public void NotifyPaintInvalid()
{
2021-04-02 19:10:51 -05:00
if (PaintInvalid == null)
return;
2021-04-02 19:10:51 -05:00
PaintInvalid();
}
2021-03-31 17:15:06 -05:00
public override string ToString() => string.Format("[ Text = {0}, Position = {1}, Size = {2} ]", _textRun.Content, _position, _size);
public event PaintInvalidEventHandler PaintInvalid;
}
}