Exemplo n.º 1
0
        /// <summary>
        /// Initializes this plugin.
        /// </summary>
        /// <remarks>Documented by CFI, 2010-06-26</remarks>
        public void Initialize()
        {
            LoadSettings();

            ProjectWatcher.Skin = Resources.icons;
            tfsManager          = new TfsManager(this);
            Thread setVC = new Thread(new ThreadStart(delegate
            {
                while (!ProjectWatcher.Initialized)
                {
                    Thread.Sleep(100);
                }
                ProjectWatcher.VcManager.AddVCManager(tfsManager);
            }));

            setVC.IsBackground = true;
            setVC.Name         = "Set TFS VC";
            setVC.Priority     = ThreadPriority.BelowNormal;
            setVC.Start();
        }
Exemplo n.º 2
0
        /// <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();
        }