コード例 #1
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="CreateSharedLinkWithSettingsArg"
        /// /> class.</para>
        /// </summary>
        /// <param name="path">The path to be shared by the shared link.</param>
        /// <param name="settings">The requested settings for the newly created shared
        /// link.</param>
        public CreateSharedLinkWithSettingsArg(string path,
                                               SharedLinkSettings settings = null)
        {
            if (path == null)
            {
                throw new sys.ArgumentNullException("path");
            }
            if (!re.Regex.IsMatch(path, @"\A(?:(/(.|[\r\n])*|id:.*)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?))\z"))
            {
                throw new sys.ArgumentOutOfRangeException("path", @"Value should match pattern '\A(?:(/(.|[\r\n])*|id:.*)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?))\z'");
            }

            this.Path     = path;
            this.Settings = settings;
        }
コード例 #2
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="CreateSharedLinkWithSettingsArg"
        /// /> class.</para>
        /// </summary>
        /// <param name="path">The path to be shared by the shared link</param>
        /// <param name="settings">The requested settings for the newly created shared
        /// link</param>
        public CreateSharedLinkWithSettingsArg(string path,
                                               SharedLinkSettings settings = null)
        {
            if (path == null)
            {
                throw new sys.ArgumentNullException("path");
            }
            else if (!re.Regex.IsMatch(path, @"\A(?:((/|id:).*)|(rev:[0-9a-f]{9,}))\z"))
            {
                throw new sys.ArgumentOutOfRangeException("path");
            }

            this.Path     = path;
            this.Settings = settings;
        }
コード例 #3
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="ModifySharedLinkSettingsArgs" />
        /// class.</para>
        /// </summary>
        /// <param name="url">URL of the shared link to change its settings</param>
        /// <param name="settings">Set of settings for the shared link.</param>
        public ModifySharedLinkSettingsArgs(string url,
                                            SharedLinkSettings settings)
        {
            if (url == null)
            {
                throw new sys.ArgumentNullException("url");
            }

            if (settings == null)
            {
                throw new sys.ArgumentNullException("settings");
            }

            this.Url      = url;
            this.Settings = settings;
        }
コード例 #4
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="ModifySharedLinkSettingsArgs" />
        /// class.</para>
        /// </summary>
        /// <param name="url">URL of the shared link to change its settings</param>
        /// <param name="settings">Set of settings for the shared link.</param>
        /// <param name="removeExpiration">If set to true, removes the expiration of the shared
        /// link.</param>
        public ModifySharedLinkSettingsArgs(string url,
                                            SharedLinkSettings settings,
                                            bool removeExpiration = false)
        {
            if (url == null)
            {
                throw new sys.ArgumentNullException("url");
            }

            if (settings == null)
            {
                throw new sys.ArgumentNullException("settings");
            }

            this.Url              = url;
            this.Settings         = settings;
            this.RemoveExpiration = removeExpiration;
        }