|
Please don't cross post.
BanjaraBoy wrote: Is this a bug or some limitation of the xpath?
Neither.
You either have to specify the namespace prefix in the xpath expression, or use an XmlNamespaceManager, to access the nodes in the namespace.
---
b { font-weight: normal; }
|
|
|
|
|
|
I have no problems sending a soap header in my call but how do i read the soap header response. This is using the proxy generated class I modified it to send the header info.
Heres an excerpt of what i have:
<br />
private SessionInfo objHeader = null;<br />
<br />
[System.Web.Services.Protocols.SoapHeader "sessionObject",Direction=SoapHeaderDirection.Out)]<br />
[System.Web.Services.Protocols.SoapRpcMethodAttribute("execute", RequestNamespace=_RequestNS, ResponseNamespace=_RequestNS)]<br />
[return: System.Xml.Serialization.SoapElementAttribute("result")]<br />
public string execute(string sql) <br />
{ <br />
object[] results = this.Invoke("execute", new object[] {sql});<br />
return ((string)(results[0]));<br />
}<br />
The sessionObject is a property that set's the private objHeader. How in the world do i read the header coming back from the soap call
This is what the header object looks like:
<br />
[XmlRoot("SessionInfo")]<br />
public class SessionInfo : SoapHeader<br />
{<br />
<br />
[XmlAttribute("xmlns")]<br />
public string xmlns=@"http://www.aspconverters.com/SessionInfoHeader";<br />
<br />
[XmlElement(ElementName="SESSION_USER")]<br />
public string SESSION_USER = "";<br />
<br />
[XmlElement(ElementName="SESSION_ID")]<br />
public string SESSION_ID = "";<br />
<br />
[XmlElement(ElementName="SESSION_SIGNATURE")]<br />
public string SESSION_SIGNATURE = "";<br />
<br />
[XmlElement(ElementName="messageID")]<br />
public string messageID = "";<br />
<br />
[XmlElement(ElementName="id")]<br />
public string id = "";<br />
}<br />
|
|
|
|
|
Is there some way anyone knows to clear out the handlers for an event? An object I've created needs to clear all handlers to it at a point in the code where it is unknown what is attached to it.
You can't just set the event to null , the compiler complains about that. I've also tried the following to no effect:
...
if (MyEvent != null)
{
Delegate[] delegateList = MyEvent.GetInvocationList();
foreach (MyEventHandler meh in delegateList)
{
MyEvent -= meh;
}
}
...
I thought it showed promise (the compiler didn't complain, and it did run fine) - unfortunately it simply didn't do anything.
I've also tried some variations to the above, using the normal way of decoupling from an event, but by trying some of the values of the delegate to get the method:
...
if (MyEvent != null)
{
Delegate[] delegateList = MyEvent.GetInvocationList();
foreach (MyEventHandler meh in delegateList)
{
MyEvent -= new MyEventHandler(meh.Method);
}
}
...
- but the Delegate.Method property (as well as it's properties) don't seem to contain the right value wanted (the compiler makes noise about the fact that a property is being passed in to the handler instead of a method).
I think I'm on the right track, but seem to be missing some key element to make it work. Anyone have any ideas?
-----
In the land of the blind, the one eyed man is king.
|
|
|
|
|
Vineas wrote: ...
if (MyEvent != null)
{
Delegate[] delegateList = MyEvent.GetInvocationList();
foreach (MyEventHandler meh in delegateList)
{
MyEvent -= new MyEventHandler(meh.Method);
}
}
Try using:
if (MyEvent != null)
{
Delegate[] delegateList = MyEvent.GetInvocationList();
foreach (MyEventHandler meh in delegateList)
{
MyEvent -= meh;
}
]
Basically your trying to remove a delegate that you've only just created, me thinks, what you need is a reference to the actual delegate as the above code demonstrates.
Ed
|
|
|
|
|
Ed.Poore wrote: Try using:
if (MyEvent != null)
{
Delegate[] delegateList = MyEvent.GetInvocationList();
foreach (MyEventHandler meh in delegateList)
{
MyEvent -= meh;
}
}
Basically your trying to remove a delegate that you've only just created, me thinks, what you need is a reference to the actual delegate as the above code demonstrates.
Ed
uh - did you read my initial post?!?!?!? That is exactly the first code snippet I listed (which does not work BTW - which then prompted me to continue to the other snippet, which also didn't work).
I still haven't found a solution to this. Some of the things I've found when searching around seem to indicate that others have tried and failed - so in the interest of brevity (and better code), for my own purposes, I re-did the section in question so am no longer facing this issue.*
I am still interested in a solution though - there have been other times I've wanted to do this, but haven't had the time to go much further - and from my searches I know others have wanted a solution as well.
* in case anyone was wondering why this was needed to begin with - some code I wrote a while ago was doing a deep copy on some different objects by doing a MemberwiseClone(), then selectively doing deep copies on reference types in that object. This worked OK until I recently found that during the MemberwiseClone() call, an event from a base object was bringing all it's handlers with it when copied. D'oh! I wanted a way to clear out the event after copying - but it was better to rewrite the copy code to work correctly than to continue with a bad idea implemented because of a time crunch.
-----
In the land of the blind, the one eyed man is king.
|
|
|
|
|
Sorry I was a bit quick in reading your post
I've had a brief look into this (which I neglected to do earlier and it seems that there is no easy or at least obvious way around this).
I'll take a look later because you have me intrigued now.
Ed
|
|
|
|
|
I have an MDI Parent form with some toolbars docked to all four sides. I found the MDIClient control in its Controls collections, then I removed it and replaced it with a SplitContainer, placing the MDIClient control in Panel1. In Panel2, I placed another control. The SplitContainer is oriented so that Panel1 is above Panel2, so it appears as though the MDIClient control is now above the control in Panel2 (just like VS2005 appears with one form docked at the bottom).
My problem is this:
The SplitContainer appears to be partially hidden by the toolbars that were already on the MDI Parent form.
Any suggestions/ideas???
|
|
|
|
|
I have several labels on a panel that I am using the MouseDown event to start drag and drop processes. this is fine, but I also need to have a DoubleClick event on the labels. the problem is that the mousedown event prevents the doubleclick from firing. The double click is an overloaded panel DoubleClick event. Something like this:
private void lbItems_MouseDown(object sender, MouseEventArgs e)
{
lbItems.DoDragDrop(lbItems.Items[lbItems.SelectedIndex].ToString(), DragDropEffects.Copy | DragDropEffects.Move);
}
private void pnlImageBorder_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Move;
}
private void pnlImageBorder_DragDrop(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(typeof(Label)))
{
Label label = (Label)e.Data.GetData(typeof(Label));
label.Location = pnlImageBorder.PointToClient(new Point(e.X, e.Y));
}
else
{
Point locPoint = pnlImageBorder.PointToClient(new Point(e.X, e.Y));
placeLabel(locPoint);
}
}
void Form1_MouseDown(object sender, MouseEventArgs e)
{
if (sender is Label)
{
Label label = (Label)sender;
pnlImageBorder.DoDragDrop(label, DragDropEffects.Move);
}
}
private void pnlImageBorder_DragOver(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(typeof(Label)))
{
Label label = (Label)e.Data.GetData(typeof(Label));
label.Location = pnlImageBorder.PointToClient(new Point(e.X, e.Y));
}
}
private void pnlImageBorder_Paint(object sender, PaintEventArgs e)
{
DoPage(e.Graphics, ForeColor, pnlImageBorder.ClientSize.Width, pnlImageBorder.ClientSize.Height);
base.OnPaint(e);
}
protected void pnlImageBorder_DoubleClick(object sender, EventArgs e)
{
if (sender is Label)
{
MessageBox.Show("label");
}
else
{
MessageBox.Show("not label");
}
}
So as you can imagine mousedown event superceeds the double click.
Thanks in advance
cbeasle1
|
|
|
|
|
Don't start a drag and drop sequence (via DoDragDrop) until the user has mouse down and has moved the mouse position a certain number of pixels in either direction.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: How 'bout a little guitar now?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
How can I get the number of pixils the mouse has moved? The only thing I have found relative to this is SystemInformation.DragSize, but I do not think that is exactly it. I am assuming you mean that I should have a drag distance conditional inside the mousedown event before calling the DoDragDrop call.
Thanks again.
cbeasle1
|
|
|
|
|
DragSize is the constant value maintained by the operating system indicating how many pixels the mouse must move before it is considered a drag operation.
Set a flag in your mouse down event that the mouse is down, and log the location of the mouse. Inside the MouseMove event, check and see if the mouse is still down. If it is, compare its position to the original mouse down location. If that distance between the current mouse location and the original mouse down location constitutes a move, then you can call DoDragDrop.
|
|
|
|
|
hi every body
we can use very simple way for soulution:by(e.Clicks = 1)
Private Sub pbBook_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pbBook.MouseDown
If e.Button = Windows.Forms.MouseButtons.Left AndAlso e.Clicks = 1 then
Me.DoDragDrop(str, DragDropEffects.Copy)
End If
|
|
|
|
|
Hi.
I am wondering how one goes about letting a user of a Windows forms app select a certain file at a certain location and then the application does whatever with the file.
What I am refering to is similar to what we see when we are attaching files in an email, one presses a button and then a dialog box opens that enables the user to browse to a certain location and select a file that is then attached to the email. I would like to know how one can get the app to work with the file chosen by the user at some location on his/her computer?
Thanks,
F
|
|
|
|
|
Look into the OpenFileDialog class on MSDN.
When you call the ShowDialog function, a browse dialog appears. You can set filters, default directory, ...
Hope this helps.
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
OpenFileDialog - its in the components of Visual Studio.
|
|
|
|
|
Hi.
I am wondering how one goes about letting a user of a Windows forms app select a certain file at a certain location and then the application does whatever with the file.
What I am refering to is similar to what we see when we are attaching files in an email, one presses a button and then a dialog box opens that enables the user to browse to a certain location and select a file that is then attached to the email. I would like to know how one can get the app to work with the file chosen by the user a some location on his/her computer?
Thanks,
F
|
|
|
|
|
If you look here:
System.Windows.Forms.FileDialog
System.Windows.Forms.FolderBrowserDialog
You will get what you want.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Actually,
I found one article on this in codeproject,but that source giving some probem at getRegistryHandle function.Please update me how can i solve that.
|
|
|
|
|
Hi,
I'm writing a web service with C#. I'm using VS.NET 2005 but I can't understand the way VS.NET create a web service (EX: I can't find the .wsdl file).
Can you explain it?
Thanks,
Hung.
Hung
|
|
|
|
|
|
Hi,
I am working on a web application in ASP.net & C# .For one of the utilities on my site, i need to use an available VC++ project.
This VC++ project produces an exe as its output.
I tried changing the output type of the VC++ project to .dll, but it doesn't help and after this, the project itself stops working.
Can someone please tell me as to how to use this VC++ project into my web application?
Thanks.
|
|
|
|
|
There're some very big issues involved here. If your VC++ project produces an exe, it is either a Windows or Console application project. So look bellow. This would work with VS2008, I don't remember how to do it using older versions.
1.- [Easiest] Is the VC++ project a managed project? Go to project properties and take a look under "Common Properties", if this tab works. Allows you to change "Targeted Framework", add references or so. It is a managed project. Solution: Just changed your project output type: Go to "Configuration Properties" > "General" > "Configuration Type" and change it to "Dynamic Library (.dll)". And just try placing the reference in your web.config, it should work. Down side. Global funcions and not managed types are not going to work for you ASP.NET site. All types you'd like to use must be marked as "__gc" or "__value". Take a look to this MSDN link > ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/dv_vclang/html/63b1e7ab-d1c8-4582-aa89-21bfddf694a9.htm
2.- [Hardest] Your project is a native one. Solution: First, change the project type, same as above (not mandatory, exe also can export functions). You'll have to make sure you're exporting the funcions you'd like to use from managed code. To see exported functions use "dumpbin.exe /EXPORTS <exe or="" dll="" file="">" from VS command prompt. Then you'll have to create a "wrapper" managed library to access to unmanaged, see this one to use native functions from managed code > ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/fxref_mscorlib/html/36830e35-7f2e-b1fa-87ca-144346051059.htm . Down side, most web hostings won't allow you to access to native code, or at lest no more than .NET native libraries or Windows API.
Hope it'll help
|
|
|
|
|
Hi
how can i check whether a screen saver is running or not.
Shajeel
|
|
|
|
|
tip #1: use google :>
tip #2: http://www.neowin.net/forum/lofiversion/index.php/t298659.html
|
|
|
|