forked from Dijji/FileMeta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPropertyListEntry.cs
47 lines (41 loc) · 1.32 KB
/
PropertyListEntry.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) 2016, Dijji, and released under Ms-PL. This, with other relevant licenses, can be found in the root of this distribution.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
namespace FileMetadataAssociationManager
{
public class PropertyListEntry : INotifyPropertyChanged
{
public bool Asterisk { get; set; }
public string Name { get; set; }
public string NameString { get { return Asterisk ? "*" + Name : Name; } }
public PropertyListEntry(string nameString)
{
if (nameString.StartsWith("*"))
{
Asterisk = true;
Name = nameString.Substring(1);
}
else
{
Asterisk = false;
Name = nameString;
}
}
public void ToggleAsterisk()
{
Asterisk = !Asterisk;
OnPropertyChanged("NameString");
}
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(String info)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(info));
}
}
}
}