Ejemplo n.º 1
0
 /// <summary>
 /// Gets the value.
 /// </summary>
 /// <param name="assembly">The assembly.</param>
 /// <param name="attribute">The attribute containing information about the plugin.</param>
 /// <returns>The value of the property.</returns>
 public object GetValue(Assembly assembly, StreamDeckPluginAttribute attribute)
 {
     return(new[]
     {
         new PlatformInfo(PlatformType.Mac, attribute.MacMinimumVersion),
         new PlatformInfo(PlatformType.Windows, attribute.WindowsMinimumVersion)
     }.Where(p => !string.IsNullOrWhiteSpace(p.MinimumVersion)));
 }
        /// <summary>
        /// Gets the value.
        /// </summary>
        /// <param name="assembly">The assembly.</param>
        /// <param name="attribute">The attribute containing information about the plugin.</param>
        /// <returns>The value of the property.</returns>
        public object GetValue(Assembly assembly, StreamDeckPluginAttribute attribute)
        {
            var applicationsToMonitor = new Dictionary <PlatformType, string[]>();

            void add(PlatformType os, string[] apps)
            {
                if (apps?.Length > 0)
                {
                    applicationsToMonitor.Add(os, apps);
                }
            }

            add(PlatformType.Mac, attribute.MacApplicationsToMonitor);
            add(PlatformType.Windows, attribute.WindowsApplicationsToMonitor);

            return(applicationsToMonitor.Count > 0 ? applicationsToMonitor : null);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets the value.
        /// </summary>
        /// <param name="assembly">The assembly.</param>
        /// <param name="attribute">The attribute containing information about the plugin.</param>
        /// <returns>The value of the property.</returns>
        public object GetValue(Assembly assembly, StreamDeckPluginAttribute attribute)
        {
            var profiles = assembly.GetCustomAttributes <StreamDeckProfileAttribute>();

            return(profiles.Any() ? profiles : null);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Gets the value.
 /// </summary>
 /// <param name="assembly">The assembly.</param>
 /// <param name="attribute">The attribute containing information about the action.</param>
 /// <returns>The value of the property.</returns>
 public object GetValue(Assembly assembly, StreamDeckPluginAttribute attribute)
 => assembly.GetTypesWithCustomAttribute <StreamDeckActionAttribute>().Aggregate(new JArray(), this.AccumulateActions);
Ejemplo n.º 5
0
 /// <summary>
 /// Gets the value.
 /// </summary>
 /// <param name="assembly">The assembly.</param>
 /// <param name="attribute">The attribute containing information about the plugin.</param>
 /// <returns>The value of the property.</returns>
 public object GetValue(Assembly assembly, StreamDeckPluginAttribute attribute)
 => new { MinimumVersion = attribute.SoftwareMinimumVersion };