|
I did not pick it. That is the only mail client we are allowed to use.
जय हिंद
|
|
|
|
|
My commiserations. I used it for nearly 3 years at my first job.
|
|
|
|
|
I have a form that has many text boxes on it. When the user selects a record to work with I load all the text boxes with the approiate data. I want to be able to determine if the user changed any of the content in any of the text boxes?
I have looked at the text change event, but won't this event fire when I load the text boxes from the db?
If any body has any suggestions or sample code for doing this it would be appreciated!
Thanks!
sk
|
|
|
|
|
Two quick solutions.
0: Unsubscribe to the TextChanged events immediately prior to loading from the Database and add the subscribers again afterwards.
1. Use a boolean flag field that you set to true when loading and set to false afterwards. Check this flag in the TextChanged event handling method(s) and just return immediately if true.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
I will vote for the boolean. Here is an example:
private bool mInUpdate;
private void LoadControlWithData()
{
//I want to keep the last mode
bool lastUpdateMode = mInUpdate;
try
{
mInUpdate = true;
//Update code goes here
}
finally
{
//restore the last flag
mInUpdate = lastUpdateMode;
}
}
private void textBox1_TextChanged(....)
{
//Test the update flag
if(!mInUpdate)
{
//Not in update lets do stuff
}
}
Natza Mitzi
|
|
|
|
|
I have this scenario:
I have hash table with keys are same as private member variable names something like below:
key ---- value
--------------------
m_strID ---- "123"
m_strName ---- "xyz"
Now without writing any loop and case statement i want to assign values from hashtable to my class local variables:
I don't want to do like below as i have to hard code things:
foreach (string key in hashtable.keys)
{
switch(key)
{
case "m_strID":
(local member) m_strID = value
}
}
Even i don't want to use reflection, i guess, it has some overhead. I can't think of any other way. Any thoughts are appreciated.
Thanks.
|
|
|
|
|
I don't think that's possible without Reflection. The overhead would only really be noticed if you loop several hundred times anyway, so there really isn't any need to worry if you're just putting together a small application
|
|
|
|
|
Thanks for the reply, i just want to confirm that there is no other way without reflection and am not missing any good logic. This bit which i am talking about is used in my serialize and deserialize process. Even there are few members (about 50), its going to be executed many times (every time i send a query across wire). Even MS logic for finding the serializable members and serializing uses reflection (hope i am not wrong).
|
|
|
|
|
see system.runtime.serialization[^]
hope it helps
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
modified on Tuesday, March 17, 2009 3:27 PM
|
|
|
|
|
Dhaim, we are implemented ISerializable in our classed and handling serialization ourself. I am looking more optimized code for serializing objects on ourown.
|
|
|
|
|
If you are looking for a faster way and less space, serialize the bytes your self using BitConverter class (static methods). The downside is that you need to hand code all of this unless you build a little SW that will do it for you.
Natza Mitzi
|
|
|
|
|
Hi!
I have build C# DLL with few function and Registered it successfully
and also consuming it through Javascript ActiveXObject.
So far All is good.
Now I want to raise one Event in C# Dll and want that event to be handled by Javascript
Is that possible to catch event in Javascript which is thrown by C# DLL, If yes can you please help me.
Thanks!
Develop2Program & Program2Develop
|
|
|
|
|
You mean Ajax?[^]
Have a look at this article[^] and how it gets the data from the server side using the Ajax.Net framework.
hmmm pie
modified on Tuesday, March 17, 2009 12:29 PM
|
|
|
|
|
Thanks for your reply, But no this is not what I mean
I want to raise an Event in C# DLL class and this should be Caught in Javascript Code
<script language="javascript">
var myObj
myObj = new ActiveXObject("myDLL.myClass");
myObj.myPropertyOne="value1";
myObj.processValue();
</script>
Now if I through Event with value 0 Then how can I get the Event in
Javascript.
Thanks!
Develop2Program & Program2Develop
|
|
|
|
|
Look, I just gave you an example of how to communicate between the C# and JavaScript. If you can't figure out how to do it then I suggest you do something else!
Loop {
response = checkValue();
if (response != 0)
Do Event
wait(2 seconds).
}
hmmm pie
|
|
|
|
|
Thanks for your efforts, I will try other resources!
Develop2Program & Program2Develop
|
|
|
|
|
how can i send data by using connection of another program?
the programs do not co-operate
|
|
|
|
|
Imagine me catching the connections of your Internet Explorer, when you're doing your banking
I doubt that this is possible.
I are troll
|
|
|
|
|
what program is it? and what exactly do you want to do with the connection?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
this is a game and i want to send and receive packets
|
|
|
|
|
your app is a game? if so then why do you not do the connection within your own app?
Unless of course your just trying to capture packets and manipulate them from some other game, i.e. some sort of hacking ability...
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
i need to create ingame app. for working with incoming and outcoming packets
|
|
|
|
|
i suppose, that i need a system language for this purpose
|
|
|
|
|
Last time I did anything like this I had to create an NDIS driver and capture the traffic at the network card. This is not for the faint of heart and if you mess it up you are likely to pull down the entire operating system.
|
|
|
|
|
What about DLL injection?
|
|
|
|