Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Disable link in Team explorer (Visual studio 2012)

$
0
0

Hello,

I am working on creating an extension to disable few links in Visual studio 2012 Team Explorer.Please see the below image for reference.I would like to disable the links highlighted in red color. 

So far my work :

I am able to get the Hyperlink field and properties info using reflection. But when I set the value it is not reflecting in UI. Please help me on this.

 var page = Tfs.TeamExplorer.CurrentPage;

            var sections = page.PageContent;
            Type type = typeof(System.Windows.Documents.Hyperlink);
            FieldInfo f1 = page.PageContent.GetType().GetField("linkCancelDecline", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public | BindingFlags.Static);
            object lateBound = Activator.CreateInstance(type);
            PropertyInfo[] test = f1.FieldType.GetProperties();
            object h = new System.Windows.Documents.Hyperlink();
            PropertyInfo info = test[54];
            info.SetValue(lateBound, Convert.ChangeType(false, info.PropertyType));



Please someone help me.

Thanks,

Sree


Sree


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>