-
Notifications
You must be signed in to change notification settings - Fork 0
OdinSearch_OutputConsumerBase
- OdinSearch_OutputConsumerBase
- IDisposable
The OdinSearch class Search Threads use this class to send output/communications to your code. This is the class one passes to OdinSearch to control what is done with the matches. To use this. Subclass it and override the Match routine plus any others.
- public virtual bool HasPendingActions() -> link to description
- public virtual bool ResolvePendingActions() -> link to it
- public string[] GetCustomParameterNames()
- public void SetCustomParameter(string name, object val)
- public object GetCustomParameter(string name)
- public object this[string ArgName]
- public virtual void WasNotMatched(FileSystemInfo info)
- public virtual void Match(FileSystemInfo info)
- public virtual void Blocked(string Blocked)
- public virtual void Messaging(string Message)
- public virtual bool SearchBegin(DateTime Start)
- public virtual void Dispose()
- public bool Disposed
- public bool EnableNotMatchCall
- public bool SearchOver
- public Uint128 TimesMatchCalled
- public Uint128 TimesNoMatchCalled
- public Uint128 TimesBlockCalled
- public Uint128 TimesMessageCalled
- protected readonly Dictionary<string, object> CustomParameters
public virtual bool HasPendingActions()
Description: If the class has pending stuff to do before reporting search is over, override this to give confirmation it's over. The Default Action is just it returns false.
Return Info: Returns a bool indicating if this class has pending actions to do or not.
Default Base Action: The default action always returns false which causes the OdinSearch class to figure the communication class is done.
public virtual bool ResolvePendingActions()
Description Fully Resolve any pending actions this class has do to.
Return Info return true if all actions are resolved
Default Base Action Always returns true as the default class does not need to do anything to resolve things.
public string[] GetCustomParameterNames()
Description: Get the names of set custom parameters for your class.
**Return Info: ** Returns an array containing make via ToArray() of the underlying Keys for the protected dictionary.
SetCustomParameter(string name, object val)
Description: Set a custom argument
Argument string name is the name of the parameter to set. Use a string.
Argument object val is the object to get as the argument once set.
public object GetCustomParameter(string name)
Description: Get the custom argument. Will throw an ArgumentNotFoundException if it does not exist.
Argument: string name is the name of the argument
Exceptions: ArgumentNotFoundException
this[string name]
Description Indexor to access custom arguments in a class based on this class.
Argument: string ArgName is the name of the argument
Exceptions: ArgumentNotFoundException
public virtual void WasNotMatched(FileSystemInfo info)
Description: FUTURE: Called if a file item was accessed by OdinSearch but it did not match the search settings.
Argument: FileSystemInfo Info is the item that did not match the search settings.
Default Action Default will increase the TimesNoMatchCalled if it is not at the cap.
public virtual void Match(FileSystemInfo info)
Description: This is called when an file system item matches the settings in OdinSearch.
Argument: FileSystemItem is the item that matched.
Default Action Default will increase the TimesMatchCalled if it is not at the cap.
public virtual void Blocked(string Blocked)
Description: This is called when the search encounters an exception when attempting to examine a file/folder
Argument: Blocked is the file system path to the item in question that we could not access or there was an exception in OdinSearch that caused accessing it to not work.
Default Action Default will increase the TimesBlockCalled if it is not at the cap
public virtual void Messaging(string Message)
Description: This is called with the search (OdinSearch) has text information to present that is not a block or filematch
Argument: string Message is the text information for the class to use.
Default Action: TimesMessageCalled is increased if not at the cap already.
public virtual bool SearchBegin(DateTime Start)
Description: This is called once for each thread when the search is started by OdinSearch. It's called shortly before each thread starts.
Return Type: bool
Return Info: Return true if your communcation class needs this call for each thread starting or return false if just once is fine.
Exception Info InvalidOperationException can be thrown if a custom required arg is not existing. That should stop the search from starting.
Default Action Returns false
public virtual void AllDone()
Description: OdinSearch calls this when all threads searching are done. Base just sets variable to true
Default Action: sets SearchOver flag to true.
public virtual void Dispose()
Description: Default Disposal routine, will invoke ResolvePendingActions also.