Esempio n. 1
0
 public TreeViewModel(FileChooser fileChooser, String rootname)
 {
     _fileChooser = fileChooser;
     _items.Add(new FileViewModel(this, rootname));
     _itemCount = 0;
     _hashSet   = new HashSet <string>();
 }
Esempio n. 2
0
        private void Init()
        {
            try
            {
                _helpLoader = new HelpLoader();

                if (!_IsDisabled)
                {
                    // Licenser
                    //log.Info("Starting licenser");
                    _licenser = new Licenser();
                    _licenser.Init(new Action(() => LicenseIsActivated()));

                    //log.Info("Starting enumerator worker");
                    RefreshBtn.IsEnabled = false;
                    _enumerator.DoWork  += EnumeratorWork;
                    _enumerator.RunWorkerAsync(_pm);

                    //log.Info("Starting image reset timer");
                    // Image Reseter
                    imageReseter          = new System.Windows.Threading.DispatcherTimer();
                    imageReseter.Tick    += new EventHandler(imageClearTimerHandler);
                    imageReseter.Interval = new TimeSpan(0, 0, 0, 0, RESETER_TIMER_PERIOD_MS);
                    imageReseter.Start();
                    // Message Reseter
                    _messageReseter          = new System.Windows.Threading.DispatcherTimer();
                    _messageReseter.Tick    += new EventHandler(messageClearTimerHandler);
                    _messageReseter.Interval = new TimeSpan(0, 0, 0, 0, RESETER_MESSAGE_LIFETIME_MS);

                    //log.Info("Setup refresher");
                    // setup background worker for refresh
                    _refresher.DoWork        += refreshOneDevice;
                    _imageFetcher.DoWork     += fetchImage;
                    _liveImageFetcher.DoWork += fetchLiveImage;

                    var providerList = _libClient.getCryptoProviders();
                    foreach (var provider in providerList)
                    {
                        AddProvider(provider.ToString());
                    }



                    _progressBar = new ProgressBar();
                    _progressBar.SetBarsCount(2);

                    _errorWindow = new ErrorWindow();

                    if (_options.IsUnsecure)
                    {
                        _filename    = Path.GetFileName(_options.InputFiles[0]);
                        _fileChooser = new FileChooser(this, _filename)
                        {
                            DecryptSelected_Notify = DecryptSelected, DecryptAll_Notify = DecryptAll
                        };
                        //log.Info("File chooser creation in Init");
                    }
                }
            }
            catch (Exception ex)
            {
                Auxiliary.Logger._log.Error("error: " + ex.Message);
            }
            // AssociationCheck();
        }