public UpdateVarNamesFromMapFileUI() { InitializeComponent(); Localize(); var moduleList = MapFileManipulator.GetListOfModulesUsedInProfile(); foreach (var m in moduleList) { _modulesList.Items.Add(m); } EnableControls(); }
private void _getVarialbesName_Click(object sender, RoutedEventArgs e) { if (_modulesList.SelectedValue != null) { var mapFilePath = OpenMapFileDialogue(); if (mapFilePath != null) { variableNameFromMapFile = MapFileManipulator.GetVariableNamesFromMapFile(mapFilePath, _modulesList.SelectedValue.ToString()).ToList(); _exactMatchCount.Content = variableNameFromMapFile.Where(x => x.DistanceToClosestVarBelow == 0).Count(); _relativeMatchCount.Content = variableNameFromMapFile.Where(x => x.DistanceToClosestVarBelow != 0).Count(); } EnableControls(); } }
private void _getVarialbesName_Click(object sender, RoutedEventArgs e) { if (_modulesList.SelectedValue != null) { var mapFilePath = OpenMapFileDialogue(); if (mapFilePath != null) { variableOffsetFromMapFile = MapFileManipulator.GetVariableOffsetFromMapFile(mapFilePath, _modulesList.SelectedValue.ToString()).ToList(); _exactMatchCount.Content = variableOffsetFromMapFile.Count(); var variables = Profile.VariableStorage.GetAllVariables(); var memoryPathVariablesArray = variables.Where(x => x is MemoryPatchVariable && (x as MemoryPatchVariable).ModuleName.ToLower() == _modulesList.SelectedValue.ToString().ToLower()).ToArray(); _relativeMatchCount.Content = memoryPathVariablesArray.Count() - variableOffsetFromMapFile.Count(); } EnableControls(); } }