aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Modules/Tango.FSE.Upgrade/ViewModelLocator.cs
blob: 1ccb2330c1a2eab291285e0e3a84a954c2b4ab60 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core.DI;
using Tango.FSE.Upgrade.Navigation;
using Tango.FSE.Upgrade.ViewModels;
using Tango.FSE.Upgrade.Views;

namespace Tango.FSE.Upgrade
{
    public static class ViewModelLocator
    {
        static ViewModelLocator()
        {
            TangoIOC.Default.Register<RemoteUpgradeNavigationManager>(new RemoteUpgradeNavigationManager(MainView.Instance));
            TangoIOC.Default.Register<MainViewVM>();
            TangoIOC.Default.Register<WelcomeViewVM>();
            TangoIOC.Default.Register<ApplicationUpgradeViewVM>();
            TangoIOC.Default.Register<FirmwareUpgradeViewVM>();
            TangoIOC.Default.Register<ApplicationUpgradeGeneratedViewVM>();
            TangoIOC.Default.Register<FirmwareUpgradeGeneratedViewVM>();
        }

        public static MainViewVM MainViewVM
        {
            get
            {
                return TangoIOC.Default.GetInstance<MainViewVM>();
            }
        }

        public static WelcomeViewVM WelcomeViewVM
        {
            get
            {
                return TangoIOC.Default.GetInstance<WelcomeViewVM>();
            }
        }

        public static ApplicationUpgradeViewVM ApplicationUpgradeViewVM
        {
            get
            {
                return TangoIOC.Default.GetInstance<ApplicationUpgradeViewVM>();
            }
        }

        public static FirmwareUpgradeViewVM FirmwareUpgradeViewVM
        {
            get
            {
                return TangoIOC.Default.GetInstance<FirmwareUpgradeViewVM>();
            }
        }

        public static ApplicationUpgradeGeneratedViewVM ApplicationUpgradeGeneratedViewVM
        {
            get
            {
                return TangoIOC.Default.GetInstance<ApplicationUpgradeGeneratedViewVM>();
            }
        }

        public static FirmwareUpgradeGeneratedViewVM FirmwareUpgradeGeneratedViewVM
        {
            get
            {
                return TangoIOC.Default.GetInstance<FirmwareUpgradeGeneratedViewVM>();
            }
        }
    }
}
lass="o">-1; return currentNode.contents[indexInsideNode]; } /// <inheritdoc/> public override int Read() { if (currentNode == null) return -1; char result = currentNode.contents[indexInsideNode++]; if (indexInsideNode >= currentNode.length) GoToNextNode(); return result; } void GoToNextNode() { if (stack.Count == 0) { currentNode = null; } else { indexInsideNode = 0; currentNode = stack.Pop(); GoToLeftMostLeaf(); } } /// <inheritdoc/> public override int Read(char[] buffer, int index, int count) { if (currentNode == null) return 0; int amountInCurrentNode = currentNode.length - indexInsideNode; if (count < amountInCurrentNode) { Array.Copy(currentNode.contents, indexInsideNode, buffer, index, count); indexInsideNode += count; return count; } else { // read to end of current node Array.Copy(currentNode.contents, indexInsideNode, buffer, index, amountInCurrentNode); GoToNextNode(); return amountInCurrentNode; } } } }