|
As soon as I add an implementation for the interface IEnumerable to my class, like this:
<br />
public class TableLayout : IEnumerable<br />
{<br />
public IEnumerator GetEnumerator()<br />
{<br />
return (IEnumerator) this;<br />
}<br />
<br />
the serializer complains with the message:
"There was an error reflecting type 'TableEditConfig'"
when reading the XML file into the class.
If I comment out the interface stuff it all works fine, does anyone know why please?
|
|
|
|
|
Add an XmlInclude attribute to your class
[XmlInclude(typeof(TableEditConfig))]
You should also make sure that TableEditConfig is marked as [Serializable()]
HTH
Shaun
|
|
|
|
|
just a curious question , with having coded in vb for a while i want to be sure that c# isn't gonna be here today , gone tommorrow.
switch(twinsOnWay)
{
case ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
break;
|
|
|
|
|
I think it's fairly safe to say that C# is certainly going to be around for the long haul... over here in the UK a massive number of companies that I'm aware of are making large investments in moves to .NET and thankfully C#... (unfortunately one or two consultancy reports indicating that the move from VB to VB.NET would be considerably less painful than to C# has really hurt the .NET name in some areas...)
I did actually think that MS were going to start moving VC++ into retirement but it looks like they are still investing heavilly in Managed C++ so it's nothing but choice for developers... (MS obviously hedging bets!! )
If you look at the roadmap for C# the future looks quite compelling... next stop... generics!!!
Shaun
|
|
|
|
|
I am sure we will see VB/Java/C# for ages to come. C# however is the only standardized language of the three langauges.
As a C++ programmer, moving to C# is fairly natural. It reminds me of my last major jump in lanaguages in 80's when I moved from Assembler to C. Moving to C++ was not much of a transition. In the early days of C, it seemed bulky and kind of slow since compared to Assembler but it added a lot of RAD development to our world at the time. For many things C was fine, but for some things you had to revert to Assembler where absolute speed was required. At the time, OS's were built with Assembler. Now they are usually built in mostly C/C++.
With C#, there is a lot of changes from C++, and it can seem slow for somethings and may require MC++. But in the future more things will move that direction and speed will increase as will computer speed.
One thing I am waiting to see happen, since C# is a standard, is a form of C# scripting added to browsers. May not have the entire .NET frameworks, but could still work well to handle client side code. I get turned off having to resort to Javascript when I code client side.
I am sure that no person can say that it will remain for sure or not, but the same goes for any language. During the last six months, I have heavily used C# and enjoy it as a language. There are a few things I would change but I can live with them.
C# gives you much of the ease that VB programmers have been used to for years without the stigma of being BASIC. As for as .NET is concerned though, it does not matter much which language you use, but the job listings for C# programmers are usually higher.
Rocky Moore <><
|
|
|
|
|
<br />
switch(twinsOnWay)<br />
{<br />
case ("twins on the way"):<br />
MessageBox.Show("for mr and mrs dynamic","twins on the way");<br />
break;<br />
--->Syntax Error - line4 ( missing } )
There are only 10 types of people in this world....those that understand binary, and those that do not.
|
|
|
|
|
the } isnt missing;P i just use that many lines on my profile signature on message boards. there's more code in the actuall form;)
switch(twinsOnWay)
{
case ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
break;
|
|
|
|
|
hi does anyone know if there's an equivalent to the Split function in c# ?
|
|
|
|
|
See String.Split and Regex.Split.
Kant wrote:
Actually she replied back to me "You shouldn't fix the bug. You should kill it"
|
|
|
|
|
cheers , although i'm struggling with it a bit, if i want to seperate the first space in a row of text, how would it be done? all i can find is info on arrays of stuff ( eg: i want to split this line "hello i'm a test" , so that all i get is "i'm" ) but all i've managed to find is some really complex stuff on msdn about splitting whole lines
in vb6 / vb.net i've always been able to do this...
Dim text as string
text = Split("hello i'm a test",chr(32))(1)
/// bringing back the "i'm" bit
any ideas?
|
|
|
|
|
Both the C# version and the VB6 version return an array, you are just accessing a specific element of that array in your example.
This should work:
string word = "hello i'm a test".Split(' ')[1];
To be more verbose, you are setting the variable word to the first element in the array returned by calling the Split method on the string "hello i'm a test".
The large downfall with the .NET version of Split is that it only splits on characters not strings. I don't think this is a problem with Regex's but I don't know for sure.
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
dynamic wrote:
Dim text as string
text = Split("hello i'm a test",chr(32))(1)
Code this on C# as:
string text = string.Split("hello i'm a test", ' ')[1];
Kant wrote:
Actually she replied back to me "You shouldn't fix the bug. You should kill it"
|
|
|
|
|
cheers guys that worked great
i've only decided this week to make a move over from vb6 / vb.net to c# so it's all new , although i'm beginning to grasp the concepts a bit now.
thanks a lot.
|
|
|
|
|
using System;
namespace testString
{
class testString
{
public static void Main(string[] args)
{
string secondword = "";
string text = "hello i'm a test";
string[] fragments = text.Split(new char[] {' '});
if( fragments.Length > 2 )
{
secondword = fragments[1];
}
Console.WriteLine(text + "\n" + secondword);
}
}
}
This will return i'm.
|
|
|
|
|
You can use the code sample I posted above just to test and see it write out the second word to the command line. Alternatively, here is a method you can add to your class or a utility class to just get the second word. This will return the 2nd word, or a zero-length string if there is no 2nd word. Yes I was bored Time to sleep now.
private string GetSecondWord(string TextIn)
{
string secondword = "";
string[] fragments = TextIn.Split(new char[] {' '});
if( fragments.Length > 2 )
{
secondword = fragments[1];
}
return secondword;
} Happy To Help,
Joe Mozelesky
imoz technologies, llc :: powered by imoz
|
|
|
|
|
I would like to know the procedure for Printing WinForm Controls, both Built-in and Custom Controls.
BETTER TO BURN OUT THAN TO FADE AWAY - Anonymous
|
|
|
|
|
Hi,
I am still amazed that nulls or blanks can not be entered in the DateTimePicker control. Everybody in my employee database needs to be terminated because of this (sarcastic).
I had to resort to either defaulting all dates with 1/1/1900 and then saving it as null in my Stored Procedures, or use a textbox with a custom coded 'format' capability for dates.
Does anyone know of a better way of doing this, that can be deployed in a marketed application. (not an in-house project where you can get away with iffy controls).
I am held up to go to production because of this and the textbox class not having an InputMask.
Thanks,
Chris
|
|
|
|
|
http://www.syncfusion.com/forums/message.asp?MessageID=1464
Here, sample code which exactly does what u want
-S
|
|
|
|
|
The web service works, but the methods are not available from a remote machine. Instead I get this "The testservice form is only available for requests from the local machine.". I've done this before, just messing around and it all went perfectly. Now that I'm under a deadline and actually working on a project I've run into this little nusance; any help anyone?
Fear not my insanity, fear the mind it protects.
|
|
|
|
|
Hi,
I have been battleing with the fact that there is no InputMask or Format property on the TextBox control in Windows Forms.
I have spent the last 8 months designing my classes, but I am still stuck on this.
How can I get the same Format capabilities of the DataGridColumn in a standard textbox.
I have played with the two examples that come up on Google, but they fall way short of a production capable control. I worked for the last two weeks to get this to work.
The example on C# Help is incomplete and does not have a link to the code.
Does anyone have or know of where I can get the code to format my textboxes?
I can not tell my customers that this functionality is not available.
In VFP, you just typed in $$$99.99 or !!!!!!! for example. I am trying to duplicate this or the DataGridColumn.Format.
Thanks,
Chris
|
|
|
|
|
Do a little searching, you will find a masked edit box at code project itself, shows you how to implement a Masked box for decimals, ints. social security, ips . etc ..
-S
|
|
|
|
|
Hi Sameer,
I actually had Michael send me his code from the example posted on C# help. It used regular expressions.
I am working on it for my use and it is going well.
I tried the other example, but it did not work well in the field.
Thanks,
Chris
|
|
|
|
|
Hey again,
I'm animating an image across the screen. My problem is, it seems to studder as it moves across the screen. This gets more pronounced the faster I move the image. Is there any way to get nice smooth animation?
I'm using the DirectX animation example as my guide but it doesn't seem to be fixing the problem. Should I create a separate thread for setting the frame rate? That's really what I'm looking for. Some way to syncronize the framerate.
Thanks,
EvilDingo
|
|
|
|
|
have you tried looking into double buffering? or maybe vsynch? i havent done any work with directx, but those two things are prolly what you'll need..
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
I have a database connection in one assembly, and I have a Crystal report in another Windows forms Application.
I want my Crystal report to access Database through the connection in first assembly.
Is this possible? Idea is to keep a single database connection.
Please Help !!!!!
Gaurika Wijeratne. // www.gaurika.com
|
|
|
|