Click here to Skip to main content
15,923,051 members
Home / Discussions / C#
   

C#

 
GeneralRe: Array of objects Pin
Michael Sync29-Dec-07 22:24
Michael Sync29-Dec-07 22:24 
GeneralRe: Array of objects [modified] Pin
eric_tran30-Dec-07 0:07
eric_tran30-Dec-07 0:07 
GeneralRe: Array of objects Pin
Michael Sync30-Dec-07 5:33
Michael Sync30-Dec-07 5:33 
Generalproblem usinf usercontrol object in HTML page Pin
samy10029-Dec-07 14:32
samy10029-Dec-07 14:32 
GeneralRe: problem usinf usercontrol object in HTML page Pin
Michael Sync29-Dec-07 22:27
Michael Sync29-Dec-07 22:27 
AnswerRe: problem usinf usercontrol object in HTML page Pin
dipak.dipak30-Dec-07 2:19
dipak.dipak30-Dec-07 2:19 
GeneralRe: problem usinf usercontrol object in HTML page Pin
samy10030-Dec-07 11:39
samy10030-Dec-07 11:39 
GeneralBinding to a property Pin
peterchen29-Dec-07 14:30
peterchen29-Dec-07 14:30 
I have a class like this:
class StateManager
{
  bool IsLoading { get { ... } }
  bool IsValidated { get {... } }
  // more such properties
}


- and I want to bind to one of these getters, i.e. pass to some function which of these properties to ask (some time later), like this:

void DoSomething()
{
   CheckLater( bind(StateManager.IsLoading));
}

void CheckIt(something property)
{
  // will be called some time after CheckLater.
  bool state = unbindAndCallGetter(property);
  // calls the getter for the property that was bound in DoSomething, and assigns the result to state
  if (!state)
    ; // ...
}


Ideally, I don't have to add to StateManager anything (per-property) except the property itself.
bind can get the name of the property as a string, or anything that's simple to type.

unbindAndCallGetter can use reflection (performance-wise it's ok in this situation)

Currently, I am passing a delegate { return StateManager.IsLoading; }, which is flexible but could be shorter, and is not good for diagnostics (knowing in CheckIt that it was "IsLoading" what failed would be immensely useful).

Any other suggesiton welcome - my goal is to simplify syntax and readability.

We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
My first real C# project | Linkify!| FoldWithUs! | sighist


GeneralMySql & C# Question ... pulling data Pin
shadowhazard29-Dec-07 9:59
shadowhazard29-Dec-07 9:59 
GeneralRe: MySql & C# Question ... pulling data [modified] Pin
shadowhazard29-Dec-07 11:27
shadowhazard29-Dec-07 11:27 
GeneralRe: MySql & C# Question ... pulling data Pin
Justin Perez29-Dec-07 14:00
Justin Perez29-Dec-07 14:00 
GeneralRe: MySql & C# Question ... pulling data Pin
shadowhazard29-Dec-07 17:16
shadowhazard29-Dec-07 17:16 
GeneralRe: MySql & C# Question ... pulling data Pin
Mark Churchill30-Dec-07 15:59
Mark Churchill30-Dec-07 15:59 
GeneralRe: MySql & C# Question ... pulling data Pin
shadowhazard30-Dec-07 17:30
shadowhazard30-Dec-07 17:30 
QuestionAny query about northwind? Pin
omegazafer29-Dec-07 9:44
omegazafer29-Dec-07 9:44 
AnswerRe: Any query about northwind? Pin
Paul Conrad30-Dec-07 6:44
professionalPaul Conrad30-Dec-07 6:44 
GeneralRe: Any query about northwind? Pin
omegazafer30-Dec-07 10:09
omegazafer30-Dec-07 10:09 
GeneralRe: Any query about northwind? Pin
Paul Conrad30-Dec-07 10:30
professionalPaul Conrad30-Dec-07 10:30 
GeneralRe: Any query about northwind? Pin
omegazafer30-Dec-07 10:57
omegazafer30-Dec-07 10:57 
Generali need your help ....am stuck Pin
netJP12L29-Dec-07 9:40
netJP12L29-Dec-07 9:40 
GeneralA little problem Pin
zeeShan anSari29-Dec-07 8:28
zeeShan anSari29-Dec-07 8:28 
AnswerRe: A little problem Pin
Guffa29-Dec-07 9:03
Guffa29-Dec-07 9:03 
GeneralRe: A little problem Pin
Rich Insley29-Dec-07 9:08
Rich Insley29-Dec-07 9:08 
QuestionGetting handle to browser window? Pin
cakewalkr729-Dec-07 3:30
cakewalkr729-Dec-07 3:30 
GeneralRe: Getting handle to browser window? Pin
Scott Dorman29-Dec-07 3:59
professionalScott Dorman29-Dec-07 3:59 

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.