Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
QuestionClick event in DOM document Pin
A.Asif17-Oct-07 19:37
A.Asif17-Oct-07 19:37 
AnswerRe: Click event in DOM document Pin
Guffa17-Oct-07 19:49
Guffa17-Oct-07 19:49 
QuestionHow to move picturebox along with cursor movements Pin
Chintan.Desai17-Oct-07 19:19
Chintan.Desai17-Oct-07 19:19 
AnswerRe: How to move picturebox along with cursor movements Pin
Abhijit Jana17-Oct-07 19:35
professionalAbhijit Jana17-Oct-07 19:35 
GeneralRe: How to move picturebox along with cursor movements Pin
Chintan.Desai25-Oct-07 22:55
Chintan.Desai25-Oct-07 22:55 
QuestionHow can I add properties to a property? Pin
JoeRip17-Oct-07 19:05
JoeRip17-Oct-07 19:05 
AnswerRe: How can I add properties to a property? Pin
JoeRip17-Oct-07 19:21
JoeRip17-Oct-07 19:21 
AnswerRe: How can I add properties to a property? Pin
Guffa17-Oct-07 20:01
Guffa17-Oct-07 20:01 
JoeRip wrote:
I could instead derive my class from Song, and use a cast.


No, you couldn't. That would enable you to cast your object to Song, but not the other way.

JoeRip wrote:
can both mySong.Artist and mySong.Artist.MaxLength yield values? If so, how do I implement this?


You can create a class for the Artist property, that has properties and an implicit conversion to string. That way you can both get the artist as a string and get properties from it:

public class LimitedString {

   private string _value;
   private int _maxLength;

   publlic LimitedString(string value, int maxLength) {
      _value = value;
      _maxLength = maxLength;
   }

   public string Value { get{ return _value; } }
   public int MaxLength { get { return _maxLength; } }

   public static implicit operator string(LimitedString limited) {
      return limited.Value;
   }

}


---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams

AnswerRe: How can I add properties to a property? Pin
N a v a n e e t h17-Oct-07 19:41
N a v a n e e t h17-Oct-07 19:41 
GeneralRe: How can I add properties to a property? Pin
JoeRip17-Oct-07 19:45
JoeRip17-Oct-07 19:45 
GeneralRe: How can I add properties to a property? Pin
N a v a n e e t h17-Oct-07 19:54
N a v a n e e t h17-Oct-07 19:54 
Questionclasses Pin
kabutar17-Oct-07 19:02
kabutar17-Oct-07 19:02 
AnswerRe: classes Pin
Chintan.Desai17-Oct-07 19:33
Chintan.Desai17-Oct-07 19:33 
GeneralRe: classes Pin
kabutar17-Oct-07 19:35
kabutar17-Oct-07 19:35 
Questionhow to get the innerHtml from iframe in C# ? Pin
kkun17-Oct-07 16:51
kkun17-Oct-07 16:51 
AnswerRe: how to get the innerHtml from iframe in C# ? Pin
N a v a n e e t h17-Oct-07 18:58
N a v a n e e t h17-Oct-07 18:58 
GeneralRe: how to get the innerHtml from iframe in C# ? Pin
kkun17-Oct-07 20:52
kkun17-Oct-07 20:52 
GeneralRe: how to get the innerHtml from iframe in C# ? Pin
N a v a n e e t h17-Oct-07 22:21
N a v a n e e t h17-Oct-07 22:21 
GeneralRe: how to get the innerHtml from iframe in C# ? [modified] Pin
kkun17-Oct-07 22:43
kkun17-Oct-07 22:43 
GeneralRe: how to get the innerHtml from iframe in C# ? Pin
lmoelleb17-Oct-07 22:24
lmoelleb17-Oct-07 22:24 
GeneralRe: how to get the innerHtml from iframe in C# ? Pin
kkun17-Oct-07 23:02
kkun17-Oct-07 23:02 
QuestionConnection String in App config file Pin
dataminers17-Oct-07 14:44
dataminers17-Oct-07 14:44 
AnswerRe: Connection String in App config file Pin
dataminers17-Oct-07 15:20
dataminers17-Oct-07 15:20 
QuestionHow to Click Element in DOM document Pin
A.Asif17-Oct-07 13:24
A.Asif17-Oct-07 13:24 
AnswerRe: How to Click Element in DOM document Pin
Judah Gabriel Himango17-Oct-07 15:48
sponsorJudah Gabriel Himango17-Oct-07 15:48 

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.