// function to refresh the property values of an RunningObjectTableComponent object private void Refresh() { // set default values this._IsDirty = false; this._IsRunning = false; // refresh the properties of the component by a call to GetComponentsFromROT() foreach (RunningObjectTableComponentInfo RunningROTComponent in RunningObjectTable.GetComponentsFromROT()) { // if the object is still in the ROT table we refresh the property values if (RunningROTComponent.DisplayName == this.DisplayName) { // if the object is still in the ROT table and the refreshed property _IsRunning is still true we return true this._IsDirty = RunningROTComponent._IsDirty; // if the object is still in the ROT table and the refreshed property _IsRunning is still true we return true this._IsRunning = RunningROTComponent._IsRunning; // if the object is still in the ROT table we return the refreshed LastChanged DateTime this._LastChanged = RunningROTComponent._LastChanged; break; } } }
// if this object is still in the Running Object Table (ROT) we try to return the reference to it public object GetInstance() { return(RunningObjectTable.GetInstanceFromROT(this)); }