コード例 #1
0
 /// <summary>
 /// Adds a list of translated descriptions stored in a ILanguageMap.
 /// </summary>
 /// <param name="languageMap">The language map containing descriptions in multiple languages.</param>
 /// <returns>The activity builder, to continue the fluent configuration.</returns>
 public IActivityBuilder AddDescription(ILanguageMap languageMap)
 {
     foreach (var item in languageMap)
     {
         _descriptionLanguageMap.Add(item.Key, item.Value);
     }
     return(this);
 }
コード例 #2
0
 /// <summary>
 /// Adds a list of translated names stored in a ILanguageMap.
 /// </summary>
 /// <param name="languageMap">The language map containing descriptions in multiple languages.</param>
 /// <returns>The activity builder, to continue the fluent configuration.</returns>
 public IActivityBuilder AddName(ILanguageMap languageMap)
 {
     foreach (var item in languageMap)
     {
         _nameLanguageMap.Add(item.Key, item.Value);
     }
     return(this);
 }
コード例 #3
0
ファイル: VerbBuilder.cs プロジェクト: zhchlmm/FluentxApi
 /// <summary>
 /// The human readable representation of the Verb in one or more languages.
 /// <para>This does not have any impact on the meaning of the Statement, but serves to give a human-readable display of the meaning already determined by the chosen Verb.</para>
 /// </summary>
 /// <param name="languageMap">A language map defining the verb in multiple languages</param>
 /// <returns>The statement builder, to continue the fluent configuration.</returns>
 public IVerbBuilder AddDisplay(ILanguageMap languageMap)
 {
     foreach (var item in languageMap)
     {
         _languageMap.Add(item.Key, item.Value);
     }
     return(this);
 }
コード例 #4
0
        public InteractionComponent(string id, ILanguageMap description)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentNullException(nameof(id));
            }

            Id          = id;
            Description = description;
        }
コード例 #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Verb"/> class with an IRI as an identifier and display information.
        /// </summary>
        /// <param name="id">IRI that corresponds to a Verb definition.</param>
        /// <param name="display">The human readable representation of the Verb in one or more languages. Key is the language code.</param>
        public Verb(Uri id, ILanguageMap display)
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id));
            }

            Id = id;

            if (display != null && display.Any())
            {
                Display = display;
            }
        }
コード例 #6
0
 /// <summary>
 /// Initializes a new instance of an Attachment.
 /// </summary>
 /// <param name="usageType">Identifies the usage of this Attachment. For example: one expected use case for Attachments is to include a "completion certificate".<para>An IRI corresponding to this usage MUST be coined, and used with completion certificate attachments.</para></param>
 /// <param name="display">Display name (title) of this Attachment.</param>
 /// <param name="contentType">The content type of the Attachment.</param>
 /// <param name="length">The length of the Attachment data in octets.</param>
 /// <param name="sha2">The SHA-2 hash of the Attachment data. This property is always required, even if fileURL is also specified.</param>
 /// <param name="description">A description of the Attachment</param>
 /// <param name="fileUrl">An IRL at which the Attachment data can be retrieved, or from which it used to be retrievable.</param>
 public Attachment(
     Uri usageType,
     ILanguageMap display,
     string contentType,
     int length,
     string sha2,
     ILanguageMap description = null,
     Uri fileUrl = null)
 {
     UsageType   = usageType;
     Display     = display;
     ContentType = contentType;
     Length      = length;
     Sha2        = sha2;
     Description = description;
     FileUrl     = fileUrl;
 }
コード例 #7
0
        /// <summary>
        /// Initializes a new instance of the ActivityDefinition class.
        /// </summary>
        /// <param name="name">The human readable/visual name of the Activity</param>
        /// <param name="type">The type of Activity.</param>
        /// <param name="description">A description of the Activity</param>
        /// <param name="moreInfo">Resolves to a document with human-readable information about the Activity, which could include a way to launch the activity.</param>
        /// <param name="extensions">A map of other properties as needed</param>
        public ActivityDefinition(ILanguageMap name, Uri type, ILanguageMap description = null, Uri moreInfo = null, Extension extensions = null)
        {
            if (name != null && name.Any())
            {
                Name = name;
            }

            if (description != null && description.Any())
            {
                Description = description;
            }

            if (extensions != null && extensions.Any())
            {
                Extensions = extensions;
            }

            Type     = type;
            MoreInfo = moreInfo;
        }