예제 #1
0
        private IEnumerable <object> GetLabels(ViaContext context)
        {
            var labels = context.Labels;

            if (labels.IsNullOrWhiteSpace())
            {
                return(default);
예제 #2
0
 private Layouts GetLayouts(ViaContext context)
 {
     return(new Layouts
     {
         Labels = this.GetLabels(context),
         Keymap = this.GetKeymap(context),
     });
 }
예제 #3
0
        private Lighting GetLighting(ViaContext context)
        {
            if (Enum.TryParse <Lighting>(context.Lighting, out var lighting))
            {
                return(lighting);
            }

            return(Lighting.none);
        }
예제 #4
0
        private ViaModel GetViaModel(ViaContext context)
        {
            var name      = context.Name;
            var vendorId  = context.VendorId;
            var productId = context.ProductId;

            return(new ViaModel
            {
                Name = name,
                VenderId = vendorId,
                ProductId = productId,
                Lighting = this.GetLighting(context),
                Matrix = this.GetMatrix(context),
                Layouts = this.GetLayouts(context),
            });
        }