static void Main(string[] args) { LoginResult loginResult = InnoviApiService.Login("*****@*****.**", "password"); User user = loginResult.User; InnoviObjectCollection <SensorEvent> efdf = user.GetDefaultAccountEvents(); foreach (SensorEvent event1 in efdf) { string asds = event1.ClipPath; bool something = event1.IsClipAvailable; } InnoviObjectCollection <Folder> lazyFolders = user.GetDefaultAccountFolders(); foreach (Folder folder in lazyFolders) { InnoviObjectCollection <Sensor> allSensors = folder.GetAllSensors(); foreach (Sensor sensor in allSensors) { string live = sensor.LiveView; List <Sensor.Health> healthArray = sensor.SensorHealthArray; } } foreach (Folder folder in lazyFolders) { InnoviObjectCollection <SensorEvent> smartEvents = folder.FolderEvents; foreach (SensorEvent smartEvent in smartEvents) { SensorEvent.eBehaviorType bType = smartEvent.RuleName; } } InnoviObjectCollection <Sensor> lazySensors = user.GetDefaultAccountSensors(); InnoviObjectCollection <SensorEvent> lazyEvents = user.GetDefaultAccountEvents(); List <SensorEvent> testList = new List <SensorEvent>(); foreach (SensorEvent lazyEvent in lazyEvents) { testList.Add(lazyEvent); Console.WriteLine(lazyEvent.SensorName); } int i = 1; }
static void Main(string[] args) { LoginResult loginResult = InnoviApiService.Login("*****@*****.**", "password"); string accessToken = InnoviApiService.AccessToken; User user = loginResult.User; InnoviObjectCollection <Folder> folders = user.GetDefaultAccountFolders(); InnoviObjectCollection <Sensor> sensors = user.GetDefaultAccountSensors(); InnoviObjectCollection <SensorEvent> events = user.GetDefaultAccountEvents(); foreach (SensorEvent sensorEvent in events) { Console.WriteLine(sensorEvent.RuleName); Console.WriteLine(sensorEvent.SensorName); } int i = 1; }
private void fetchFoldersHierarchy() { InnoviObjectCollection <Folder> rootFolders = ServiceManager.Instance.LoginService.LoggedInUser.GetDefaultAccountFolders().Clone(); _cachedHierarchy = new Dictionary <Folder, ObservableCollection <FolderModel> >(); rootFoldersCache = new ObservableCollection <FolderModel>(foldersToFolderModels(rootFolders)); //<ImproveIt><begin> change to foreach loop - for now some issue arrises <begin><ImproveIt> IEnumerator <Folder> rootFoldersEnumerator = rootFolders.GetEnumerator(); bool hasNext = true; while (hasNext = rootFoldersEnumerator.MoveNext()) { _cachedHierarchy.Add(rootFoldersEnumerator.Current, new ObservableCollection <FolderModel>( foldersToFolderModels(rootFoldersEnumerator.Current.Folders))); fetchFoldersHierarchyHelper(rootFoldersEnumerator.Current); } lock (cacheLock) { cachedHierarchy = _cachedHierarchy; } //<ImproveIt><end> change to foreach loop <end><ImproveIt> }