Exemplo n.º 1
0
        public FormSearchWorkItems(WorkItemStore workItemStore, string projectName)
        {
            InitializeComponent();

            WorkingItem = new WorkingItem();

            pickWorkItemsControl = new PickWorkItemsControl(workItemStore, false)
            {
                Dock = DockStyle.Fill,
                PortfolioDisplayName = projectName
            };
            pickWorkItemsControl.PickWorkItemsDoubleClicked += pickWorkItemsControl_PickWorkItemsListViewDoubleClicked;

            // Add context menu to view the work item when trying to pick from the query
            try
            {
                // Dirty hack - this will continue to work as long as the TFS control has not been updated by Microsoft.
                pickWorkItemsControl.Controls[0].Controls[9].Controls[0].MouseUp += FormSearchWorkItems_MouseUp;
            }
            catch (Exception)
            {
                // Let this go!!
                // The only implication is the context menu wont display
            }

            Controls.Add(pickWorkItemsControl);
            SetClientSizeCore(pickWorkItemsControl.PreferredSize.Width, pickWorkItemsControl.PreferredSize.Height);
            Text = string.Format(CultureInfo.CurrentCulture, Resources.SearchForWorkItemsIn, projectName);
        }
Exemplo n.º 2
0
 private void SetCurrentWorkItem(int itemId)
 {
     _workingItem = new WorkingItem();
     _workingItem.PropertyChanged += WorkingItem_PropertyChanged;
     _workingItem.WorkItem         = Connection.GetConnection().WorkItemStore.GetWorkItem(itemId);
     _workingItem.WorkItem.Open();
 }
Exemplo n.º 3
0
        private void WorkingItem_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName != WorkingItem.WorkItemPropertyName)
            {
                return;
            }

            _workingItem = sender as WorkingItem;

            bool hasWorkItem = _workingItem != null;

            this.selectedToolStripMenuItem.Enabled = hasWorkItem;
            this.startToolStripMenuItem.Enabled    = hasWorkItem;

            if (_workingItem == null)
            {
                return;
            }

            _workingItem.Connection = Connection.GetConnection();
            _workingItem.UserActivityMonitor.MonitorTriggeredEvent += _userActivity_MonitorTriggeredEvent;

            selectedToolStripMenuItem.Text        = string.Format(CultureInfo.CurrentCulture, Resources.Selected, _workingItem.WorkItem.Id);
            selectedToolStripMenuItem.ToolTipText = _workingItem.WorkItem.Title;
            StartStop();

            AskForEstimates();
        }
Exemplo n.º 4
0
        public FormEstimates(WorkingItem workingItem)
        {
            InitializeComponent();

            _workingItem = workingItem;
            estimatesBindingSource.DataSource = workingItem.Estimates;
            workingItem.UpdateWorkingOnEstimates();
        }
Exemplo n.º 5
0
        private void Connection_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            this._workingItem = null;
            this.SetMenuSelectedItemToDefault();

            switch (e.PropertyName)
            {
            case Connection.TeamProjectCollectionAbsoluteUriPropertyName:
                _currentSettings.SetCollectionLastWorkedOn(Connection.GetConnection().TeamProjectCollectionAbsoluteUri);
                break;

            case Connection.SelectedProjectNamePropertyName:
                _currentSettings.LastProjectCollectionWorkedOn.SetProjectLastWorkedOn(Connection.GetConnection().SelectedProjectName);
                _currentSettings.LastProjectCollectionWorkedOn.LastProjectWorkedOn.PropertyChanged += ProjectWorkedOn_PropertyChanged;
                break;
            }

            SetUserOptionAccess();
        }