Example #1
0
 public PrintWorkItem(WorkItem workItem, Settings settings, TfsHelper tfsHelper, int x, int y, int width,
     int height)
 {
     this.x = x;
     this.y = y;
     this.width = width;
     this.height = height;
     padding = 10;
     textPrintArea = new RectangleF(x + padding, y + padding, width - (padding*2), height - (padding*2));
     cardArea = new RectangleF(x, y, width, height);
     item = workItem;
     this.settings = settings;
     this.tfsHelper = tfsHelper;
 }
Example #2
0
 private void ScrumySettingsCallback(object sender, EventArgs e)
 {
     TeamFoundationServerExt tfsExt = (TeamFoundationServerExt)Dte.GetObject("Microsoft.VisualStudio.TeamFoundation.TeamFoundationServerExt");
     TfsHelper tfsHelper = new TfsHelper(new Uri(tfsExt.ActiveProjectContext.DomainUri), tfsExt.ActiveProjectContext.ProjectName);
     SettingsForm settingsForm = new SettingsForm(tfsHelper);
     settingsForm.ShowDialog();
 }
Example #3
0
        private void PrintItemCallback(object sender, EventArgs e)
        {
            TeamFoundationServerExt tfsExt = (TeamFoundationServerExt)Dte.GetObject("Microsoft.VisualStudio.TeamFoundation.TeamFoundationServerExt");

            IWorkItemTrackingDocument doc = GetActiveDocument();
            int[] selectedItemIds = ((IResultsDocument)doc).SelectedItemIds;
            doc.Release(this);

            PrintDialog printDialog = new PrintDialog();
            TfsHelper tfsHelper = new TfsHelper(new Uri(tfsExt.ActiveProjectContext.DomainUri), tfsExt.ActiveProjectContext.ProjectName);
            Settings settings = new Settings();
            settings.LoadSettings();
            ItemsDocument printDoc = new ItemsDocument(settings, tfsHelper);
            foreach (var workItem in tfsHelper.GetWorkItems(selectedItemIds))
            {
                printDoc.AddWorkItem(workItem);
            }

            printDialog.Document = printDoc;
            if (printDialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    printDialog.Document.Print();
                }
                catch (Win32Exception)
                {
                    IVsUIShell uiShell = (IVsUIShell)GetService(typeof(SVsUIShell));
                    Guid clsid = Guid.Empty;
                    int result;
                    Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(uiShell.ShowMessageBox(
                               0,
                               ref clsid,
                               "Print item error",
                               "Not possible to print. Try to restart 'Print Spooler'",
                               string.Empty,
                               0,
                               OLEMSGBUTTON.OLEMSGBUTTON_OK,
                               OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
                               OLEMSGICON.OLEMSGICON_INFO,
                               0,        // false
                               out result));
                }
            }
        }
Example #4
0
        private void AnalyzeBugsCallback(object sender, EventArgs e)
        {
            TeamFoundationServerExt tfsExt = (TeamFoundationServerExt)Dte.GetObject("Microsoft.VisualStudio.TeamFoundation.TeamFoundationServerExt");

            IWorkItemTrackingDocument doc = GetActiveDocument();
            int[] selectedItemIds = ((IResultsDocument)doc).SelectedItemIds;
            doc.Release(this);

            TfsHelper tfsHelper = new TfsHelper(new Uri(tfsExt.ActiveProjectContext.DomainUri), tfsExt.ActiveProjectContext.ProjectName);
            //foreach (var workItem in tfsHelper.GetWorkItems(selectedItemIds))
            //{
            //    Bug bug = workItem as Bug;

            //    if(bug != null)
            //    {

            //    }
            //}
        }
Example #5
0
 public WorkItemTab(Dictionary<string, Font> fonts, TfsHelper tfsHelper)
 {
     this.fonts = fonts;
     this.tfsHelper = tfsHelper;
     InitializeComponent();
 }
Example #6
0
 public RowItem(Dictionary<string, Font> fonts, TfsHelper tfsHelper)
 {
     this.InitializeComponent();
     this.fonts = fonts;
     this.tfsHelper = tfsHelper;
 }
Example #7
0
 public ItemsDocument(Settings settings, TfsHelper tfsHelper)
 {
     this.settings = settings;
     this.tfsHelper = tfsHelper;
 }