/// <summary>
        /// Modify the selected contacts permissions over an outgoing shared folder
        /// </summary>
        /// <param name="newAccessLevel">New access level</param>
        private void ChangePermissions(MShareType newAccessLevel)
        {
            if (!this.ItemCollection.HasSelectedItems)
            {
                return;
            }

            // Use a temp variable to avoid InvalidOperationException
            this.ChangePermissionsMultipleContacts(this.ItemCollection.SelectedItems.ToList(), newAccessLevel);

            this.ItemCollection.IsMultiSelectActive = false;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Modify the contact permissions over an outgoing shared folder
        /// </summary>
        /// <param name="newAccessLevel">New access level</param>
        /// <returns>Result of the action</returns>
        public async Task <bool> ChangePermissionsAsync(MShareType newAccessLevel)
        {
            var changePermissions = new ShareRequestListenerAsync();
            var result            = await changePermissions.ExecuteAsync(() =>
            {
                SdkService.MegaSdk.shareByEmail(
                    SdkService.MegaSdk.getNodeByHandle(this._outShare.getNodeHandle()),
                    this.Email, (int)newAccessLevel, changePermissions);
            });

            return(result);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Modify the contact permissions over an outgoing shared folder
        /// </summary>
        /// <param name="newAccessLevel">New access level</param>
        private async void ChangePermissions(MShareType newAccessLevel)
        {
            var contactList = this.ContactList as ContactsListOutgoingSharedFolderViewModel;

            if (contactList?.ItemCollection != null && contactList.ItemCollection.IsMultiSelectActive)
            {
                if (contactList.ChangePermissionsCommand.CanExecute(newAccessLevel))
                {
                    contactList.ChangePermissionsCommand.Execute(newAccessLevel);
                }
                return;
            }

            await this.ChangePermissionsAsync(newAccessLevel);
        }
 /// <summary>
 /// Modify the selected contacts permissions over an outgoing shared folder
 /// </summary>
 /// <param name="newAccessLevel">New access level</param>
 private async void ChangePermissionsMultipleContacts(ICollection <IMegaContact> contacts, MShareType newAccessLevel)
 {
     foreach (var contact in contacts)
     {
         await(contact as ContactOutgoingSharedFolderViewModel).ChangePermissionsAsync(newAccessLevel);
     }
 }
Ejemplo n.º 5
0
 private void SetFolderPermission(MShareType accessLevel) => this.AccessLevel = accessLevel;