public static WorkspaceScopeList Deserialize(string text) { var list = JsonConvert.DeserializeObject <List <WorkspaceScopeGeneric> >(text); var scopeList = new WorkspaceScopeList(); foreach (var line in list) { var variableType = Type.GetType(line.TypeName); var variables = line.Variables.ToObject(variableType); WorkspaceScope scope = new WorkspaceScope() { Name = line.Name, TypeName = line.TypeName, Variables = (ScopeVariables)variables }; scopeList.Add(scope); } return(scopeList); }
public void Add(WorkspaceScope scope) { _scopes.Add(scope); }