230 lines
6.2 KiB
C#
230 lines
6.2 KiB
C#
using HandyControl.Controls;
|
|
using Laservall.Solidworks.Common;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows.Media;
|
|
using ReadOnlyTextPropertyEditor = Laservall.Solidworks.Common.ReadOnlyTextPropertyEditor;
|
|
|
|
namespace Laservall.Solidworks.Model
|
|
{
|
|
public class PartPropModel : INotifyPropertyChanged
|
|
{
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
|
{
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
}
|
|
|
|
private string _drawNo;
|
|
[Category("设计")]
|
|
[DisplayName("图号")]
|
|
[Editor(typeof(ReadOnlyTextPropertyEditor), typeof(ReadOnlyTextPropertyEditor))]
|
|
public string DrawNo
|
|
{
|
|
get => _drawNo;
|
|
set
|
|
{
|
|
if (_drawNo == value) return;
|
|
_drawNo = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
private string _docNumber;
|
|
[Category("设计")]
|
|
[DisplayName("文档编码")]
|
|
[Editor(typeof(ReadOnlyTextPropertyEditor), typeof(ReadOnlyTextPropertyEditor))]
|
|
public string DocNumber
|
|
{
|
|
get => _docNumber;
|
|
set
|
|
{
|
|
if (_docNumber == value) return;
|
|
_docNumber = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
private string _partName;
|
|
[Category("设计")]
|
|
[DisplayName("零件名称")]
|
|
public string PartName
|
|
{
|
|
get => _partName;
|
|
set
|
|
{
|
|
if (_partName == value) return;
|
|
_partName = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
private string _designer;
|
|
[Category("设计")]
|
|
[DisplayName("设计")]
|
|
public string Designer
|
|
{
|
|
get => _designer;
|
|
set
|
|
{
|
|
if (_designer == value) return;
|
|
_designer = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
private string _partProp;
|
|
[Category("零件属性")]
|
|
[DisplayName("属性")]
|
|
public string PartProp
|
|
{
|
|
get => _partProp;
|
|
set
|
|
{
|
|
if (_partProp == value) return;
|
|
_partProp = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
private string _material;
|
|
[Category("零件属性")]
|
|
[DisplayName("材质")]
|
|
[Editor(typeof(ComboxPropertyEditor), typeof(ComboxPropertyEditor))]
|
|
public string Material
|
|
{
|
|
get => _material;
|
|
set
|
|
{
|
|
if (_material == value) return;
|
|
_material = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
private string _classNo;
|
|
[Category("零件属性")]
|
|
[DisplayName("分类")]
|
|
[Editor(typeof(ComboxPropertyEditor), typeof(ComboxPropertyEditor))]
|
|
public string ClassNo
|
|
{
|
|
get => _classNo;
|
|
set
|
|
{
|
|
if (_classNo == value) return;
|
|
_classNo = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
private string _surfaceTreatment;
|
|
[Category("零件属性")]
|
|
[DisplayName("表面处理")]
|
|
[Editor(typeof(ComboxPropertyEditor), typeof(ComboxPropertyEditor))]
|
|
public string SurfaceTreatment
|
|
{
|
|
get => _surfaceTreatment;
|
|
set
|
|
{
|
|
if (_surfaceTreatment == value) return;
|
|
_surfaceTreatment = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
private string _brand;
|
|
[Category("零件属性")]
|
|
[DisplayName("品牌")]
|
|
[Editor(typeof(ComboxPropertyEditor), typeof(ComboxPropertyEditor))]
|
|
public string Brand
|
|
{
|
|
get => _brand;
|
|
set
|
|
{
|
|
if (_brand == value) return;
|
|
_brand = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
private string _unit;
|
|
[Category("零件属性")]
|
|
[DisplayName("单位")]
|
|
[Editor(typeof(ComboxPropertyEditor), typeof(ComboxPropertyEditor))]
|
|
public string Unit
|
|
{
|
|
get => _unit;
|
|
set
|
|
{
|
|
if (_unit == value) return;
|
|
_unit = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
private string _partType;
|
|
[Category("零件属性")]
|
|
[DisplayName("零件类型")]
|
|
[Editor(typeof(SearchableComboBoxPropertyEditor), typeof(SearchableComboBoxPropertyEditor))]
|
|
public string PartType
|
|
{
|
|
get => _partType;
|
|
set
|
|
{
|
|
if (_partType == value) return;
|
|
_partType = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
private bool _purCheck;
|
|
[Category("零件属性")]
|
|
[DisplayName("采购检验")]
|
|
public bool PurCheck
|
|
{
|
|
get => _purCheck;
|
|
set
|
|
{
|
|
if (_purCheck == value) return;
|
|
_purCheck = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
private double _wight;
|
|
[Category("零件属性")]
|
|
[DisplayName("重量")]
|
|
[Editor(typeof(ReadOnlyTextPropertyEditor), typeof(ReadOnlyTextPropertyEditor))]
|
|
public double Wight
|
|
{
|
|
get => _wight;
|
|
set
|
|
{
|
|
if (_wight == value) return;
|
|
_wight = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
private string _remark;
|
|
[Category("杂项")]
|
|
[DisplayName("备注")]
|
|
public string Remark
|
|
{
|
|
get => _remark;
|
|
set
|
|
{
|
|
if (_remark == value) return;
|
|
_remark = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
}
|
|
}
|