public UpgradeBatchTaskView(IActivityContext <Unit> context)
        {
            this.context = context;

            items         = new ObservableCollection <BatchItem>();
            manufacturers = new ObservableCollection <string>();
            models        = new ObservableCollection <string>();

            CommonList = new List <BatchItem>();
            BatchTaskEventArgs evargs = context.container.Resolve <BatchTaskEventArgs>();

            nvtSession = evargs.session;;

            evargs.Devices.ForEach(dev => {
                BatchItem bitem        = new BatchItem(dev);
                bitem.PropertyChanged += new PropertyChangedEventHandler((object sender, PropertyChangedEventArgs e) => {
                    CanUpgrade();
                });
                CommonList.Add(bitem);
            });

            this.CommandBindings.Add(
                new CommandBinding(
                    UpgradeBatchTaskView.UpgradeCommand,
                    (s, a) => {
                OnUpgrade();
            }
                    )
                );

            this.CommandBindings.Add(
                new CommandBinding(
                    UpgradeBatchTaskView.CancelCommand,
                    (s, a) => {
                Success();
            }
                    )
                );

            InitializeComponent();

            BindData();
            Localization();
        }
Esempio n. 2
0
        public RestoreBatchTaskView(IActivityContext <Unit> context)
        {
            this.activityContext = context;

            items         = new ObservableCollection <BatchItem>();
            manufacturers = new ObservableCollection <string>();
            models        = new ObservableCollection <string>();
            firmwares     = new ObservableCollection <string>();

            CommonList = new List <BatchItem>();
            BatchTaskEventArgs evargs = context.container.Resolve <BatchTaskEventArgs>();

            nvtSession = evargs.session;
            ;

            evargs.Devices.ForEach(dev => {
                BatchItem bitem = new BatchItem(dev);
                CommonList.Add(bitem);
            });

            this.CommandBindings.Add(
                new CommandBinding(
                    RestoreBatchTaskView.RestoreCommand,
                    (s, a) => {
                OnRestore();
            }
                    )
                );

            this.CommandBindings.Add(
                new CommandBinding(
                    RestoreBatchTaskView.CancelCommand,
                    (s, a) => {
                Success();
            }
                    )
                );

            InitializeComponent();

            BindData();
            Localization();
        }