Changeset 1287 for trunk/sources/HeuristicLab.CEDMA.Core/DataSetList.cs
- Timestamp:
- 03/08/09 12:48:18 (16 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.Core/DataSetList.cs
r957 r1287 41 41 store = value; 42 42 Action reload = ReloadList; 43 lock (dataSetList) {43 lock (dataSetList) { 44 44 dataSetList.Clear(); 45 45 } … … 58 58 59 59 private void ReloadList() { 60 throw new NotImplementedException(); 61 //foreach( a in database.GetAgents()) { 62 // Agent newAgent = new Agent(Database, a.Id); 63 // newAgent.Name = a.Name; 64 // newAgent.Status = a.Status; 65 // lock(agentList) { 66 // agentList.Add(newAgent); 67 // } 68 // FireChanged(); 69 //} 70 } 71 72 internal static void CreateDataSet() { 73 throw new NotImplementedException(); 60 HeuristicLab.CEDMA.DB.Interfaces.Variable dataSetVar = new HeuristicLab.CEDMA.DB.Interfaces.Variable("DataSet"); 61 HeuristicLab.CEDMA.DB.Interfaces.Variable dataSetNameVar = new HeuristicLab.CEDMA.DB.Interfaces.Variable("Name"); 62 var bindings = store.Query( 63 "?DataSet <"+Ontology.PredicateInstanceOf.Uri+"> <"+Ontology.TypeDataSet.Uri+"> ." + Environment.NewLine + 64 "?DataSet <"+Ontology.PredicateName.Uri+"> ?Name ."); 65 // new Statement[] { 66 // new Statement(dataSetVar, Ontology.PredicateInstanceOf, Ontology.TypeDataSet), 67 // new Statement(dataSetVar, Ontology.PredicateName, dataSetNameVar) 68 //}); 69 foreach (var binding in bindings) { 70 DataSet d = new DataSet(store, (Entity)binding.Get("DataSet")); 71 d.Name = (string)((Literal)binding.Get("Name")).Value; 72 lock (dataSetList) { 73 dataSetList.Add(d); 74 } 75 FireChanged(); 76 } 74 77 } 75 78 76 79 public IEnumerator<DataSet> GetEnumerator() { 77 80 List<DataSet> dataSets = new List<DataSet>(); 78 lock (dataSets) {81 lock (dataSets) { 79 82 dataSets.AddRange(dataSetList); 80 83 } … … 85 88 return GetEnumerator(); 86 89 } 90 91 public void Add(DataSet dataSet) { 92 dataSetList.Add(dataSet); 93 } 87 94 } 88 95 }
Note: See TracChangeset
for help on using the changeset viewer.