Exemplo n.º 1
0
    private async Task GetGroupItemsAsync(O365DataGroup group) {
      switch (group.UniqueId) {
        case "calendar":
          var ops = new O365Helpers.CalendarOperations();
          //var events = await ops.GetTodaysCalendar(48, 48);
          var events = await ops.GetCalendarEvents();
          foreach (ViewModels.EventViewModel item in events) {
            group.Items.Add(new O365DataItem(item.Id, item.Subject, item.LocationName, "Assets/event.png", item.DisplayString, item.BodyContent));
          }

          break;

        case "contacts":
          break;
        case "mail":
          break;
        case "files":
          var fileOps = new O365Helpers.FileOperations();
          var files = await fileOps.GetMyFilesAsync();
          foreach (var item in files) {
            ViewModels.FileSystemItemViewModel vm = new ViewModels.FileSystemItemViewModel(item);
            string lastModified = String.Format("Last modified by {0} on {1:d}",
                                    vm.FileSystemItem.LastModifiedBy,
                                    vm.FileSystemItem.DateTimeLastModified);
            group.Items.Add(new O365DataItem(vm.FileSystemItem.Id, vm.Name, lastModified, "Assets/file.png", vm.DisplayName, String.Empty));
          }
          break;
        default:
          break;
      }

    }
Exemplo n.º 2
0
        private async Task GetGroupItemsAsync(O365DataGroup group)
        {
            switch (group.UniqueId)
            {
            case "calendar":
                var ops    = new O365Helpers.CalendarOperations();
                var events = await ops.GetCalendarEvents();

                foreach (var item in events)
                {
                    group.Items.Add(new O365DataItem(item.Id, item.Subject, item.LocationName, "Assets/event.png", item.DisplayString, item.BodyContent));
                }
                break;

            case "files":
                var fileOps = new O365Helpers.FileOperations();
                var files   = await fileOps.GetMyFilesAsync();

                foreach (var item in files)
                {
                    group.Items.Add(new O365DataItem(item.Id, item.Name, item.LastModified, "Assets/files.png", item.DisplayName, String.Empty));
                }
                break;

            default:
                break;
            }
        }
        private async Task GetGroupItemsAsync(O365DataGroup group)
        {
            switch (group.UniqueId)
            {
                case "calendar":
                    var ops = new O365Helpers.CalendarOperations();
                    var events = await ops.GetCalendarEvents();
                    foreach (var item in events)
                    {
                        group.Items.Add(new O365DataItem(item.Id, item.Subject, item.LocationName, "Assets/event.png", item.DisplayString, item.BodyContent));
                    }
                    break;

                case "files":
                    var fileOps = new O365Helpers.FileOperations();
                    var files = await fileOps.GetMyFilesAsync();
                    foreach (var item in files)
                    {
                        group.Items.Add(new O365DataItem(item.Id, item.Name, item.LastModified, "Assets/files.png", item.DisplayName, String.Empty));
                    }
                    break;

                default:
                    break;
            }

        }
Exemplo n.º 4
0
        private async Task GetGroupItemsAsync(O365DataGroup group)
        {
            switch (group.UniqueId)
            {
            case "calendar":
                var ops = new O365Helpers.CalendarOperations();
                //var events = await ops.GetTodaysCalendar(48, 48);
                var events = await ops.GetCalendarEvents();

                foreach (ViewModels.EventViewModel item in events)
                {
                    group.Items.Add(new O365DataItem(item.Id, item.Subject, item.LocationName, "Assets/event.png", item.DisplayString, item.BodyContent));
                }

                break;

            case "contacts":
                break;

            case "mail":
                break;

            case "files":
                var fileOps = new O365Helpers.FileOperations();
                var files   = await fileOps.GetMyFilesAsync();

                foreach (var item in files)
                {
                    ViewModels.FileSystemItemViewModel vm = new ViewModels.FileSystemItemViewModel(item);
                    string lastModified = String.Format("Last modified by {0} on {1:d}",
                                                        vm.FileSystemItem.LastModifiedBy,
                                                        vm.FileSystemItem.DateTimeLastModified);
                    group.Items.Add(new O365DataItem(vm.FileSystemItem.Id, vm.Name, lastModified, "Assets/file.png", vm.DisplayName, String.Empty));
                }
                break;

            default:
                break;
            }
        }