Пример #1
0
 private bool EnsureDataSnapshotIsUpToDate()
 {
     // If the snapshot data is null, we have to create it
     if (_cameraDataSnapshot == null)
     {
         _cameraDataSnapshot = new CameraDataSnapshot();
         _cameraDataSnapshot.TakeSnapshot(Camera);
         return(true);
     }
     else
     {
         // Build a new camera data snapshot instance and check if it is different
         // from the current one. If it is, we will update the data snapshot reference.
         CameraDataSnapshot newCameraDataSnapshot = new CameraDataSnapshot();
         newCameraDataSnapshot.TakeSnapshot(Camera);
         if (newCameraDataSnapshot != _cameraDataSnapshot)
         {
             _cameraDataSnapshot = newCameraDataSnapshot;
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Пример #2
0
        public bool Equals(CameraDataSnapshot cameraDataSnapshot)
        {
            if (ReferenceEquals(cameraDataSnapshot, null))
            {
                return(false);
            }
            if (ReferenceEquals(cameraDataSnapshot, this))
            {
                return(true);
            }

            return(IsEqual(cameraDataSnapshot));
        }
Пример #3
0
 private bool IsEqual(CameraDataSnapshot cameraDataSnapshot)
 {
     return(_transformSnapshot == cameraDataSnapshot._transformSnapshot &&
            _cameraType == cameraDataSnapshot._cameraType);
 }