|
Ennis Ray Lynch, Jr. wrote: One workaround is to mark your date property as not serializable and create a seperate string property that returns the string formated the way you want it.
Well not actually. Since it will be evaluating at class level it should stay there. Plus, it puts a lot of responsibility on the developer to remember to include the attribute on each method.
Ennis Ray Lynch, Jr. wrote: But you may have to write your own serializer to acheive it ( idk?) also you would most likely want your attribute on the property level.
And actually since an attibute is added at runtime I can just have my attibute extend the ISerlializable and iterate through each property. Formatting the date fields as they are encountered.
Thanks for your efforts to help,
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
I was trying to implement .net remoting in my project as
object oriented programming. Means, I get success to create
server process as SAO/CAO but in my client application after geting server remoted object, I was trying to pass a object in method of server remoted object, whitch was created on client side .
But I could'nt succes.
If you need my project to solve my problem , then send me email on EMAIL ID : sanjaykhang@yahoo.co.in
|
|
|
|
|
more than likely its not serializable. But know one can answer with that little amount of information
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
I was trying to implement .net remoting in my project as
object oriented programming. Means, I get success to create
server process as SAO/CAO but in my client application after geting server remoted object, I was trying to pass in method of server remoted object, whitch was created on client side .
But I could'nt succes.
If you need my project to solve my problem , then send me email on EMAIL ID : sanjaykhang@yahoo.co.in
|
|
|
|
|
As short as i can explain... I have a RichTextBox that i want to use for syntax highlighting. For coloring i use:
richControl.Select(...);
richControl.SelectionColor= ...;
and it works . The text is highlighted using a list of keywords. Lets say that I have te following line in my textbox:
I like icecream
In this line "like" is a keyword and its color is red(for explanation sake) and all the other words are black. THE PROBLEM is that if I move the caret just after the word "like" and I start typing, the new inputed characters will also be red,and i wanted them to be black. How can i escape this problem?
|
|
|
|
|
That's the regular behaviour you get in every text editor under windows that allows for formatted text.
If you really want to do syntax highlighting in your RTB yourself (although there are several articles here on this topic), you should reconsider when to perform colorization.
If you do it whenever the text is changed or when a key is pressed, then you'll find out that like + the letter you typed isn't a keyword anymore, so the whole word should be black.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
I implimented the Windows Media Player control in my project, it is very easy to pen a file with it but how can i load the file without openning it, is there a property(Load)?
and how can i give it an array of files, with there path?
and how can i see what is the time of the song?
Thanks
|
|
|
|
|
Hi,
I am trying to convert c++ code into c# code, and I am having trouble with arrays in structs.
The c++ struct looks like the following:
typedef struct {
int nAs;
int As[8];
int nBs;
int Bs[12];
int nCs;
int Cs[30];
} AN_ENTRY;
After quite a bit search, I figured out the definition can be changed to this:
[StructLayout(LayoutKind.Sequential, Pack = 4)]
public struct AnEntry
{
public int nAs;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=8)]
public int[] As;
public int nBs;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=12)]
public int[] Bs;
public int nCs;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=30)]
public int[] Cs;
}
But how would I go around and initialize such a struct, I mean they are 53 integers that need to be passed in to initialize this? Can I do the following?
AnEntry anEntry = new AnEntry(1, 1, 1, 1, ....., 1, 1); // 53 1's
Do I have a define a constructor in the struct? If yes, the argument list of the constructor would be REALLY long. What if I need to create an array of AnEntry? Any suggestion or comment is highly appreciated. Thanks a lot.
|
|
|
|
|
Usually when your passing a new array of something into a constructor / parameter, you would do something like this:
AnEntry anEntry = new AnEntry(new int[53]{1,1,1,1,1,1,1,1...}) ;
make sense?
|
|
|
|
|
But do I need to create a constructor inside the struct? If yes, I will have to list all those 53 parameters? Thanks.
|
|
|
|
|
Where do you take data for the struct instances?
If data are taken from a database then you can create constructor with one parameter (record identifier) and load data within this constructor. Or you can add Load(int id) method to your struct. If data are random then you can add FillRandom() method. And so on.
|
|
|
|
|
in a textbox when user enter some input after that i want to check wether user enter only alphanumeric values or any special char like *&$@!":. if user does i will inform the user that input string is not valid
my question is how i will find out that user has entered special char.
reply soon
|
|
|
|
|
string input = textBox.Text;
if(!input.Contains("@"))
{
}
Does that help?
|
|
|
|
|
so for all special char i have to check seprately. is there is any method to check all of them at once or user would be not able to enter special char
thanks
|
|
|
|
|
Override the text box and overrid the following method
protected override bool ProcessKeyMessage(ref Message m);
There are other ways as well but this one is fairly simple.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Use a regular expression
only two letters away from being an asset
|
|
|
|
|
Hi all.
How can I get a Flash object to work correctly with the .Net 2.0 WebBrowser Control.
Best way to explain my problem is with a small project.
Open Visual Studio 2005 and create a Windows application (c# or VB).
on the main form, place a System.Windows.Forms.WebBrowser.
on the Forms load event, send the webbrowser to this page (http://www.helloworld.com.es)
scroll down the page until you reach the small color chart.
now click on the colors, you will notice it will only play the flash once.
In order to play the flash movie a second time you need to click anywhere on the page, then click on the flash movie again. The flash behaves as expected in all other browsers. (you can check with IE)
Has anyone please got some ideas for a work around.
many thanks
sean
-- modified at 15:12 Monday 24th July, 2006
|
|
|
|
|
Well It might be the behavior of the control. Have you viewed source to see that the Loop property isn't being changed?
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Hey, I'm corrently building an IRC bot, using Threshers \ SharkByte IRC client.
It has a Connection class, which uses Threads.
I have 2 forms, a connection form, and a controling form.
After the user sets the data in the connection form, and logs in, I need to "move" the Connection obj into the next form.
but I can't cuz the Thread is throwing an error.
How can I still do something with it? or how can I move it?
Please help.
NaNg.
"FEAR MY CAPS!"
|
|
|
|
|
Might be helpful to know what the error is you are getting.
only two letters away from being an asset
|
|
|
|
|
"cross-thread operation is not valid: control "frmconn" accessed from a thread other than the thread it was created on"
this is the error.
|
|
|
|
|
I'm not familar with the tools you mention but if frmconn is a windows control then it is not possible to "move" it to another thread. It must interact with the UI thread in which it was created.
only two letters away from being an asset
|
|
|
|
|
A connection object is not guaranteed thread safety when used between threads. So you may want to use separate connection objects for your threads.
Regards.
modified 17-Jul-19 21:02pm.
|
|
|
|
|
when is it appropriate to use a Dictionary and a Hashtable?
Dictionary <string, string=""> cacheLanguage = new Dictionary<string,string>();
Hashtable table = new Hashtable();
|
|
|
|
|
a Dictionary is a generic collection where as a Hashtable is just a collection. So if you need to use generics use a Dictionary, if you don't use a Hashtable. Otherwise, they are identical, think of a Dictionary as a Hashtable for generics, just like ArrayList and List.
btw, should be:
Dictionary<typeOfKey, typeOfValue> cacheLanguage = new Dictionary<typeOfKey, typeOfValue>();
-- modified at 14:53 Monday 24th July, 2006
|
|
|
|