Click here to Skip to main content
16,020,666 members
Home / Discussions / C#
   

C#

 
GeneralRe: Get Variable Type from String PinPopular
SledgeHammer017-Aug-12 18:52
SledgeHammer017-Aug-12 18:52 
GeneralRe: Get Variable Type from String Pin
PIEBALDconsult8-Aug-12 3:46
mvePIEBALDconsult8-Aug-12 3:46 
AnswerRe: Get Variable Type from String Pin
Shameel8-Aug-12 4:49
professionalShameel8-Aug-12 4:49 
GeneralRe: Get Variable Type from String Pin
SledgeHammer018-Aug-12 7:39
SledgeHammer018-Aug-12 7:39 
GeneralRe: Get Variable Type from String Pin
eddieangel8-Aug-12 6:01
eddieangel8-Aug-12 6:01 
GeneralRe: Get Variable Type from String Pin
eddieangel8-Aug-12 6:23
eddieangel8-Aug-12 6:23 
GeneralRe: Get Variable Type from String Pin
SledgeHammer018-Aug-12 7:44
SledgeHammer018-Aug-12 7:44 
GeneralRe: Get Variable Type from String Pin
eddieangel8-Aug-12 8:54
eddieangel8-Aug-12 8:54 
Having gutted out much of what was there, here is where I am:

C#
private void GoTo(string viewModel, int claimId)
{
    Type type = Type.GetType(viewModel);
    var workspace = _mainWindow.Workspaces.FirstOrDefault(vm => vm is type); //Error on type

    if (workspace == null)
    {
        Activator.CreateInstance(type, new object[] { claimId });
        _mainWindow.Workspaces.Add(workspace);
    }
    _mainWindow.SetActiveWorkspace(workspace);
}


Error is "The type or namespace 'type' could not be found."
GeneralRe: Get Variable Type from String Pin
Pete O'Hanlon8-Aug-12 9:27
mvePete O'Hanlon8-Aug-12 9:27 
GeneralRe: Get Variable Type from String Pin
SledgeHammer018-Aug-12 9:32
SledgeHammer018-Aug-12 9:32 
GeneralRe: Get Variable Type from String Pin
SledgeHammer018-Aug-12 9:33
SledgeHammer018-Aug-12 9:33 
GeneralRe: Get Variable Type from String Pin
eddieangel8-Aug-12 13:24
eddieangel8-Aug-12 13:24 
GeneralRe: Get Variable Type from String Pin
SledgeHammer018-Aug-12 13:44
SledgeHammer018-Aug-12 13:44 
GeneralRe: Get Variable Type from String Pin
eddieangel9-Aug-12 6:46
eddieangel9-Aug-12 6:46 
GeneralRe: Get Variable Type from String Pin
eddieangel9-Aug-12 6:55
eddieangel9-Aug-12 6:55 
GeneralRe: Get Variable Type from String Pin
SledgeHammer019-Aug-12 7:58
SledgeHammer019-Aug-12 7:58 
GeneralRe: Get Variable Type from String Pin
eddieangel9-Aug-12 8:02
eddieangel9-Aug-12 8:02 
GeneralRe: Get Variable Type from String Pin
Pete O'Hanlon7-Aug-12 22:27
mvePete O'Hanlon7-Aug-12 22:27 
GeneralRe: Get Variable Type from String Pin
eddieangel8-Aug-12 6:02
eddieangel8-Aug-12 6:02 
GeneralRe: Get Variable Type from String Pin
eddieangel8-Aug-12 6:42
eddieangel8-Aug-12 6:42 
GeneralRe: Get Variable Type from String Pin
Pete O'Hanlon8-Aug-12 7:31
mvePete O'Hanlon8-Aug-12 7:31 
QuestionFarsiLibrary Pin
amin_alexi7-Aug-12 2:02
amin_alexi7-Aug-12 2:02 
AnswerRe: FarsiLibrary Pin
Dave Kreskowiak7-Aug-12 2:11
mveDave Kreskowiak7-Aug-12 2:11 
QuestionVideo Recording from a DVR using EMGU or DirectShow C# Pin
Gertlaub26-Aug-12 23:26
Gertlaub26-Aug-12 23:26 
QuestionRe: Video Recording from a DVR using EMGU or DirectShow C# Pin
Eddy Vluggen6-Aug-12 23:34
professionalEddy Vluggen6-Aug-12 23:34 

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.