implement helper function to get property value as a specific type
This commit is contained in:
parent
d6e08850e2
commit
0e0e176111
@ -354,5 +354,15 @@ namespace UniversalEditor.ObjectModels.FileSystem
|
||||
bw.Flush();
|
||||
return count;
|
||||
}
|
||||
|
||||
public T GetProperty<T>(string name, T defaultValue = default(T))
|
||||
{
|
||||
if (Properties.ContainsKey(name))
|
||||
{
|
||||
if (Properties[name] is T)
|
||||
return (T)Properties[name];
|
||||
}
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user