Class ProjectServiceBase<T>
[Display(Name = "工程数据", GroupName = "数据设置")]
public abstract class ProjectServiceBase<T> : BindableBase, INotifyPropertyChanged, IProjectService, ISplashSave, ISaveable, ISplashLoad, ILoadable, IDataSource<T> where T : IProjectItem
Type Parameters
T
- Inheritance
-
ProjectServiceBase<T>
- Implements
-
IDataSource<T>
- Derived
- Inherited Members
- Extension Methods
Constructors
ProjectServiceBase(IOptions<ProjectOptions>)
public ProjectServiceBase(IOptions<ProjectOptions> options)
Parameters
options
IOptions<ProjectOptions>
Properties
Collection
[Browsable(false)]
public IEnumerable<T> Collection { get; }
Property Value
- IEnumerable<T>
Current
[JsonIgnore]
[Browsable(false)]
public IProjectItem Current { get; set; }
Property Value
CurrentChanged
[JsonIgnore]
[Browsable(false)]
public Action<IProjectItem, IProjectItem> CurrentChanged { get; set; }
Property Value
Name
public string Name { get; }
Property Value
Methods
Add(params T[])
public virtual void Add(params T[] ts)
Parameters
ts
T[]
Clear()
public void Clear()
Create()
public abstract T Create()
Returns
- T
Delete(params T[])
public virtual void Delete(params T[] ts)
Parameters
ts
T[]
GetFolderPath()
protected virtual string GetFolderPath()
Returns
GetSerializer()
protected virtual ISerializerService GetSerializer()
Returns
Load(out string)
public virtual bool Load(out string message)
Parameters
message
string
Returns
LoadDefaultProjects()
protected virtual Projects<T> LoadDefaultProjects()
Returns
- Projects<T>
OnCurrentChanged(IProjectItem, IProjectItem)
protected virtual void OnCurrentChanged(IProjectItem o, IProjectItem n)
Parameters
OnItemChanged()
protected virtual void OnItemChanged()
Save(out string)
public virtual bool Save(out string message)
Parameters
message
string
Returns
Where(Func<IProjectItem, bool>)
public virtual IEnumerable<IProjectItem> Where(Func<IProjectItem, bool> func = null)
Parameters
func
Func<IProjectItem, bool>
Returns
Events
CollectionChanged
public event EventHandler CollectionChanged