//-- Constructors #endregion //--------------------------------------------------------------------- #region Event Handlers private void m_updateTimer_Elapsed(object sender, ElapsedEventArgs e) { //-- Keep the start timestamp in mind var startDateTime = DateTime.Now; //-- Get all available Fhem objects var currentFhemObjects = m_fhemClient.GetFhemObjects(); //-- Determine old Fhem objects ////var oldFhemObjects = new List<FhemObject>(); ////foreach( FhemObject tmpFhemObject in m_fhemObjectsByNr.Values ) ////{ //// if( !currentFhemObjects.ContainsKey( tmpFhemObject.ID ) ) //// { //// oldFhemObjects.Add( tmpFhemObject ); //// } ////} ////-- Determine new Fhem objects //var newFhemObjects = new List<FhemObject>(); //foreach( FhemObject currentFhemObject in currentFhemObjects ) //{ // if( !m_fhemObjectsByNr.ContainsKey( currentFhemObject.ID ) ) // { // newFhemObjects.Add( currentFhemObject ); // } //} ////-- Raise the 'CollectionChanged' event //this.CollectionChanged?.Invoke( this, new NotifyCollectionChangedEventArgs( NotifyCollectionChangedAction.Replace, newFhemObjects, oldFhemObjects ) ); //-- Calculate the update duration this.LastUpdateDuration = DateTime.Now - startDateTime; }
public void FhemClient_GetFhemObjects_FhemClientNotConnectedTest() { var fhemClient = new FhemClient(); fhemClient.GetFhemObjects(); }