private List<string> p_texts = new List<string>();
[PropNameAttribute("strings"), Description(""), PropCategoryAttribute("mtext")]
[RefreshProperties(RefreshProperties.Repaint)]
[Editor(@"System.Windows.Forms.Design.StringCollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
[Browsable(true)]
public List<string> Texts
{
get
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
Editor ed = doc.Editor;
bool f = false;
try
{
using (DocumentLock dcl = doc.LockDocument())
{
using (Transaction trans = doc.TransactionManager.StartOpenCloseTransaction())
{
PromptSelectionResult selected = ed.SelectImplied();
if (selected.Value != null && selected.Value.Count == 1)
{
Entity ent = (Entity)trans.GetObject(selected.Value[0].ObjectId, OpenMode.ForRead);
if (ent is Polyline)
{
Polyline pline = (Polyline)ent;
if (!pline.IsWriteEnabled)
{
f = true;
pline.UpgradeOpen();
}
MultiTextLeaderClass mt;
if (XDataClass.XDataRead(pline, out mt))
{
mt.Texts = Texts;
XDataClass.XDataUpdate(ref pline, mt);
pline.RecordGraphicsModified(true);
}
if (f)
pline.DowngradeOpen();
}
}
trans.Commit();
}
}
}
catch { }
Autodesk.AutoCAD.Internal.Utils.FlushGraphics();
return p_texts;
}
set { p_texts = value; }
}