You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// <param name="FilePath">Set the path for saving and loading. This can be an absolute path (eg c:\test.cfg) or a relative path from the location of the assembly dll (eg. ../config/test)</param>
/// This overridable function executes whenever the object is loaded from a config node structure. Use this for complex classes that need decoding from simple confignode values
67
+
/// </summary>
68
+
publicvirtualvoidOnDecodeFromConfigNode(){}
69
+
/// <summary>
70
+
/// This overridable function executes whenever the object is encoded to a config node structure. Use this for complex classes that need encoding into simple confignode values
71
+
/// </summary>
72
+
publicvirtualvoidOnEncodeToConfigNode(){}
73
+
#endregion
74
+
75
+
/// <summary>
76
+
/// Test whether the configured FilePath exists
77
+
/// </summary>
78
+
/// <returns>True if its there</returns>
79
+
publicBooleanFileExists
80
+
{
81
+
get
82
+
{
83
+
returnSystem.IO.File.Exists(FilePath);
84
+
}
85
+
}
86
+
87
+
/// <summary>
88
+
/// Loads the object from the ConfigNode structure in the previously supplied file
89
+
/// </summary>
90
+
/// <returns>Succes of Load</returns>
91
+
publicBooleanLoad()
92
+
{
93
+
returnthis.Load(FilePath);
94
+
}
95
+
/// <summary>
96
+
/// Loads the object from the ConfigNode structure in a file
97
+
/// </summary>
98
+
/// <param name="fileFullName">Absolute Path to the file to load the ConfigNode structure from</param>
99
+
/// <returns>Success of Load</returns>
100
+
publicBooleanLoad(StringfileFullName)
101
+
{
102
+
BooleanblnReturn=false;
103
+
try
104
+
{
105
+
if(FileExists)
106
+
{
107
+
//Load the file into a config node
108
+
ConfigNodecnToLoad=ConfigNode.Load(fileFullName);
109
+
//remove the wrapper node that names the class stored
0 commit comments