コード例 #1
0
        public WorkItemController()
        {
            TFSServer = ConfigurationManager.AppSettings["TFSUrl"];

            tpc = new TfsTeamProjectCollection(
                new Uri(TFSServer));
            try
            {
                workItemStore = (WorkItemStore)tpc.GetService(typeof(WorkItemStore));
            }
            catch (Exception ex)
            {
                MessageBox.Show("Unable to Connect to TFS. Check your VPN Connection. \nError " + ex.Message);
                Environment.Exit(-1);
                return;
            }

            parentLinkType = workItemStore.WorkItemLinkTypes.FirstOrDefault(l => l.ReverseEnd.Name == "Parent");

            workItemProject = workItemStore.Projects[0];

            GetAreas(workItemProject);
            GetIterations(workItemProject);
            GetUsers(tpc);
            GetStates();

            UpdateQueue = new ObservableCollection <TaskUpdate>();

            lastRefresh = DateTime.Now;

            mainWindow = UICommon.GetProperty("MainWindow") as MainWindow;
        }
コード例 #2
0
        private void btnBugOpenApp_Click(object sender, RoutedEventArgs e)
        {
            var mainWindow = UICommon.GetProperty("MainWindow") as MainWindow;

            mainWindow.Show();
            this.Close();
        }
コード例 #3
0
 public TaskEditor()
 {
     InitializeComponent();
     ddArea.ItemsSource      = UICommon.GetProperty("Areas") as List <string>;
     ddUser.ItemsSource      = UICommon.GetProperty("Users") as List <string>;
     ddIteration.ItemsSource = UICommon.GetProperty("Iterations") as List <string>;
 }
コード例 #4
0
        private void btnAttachmentUpload_Click(object sender, RoutedEventArgs e)
        {
            Task.Attachments.Add(new TaskAttachment(txtAttachmentFile.Text, Task));
            var WIC = UICommon.GetProperty("WIC") as WorkItemController;

            Task.SaveUpdates(WIC);
        }
コード例 #5
0
        public EditPreferences()
        {
            InitializeComponent();

            ddPrefUserNames.ItemsSource = UICommon.GetProperty("Users") as List <string>;

            Preferences = new Preferences();
            DataContext = Preferences;
        }
コード例 #6
0
        public TaskEditor(DisplayTask task)
        {
            InitializeComponent();
            Task        = task;
            DataContext = Task;

            ddArea.ItemsSource            = UICommon.GetProperty("Areas") as List <string>;
            ddUser.ItemsSource            = UICommon.GetProperty("Users") as List <string>;
            ddIteration.ItemsSource       = UICommon.GetProperty("Iterations") as List <string>;
            icTaskAttachments.ItemsSource = Task.Attachments;
        }
コード例 #7
0
ファイル: DisplayTask.cs プロジェクト: dkevinscalf/TaskJeeves
        public DisplayTask(string taskType)
        {
            var WIC = UICommon.GetProperty("WIC") as WorkItemController;

            workItem = WIC.GetNewWorkItem(taskType);
            workItem["Stack Rank"] = 500;
            LinkedTasks            = new ObservableCollection <DisplayTask>();
            Attachments            = new ObservableCollection <TaskAttachment>();
            Update      = new TaskUpdate();
            borderColor = DefaultBorderColor;
            BuildFieldList();
        }
コード例 #8
0
        private void btnDeleteAttachment_Click(object sender, RoutedEventArgs e)
        {
            var result = MessageBox.Show("Are you sure you want to delete this attachment?", "Attachment Deletion Confirmation", MessageBoxButton.YesNo);

            if (result != MessageBoxResult.Yes)
            {
                return;
            }

            var attachment = DataContext as TaskAttachment;

            attachment.Remove(UICommon.GetProperty("WIC") as WorkItemController);
        }
コード例 #9
0
        private void BindTaskData()
        {
            icNewTaskList.ItemsSource      = NewTasks;
            icActiveTaskList.ItemsSource   = ActiveTasks;
            icCompleteTaskList.ItemsSource = CompleteTasks;

            icPlanningUserStories.ItemsSource = UserStories;

            dgMoveTasks.ItemsSource          = AllTasks;
            ddMassMoveAreas.ItemsSource      = UICommon.GetProperty("Areas") as List <string>;
            ddMassMoveUsers.ItemsSource      = UICommon.GetProperty("Users") as List <string>;
            ddMassMoveIterations.ItemsSource = UICommon.GetProperty("Iterations") as List <string>;

            ddIterationCopySource.ItemsSource      = UICommon.GetProperty("Iterations") as List <string>;
            ddIterationCopyDestination.ItemsSource = UICommon.GetProperty("Iterations") as List <string>;
        }
コード例 #10
0
        private void btnPrefSave_Click(object sender, RoutedEventArgs e)
        {
            Preferences.Save();

            var mainWindow = UICommon.GetProperty("MainWindow") as MainWindow;

            mainWindow.BugTimer.Interval = new TimeSpan(0, Convert.ToInt32(Preferences.BugTimer), 0);

            if (userChanged)
            {
                var WIC = UICommon.GetProperty("WIC") as WorkItemController;

                WIC.UpdateQueue.AddOnUI(new TaskUpdate {
                    IsReadRequest = true, ID = -1
                });
            }

            Close();
        }
コード例 #11
0
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            var mainWindow = UICommon.GetProperty("MainWindow") as MainWindow;

            mainWindow.FilterTasksFromThread();
        }