[ADVANCED-DOTNET] Java has InheritableThreadLocal, and .NET?

2003-08-22 Thread Burkhard Perkens-Golomb
I'm porting a Java application to .NET. In Java you can use "InheritableThreadLocal"[¹] to hand down variable values to child threads, and with .NET? In Java you can use "ThreadLocal", in .NET "ThreadStatic" for thread local variables without handing down values to child threads. But what about "I

Re: [ADVANCED-DOTNET] Custom ServerTransportSink

2003-08-22 Thread J. Merrill
I don't have much experience here, but this line looks odd -- could it be causing trouble for the next sink? requestHeaders["__RequestVerb"] = null; What if the next sink looks for the value of __RequestVerb and blows if it's not found? Not having really looked, I'd somewhat presume tha

Re: [ADVANCED-DOTNET] Catching events in HTTP Module

2003-08-22 Thread Wenfeng Gao
If your button is a server control, then you can find it out as follows. public IAsyncResult BeginPreRequestHandlerExecute(Object sender, EventArgs e, AsyncCallback cb, Object extraData) if (Request.Url.AbsolutePath == "/MyWebApp/WebForm1.aspx") if(Request.RequestType == "POST")

Re: [ADVANCED-DOTNET] Catching events in HTTP Module

2003-08-22 Thread Chad M. Gross
I'm going to do my best here to assume what you are referring to and what you are try to do. First, when you say "I have written a HttpModule and am calling a method on context.PreRequestHandlerExecute" I am assuming you are referring to adding your own event handler to the HttpApplication PreRequ

Re: [ADVANCED-DOTNET] Events

2003-08-22 Thread Rick McMullen
Krzysztof, One option you might want to consider is subscribing to the events for all the forms you are trying to monitor from one location. What I mean here is suppose you have a main form which spawns other forms based upon user interaction. You can subscribe to the events of those "child" for

[ADVANCED-DOTNET] Custom ServerTransportSink

2003-08-22 Thread Brant Fallin
When calling _nextSink.ProcessMessage(...) from a custom server transport sink i am developing i get a ReturnMessage that contains an exception with the following text: "Error: Server encountered an internal error. For more information, turn on customErrors in the server's .config file" >From wh

Re: [ADVANCED-DOTNET] Determining what spawned a postback in a datagrid

2003-08-22 Thread Fred Palmer
Courtney, > The issue is there is a databind() method that is called that > appears to 'wipeclean' the values in my textbox objects using > the original values and NOT what I have typed You should rebind the datagrid after you do an update or delete. This allows you to take out the else clause a

Re: [ADVANCED-DOTNET] Determining what spawned a postback in a datagrid

2003-08-22 Thread J. Merrill
The result of GetProperty is an object, not a string. When you pass an object to Response.Write, the ToString method of the object is called and its result ("Update") is what gets displayed. If you add .ToString to your test -- if e.GetType.GetProperty("commandname").ToString <> "Updat

Re: [ADVANCED-DOTNET] Design Puzzle

2003-08-22 Thread Gibson, M (Mark)
A possible simplification exists, I think. If the creation of Identity does not rely on the instance of the PLUGIN ... The SECURITY object can create an Identity before it creates the PLUGIN, and then passes the Identity in to the PLUGIN constructor (it is only the SECURITY object that creates

[ADVANCED-DOTNET] Catching events in HTTP Module

2003-08-22 Thread Sujay Suresh Maheshwari
Hi Group, I have written a HttpModule and I am calling a method on context.PreRequestHandlerExecute Now this method will be called on all page load. Can I know the event which called this page load. Rather if a user presses an Add button, can I know that an add button is clicked. May b

Re: [ADVANCED-DOTNET] Design Puzzle

2003-08-22 Thread Janis Braslins
Once again thank you to everyone who replied! I think I figured it out. I like the cookie approach. I've extended on it a little: 1) Since value of read-only Identity property will be passed to the SECURITY object to determine the callers role and perhaps a callback reference if necessary, Identi

[ADVANCED-DOTNET] Determining what spawned a postback in a datagrid

2003-08-22 Thread Courtney Smith
Here is the deal. I have a datagrid. In this datagrid I am updating (ok|cancel) and deleting recorords. I got the wonderful idea to allow users to filter them since there are so many. The filter logically calls for a dropdownlist. The DDL has a autopost set to true. Then the DDL only binds on

Re: [ADVANCED-DOTNET] Obtaining reference to the calling object

2003-08-22 Thread Bryan, Jason (Contractor)
What if you passed the reference in at creation? I do this with ASP.NET when I have a class that needs to access some of the ASP stuff: >From the web page: Thing obj = new thing(this); Class: Public class thing { private System.Web.UI.Page m_varPageReference; public thing(Syst

Re: [ADVANCED-DOTNET] Design Puzzle

2003-08-22 Thread J. Merrill
SECURITY is a singleton, right? (Or do you have one per PLUGIN type? Not sure it matters.) I think the answer lies in giving each plugin a "cookie" that it has to use in order to make calls; if the cookie values can't be faked, I think you're safe. Details: SECURITY is (or should be) respons

Re: [ADVANCED-DOTNET] Design Puzzle

2003-08-22 Thread Duncan Godwin
OK, some ideas, which may progress the discussion. I assume the SECURITY object is a singleton (one instance). What if each plugin inherits from an abstract class, within that class there is a public (sealed) method AssignRole, which accepts a Role object, which is available as a protected get

Re: [ADVANCED-DOTNET] Design Puzzle

2003-08-22 Thread Mike Diehl
Steve, I was reminded of this too. I thought the scenario resembled the Façade pattern, which defines a higher level of interface to sub-systems or individual functional implementations. I don't know if that's quite right since the Façade is supposed to represent the sub-system(s) instead of pr