예제 #1
0
파일: PluginUI.cs 프로젝트: chrfin/fdTFS
        /// <summary>
        /// Initializes a new instance of the <see cref="PluginUI"/> class.
        /// </summary>
        /// <param name="main">The main plugin instance.</param>
        /// <remarks>Documented by CFI, 2010-06-26</remarks>
        public PluginUI(TfsManager manager)
        {
            Manager = manager;

            InitializeComponent();

            Enabled = false;

            listViewSourceFiles.SmallImageList = new ImageList();
            listViewSourceFiles.LargeImageList = new ImageList();

            ToolTip toolTip = new ToolTip();

            toolTip.SetToolTip(radioButtonSourceFiles, "Source Files");
            toolTip.SetToolTip(radioButtonWorkItems, "Work Items");
            toolTip.SetToolTip(radioButtonCheckInNotes, "Check-in Notes");
            toolTip.SetToolTip(radioButtonPolicyWarnings, "Policy Warnings");
            toolTip.SetToolTip(radioButtonConflicts, "Conflicts");

            olvColumnCheckInAction.AspectToStringConverter = delegate(object x)
            {
                if (x is WorkItemCheckinAction)
                {
                    WorkItemCheckinAction action = (WorkItemCheckinAction)x;
                    if (action == WorkItemCheckinAction.None)
                    {
                        return("");
                    }
                    else
                    {
                        return(action.ToString());
                    }
                }
                else
                {
                    return(x.ToString());
                }
            };
            objectListViewWorkItems.BooleanCheckStatePutter = delegate(Object rowObject, bool newValue)
            {
                (rowObject as WorkItemCheckinInfo).CheckinAction = newValue ? WorkItemCheckinAction.Associate : WorkItemCheckinAction.None;
                return(newValue);
            };

            olvColumnDescription.AspectGetter = delegate(object item)
            {
                if (item is PolicyFailure)
                {
                    return((item as PolicyFailure).Message);
                }
                else if (item is Exception)
                {
                    return((item as Exception).Message);
                }
                else
                {
                    return(item.ToString());
                }
            };

            ShowSourceFiles();
        }
예제 #2
0
 private WorkItemCheckinInfo GetWorkItemInfo(string workItem, WorkItemCheckinAction checkinAction)
 {
     return new WorkItemCheckinInfo(WorkItems.GetWorkItem(Convert.ToInt32(workItem)), checkinAction);
 }
예제 #3
0
 private static WorkItemCheckedInfo GetWorkItemCheckedInfo(string workitem, WorkItemCheckinAction checkinAction)
 {
     return(new WorkItemCheckedInfo(Convert.ToInt32(workitem), true, checkinAction));
 }
예제 #4
0
 private IEnumerable<WorkItemCheckinInfo> GetWorkItemInfos(IEnumerable<string> workItems, WorkItemCheckinAction checkinAction)
 {
     return workItems.Select(workItem => GetWorkItemInfo(workItem, checkinAction));
 }
예제 #5
0
 private WorkItemCheckinInfo GetWorkItemInfo(string workItem, WorkItemCheckinAction checkinAction)
 {
     return(new WorkItemCheckinInfo(WorkItems.GetWorkItem(Convert.ToInt32(workItem)), checkinAction));
 }