VS 2012 Add-In

Posts   
 
    
rblock avatar
rblock
User
Posts: 71
Joined: 13-Mar-2009
# Posted on: 08-Mar-2013 18:03:31   

When selecting Settings from "LLBLGEN PRO/Project" menu, nothing happens but it seems that the Add-In crashed because no more menu items are active. All items are greyed out.

Perhaps there should be a reload possibility like in GhostDoc Pro.

Testing greetings

Reiner

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 08-Mar-2013 19:02:47   

You mean, the menu at the top when you don't have a project loaded? Yes I saw that. The thing is: the menu items ARE disabled. VS.NET though makes them not disabled. The problem is that the add-in doesn't really run at that moment, it starts when a project file is loaded. Then the menu is activated.

Or did you experience the crash when an llblgen pro file was open in vs.net?

Frans Bouma | Lead developer LLBLGen Pro
rblock avatar
rblock
User
Posts: 71
Joined: 13-Mar-2009
# Posted on: 08-Mar-2013 21:54:18   

Hi Frans,

the first screenshot shows the Add-In menu after I already loaded a VS 2012 project where I have a LLBL project for, too. The second the same but after clicking additionally on Preferences.

But for the rest U R right. After loading the LLBL project the menu items became active again and I could work with them inside of VS. simple_smile At least it looks great! smile

Approving greetings

Reiner

Attachments
Filename File size Added on Approval
LLBLGen Pro 4 Beta, VS2012 Add-In - 1.png 88,111 08-Mar-2013 21:54.39 Approved
rblock avatar
rblock
User
Posts: 71
Joined: 13-Mar-2009
# Posted on: 08-Mar-2013 21:55:13   

second attachment

Attachments
Filename File size Added on Approval
LLBLGen Pro 4 Beta, VS2012 Add-In - 2.png 89,358 08-Mar-2013 21:55.24 Approved
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 09-Mar-2013 10:02:04   

rblock wrote:

Hi Frans,

the first screenshot shows the Add-In menu after I already loaded a VS 2012 project where I have a LLBL project for, too. The second the same but after clicking additionally on Preferences.

Yes, I saw the same behavior but I couldn't find a reason why it behaved like that. It's strange, really. All menu items are added as 'disabled', but added as if they're not. I'll re-check the code, perhaps I still made a mistake somewhere.

But for the rest U R right. After loading the LLBL project the menu items became active again and I could work with them inside of VS. simple_smile At least it looks great! smile

thanks! simple_smile

Yes what happens is that if for some reason a menu option is selected and no designer instance is known, it simply returns, so it doesn't 'crash', it simply doesn't do anything. But I agree with you: it sucks to have this menu being enabled while it doesn't do anything. I'll recheck the code (on monday simple_smile )

Frans Bouma | Lead developer LLBLGen Pro
rblock avatar
rblock
User
Posts: 71
Joined: 13-Mar-2009
# Posted on: 09-Mar-2013 10:42:07   

Hi Frans,

is there any possiblity to e.g. add a filter in File Open of VS for LLBL projects or add a menu item in the LLBL menu for opening such a project file? Because this was the first I was looking for if there is such thing. But I didn'd find it therefore I wasn't sure if it is possible to load a project file.

Searching...

Ah, here it is: http://msdn.microsoft.com/en-us/library/bb166537.aspx

How to register a new project type. simple_smile

Suggesting greetings

Reiner

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 09-Mar-2013 11:05:36   

rblock wrote:

Hi Frans,

is there any possiblity to e.g. add a filter in File Open of VS for LLBL projects or add a menu item in the LLBL menu for opening such a project file? Because this was the first I was looking for if there is such thing. But I didn'd find it therefore I wasn't sure if it is possible to load a project file.

Searching...

Ah, here it is: http://msdn.microsoft.com/en-us/library/bb166537.aspx

How to register a new project type. simple_smile

Suggesting greetings

Reiner

No that's not the way to go. What the link you posted refers at is a vs.net project, inside a solution. That's so complex to manage in your add-in, I don't even want think about it for now (consider the code you need is com-wrapping .net code with barely any documentation or useful examples)

LLBLGen Pro's project file is just a file with an associated editor (our designer). That we call it a 'project' doesn't mean VS.NET looks at it like that.

So the route to go is to 'add new item' to your vs.net project or add existing llblgenproj file to the vs.net project, then open it. You can file -> open and then load the llblgenproj file but it's then not added to your solution and it's then the same as if you'd run our own designer.

