aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.FileSystem/Network/FileDownloadRequest.cs
blob: b63937f8b241728ca1e90c5913ab27c4751ad1bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.FileSystem.Network
{
    public class FileDownloadRequest
    {
        public String Path { get; set; }
    }
}
d2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;
using Tango.BL.Enumerations;
using Tango.Settings;

namespace Tango.PPC.Jobs
{
    /// <summary>
    /// Represents the jobs module settings.
    /// </summary>
    /// <seealso cref="Tango.Settings.SettingsBase" />
    public class JobsModuleSettings : SettingsBase
    {
        public class RecentCatalog
        {
            public String Guid { get; set; }
            public List<String> RecentItems { get; set; }

            public RecentCatalog()
            {
                RecentItems = new List<string>();
            }
        }

        /// <summary>
        /// Gets or sets the recent catalogs items.
        /// </summary>
        public List<RecentCatalog> RecentCatalogsItems { get; set; }

        /// <summary>
        /// Gets or sets the last job color space.
        /// </summary>
        public ColorSpaces? LastJobColorSpace { get; set; }

        /// <summary>
        /// Gets or sets the new job last type.
        /// </summary>
        public JobTypes? LastJobType { get; set; }

        /// <summary>
        /// Gets or sets the last selected catalog unique identifier.
        /// </summary>
        public String LastSelectedCatalogGuid { get; set; }

        /// <summary>
        /// Adds a catalog item to the recent list.
        /// </summary>
        /// <param name="catalog">The catalog.</param>
        /// <param name="item">The catalog item.</param>
        public void AddRecentCatalogItem(ColorCatalog catalog, ColorCatalogsItem item)
        {
            var recentCatalog = RecentCatalogsItems.FirstOrDefault(x => x.Guid == catalog.Guid);

            if (recentCatalog == null)
            {
                recentCatalog = new RecentCatalog();
                recentCatalog.Guid = catalog.Guid;
                RecentCatalogsItems.Add(recentCatalog);
            }

            if (recentCatalog.RecentItems.Exists(x => x == item.Guid))
            {
                recentCatalog.RecentItems.Remove(item.Guid);
            }

            recentCatalog.RecentItems.Insert(0, item.Guid);

            if (recentCatalog.RecentItems.Count > 20)
            {
                recentCatalog.RecentItems.RemoveAt(recentCatalog.RecentItems.Count - 1);
            }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="JobsModuleSettings"/> class.
        /// </summary>
        public JobsModuleSettings()
        {
            RecentCatalogsItems = new List<RecentCatalog>();
        }
    }
}