Beispiel #1
0
        private static IEnumerable <Link> CreateSharedLinks(LinkData linkData)
        {
            Console.WriteLine("Creating Shared Links ...");
            var links = new Link[]
            {
                new Link
                {
                    SyncPointId           = _currentFolder.SyncpointId,
                    VirtualPath           = $"{_currentFolder.VirtualPath}{linkData.FileName}",
                    LinkExpireInDays      = 90,
                    LinkExpirationPolicy  = ShareLinkExpirationPolicy.Enabled,
                    PasswordProtectPolicy = ShareLinkPasswordProtectedPolicy.Disabled,
                    RolId            = 1,
                    SharedLinkPolicy = ShareLinkPolicy.IntendedOnly,
                    IrmRoleType      = IrmRoleType.Reader,
                    IsIrmProtected   = true,
                    Users            = new User []
                    {
                        new User {
                            EmailAddress = linkData.Email
                        }
                    },
                    Message = linkData.OldMessage
                }
            };

            return(LinksService.CreateSharedLinks(links));
        }