Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OpenGraphName"/> class in the specified namespace.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="namespaceName">Name of the namespace.</param>
        /// <param name="namespaceUri">The namespace URI.</param>
        /// <exception cref="System.ArgumentException">The value cannot be empty;name</exception>
        public OpenGraphName(string name, string namespaceName, string namespaceUri)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentException("The value cannot be empty", "name");
            }

            this.@namespace = new OpenGraphNamespace(namespaceName, namespaceUri);
            this.name       = name;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OpenGraphName"/> class in the specified namespace.
        /// </summary>
        /// <param name="namespace">The namespace.</param>
        /// <param name="name">The name.</param>
        /// <exception cref="System.ArgumentException">The value cannot be empty;name</exception>
        /// <exception cref="System.ArgumentNullException">@namespace</exception>
        public OpenGraphName(OpenGraphNamespace @namespace, string name)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentException("The value cannot be empty", "name");
            }
            if (@namespace == null)
            {
                throw new ArgumentNullException("@namespace");
            }

            this.@namespace = @namespace;
            this.name       = name;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OpenGraphName"/> class in the "og" namespace.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <exception cref="System.ArgumentException">The value cannot be empty;name</exception>
        public OpenGraphName(string name)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentException("The value cannot be empty", "name");
            }

            this.@namespace = OpenGraphNamespace.OG;
            if (name.StartsWith("og:"))
            {
                this.name = name.Substring(3);
            }
            else
            {
                this.name = name;
            }
        }