You can use a custom tool, which will fire at the point where the user will
press the savebutton. It implements the BaseCodeGeneratorWithSite interface
and you need to override the method GenerateCode in your childclass to make
it work. Then if you registered the dll, just add the ProgID of the
generatordll to the custom tool property of the desired file. You can find
the basegenerator on the internet really easy.
> Hi there
> I an so confused and lost its not even funny - maybe someone here can help me.
[quoted text clipped - 8 lines]
> Regards,
> Bernard
Bernard - 10 Dec 2004 06:41 GMT
Thanks, Himo.
Not that I am 100% sure what you mean, but at least you have given me a new
direction to look into. I will definately go and read up on those interfaces.
> You can use a custom tool, which will fire at the point where the user will
> press the savebutton. It implements the BaseCodeGeneratorWithSite interface
[quoted text clipped - 15 lines]
> > Regards,
> > Bernard
Himo - 10 Dec 2004 08:15 GMT
I will make it even more clear to you:
A possible implementation of this interface would be:
using System;
using System.Runtime.InteropServices;
using CustomToolGenerator;
namespace Generator
{
/// <summary>
/// Summary description for Class1.
/// </summary>
[ProgId("Generator")]
[Guid("53CAA492-A11B-4e52-B4DB-D1A248CE26EE")]
public class TemtecRDLGenerator: BaseCodeGeneratorWithSite
{
public TemtecRDLGenerator()
{
System.Windows.Forms.MessageBox.Show("Tool started");
}
protected override byte[] GenerateCode(string inputFileName, string
inputFileContent)
{
System.Windows.Forms.MessageBox.Show("Saving...!");
return null;
}
}
}
Bernard - 10 Dec 2004 10:11 GMT
Himo
I understand now much better what you are telling me, but I think that I
didn't explain my situal well enough. My problem is as follows:
Somewherein visual studio I want to click on a menu item or a toolbar
button, or any other place. This click must open up a properties window where
you specify a URL and credential information. Once you close the window, my
utility must connect to a web service and extract C# code from it (the
webservice part I can do). This code that is extracted must then be placed in
a C# code editor where you can modify the code. Then, once you click on
save, the editor must again connect to the webservice and send the modifed
code to this webservice.
Right now I am able to create a new visual studio package with a custom
editor. The only problem is that this editor seems to be file-bound - you
can only persist the data from the editor to a file. I just can't figure out
how to change it so that I can, for instance, just save a stream to a
repository or anything like that...
> I will make it even more clear to you:
> A possible implementation of this interface would be:
[quoted text clipped - 28 lines]
> }
> }