Click here to Skip to main content
16,013,082 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: want to set some properties run time Pin
Christian Graus11-Jul-07 0:50
protectorChristian Graus11-Jul-07 0:50 
AnswerRe: want to set some properties run time Pin
Fayu15-Jul-07 18:05
Fayu15-Jul-07 18:05 
QuestionAsking for WSAAccept declaration. Pin
amar_nath9-Jul-07 2:43
amar_nath9-Jul-07 2:43 
AnswerRe: Asking for WSAAccept declaration. Pin
Mike Dimmick11-Jul-07 3:01
Mike Dimmick11-Jul-07 3:01 
QuestionError with smart client application Pin
Sebastian T Xavier8-Jul-07 19:21
Sebastian T Xavier8-Jul-07 19:21 
AnswerRe: Error with smart client application Pin
originSH10-Jul-07 22:42
originSH10-Jul-07 22:42 
QuestionUser Authentication in CAB Pin
Michael Sync8-Jul-07 17:21
Michael Sync8-Jul-07 17:21 
AnswerRe: User Authentication in CAB Pin
Michael Sync10-Jul-07 22:10
Michael Sync10-Jul-07 22:10 
I was doing some experiments on this issue during these days. I realized that it's so hard to unload the loaded dll(s) from current domain. In order to unload the dll (assembly) from current domain, we have to shift this dll to another domain and unload the whole new domain.. loading dll to different domain(s) is okay as long as they dont have visual. But modules have a lot of visual things Frown | :(

Loading modules on deamand:
http://staff.southworks.net/blogs/matiaswoloski/archive/2006/02/26/CABModulesOnDemand.aspx

About restarting application
http://www.codeplex.com/smartclient/Thread/View.aspx?ThreadId=4786

Logout generally:
http://www.codeplex.com/smartclient/Thread/View.aspx?ThreadId=10140

Tell us more about CAB Modules isolation requirements
http://blogs.msdn.com/eugeniop/archive/2006/09/21/764953.aspx

It seems like the limitation of winform. Frown | :( The login/logout things is very common in practical project and I think it is a must to have in every applications. (Why do we need to shut down the application to change the logged-in users? )

However, I'm thinking another strategy to achieve this goal.

I created one small project in the same way mentioned in the sample ("08 ObjectBuilder with CAB" from Hand-on Lab ).

I made some changes (which is in bold) as following in BuildUp method.

public override object BuildUp(IBuilderContext context, Type t, object existing, string id)<br />
        {<br />
            if (existing == null)<br />
            {<br />
                return base.BuildUp(context, t, existing, id);<br />
            }<br />
            bool hideControl = false;<br />
            Type targetType = existing.GetType();<br />
            foreach (AuthorizationAttribute attr in<br />
                targetType.GetCustomAttributes(typeof(AuthorizationAttribute), true))<br />
            {<br />
                string role = attr.Role;<br />
                if (!Thread.CurrentPrincipal.IsInRole(role)) <br />
                    hideControl = true;<br />
                <br />
            }<br />
            if (hideControl)<br />
            {<br />
                UserControl ctrl = existing as UserControl;                <br />
                <br />
                if (ctrl != null)<br />
                    ctrl.Visible = false; //<< HERE!! I make it invisible but it shows. :( <br />
            }<br />
<br />
            foreach (PropertyInfo propertyInfo in targetType.GetProperties())<br />
            {<br />
                CheckAuthorization(context, existing, propertyInfo);<br />
            }<br />
<br />
            return base.BuildUp(context, t, existing, id);<br />
        }


And put the [Authorization(Role = "manager")] in one of usercontrol of one module. The idea is that showing/hiding usercontrol based on User Level. If normal user log on to the System, the control that I mark should not be shown. But it doesn't work. If I set ctrl.Enabled = false; instead of ctrl.Visible = false; then it works. but it doesn't work with visible property. Frown | :(

Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)


Questionneed code to find serial number of hard, mainboard and cpu Pin
omidreza8126-Jul-07 20:33
omidreza8126-Jul-07 20:33 
AnswerRe: need code to find serial number of hard, mainboard and cpu Pin
Michael Sync8-Jul-07 17:25
Michael Sync8-Jul-07 17:25 
GeneralRe: need code to find serial number of hard, mainboard and cpu Pin
omidreza8129-Jul-07 2:28
omidreza8129-Jul-07 2:28 
QuestionWhere does xml file come from when compliing dll file? Pin
Michael Sync6-Jul-07 19:36
Michael Sync6-Jul-07 19:36 
AnswerRe: Where does xml file come from when compliing dll file? Pin
Scott Dorman6-Jul-07 19:52
professionalScott Dorman6-Jul-07 19:52 
GeneralRe: Where does xml file come from when compliing dll file? Pin
Michael Sync6-Jul-07 19:54
Michael Sync6-Jul-07 19:54 
QuestionUser typing moves row on DataGridView Pin
bobishkindaguy6-Jul-07 12:52
bobishkindaguy6-Jul-07 12:52 
AnswerRe: Problem in calling a dotnet exe from VB 6.0 exe Pin
Pete O'Hanlon6-Jul-07 1:14
mvePete O'Hanlon6-Jul-07 1:14 
QuestionProblem in calling a dotnet exe from VB 6.0 exe Pin
Syed Muhammad Kamran5-Jul-07 23:50
Syed Muhammad Kamran5-Jul-07 23:50 
QuestionLocalization, but how? Pin
Luka Grabarevic5-Jul-07 23:14
Luka Grabarevic5-Jul-07 23:14 
AnswerRe: Localization, but how? Pin
Luc Pattyn6-Jul-07 0:48
sitebuilderLuc Pattyn6-Jul-07 0:48 
QuestionAssembly Pin
kankeyan5-Jul-07 21:53
kankeyan5-Jul-07 21:53 
AnswerRe: Assembly Pin
originSH5-Jul-07 22:17
originSH5-Jul-07 22:17 
AnswerRe: Assembly Pin
Ilya Verbitskiy8-Jul-07 1:00
Ilya Verbitskiy8-Jul-07 1:00 
QuestionGnerate a pdf file using c# without using a third party product???? Pin
Nithin Krishna5-Jul-07 21:50
Nithin Krishna5-Jul-07 21:50 
AnswerRe: Gnerate a pdf file using c# without using a third party product???? Pin
Christian Graus5-Jul-07 23:44
protectorChristian Graus5-Jul-07 23:44 
AnswerRe: Gnerate a pdf file using c# without using a third party product???? Pin
Vasudevan Deepak Kumar9-Jul-07 2:57
Vasudevan Deepak Kumar9-Jul-07 2:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.