|
Thanks Le Centriste,
My class MyException is a class of the final level (e.g. be used by other components directly). I think I may be wrong. If I mark it as protected, during serialization, the constructor will not be called since from outside protected contructor could not be called?
regards,
George
|
|
|
|
|
You can make the constructor protected only if you need to prevent access to this constructor from child classes. Else make it as public.
|
|
|
|
|
Thanks Navaneeth,
If I mark the constructor as protected, I think it will be invoked when the instance is de-serialized, and since it is also protected, it means only the sub-class of this class is able to de-serialize the instance?
regards,
George
|
|
|
|
|
The same question is answered many times in MSDN as well as here. Still you are not clear?
2 - Because the constructors are not inherited. So it allowes to pass the parameters when you are instantiating child class.
|
|
|
|
|
Thanks Navaneeth!
Why you say "the constructors are not inherited"? When I inherit from a class, all public methods should be inherited and constructor is also inherited and could be called by base keywords. Any comments to clarify?
regards,
George
|
|
|
|
|
George_George wrote: Why you say "the constructors are not inherited"? When I inherit from a class, all public methods should be inherited and constructor is also inherited and could be called by base keywords. Any comments to clarify?
Here[^]
|
|
|
|
|
|
Hi there,
I am developing an application in WPF, which plays a video in mediaelement. Now I want to export the video or in other words save the video in other format. How can I do that?? Please Help.
|
|
|
|
|
WPF cannot do this natively. You will have to consider using a third-party control or I believe DirectX has this capability.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
any understandble thing which is enough for understanding me.
in simple words , i want a simple example of asp.net(using c#) with some control.
--------------------------------------------------------------------------------
Maifs
|
|
|
|
|
|
any understandble thing which is enough for understanding me.
in simple words , i want a simple example of asp.net(using c#) with some control.
--------------------------------------------------------------------------------
|
|
|
|
|
That is the Worst English i have ever seen in Writting lol Before you write something you must take your time and make sure that someone will understand what you wrote
lol
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Probably a 6-year old kid.
|
|
|
|
|
Hello, I am new to THE CODE PROJECT. I have a question...
How do I make a console application that runs a screensaver?
FYI: I use Microsoft Visual C# 2008 with the .NET Framework 3.5
Thank You,
Josh
|
|
|
|
|
|
hi to all
i want to call javascript function and store the returnable value to a variable from my codebehind file when the grid edit button's click.
Thanks
(with regards)
B.Balachandhar
|
|
|
|
|
You're looking for the ASP.NET forum. You can't call a client-side Java function from the codebehind because that's running on the web-server, not the client.
|
|
|
|
|
Hi there !!
calling Javascript using your codebehond file is easy, all you have to do is to add the onClick attribute to your button. ( myButton.attributes.add("Onclick","JavascriptCode or funcion's name but you must register the script")
maintaining the return value would be easy if you create a hidden text fields and set it value with the script return value.
Hope that will help
WaelA
Senior Software Engineer
abu_wer@hotmail.com
|
|
|
|
|
Hi all,
How to identify Date in a String ?
The string may contains different sysmbols and alpha numeric values including Date
(like hj/dfsks jh/f12/353 @@2df 23/11/2008 kjdl jf\ioi jr4398 rjeo i")
Please suggest me how to find that.
Thanks in advance
|
|
|
|
|
You can use regular expressions to parse strings and extract data formatted in specific ways.
You will need to create a Regex[^] object with the require pattern you want to match.
There is a guide to .net regular expressions here[^].
This is also quite a good resource for regular expressions:
http://www.regular-expressions.info/[^]
You might want to consider downloading something like Expresso[^] to test your regular expression patterns.
Simon
|
|
|
|
|
Rather than using the regex aproach i would suggest Date.TryParse(in "string containing date", out date_object) ... as date varies on localization it might be a lil overhead building a regex to handle all kinds of formatting and might require, depending on case, a lot more processing time.
Code? Yeah i love it fried together with a glass of wine.
|
|
|
|
|
Based on the string you provided...
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
namespace TestConsole
{
class Program
{
static void Main(string[] args)
{
string myString = "hj/dfsks jh/f12/353 @@2df 23/11/2008 kjdl jf\\ioi jr4398 rjeo i";
string[] parts = myString.Split(' ');
DateTime dateFound;
CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US");
DateTimeStyles styles = DateTimeStyles.None;
foreach (string part in parts)
{
DateTime date;
if (DateTime.TryParseExact(part, "dd/MM/yyyy", culture, styles, out date))
{
dateFound = date;
break;
}
}
}
}
}
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi ,
I am CommandBar class for creating Addin, in which I want to call function Control.Add(). This function take 4 parameter of type object and all parameters are Optional type. I have to pass only one parameter but it is not allowed to me.
Code is as
Controls.Add(MsoControlType.msoControlPopup);
This function is worked in VB.Net but not in C#.net. So is there any different way to call optional parameter in C#.
Thanks
aaa
|
|
|
|
|
C# doesn't support optional parameters. Either pass null or Missing.Value
Simon
|
|
|
|