123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- using System;
- using System.ComponentModel;
- using System.Windows;
- using System.Windows.Media;
- namespace PRSDesktop
- {
- public class OrgChartEntry : INotifyPropertyChanged
- {
- private string _background = "#00000000";
- private string _color = "#00000000";
- private Guid _id = Guid.Empty;
- private ImageBrush _image = new();
- private Guid _imageid = Guid.Empty;
- private string _name;
- private Guid _parentid = Guid.Empty;
- private string _position;
- private bool _visible;
- public Guid ID
- {
- get => _id;
- set
- {
- if (_id != value)
- {
- _id = value;
- OnPropertyChanged("ID");
- }
- }
- }
- public Guid ParentID
- {
- get => _parentid;
- set
- {
- if (_parentid != value)
- {
- _parentid = value;
- OnPropertyChanged("ParentID");
- }
- }
- }
- public string Position
- {
- get => _position;
- set
- {
- if (_position != value)
- {
- _position = value;
- OnPropertyChanged("Position");
- }
- }
- }
- public string Name
- {
- get => _name;
- set
- {
- if (_name != value)
- {
- _name = value;
- OnPropertyChanged("Name");
- }
- }
- }
- public Guid ImageID
- {
- get => _imageid;
- set
- {
- if (_imageid != value)
- {
- _imageid = value;
- OnPropertyChanged("ImageID");
- }
- }
- }
- public ImageBrush Image
- {
- get => _image;
- set
- {
- if (_image != value)
- if (value != null)
- {
- _image = value;
- OnPropertyChanged("Image");
- }
- }
- }
- public Visibility ImageVisible => _imageid != Guid.Empty ? Visibility.Visible : Visibility.Collapsed;
- public string Color
- {
- get => _color;
- set
- {
- if (_color != value)
- if (value != null)
- {
- _color = value;
- OnPropertyChanged("Color");
- }
- }
- }
- public bool Visible
- {
- get => _visible;
- set
- {
- if (_visible != value)
- {
- _visible = value;
- OnPropertyChanged("Visible");
- }
- }
- }
- public string WarningColor
- {
- get => _background;
- set
- {
- if (_background != value)
- if (value != null)
- {
- _background = value;
- OnPropertyChanged("WarningColor");
- }
- }
- }
- public event PropertyChangedEventHandler PropertyChanged;
- private void OnPropertyChanged(string name)
- {
- if (PropertyChanged != null) PropertyChanged.Invoke(this, new PropertyChangedEventArgs(name));
- }
- }
- }
|