Exemplo n.º 1
0
        protected override void ProcessRecord()
        {
            var extensions = client.Extensions.Search(MinExtension, MaxExtension, MinCreationDate, MaxCreationDate, 100000, 1, Type);

            if (Extension != null && Extension.Length > 0)
            {
                extensions = extensions.Where(e => Extension.Any(ex => ex == e.Extension)).ToList();
            }

            if (AccountID != null && AccountID.Length > 0)
            {
                extensions = extensions.Where(e => AccountID.Any(ex => ex == e.AccountId)).ToList();
            }

            if (Name != null)
            {
                WildcardPattern pattern = new WildcardPattern(Name, WildcardOptions.IgnoreCase);

                extensions = extensions.Where(e => pattern.IsMatch(e.DisplayName) || pattern.IsMatch(e.Extension)).ToList();
            }

            WriteObject(extensions, true);

            //todo -- remove item/count parameters for logs
            //todo -- implement count parameter with streaming implementation
        }
Exemplo n.º 2
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;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Checks whether the activity should contain an activity definition.
 /// </summary>
 /// <returns>True if the activity contains an activity definition, otherwise false.</returns>
 private bool HasActivityDefinition()
 {
     return(_activityType != null || _descriptionLanguageMap.Any() || _nameLanguageMap.Any() || _extensions.Any());
 }