StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



loDialog.ShowDialog(false, false); in C#:...Expand / Collapse
Author
Message
Posted 08/20/2007 11:38:42 AM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 09/30/2008 3:56:47 AM
Posts: 69, Visits: 1,281
Hi,

maybe I'm doing something stupid. Following the help files, I tried to include security into my application. This works so far as I don't try to use 'loDialog.ShowDialog(false, false);' which I copied from the help file. That gives me an error message: 'No overload for method 'ShowDialog' takes '2' arguments'. Opposite to that the help file is telling me: 'Showing the SecurityDialog without Permissions or Restriction Sets [C#]'.

I'm using StrataFrame 1.6.1.

Can someone have a look at this?

TIA and friendly greetings,

Ralph
Post #10945
Posted 08/20/2007 3:24:16 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 10:32:08 AM
Posts: 4,565, Visits: 4,547
Ralph,

The SecurityDialog accepts two parms, and the language does not make a difference.  If you open up the Object Browser and look at the SecurityDialog form, do you have a constructor that accepts two boolean parms?  If not, then you may not be running on 1.6.1 and you may need up upgrade to the latest.  Otherwise, please post the stack trace or the error so I know what you are getting.

Post #10947
Posted 08/21/2007 8:44:00 AM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 09/30/2008 3:56:47 AM
Posts: 69, Visits: 1,281
Hello Trent,

thank you very much for your help. StrataFrame support is best! :-)

I did what you wrote and there wasn't any "new" constructor. So I opened the source code and there was all what should be there. Removed the reference and added it again, with no success. I did a clean solution and a rebuild solution, did run the afterbuild.bat, removed the reference to the StrataFrame Security from my own solution, added it again with no success again. I did all of that many times, restarted my machine between, restarted VS between, no success.

The dll is there, opened in VS it looks exactly like your screen shot. But as a reference added to my project, it lacks of the new construtors.

I don't know what's going on or what can I do.

Any hint?

TIA and friendly greetings,

Ralph
Post #10957
Posted 08/21/2007 11:16:35 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 10:32:08 AM
Posts: 4,565, Visits: 4,547
Any hint?

It sounds like you have an older set of SF DLLs that are being built or loaded.  If you download the most recent source code from the website, build it.  Get out of Visual Studio, open your project again, remove the SF references, add the newly recompiled references, clean your solution, get out of VS again, then go back in and recompile do they show up?

I know this sounds like a long way around, but you have some old assemblies somewhere that are being loaded instead of the 1.6.1 assemblies.  Also, one other thing you could try it to manually delete the StrataFrame entries in the GAC before you rebuild the StrataFrame solution.   This way you know they are gone before you build them and then after you build the SF code they should be back in there.  You should only need to remove the four highlighted below....and any versions that are older than 1.6.0.  Just FYI, the GAC will show 1.6.0 for the 1.6.1 version of SF.  We did this intentionally to make it easier for developers to move to the 1.6.1 version.

Post #10966
Posted 08/22/2007 2:16:08 AM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 09/30/2008 3:56:47 AM
Posts: 69, Visits: 1,281
Hello Trent,

I did all you said, but with no success. :-(

Reinstalled StrataFrame, no success.

Something else I can do?

Thank you very much and friendly greetings,

Ralph
Post #10986
Posted 08/22/2007 2:23:31 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 09/26/2008 8:30:36 AM
Posts: 2,685, Visits: 1,886
Well, the problem is that you're probably using C# and the screenshot that Trent took is from the Object Browser when you have a VB project open.  It changes so that constructors show up as New() instead of [ClassName]() like they do in C#.  I think you're problem is most likely a bug in the help documentation.  Try this snippet and see if it works for you:

using MicroFour.StrataFrame.Security;

...

SecurityDialog dialog = new SecurityDialog(false, false);
dialog.ShowDialog();

I don't think there's an overload for the ShowDialog() method, but there are overloads for the constructor, so you can pass the 2 falses to the dialog's constructor.


www.bungie.net
Post #11007
Posted 08/23/2007 8:22:16 AM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 09/30/2008 3:56:47 AM
Posts: 69, Visits: 1,281
Hi Ben,

thank you very much for jumping in. Yes, you're right, I'm using C#. Didn't know that makes any difference. I should mention in future that I use C#.

SecurityDialog loDialog = new SecurityDialog(false, false)

That did the trick! :-)

Thank you again and friendly greetings,

Ralph

 

Post #11018
Posted 08/23/2007 9:03:38 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 09/26/2008 8:30:36 AM
Posts: 2,685, Visits: 1,886
No problem, Ralph

The differences between C# and VB are generally very minor syntax changes, but VS keeps up with them enough to even change the Object Browser!!  Oh well, I think it took me a while before I figured out that when I had a VB project open, lots of stuff changed in the environment.

Glad you got it working.


www.bungie.net
Post #11023
Posted 09/04/2008 7:44:31 PM
Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: StrataFrame Users
Last Login: Today @ 10:53:44 AM
Posts: 622, Visits: 2,556
I've just been bit by this one, the problem is that the topic "Calling the Security Maintenance Dialog" has the code sample wrong like this:

Imports MicroFour.StrataFrame.Security
...
Private Sub ShowSecurityDialog()
    '-- Create the form and show it
    Using loDialog As New SecurityDialog()
        loDialog.ShowDialog(False, False)
    End Using
End Sub

Where the overload parameters should be passed to the New SecurityDialog() like this:

Imports MicroFour.StrataFrame.Security
...
Private Sub ShowSecurityDialog()
    '-- Create the form and show it
    Using loDialog As New SecurityDialog(False, False)
        loDialog.ShowDialog()
    End Using
End Sub


 
Post #19093