Is there a way to programmatically expose "Excluded Changes"?
hi miguel,
thanks post.
to excluded changes using tfs api, please refer example in article: https://mhusseini.wordpress.com/2014/10/11/tfs-get-and-modify-included-and-excluded-pending-changes-in-visual-studio/.
using system; using system.collections.generic; using system.reflection; using microsoft.teamfoundation.controls; using microsoft.teamfoundation.controls.wpf.teamexplorer; using microsoft.teamfoundation.versioncontrol.client; namespace prettyflyforanamespace { public class pendingchangesinclusion { private readonly action<ilist<pendingchange>> _includechanges; private readonly action<ilist<pendingchange>> _excludechanges; private readonly func<ilist<pendingchange>> _getincludedchanges; private readonly func<ilist<pendingchange>> _getexcludedchanges; public pendingchangesinclusion(iteamexplorer teamexplorer) { var pendingchangespage = (teamexplorerpagebase)teamexplorer.navigatetopage(new guid(teamexplorerpageids.pendingchanges), null); var model = pendingchangespage.model; var p = model.gettype().getproperty("dataprovider", bindingflags.nonpublic | bindingflags.instance | bindingflags.flattenhierarchy); var dataprovider = p.getvalue(model); // ipendingchangesdataprovider internal; var dataprovidertype = dataprovider.gettype(); p = dataprovidertype.getproperty("includedchanges", bindingflags.public | bindingflags.nonpublic | bindingflags.instance | bindingflags.flattenhierarchy); var m = p.getmethod; _getincludedchanges = (func<ilist<pendingchange>>)m.createdelegate(typeof(func<ilist<pendingchange>>), dataprovider); p = dataprovidertype.getproperty("excludedchanges", bindingflags.public | bindingflags.nonpublic | bindingflags.instance | bindingflags.flattenhierarchy); m = p.getmethod; _getexcludedchanges = (func<ilist<pendingchange>>)m.createdelegate(typeof(func<ilist<pendingchange>>), dataprovider); m = dataprovidertype.getmethod("includechanges", bindingflags.public | bindingflags.nonpublic | bindingflags.instance | bindingflags.flattenhierarchy); _includechanges = (action<ilist<pendingchange>>)m.createdelegate(typeof(action<ilist<pendingchange>>), dataprovider); m = dataprovidertype.getmethod("excludechanges", bindingflags.public | bindingflags.nonpublic | bindingflags.instance | bindingflags.flattenhierarchy); _excludechanges = (action<ilist<pendingchange>>)m.createdelegate(typeof(action<ilist<pendingchange>>), dataprovider); } public void includechanges(ilist<pendingchange> changes) { _includechanges(changes); } public void excludechanges(ilist<pendingchange> changes) { _excludechanges(changes); } public ilist<pendingchange> getincludechanges() { return _getincludedchanges(); } public ilist<pendingchange> getexcludedchanges() { return _getexcludedchanges(); } } }
we trying better understand customer views on social support experience, participation in interview project appreciated if have time. helping make community forums great place. click here participate survey.
Archived Forums V > Team Foundation Server - Source and Version Control
Comments
Post a Comment