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.
68 lines
2.3 KiB
68 lines
2.3 KiB
using Eplan.EplApi.MasterData;
|
|
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;
|
|
|
|
namespace KPlan.Forms {
|
|
public class EPlanTreeItem : TreeViewItem {
|
|
|
|
public string object_string { get; set; }
|
|
public MDPart part { get; set; }
|
|
public bool isLoadMark = false;
|
|
public int groupId { get; set; }
|
|
/// <summary>
|
|
/// 分类用
|
|
/// </summary>
|
|
public MDPartsDatabaseItem.Enums.ProductGroup productGroup { get; set; }
|
|
public MDPartsDatabaseItem.Enums.ProductTopGroup productTopGroup { get; set; }
|
|
public bool isProductGroup = false;
|
|
|
|
|
|
public EPlanTreeItem() {
|
|
Header = "Loading";
|
|
isLoadMark = true;
|
|
}
|
|
|
|
public EPlanTreeItem(MDPart obj,string groupName) {
|
|
if (obj == null) {
|
|
Header = "Loading";
|
|
}
|
|
else {
|
|
this.part = obj;
|
|
this.object_string = this.part.PartNr;
|
|
Header = this.object_string;
|
|
Resources["ICON"] = TCUtil.GetIcon(groupName);
|
|
}
|
|
}
|
|
|
|
public EPlanTreeItem(MDPartsDatabaseItem.Enums.ProductTopGroup topGroup) {
|
|
this.groupId = (int)topGroup;
|
|
string header = MDPartsDatabaseItem.GetProductTopGroupName(topGroup);
|
|
if (KUtil.IsEmpty(header)) { header = topGroup.ToString(); }
|
|
Header = header;
|
|
Resources["ICON"] = new BitmapImage(new Uri("pack://application:,,,/EPLAN.EplAddin.KPlan;component/Resources_EPLAN/e_folder.png"));
|
|
}
|
|
|
|
public EPlanTreeItem(MDPartsDatabaseItem.Enums.ProductTopGroup topGroup,MDPartsDatabaseItem.Enums.ProductGroup group) {
|
|
this.groupId = (int)group;
|
|
this.productGroup = group;//分类用
|
|
this.productTopGroup = topGroup;
|
|
this.isProductGroup = true;
|
|
string header = MDPartsDatabaseItem.GetProductGroupName(group);
|
|
Header = header;
|
|
Resources["ICON"] = TCUtil.GetIcon(header);
|
|
}
|
|
|
|
public EPlanTreeItem(string header) {
|
|
Header = header;
|
|
Resources["ICON"] = new BitmapImage(new Uri("pack://application:,,,/EPLAN.EplAddin.KPlan;component/Resources_EPLAN/e_folder.png"));
|
|
}
|
|
|
|
}
|
|
}
|