public void RemoveFileChangeListen(FileChangeCallback varFunc) { if (varFunc == null) { return; } if (AllListeners == null || AllListeners.Count == 0) { return; } AllListeners.Remove(varFunc); }
public void NotifyListener(string filePath) { if (AllListeners == null || AllListeners.Count == 0) { return; } for (int i = 0; i < AllListeners.Count; i++) { FileChangeCallback callback = AllListeners[i]; if (callback == null) { continue; } callback(filePath); } }
public void SetFileChangeListen(FileChangeCallback varFunc) { if (varFunc == null) { return; } if (AllListeners == null) { AllListeners = new List <FileChangeCallback>(); } if (AllListeners.Contains(varFunc)) { return; } AllListeners.Add(varFunc); }