예제 #1
0
        public Toolbar()
        {
            InitializeComponent();
            txtVersion.Text = MainPage.GetFileVersion();

            _model = ViewModel.Current;
            Loaded += Toolbar_Loaded;
        }
예제 #2
0
 public RevisionHistoryDialog()
 {
     InitializeComponent();
     _model = ViewModel.Current;
     _model.Provider.FetchRevisionHistoryCompleteEvent += Provider_FetchRevisionHistoryCompleteEvent;
     BusyIndicator.Visibility = Visibility.Visible;
     IsEnabled = false;
     Cursor = Cursors.Hand; 
 }
예제 #3
0
        public MainPage()
        {
            _viewmodel = BCheck.Data.ViewModel.Current;
            aipc = new AlertsIpc(idIPC, _viewmodel);
            PerformInitializations();
            //InitializeComponent();
            //Loaded += MainPage_Loaded;
           

        }
예제 #4
0
        public SummaryView(ViewModel model)
        {
            _viewModel = model;
            _isRefreshRequired = false; ;
            _viewModel.Tasks.CollectionChanged += Tasks_CollectionChanged;
            _viewModel.PropertyChanged += viewModel_PropertyChanged;

            _isRefreshing = false;
            ResetStatus(StatusDatanotavailable);
            _viewModel.Provider.FetchSummaryCompleteEvent += Provider_FetchSummaryCompleteEvent; 

        }
예제 #5
0
        public AlertsIpc(Guid receiver, ViewModel vm)
        {
            _receiverId = receiver;

            _messageReceiver = new LocalMessageReceiver(
                    _receiverId.ToString (), 
                    ReceiverNameScope.Global, LocalMessageReceiver.AnyDomain);
            _messageReceiver.MessageReceived += messageReceiver_MessageReceived;
            _messageReceiver.DisableSenderTrustCheck = true;
            _vmodel = vm;
            try
            {
                _messageReceiver.Listen();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
예제 #6
0
 public RegionalSetting( ViewModel vm)
 {
     _vm = vm;
 }
예제 #7
0
        /// <summary>
        /// This will query the alerts data that is currently held by the model and
        /// prepara a smaller subset of data that needs to be displayed in the Popup UI
        /// </summary>
        /// <param name="vm"></param>
        /// <param name="alertCategory"> </param>
        /// <returns></returns>
        public static AlertsDataTransfer CreateFromModel(ViewModel vm ,AlertsCategory alertCategory)
        {
            var trfr = new AlertsDataTransfer {CurrentTimeZone = ViewModel.Current.RegionalSettings.ActiveTimeZone};


            IEnumerable<TaskItem>   queryTasksAlerts=null;
            ObservableCollection<TaskItem> alertsCollection = null;

            if (alertCategory == AlertsCategory.AlertAssignedTasks)
            {
                queryTasksAlerts= vm.TaskAlerts.AssignedTasksAlerts;
                alertsCollection = trfr.AssignedTasks;
                Debug.WriteLine("Creating alerts for Assigned tasks");
            }

            if (alertCategory == AlertsCategory.AlertsManagedTasks)
            {
                queryTasksAlerts = vm.TaskAlerts.ManagedTasksAlerts;
                alertsCollection = trfr.ManagedTasks;
                Debug.WriteLine("Creating alerts for Managed tasks");
            }

            int count = MaxRowsToTransfer;
            
            foreach (TaskItem t in queryTasksAlerts )
            {
                TaskItem d = t.Clone();
                alertsCollection.Add(d);
                
                count--;
                if (count <= 0) break;
            }

            trfr.TotalAlerts = queryTasksAlerts.Count();
            Debug.WriteLine( string.Format ( "Created a total of {0}",trfr.TotalAlerts ));

            return trfr;
        }