/*public List<TableSMItem> TableItemList
         *      {
         *              get { return _tableItemList; }
         *              set { _tableItemList = value; }
         *      }*/

        /// <summary>
        /// Default constructor.  We set the initial view-model to 'FirstViewModel'.
        /// We also associate the commands with their execution actions.
        /// </summary>
        public MainWindowViewModel()
        {
            CurrentViewModel  = MainWindowViewModel._tabularViewModel;
            FirstViewCommand  = new RelayCommand(() => ExecuteFirstViewCommand());
            SecondViewCommand = new RelayCommand(() => ExecuteSecondViewCommand());
            //ConnectToCalculationEngine();
            //ShowNetwork = Visibility.Visible;
            //ShowApplyDelta = Visibility.Collapsed;


            CacheReceiver cacheReceiver = CacheReceiver.Instance;

            int tryCounter = 0;

            while (true)
            {
                if (tryCounter.Equals(maxTry))
                {
                    throw new Exception("CEDistributionProxy: Connection error.");
                }

                try
                {
                    cacheReceiver.ConnectToCalculationEngine();
                    break;
                }
                catch (Exception)
                {
                    tryCounter++;
                    Thread.Sleep(3000);
                }
            }
        }
Beispiel #2
0
        /*public List<TableSMItem> TableItemList
         *      {
         *              get { return _tableItemList; }
         *              set { _tableItemList = value; }
         *      }*/

        /// <summary>
        /// Default constructor.  We set the initial view-model to 'FirstViewModel'.
        /// We also associate the commands with their execution actions.
        /// </summary>
        public MainWindowViewModel()
        {
            CurrentViewModel        = MainWindowViewModel._tabularViewModel; // bio je tabular //vratiti ga posle na logovanje i obrisati ovu liniju ispod
            DataTemplatesVisibility = true;
            GridVisibility          = false;

            //aorManagementProxy = new AORManagementProxy(); // vrati se AOR
            //ButtonLoginOnClick = new RelayCommand(() => ButtonLoginOnClickExecute(), () => true);

            FirstViewCommand         = new RelayCommand(() => ExecuteFirstViewCommand());
            SecondViewCommand        = new RelayCommand(() => ExecuteSecondViewCommand());
            ShowAORManagementCommand = new RelayCommand(() => ExecuteShowAORManagementCommand());
            //ConnectToCalculationEngine();
            //ShowNetwork = Visibility.Visible;
            //ShowApplyDelta = Visibility.Collapsed;


            CacheReceiver cacheReceiver = CacheReceiver.Instance;

            int tryCounter = 0;

            while (true)
            {
                if (tryCounter.Equals(maxTry))
                {
                    throw new Exception("CEDistributionProxy: Connection error.");
                }

                try
                {
                    cacheReceiver.ConnectToCalculationEngine();
                    break;
                }
                catch (Exception)
                {
                    tryCounter++;
                    Thread.Sleep(3000);
                }
            }
        }