An llblgenproj file added to your vs.net project doesn't affect your vs.net project, though it keeps things together and easier to work with (just double click the llblgen project in vs.net's solution explorer)

BUT! I see what you mean if you do: File -> Open -> File... and the vs.net open dialog shows a long list of filters, but not for our project files. Frankly I have no idea to get into that list. I'll check whether it's possible to get in there. Not through registering a project though simple_smile (as .edmx is also listed in that filter, but isn't a project file either)

Frans Bouma | Lead developer LLBLGen Pro
rblock avatar
rblock
User
Posts: 71
Joined: 13-Mar-2009
# Posted on: 09-Mar-2013 11:52:18   

Hi Frans,

as I read the docu behind the MSDN link this is the way to add a new project type including the filter for loading those project files. It has to be added to the Registry and in the examples "Figure" would've to be replaced by "LLBLGenPro".

Or do am I wrong?

Of course U can say it is just a nice to have, but IMHO it would make the Add-In more comfortable. Perhaps it would be best to create a special csproj with this *.llblgenpro project file as a whole VS project that is excluded from compilation.

Just my five cent. wink

Investigating greetings

Reiner

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 10-Mar-2013 10:12:57   

rblock wrote:

Hi Frans,

as I read the docu behind the MSDN link this is the way to add a new project type including the filter for loading those project files. It has to be added to the Registry and in the examples "Figure" would've to be replaced by "LLBLGenPro".

Or do am I wrong?

yes, because 'file -> open -> file' opens files, not vs.net project files. If you open the filter in the open dialog box, you'll see e.g 'data files' where *.edmx is present. What you're referring to is that vs.net knows a csproj file is a project so it opens differently and lets a csproj handler handle the solution explorer nodes etc.

Of course U can say it is just a nice to have, but IMHO it would make the Add-In more comfortable. Perhaps it would be best to create a special csproj with this *.llblgenpro project file as a whole VS project that is excluded from compilation.

I wanted this first, but it's so much work. For example, the complete project explorer we have should be rebuild in vs.net so the entity nodes are below the project node in solution explorer in vs.net. Adding your own project system is a tremendous amount of work and above all: there's little information how to do things. Already with writing this add-in I had a lot of moments where I ran into an issue and had no clue what to do to fix it and no info was available in the docs nor examples nor online. A lot of trial/error.

Adding our own project system to vs.net doesn't add anything as we still have and always will have the stand-alone designer. But it's a completely different thing than what you want: the file -> open -> file dialog that it filters on llblgenproj files.

Frans Bouma | Lead developer LLBLGen Pro
gregkuha60
User
Posts: 47
Joined: 23-Jan-2012
# Posted on: 11-Mar-2013 13:57:28   

I'm think i having same problem. Starting VS2012 with or without administrator rights, the items under the llblgenpro menu is "enabled". But if i select "Add Relation Model Data from a Database" or "Preferences" nothing happens and then trying to do something again all menu items are greyed out under the llblgen Pro.

//best regards Greg

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 11-Mar-2013 14:23:57   

Yes, the initial 'enabled' state is being investigated. The initial state should be 'all greyed' out. I even wanted to have the menu simply be 'greyed' out from the top, but that's not possible, you can only grey out menu items, not menus.

To use the VSNET add in, simply open a llblgenproj file, add a new llblgen proj to your project or an existing one, and open it through the solution explorer.

This is also the reason there's no open file in the llblgen pro menu in vs.net, as vs.net takes care of that.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 11-Mar-2013 15:02:55   

Ok, I managed to solve it.

I first had all menu items disabled, but I saw other parts of VS.NET dynamically make their menu visible and hidden (completely) if they're in context. So I added that instead. This means that when you open vs.net, there's no LLBLGen Pro menu at the top, if there's no llblgen pro project loaded. When you load an llblgen pro project, it's enabled and visible. When you close it again, it's gone. It's also gone when you focus, say, a C# code file. This is natural, as it's the same behavior as e.g. the XML menu which disappears when you focus a C# code file, but re-appears when you focus e.g. a web.config file.

This makes it also less confusing what to do in vs.net, as there's no menu so people don't get confused that 'everything is disabled, what to do?'.

Don't know whether this works or not (as you now don't see 'LLBLGen Pro' in the top menu when no project is loaded) but neither do you see the toplevel menu for the XML editor, however it shows up when you open the xml editor simple_smile .

