WorkItemFormControl - Linked Work Items opened as HTML documents

  • Thread starter Thread starter SasaT
  • Start date Start date
S

SasaT

Hi people...

I integrated WorkItemFormControl with my application and it works as
expected except one little detail: if some work Item have another WI or
Changset attached as a link (Links tab), linked items will always be opened
as HTML read-only documents.

If you do the same action from the Team Explorer, result will be alive Work
Item opened in a new WorkItemFormControl window.

Is there a way to simulate Team Explorer functionallity from the custom form
with hosted WorkItemFormControl control?

Thanks in advance,
Sasa
 
As long as the target machines you intend to run your application on have
Team Explorer installed on them, yes it's possible.

I've actually got a project out on CodePlex that I integrated their form
into my application already if you need a working example.
http://www.codeplex.com/NException

Check out the EditTFSWorkItemForm class, it should have a good example of
how to use it. Also, from my experience with TFS and custom applications you
*will* run into problems with using their controls on forms. The controls
you'll be using aren't registered in the GAC *cough* so your application
will have problems resolving where the assemblies are located when using
them on your target machines. That's the workaround I came up with to ensure
the assemblies could be resolved properly (it's inside the Program.cs file
in the project I directed you to)

static Assembly CurrentDomain_AssemblyResolve(object sender,
ResolveEventArgs args) {
AssemblyName name = new AssemblyName(args.Name);

using (RegistryKey key =
Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\VisualStudio\9.0")) {
// Locate the installation directory for Visual Studio.
string installDir = key.GetValue("InstallDir").ToString();
string privateAssembliesFolder = Path.Combine(installDir,
"PrivateAssemblies");

string assemblyFile = Path.Combine(privateAssembliesFolder,
name.Name + ".dll");
if (File.Exists(assemblyFile)) {
return Assembly.LoadFile(assemblyFile,
AppDomain.CurrentDomain.Evidence);
}
}

return null;
}
 
Hi Jeff,

thanks for helping.
I downloaded your project and checked out EditTFSWorkItemForm class, but can
not see any parameter which changes default WorkItemFormControl behaviour and
opens linked work items in a new WorkItemFormControl window instead as HTML
read-only documents.

Can you explain me which property/method call/anything ensures that linked
work items are opened as editable WorkItemFormControl controls?

Thanks,
Sasa
 
Ah sorry, must've been a little tired when i answered that the other day.
Can't say i've ever tried using the control to open up linked work items
before. There might be something in the TFS SDK about it, but i doubt it.

Sorry i couldn't be of more help
 
Back
Top