Browsing 7239 questions and answers with Jon Skeet
I suspect you've misinterpreted the advice. I suspect it was actually suggesting: private static extern int ReadMenu1File([MarshalAs(UnmanagedType.LPWStr)] string Menu1Path); EDIT: This fits in... more 9/24/2013 5:03:18 PM
\10 is in octal which is why you're getting U+0008. I don't believe there are any escape formats which use decimal; I'd suggest using the \uxxxx format, or specific escape sequences for supported characters (\r, \n etc). So for the second... more 9/24/2013 4:30:04 PM
If you know the Type to use, you can use Activator.CreateInstance: private void ShowForm(Form form, Type type) { if (form == null || form.IsDisposed) { form = (Form) Activator.CreateInstance(type); form.MdiParent =... more 9/24/2013 4:01:44 PM
Can anybody here help me how I can solve it and also format it so it only write to xml file in this format dd/MM/yyyy You can't and shouldn't - at least not without changing the schema. Your schema expressly specifies that it's an... more 9/24/2013 3:51:25 PM
It's definitely something to be avoided if possible - calling virtual methods within a constructor is always a bit smelly, as you'll be executing code before the subclass gets to perform initialization - its constructor body won't have... more 9/24/2013 3:21:38 PM
The methods would go in the outer class. The only purpose of the nested class is to enforce particular timing of the initialization of the singleton instance of the outer class. Don't forget that your GetInstance method returns a... more 9/24/2013 2:46:24 PM
This property: bool disposed { get; set; } is almost equivalent to a field. It's effectively this: bool _disposed; bool disposed { get { return _disposed; } set { _disposed = value; } } Given that both the field and the property are... more 9/24/2013 2:34:58 PM
You should be able to do the join explicitly: from order in db.Orders join supplier in db.Suppliers on order.SupplierId equals supplier.Id where supplier.City == "London" select order; (You could filter on "only suppliers within London"... more 9/24/2013 1:45:41 PM
I suggest you do it by actual times of day (represented as TimeSpan values) instead: var firstPeriodStart = new TimeSpan(12, 30, 0); var firstPeriodEnd = new TimeSpan(14, 0, 0); var secondPeriodStart = new TimeSpan(18, 0, 0); var... more 9/24/2013 7:36:49 AM
You're fetching by character, but your map's key is Boolean. You want the key to be Character and the value to be Boolean: HashMap<Character, Boolean> tab = new HashMap<Character, Boolean>(); Character c; for (int i = 0; i... more 9/23/2013 8:15:40 PM