private void ReloadList() { ObjectsList.Clear(); ObjectListBox.ItemsSource = null; RefreshObjectColumns(ObjectListBox); var SceneObjects = _SceneObjects.Select(y => y.Name.ToString()).OrderBy(x => x.ToString()); var StageConfigObjects = _StageConfigObjects.OrderBy(x => x.ToString()); var GameConfigObjects = _GameConfigObjects.OrderBy(sso => sso.ToString()); var AllObjects = SceneObjects.Union(StageConfigObjects).OrderBy(sso => sso.ToString()); int index = 0; foreach (var name in AllObjects) { if (SceneObjects.Contains(name)) { var lvc = GenerateListEntry(name, index, SceneObjects, GameConfigObjects, StageConfigObjects); ObjectsList.Add(lvc); index++; } else { var lvc = GenerateListEntry(name, -1, SceneObjects, GameConfigObjects, StageConfigObjects); ObjectsList.Add(lvc); } } ObjectListBox.ItemsSource = VisibleObjectsList; UpdateSelectionControls(); }
public override void OnLoad(ConfigNode node) { if (ObjectsList == null) { ObjectsList = new List <ConstrainedObjectEx>(); } trackingMode = (TrackMode)Enum.Parse(typeof(TrackMode), trackingModeString); if (node.HasNode("CONSTRAINFX")) { ObjectsList.Clear(); for (int i = 0; i < node.nodes.Count; i++) { ConfigNode configNode = node.nodes[i]; string name = configNode.name; if (name != null && name == "CONSTRAINFX") { ConstrainedObjectEx constrainedObject = new ConstrainedObjectEx(); constrainedObject.Load(configNode); SetupObjects(constrainedObject); } } } }
private void ReloadAssembly() { LoadAssembly(); ObjectsList.Clear(); if (LoadedAssemblyRepresentation != null) { TreeViewItem item = new AssemblyItem((AssemblyMetadata)LoadedAssemblyRepresentation); ObjectsList.Add(item); SaveModel.RaiseCanExecuteChanged(); ObjectSelected = item; } }
public void ResetHeapData() { ObjectsList.Clear(); ObjectTypeCodes.Clear(); ReferenceCodes.Clear(); FieldReferenceCodes.Clear(); RealObjectCount = 1; // The 'unknown' object ObjectInfo ob = new ObjectInfo(); ob.Code = ObjectMapReader.UnknownObjectId; ob.Size = 0; ob.RefsIndex = 0; ob.RefsCount = 0; ObjectTypeCodes.Add(ObjectMapReader.UnknownTypeId); ObjectsList.Add(ob); }
private async Task Load(ISourceProvider targetPathProvider) { if (targetPathProvider == null) { throw new ArgumentNullException(nameof(targetPathProvider), "SourceProvider can't be null."); } if (Persister.FileSystemDependency == FileSystemDependency.Independent) { targetPathProvider = new NullSourceProvider(); } if (targetPathProvider.GetAccess()) { try { string target = targetPathProvider.GetPath(); IAssemblyMetadata result = await Task.Run( async() => await LoadRootAssembly(target)); if (result is null) { const string errorMessage = "Repository doesn't contain any elements"; ErrorMessageTarget.SendMessage("Loading error", errorMessage); if (IsTracingEnabled) { Tracer.LogFailure($"{target}; {errorMessage}"); Tracer.Flush(); } } else { ObjectsList.Clear(); ObjectsList.Add(new AssemblyItem(result as AssemblyMetadata)); LoadedAssembly = "Model deserialized"; SaveModel.RaiseCanExecuteChanged(); InformationMessageTarget?.SendMessage("Loading completed", "Model was successfully loaded."); if (IsTracingEnabled) { Tracer.LogModelLoaded(target); Tracer.Flush(); } } } catch (Exception ex) { ErrorMessageTarget.SendMessage("Loading error", ex.Message); if (IsTracingEnabled) { Tracer.LogFailure( $"Exception caught when trying to open a file for reading {Environment.NewLine}{ex.Message}"); Tracer.Flush(); } } } else { ErrorMessageTarget.SendMessage("Target in use", "File you tried to open is currently in use by another program"); } }
//------ public void Clear() { ObjectsList.Clear(); tbl.Clear(); }
public static void ClearObjects() { ObjectsList.Clear(); }
public virtual void Clear() { list.Clear(); }