You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.2 KiB

using KPlan.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
using Teamcenter.Soa.Client.Model;
namespace KPlan.Forms {
class TCTreeItem : TreeViewItem{
public ModelObject mo { get; set; }
public string object_string { get; set; }
public TCTreeItem(ModelObject obj) {
if (obj == null) {
Header = "Loading";
}
else {
this.mo = obj;
ModelObject[] objs = TCUtil.Refresh(mo);
TCUtil.GetProperties(false, objs, "object_string");
this.object_string = "[" + mo.SoaType.Name + "]" + mo.GetPropertyDisplayableValue("object_string");
Header = this.object_string;
Resources["ICON"] = new BitmapImage(new Uri("pack://application:,,,/EPLAN.EplAddin.KPlan;component/Resources/" + TCUtil.GetIconName(mo)));
}
}
public TCTreeItem(ModelObject mo, string folderName,string iconName) {
Header = folderName;
this.mo = mo;
Resources["ICON"] = new BitmapImage(new Uri("pack://application:,,,/EPLAN.EplAddin.KPlan;component/Resources/"+iconName));
}
}
}