Exemplo n.º 1
0
        private void AddSyncJobHistory(SyncJobViewModel syncJobViewModel)
        {
            SyncJobPanelViewModel syncJobPanel = new SyncJobPanelViewModel(this.relationship)
            {
                SyncJobViewModel = syncJobViewModel
            };

            int index = this.FindIndex(syncJobPanel);

            this.Children.Insert(index, new SyncJobNodeViewModel(this, syncJobPanel));
            this.RaisePropertyChanged(nameof(this.Children));
        }
Exemplo n.º 2
0
        public SyncJobNodeViewModel(NavigationNodeViewModel parent, SyncJobPanelViewModel syncJobPanel)
            : base(parent, syncJobPanel)
        {
            this.syncJobPanel = syncJobPanel;

            if (syncJobPanel.SyncJobViewModel != null)
            {
                this.Name = syncJobPanel.SyncJobViewModel.StartTime.ToString("g");
            }

            this.SetIconImage();
        }
Exemplo n.º 3
0
        private int FindIndex(SyncJobPanelViewModel syncJobPanel)
        {
            int i = 0;

            for (; i < this.Children.Count; i++)
            {
                SyncJobNodeViewModel nodeViewModel = this.Children[i] as SyncJobNodeViewModel;

                if (syncJobPanel.SyncJobViewModel.StartTime >
                    ((SyncJobPanelViewModel)nodeViewModel.Item).SyncJobViewModel.StartTime)
                {
                    return(i);
                }
            }

            return(i);
        }