So if this is confusing too we'll go for the 'disable all the things!!' option.

Frans Bouma | Lead developer LLBLGen Pro
rblock avatar
rblock
User
Posts: 71
Joined: 13-Mar-2009
# Posted on: 11-Mar-2013 15:50:07   

Hi Frans,

do U have ReSharper installed?

After starting VS it looks like in the screenshot. The menu items are disabled just the submenu items are enabled.

Hinting greetings

Reiner

Attachments
Filename File size Added on Approval
LLBLGen Pro 4 Beta, VS2012 Add-In - 3.png 61,645 11-Mar-2013 15:50.28 Approved
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 11-Mar-2013 16:08:53   

The resharper add-in is something else, as it extends an editor, it's not an editor of its own. The problem is that even though our menu might be there, the add-in doesn't run, and there's no designer loaded. The designer is loaded when the editor is loaded, which is done by vs.net when you open a llblgenproj file.

So not the same thing. We'll see. If people find it confusing we can always go to this route, however this too is confusing IF you look at that menu and plan to do anything, e.g. edit preferences or open a file.

Btw, I've also looked into the 'File -> open -> file' file filters, but these are assigned by the project types, e.g. csproj has it's extensions registered in the registry under: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0_Config\ Projects{FAE04EC0-301F-11d3-BF4B-00C04F79EFBC}\FileExtensions

It's of course possible to mess with the registry and add our extension there, but I'm reluctant to do that, as I don't want to manipulate VS.NET's own settings. So for now we don't add our own file filter there.

Frans Bouma | Lead developer LLBLGen Pro
MJC
User
Posts: 50
Joined: 06-May-2004
# Posted on: 14-Mar-2013 19:35:57   

You guys covered a lot in this thread. It would indeed be nice to navigate the LLBLGen project right from within solution explorer, but I understand that's a lot of work, maybe v4.5? :-)

Regarding making the LLBLGen project an actual VS.NET project. I think if you did go that route at some point, the actual llblgen project file I think would probably stay just a plain old file, the LLBLGen VS.NET Project would be of a different kind. It will currently take some getting used to managing the LLBLGen project as a file within an existing VS.NET project, but not a big issue, more a gripe. If you did create an actual VS.NET LLBLGen project template, it sounds like it would take on a new approach, kind of like it's done in SharePoint development where you are now adding your entities, and all other project items as assets within a SharePoint project, and the llblgen project file is just like a package.xml file (part of the vs.net project) that gets updated behind the scenes based on everything else being done, but yeah, sounds like a rewrite, ughh.

I think the idea of having the menu at the top come up when the LLBLGen project file in the current approach is open is good.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 15-Mar-2013 13:53:05   

MJC wrote:

You guys covered a lot in this thread. It would indeed be nice to navigate the LLBLGen project right from within solution explorer, but I understand that's a lot of work, maybe v4.5? :-)

Considering the amount of black tar I had to wade through for this extension to make it work, I have no hope that this project system will see the light of day. Writing code to integrate into vs.net is not fun, and I put that lightly. wink

Regarding making the LLBLGen project an actual VS.NET project. I think if you did go that route at some point, the actual llblgen project file I think would probably stay just a plain old file, the LLBLGen VS.NET Project would be of a different kind. It will currently take some getting used to managing the LLBLGen project as a file within an existing VS.NET project, but not a big issue, more a gripe. If you did create an actual VS.NET LLBLGen project template, it sounds like it would take on a new approach, kind of like it's done in SharePoint development where you are now adding your entities, and all other project items as assets within a SharePoint project, and the llblgen project file is just like a package.xml file (part of the vs.net project) that gets updated behind the scenes based on everything else being done, but yeah, sounds like a rewrite, ughh.

Yeah, the project explorer pretty much has to be rewritten with vs.net code. We do have all application logic elsewhere, but the GUI code itself is still significant (consider the undo-redo refreshes alone). I'm not sure this is worth the effort, as it will take a tremendous amount of time (I think more than 4-6 months), for little gain. I always think: why didn't the EF designer guys take this route... then I try some prototype and find out it's a black hole you don't want to come close to.

I think the idea of having the menu at the top come up when the LLBLGen project file in the current approach is open is good.

simple_smile I hope to have a new beta later today for you guys to test.

Frans Bouma | Lead developer LLBLGen Pro