Exemple #1
0
        public void CommitEdits(SetViewModel setViewModel, string newPassword, SetVisibility?newVisibility, SetEditPermissions?newPermissions, IEnumerable <long> groupIDs, Action completed, Action <Exception> errorHandler)
        {
            string editable   = newPermissions.HasValue ? newPermissions.Value.ToApiString() : null;
            string visibility = newVisibility.HasValue ? newVisibility.Value.ToApiString() : null;

            api.EditSet(setViewModel.ToSetInfo(), newPassword, visibility, editable, groupIDs, completed, errorHandler, new CancellationToken());
        }
Exemple #2
0
        public void RegisterSetInfo(SetViewModel set)
        {
            if (cache == null)
            {
                return;
            }

            cache.AddSetInfo(set.ToSetInfo());
        }
Exemple #3
0
        public void CreateSet(SetViewModel setViewModel, string password, IEnumerable <long> groupIDs, Action completed, Action <Exception> errorHandler)
        {
            setViewModel.Author = UserName;
            var si = setViewModel.ToSetInfo();

            api.CreateSet(
                si,
                password,
                groupIDs,
                (id, uri) => {
                si.ID  = setViewModel.ID = id;
                si.Uri = setViewModel.Uri = uri;

                cache.AddSetInfo(si);
                MySets.Insert(0, setViewModel);

                completed();
            },
                errorHandler,
                new CancellationToken());
        }