aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/AutoComplete/MachinesProvider.cs
blob: 93ce382f0d1d6f47485988c5962f2ce643cf4c04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.AutoComplete.Editors;
using Tango.BL;
using Tango.BL.Entities;

namespace Tango.MachineStudio.Synchronization.AutoComplete
{
    /// <summary>
    /// Represents an auto-complete machines suggestions provider.
    /// </summary>
    /// <seealso cref="Tango.AutoComplete.Editors.ISuggestionProvider" />
    public class MachinesProvider : ISuggestionProvider
    {
        /// <summary>
        /// Gets the suggestions.
        /// </summary>
        /// <param name="filter">The filter.</param>
        /// <returns></returns>
        public IEnumerable GetSuggestions(string filter)
        {
            return ObservablesEntitiesAdapter.Instance.Machines.Where(x => x.SerialNumber.StartsWith(filter, StringComparison.CurrentCultureIgnoreCase)).ToList();
        }
    }
}
ass="w"> = new GradientStopCollection(); foreach (var stop in segment.BrushStops.OrderBy(x => x.StopIndex)) { stops.Add(new GradientStop(stop.Color, stop.OffsetPercent / 100d)); } return stops; } return null; } catch { return null; } } public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }