|
Ah!
In that case - this should work:
<br />
class TCPSocket<br />
{<br />
public event ConnectedEventHandler Connected;<br />
<br />
private Control user;<br />
<br />
public TCPSocket(...) { ... }<br />
<br />
public TCPSocket(..., Control user)<br />
{<br />
...<br />
this.user = user;<br />
}<br />
<br />
private void RaiseConnectionEvent(IPEndPoint ep)<br />
{<br />
if (user != null)<br />
user.Invoke(this.Invoker, new object[]{ep});<br />
else<br />
this.OnRaiseConnectedEvent(ep);<br />
}<br />
<br />
protected virtual void OnRaiseConnectedEvent(IPEndPoint ep)<br />
{<br />
if (Connected != null)<br />
{<br />
Connected(this, ep);<br />
}<br />
}<br />
<br />
private void Invoker(IPEndPoint ep)<br />
{<br />
OnRaiseConnectedEvent(ep)<br />
}<br />
}<br />
Tris
|
|
|
|
|
Hmm...
Why do we need the proxy Invoker() method?
user.Invoke() can accept an event as the 1st parameter, so why send it a function which raises the event?
Am I missing something here?
|
|
|
|
|
Hmm, didn't know that, but it makes sense.
I think the delegate route makes it more flexible if you want to add info in the EventArgs with details about the executing thread.
I'm not actualy sure what you're asking, the origional version would have worked, so what is the problem?
Tris
|
|
|
|
|
Well, I just wanted an opinion on my code, as I wasn't sure it's a good practice to send a Control object to the constructor.
I think I'll hold a reference to System.ComponentModel.ISynchronizeInvoke instead of a Control object, so it would be more generic...
Anyway... Thank you very much!
Much appreciated!
|
|
|
|
|
Cool, np.
Good luck, let me know how it all ties up.
T
|
|
|
|
|
Hi,
There is a project with classes (businessLayer) referenced from the clients (WinForms) project. So the BusinessLayer dll is sitting on the client. What happens if the businessLayer changes in the future? How will the clients pick up the new dll?
Please note that for business purposes this is how the solution is setup.
Thanks
|
|
|
|
|
i use AxShockwaveFlashObjects in VS.net 2003 , but when i run the exe of this project , on framework 2 , this object cause error!!!!!!!!
why?
how could i solve this problem!!!
|
|
|
|
|
I use AxShockwaveFlash object in C# , and when the user click the right button of mouse on it , he/she can see the flash menu ,how could i hide this menu?
|
|
|
|
|
Put Stage.showMenu = false; in the first frame of your flash.
|
|
|
|
|
thanks , but it dosent work on win app. im using flash object in windows application.
|
|
|
|
|
Hi, I am using XslCompiledTransform class to convert xml files to html with xsl.
Evething is good but when input comes with special char it also convert them to html; like " < to < "
I don't want this. Because I need them in html like
blah blah as it orjinal.
What must I do.
<br />
StringBuilder sb = new StringBuilder(); <br />
<br />
XPathDocument XPathDoc = new XPathDocument(NewsXmlFile);<br />
<br />
XslCompiledTransform XslTrans = new XslCompiledTransform();<br />
XsltSettings settings = new XsltSettings(true, true); <br />
XslTrans.Load(Server.MapPath(@"xsl\NewsDefault.xsl"), settings, null); <br />
<br />
XmlWriter xtw = XmlTextWriter.Create(sb); <br />
XslTrans.Transform(XPathDoc, (XsltArgumentList)null, xtw); <br />
uxNewsBody.InnerHtml = sb.ToString();<br />
karanba
|
|
|
|
|
hi every one, i know i have alot of stupid questions regarding networking and this's one i hope you can help me with..
i created a virtual directory using IIS5.1, now when i cant get to the index inside this, i used strange applications that told me my ip adress is blah blah blah and when i tried what they told me i get the common 401 authuntication error despite providing the right username/password, pleas help me
ps. this's my ip settings
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : lan
IP Address. . . . . . . . . . . . : 10.0.0.6
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.0.0.138
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hey, your IP seems to be on a private network, so unless I misunderstood your question, the 401 error you may be getting is because your not trying to connect to your IIS installation, but to the administration panel of your Router. Try opening up a web browser on a system in your network, and type in http://10.0.0.6 , it should work.
If it does then you'll need to port forward port 80 (and any other ports you want) to that IP with in your router.
|
|
|
|
|
?????
didnt understand anything dont worry, i think apache is making me some troubles, thanx any wayz.
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
I have made a file using the following (with the writestream):
int written = 0;
while (written < listView1.Items.Count)
{
sw.WriteLine(";" + " Name: " + listView1.Items[written].SubItems[0] + "; Address: " +
listView1.Items[written].SubItems[1] + "; City: " + listView1.Items[written].SubItems[2] + "; State: " +
listView1.Items[written].SubItems[3] + "; Zip: " + listView1.Items[written].SubItems[4] + "{}" );
written = written + 1;
}
I am now trying to open the files by first seperating them into each set, and then seperate the properties. The code for that part looks like this(so far).
string[] TestString = Regex.Split(OpenedFile, "{}", RegexOptions.None);
int TestStringLength = TestString.Length;
int number = 0;
while (number < TestStringLength)
{
string[] StringSplit = Regex.Split(TestString[number], ";", RegexOptions.None);
}
What i want is to be able to put all of the seperate values back in their appropriate spots in a listview. Could someone please explain to me what i should do now?
Thanks in advance.
|
|
|
|
|
Assuming from the code that the order written to the file and the order in listview is same, you can create a ListViewItem and add the value to the listview.
ListViewItem lvwItem = new ListViewItem(StringSplit[0].Split(':')[1]);
for(int = 1; i < StringSplit.Length; i++)
{
lvwItem.SubItems.Add(StringSplit[i].Split(':')[1]);
}
ListView1.Items.Add(lvwItem);
Tarakeshwar Reddy
MCP, CCIE Q(R&S)
|
|
|
|
|
does anyone know a free web hosting service that supports published c# apps?? i just uploaded my files to geocities and it's not working
thanx!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
|
|
New registration is temporarily closed. We will re open soon after we add more resources to our server. Please check back later or browse other features of AspSpider.NET
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
|
thanx , i'll give it a try!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hello Friends,
Season greetings.
I am working in a C# (VS2005) windows application. In that I need to draw Contour chart.
I tried with different chart components, but they are following different patterns..not providing the expected result. I expect that, the component should produce the graph as same as the MS Excel draws contour chart for a speciific data.
Can anybody tell me which component I have to use for this type chart.
Thanks in Advance
Raja
|
|
|
|
|
Maybe this google search[^] can help you out. The first few components look interesting...
Some people have a memory and an attention span, you should try them out one day. - Jeremy Falcon
|
|
|
|
|
hi all,
i have a question that i have been thinking of for a while.
when i need to have an application that look like, for example, out look with a side panel and a cente panel. When clicking on a button on the side panel the center panel changes it components.
I usually use "UserControls" for this kind of application. And i assign the userCOntrols to the middle panels. It works fine with no problems.
But i have been thinking if i can assign form like that. Not a form that opens as a new window separate from the mother window. but a form that opens inside the mother form.
if it is possible please brief me.
|
|
|
|