Click here to Skip to main content
15,908,775 members
Home / Discussions / C#
   

C#

 
GeneralRe: Rename files in WinScp Directory using C# Pin
Sriram Valluri27-Apr-20 8:07
Sriram Valluri27-Apr-20 8:07 
AnswerRe: Rename files in WinScp Directory using C# Pin
Luc Pattyn27-Apr-20 8:21
sitebuilderLuc Pattyn27-Apr-20 8:21 
GeneralRe: Rename files in WinScp Directory using C# Pin
Sriram Valluri27-Apr-20 21:21
Sriram Valluri27-Apr-20 21:21 
QuestionMulticombobox in datagridview c# Pin
Member 1347974626-Apr-20 16:12
Member 1347974626-Apr-20 16:12 
AnswerRe: Multicombobox in datagridview c# Pin
OriginalGriff26-Apr-20 19:25
mveOriginalGriff26-Apr-20 19:25 
QuestionAccess Rights Management Pin
Member 1481258225-Apr-20 13:13
Member 1481258225-Apr-20 13:13 
AnswerRe: Access Rights Management Pin
OriginalGriff25-Apr-20 20:09
mveOriginalGriff25-Apr-20 20:09 
AnswerRe: Access Rights Management Pin
Gerry Schmitz26-Apr-20 6:54
mveGerry Schmitz26-Apr-20 6:54 
AnswerRe: Access Rights Management Pin
Mycroft Holmes26-Apr-20 12:21
professionalMycroft Holmes26-Apr-20 12:21 
QuestionIssue while solving 100 Doors Kata Problem Pin
User-862169524-Apr-20 21:51
User-862169524-Apr-20 21:51 
AnswerRe: Issue while solving 100 Doors Kata Problem Pin
OriginalGriff24-Apr-20 22:06
mveOriginalGriff24-Apr-20 22:06 
GeneralRe: Issue while solving 100 Doors Kata Problem Pin
User-862169524-Apr-20 22:21
User-862169524-Apr-20 22:21 
GeneralRe: Issue while solving 100 Doors Kata Problem Pin
OriginalGriff24-Apr-20 22:31
mveOriginalGriff24-Apr-20 22:31 
QuestionRe: Issue while solving 100 Doors Kata Problem Pin
Richard MacCutchan24-Apr-20 22:09
mveRichard MacCutchan24-Apr-20 22:09 
AnswerRe: Issue while solving 100 Doors Kata Problem Pin
Gerry Schmitz25-Apr-20 11:52
mveGerry Schmitz25-Apr-20 11:52 
QuestionSQL Connection in Visual Studio Pin
Member 1481258224-Apr-20 12:25
Member 1481258224-Apr-20 12:25 
AnswerRe: SQL Connection in Visual Studio Pin
Eddy Vluggen24-Apr-20 12:40
professionalEddy Vluggen24-Apr-20 12:40 
AnswerRe: SQL Connection in Visual Studio Pin
Matt Slay24-Apr-20 16:28
Matt Slay24-Apr-20 16:28 
AnswerRe: SQL Connection in Visual Studio Pin
OriginalGriff24-Apr-20 20:09
mveOriginalGriff24-Apr-20 20:09 
AnswerRe: SQL Connection in Visual Studio Pin
Gerry Schmitz25-Apr-20 11:46
mveGerry Schmitz25-Apr-20 11:46 
Questioncasting from interface instance back to generic instance ? Pin
BillWoodruff24-Apr-20 1:11
professionalBillWoodruff24-Apr-20 1:11 
GeneralRe: casting from interface instance back to generic instance ? Pin
harold aptroot24-Apr-20 1:29
harold aptroot24-Apr-20 1:29 
GeneralRe: casting from interface instance back to generic instance ? Pin
BillWoodruff24-Apr-20 2:41
professionalBillWoodruff24-Apr-20 2:41 
GeneralRe: casting from interface instance back to generic instance ? Pin
Richard Deeming24-Apr-20 3:26
mveRichard Deeming24-Apr-20 3:26 
GeneralRe: casting from interface instance back to generic instance ? Pin
BillWoodruff24-Apr-20 4:52
professionalBillWoodruff24-Apr-20 4:52 
Thanks, Richard, if you look at the code I posted, you will see that as the generic instance is created, the generic Type is injected into the instance.
public IBeing AddBeing<T>(string name, T value) where T : class
{
    Being<T> newbeing = new Being<T>(name, value);
    newbeing.BType = typeof(T);
    Beings.Add(newbeing);
    return newbeing;
}
when the generic Type is added to the interface instance collection, it is "downcast" to the interface, but the Type variable is there, and accessible from the interface instance at run time.

Your code example has no relevance to the issue here.
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali

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.