Click here to Skip to main content
15,920,627 members
Home / Discussions / C#
   

C#

 
GeneralRe: Add two zéro after a comma Pin
musefan16-Feb-09 5:36
musefan16-Feb-09 5:36 
GeneralRe: Add two zéro after a comma Pin
Guffa16-Feb-09 5:15
Guffa16-Feb-09 5:15 
GeneralRe: Add two zéro after a comma Pin
musefan16-Feb-09 5:43
musefan16-Feb-09 5:43 
AnswerRe: Add two zéro after a comma Pin
stancrm16-Feb-09 1:21
stancrm16-Feb-09 1:21 
QuestionDynamically assign values to instance Pin
Stevo Z16-Feb-09 0:59
Stevo Z16-Feb-09 0:59 
AnswerRe: Dynamically assign values to instance Pin
musefan16-Feb-09 1:05
musefan16-Feb-09 1:05 
GeneralRe: Dynamically assign values to instance Pin
Stevo Z16-Feb-09 1:15
Stevo Z16-Feb-09 1:15 
AnswerRe: Dynamically assign values to instance Pin
DaveyM6916-Feb-09 1:22
professionalDaveyM6916-Feb-09 1:22 
If it's only the one property you could use an implicit operator overload.
public class AClass
{
    public AClass() : this(string.Empty) { }
    private AClass(string aValue)
    {
        AValue = aValue;
    }
    public static implicit operator AClass(string aValue)
    {
        return new AClass(aValue);
    }
    public string AValue
    {
        get;
        set;
    }
}
AClass aInstance = "Test String";
Console.WriteLine(aInstance.AValue);


Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

GeneralRe: Dynamically assign values to instance Pin
Stevo Z16-Feb-09 1:25
Stevo Z16-Feb-09 1:25 
GeneralRe: Dynamically assign values to instance Pin
DaveyM6916-Feb-09 1:59
professionalDaveyM6916-Feb-09 1:59 
GeneralRe: Dynamically assign values to instance Pin
Stevo Z16-Feb-09 2:11
Stevo Z16-Feb-09 2:11 
AnswerRe: Dynamically assign values to instance Pin
S. Senthil Kumar16-Feb-09 1:22
S. Senthil Kumar16-Feb-09 1:22 
GeneralRe: Dynamically assign values to instance Pin
Stevo Z16-Feb-09 1:27
Stevo Z16-Feb-09 1:27 
GeneralRe: Dynamically assign values to instance Pin
S. Senthil Kumar16-Feb-09 1:55
S. Senthil Kumar16-Feb-09 1:55 
GeneralRe: Dynamically assign values to instance Pin
Stevo Z16-Feb-09 2:13
Stevo Z16-Feb-09 2:13 
GeneralRe: Dynamically assign values to instance Pin
S. Senthil Kumar16-Feb-09 2:19
S. Senthil Kumar16-Feb-09 2:19 
GeneralRe: Dynamically assign values to instance Pin
Stevo Z16-Feb-09 2:31
Stevo Z16-Feb-09 2:31 
GeneralRe: Dynamically assign values to instance Pin
S. Senthil Kumar16-Feb-09 4:28
S. Senthil Kumar16-Feb-09 4:28 
AnswerRe: Dynamically assign values to instance Pin
Calin Tatar16-Feb-09 1:35
Calin Tatar16-Feb-09 1:35 
GeneralRe: Dynamically assign values to instance Pin
Stevo Z16-Feb-09 1:37
Stevo Z16-Feb-09 1:37 
GeneralRe: Dynamically assign values to instance Pin
Calin Tatar16-Feb-09 1:45
Calin Tatar16-Feb-09 1:45 
GeneralRe: Dynamically assign values to instance Pin
Stevo Z16-Feb-09 1:52
Stevo Z16-Feb-09 1:52 
GeneralRe: Dynamically assign values to instance Pin
Calin Tatar16-Feb-09 1:54
Calin Tatar16-Feb-09 1:54 
GeneralRe: Dynamically assign values to instance Pin
Calin Tatar17-Feb-09 2:33
Calin Tatar17-Feb-09 2:33 
Questiongoogle maps within windows application Pin
laziale16-Feb-09 0:14
laziale16-Feb-09 0:14 

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.