Click here to Skip to main content
15,915,319 members
Home / Discussions / C#
   

C#

 
AnswerRe: Excel Interop - Excel Not Closing Pin
BobJanova8-Aug-11 23:13
BobJanova8-Aug-11 23:13 
AnswerRe: Excel Interop - Excel Not Closing Pin
NarVish10-Aug-11 1:40
NarVish10-Aug-11 1:40 
QuestionObjectDataSource seems to bind, but doesn't, really. Pin
ShearWater5098-Aug-11 6:58
professionalShearWater5098-Aug-11 6:58 
QuestionHow to unit test this method Pin
chuckdawit8-Aug-11 6:28
chuckdawit8-Aug-11 6:28 
QuestionLucene .Net: search results are case sensitive Pin
NarVish8-Aug-11 2:00
NarVish8-Aug-11 2:00 
AnswerRe: Lucene .Net: search results are case sensitive Pin
Pete O'Hanlon8-Aug-11 2:24
mvePete O'Hanlon8-Aug-11 2:24 
GeneralRe: Lucene .Net: search results are case sensitive Pin
NarVish9-Aug-11 19:58
NarVish9-Aug-11 19:58 
QuestionSerialization of a Func property Pin
cjb1108-Aug-11 0:01
cjb1108-Aug-11 0:01 
I'd like to serialize this func property of my class.
C#
public Func<object, object, object> CostAdditionFunction { get; set; }

But if I add the [DataMember(Order = 6)] attribute to use DataContract serialisation, I get the following error:
Type 'System.DelegateSerializationHolder+DelegateEntry' with data contract name 'DelegateSerializationHolder.DelegateEntry:http://schemas.datacontract.org/2004/07/System' is not expected. Consider using a DataContractResolver or add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.
Not entirely sure I understand the error, or how to resolve it...

The reason for this request is that there is a related class with a object Cost property, and because I don't know the actual type of Cost, I can't just do Cost + Cost as the object might not have a + operator defined. So the func allows me do things like CostAdditionFunction = (s, t) => ((int) s) + ((int) t);.

btw I did try using Generics to solve this as well, but that didn't work when I was trying to provide the GUI layer for these classes. But if I'm doing something utterly stupid, I'll consider alternatives!
Questionproject upgrade Pin
wasifmuneer7-Aug-11 20:40
wasifmuneer7-Aug-11 20:40 
QuestionDatagidview custom data Pin
sarang_k7-Aug-11 18:57
sarang_k7-Aug-11 18:57 
AnswerRe: Datagidview custom data Pin
Mycroft Holmes7-Aug-11 19:16
professionalMycroft Holmes7-Aug-11 19:16 
QuestionC# coding Pin
DammyMulero7-Aug-11 18:54
DammyMulero7-Aug-11 18:54 
AnswerRe: C# coding Pin
Richard MacCutchan7-Aug-11 21:52
mveRichard MacCutchan7-Aug-11 21:52 
AnswerRe: C# coding Pin
BobJanova7-Aug-11 23:14
BobJanova7-Aug-11 23:14 
AnswerRe: C# coding Pin
#realJSOP8-Aug-11 1:49
professional#realJSOP8-Aug-11 1:49 
GeneralRe: C# coding Pin
Not Active8-Aug-11 1:53
mentorNot Active8-Aug-11 1:53 
AnswerRe: C# coding Pin
V.8-Aug-11 2:16
professionalV.8-Aug-11 2:16 
AnswerRe: C# coding Pin
PIEBALDconsult8-Aug-11 2:48
mvePIEBALDconsult8-Aug-11 2:48 
QuestionHow do I store two int values into one DWORD, and then convert it to a 4 byte array? Pin
stephen.darling7-Aug-11 11:04
stephen.darling7-Aug-11 11:04 
AnswerRe: How do I store two int values into one DWORD, and then convert it to a 4 byte array? Pin
PIEBALDconsult7-Aug-11 13:44
mvePIEBALDconsult7-Aug-11 13:44 
AnswerRe: How do I store two int values into one DWORD, and then convert it to a 4 byte array? Pin
Luc Pattyn7-Aug-11 15:32
sitebuilderLuc Pattyn7-Aug-11 15:32 
GeneralRe: How do I store two int values into one DWORD, and then convert it to a 4 byte array? Pin
PIEBALDconsult7-Aug-11 18:02
mvePIEBALDconsult7-Aug-11 18:02 
GeneralRe: How do I store two int values into one DWORD, and then convert it to a 4 byte array? Pin
stephen.darling8-Aug-11 4:48
stephen.darling8-Aug-11 4:48 
GeneralRe: How do I store two int values into one DWORD, and then convert it to a 4 byte array? Pin
PIEBALDconsult8-Aug-11 16:37
mvePIEBALDconsult8-Aug-11 16:37 
GeneralRe: How do I store two int values into one DWORD, and then convert it to a 4 byte array? Pin
stephen.darling8-Aug-11 5:08
stephen.darling8-Aug-11 5:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.