public int GetFirstLineOfMethod(MethodViewModel methodViewModel) { Method method = MethodModelByIdDict[methodViewModel.Id]; var firstLineNumber = method.FirstLineNumber; return(firstLineNumber); }
public string GetSourceFilePathForMethod(MethodViewModel methodViewModel) { Method method = MethodModelByIdDict[methodViewModel.Id]; string sourceFile = method.SourceFile; return(sourceFile); }
public void ActivateCriterion(Criterion criterion) { if (MethodVMByIdDict == null) { return; } ActiveCriterion = criterion; foreach (var kvp in MethodVMByIdDict) { uint methodId = kvp.Key; MethodViewModel methodViewModel = kvp.Value; Method method = MethodModelByIdDict[methodId]; Contract.Assume(method.Id == methodViewModel.Id); IValue activeValue = method.GetValueFor(criterion); IValue maxValue = CriteriaContext.GetMaxValueFor(criterion); methodViewModel.Opacity = activeValue.ConvertToZeroOneScale(maxValue) * 0.8 + 0.1; methodViewModel.ActiveValue = activeValue; } var newSortedMethodVMs = SortedMethodVMs.OrderByDescending(mvm => mvm.ActiveValue).ToArray(); SortedMethodVMs.Clear(); foreach (var methodVM in newSortedMethodVMs) { SortedMethodVMs.Add(methodVM); } }
public void OnMethodClick(MethodViewModel methodViewModel) { Action <MethodViewModel> handler = MethodClick; if (handler != null) { handler(methodViewModel); } }
public void InitAllMethodViewModels() { foreach (var kvp in MethodVMByIdDict) { MethodViewModel methodViewModel = kvp.Value; methodViewModel.Activate += MethodActivate; methodViewModel.Deactivate += MethodDeactivated; methodViewModel.Highlight += OnMethodClick; } }
public void MethodDeactivated(MethodViewModel methodVM) { if (ActiveMethodVM == null) { return; } Contract.Assume(ActiveMethodVM.Id == methodVM.Id); ActiveMethodVM.Opacity = ActiveMethodVM.OpacityTemp; ActiveMethodVM = null; methodVM.BorderBrush = MethodView.MethodBorderColor.ToBrush(); methodVM.IsActive = false; }
public void MethodActivate(MethodViewModel methodVM) { if (ActiveMethodVM != null && ActiveMethodVM.IsActive) { MethodDeactivated(ActiveMethodVM); } ActiveMethodVM = methodVM; methodVM.IsActive = true; methodVM.BorderBrush = MethodView.ActiveMethodBorderColor.ToBrush(); ActiveMethodVM.OpacityTemp = ActiveMethodVM.Opacity; ActiveMethodVM.Opacity = 1; ShowMethodInDetail(methodVM.Id); }
public void OnMethodClick(MethodViewModel methodViewModel) { Action<MethodViewModel> handler = MethodClick; if (handler != null) { handler(methodViewModel); } }
public void MethodDeactivated(MethodViewModel methodVM) { if (ActiveMethodVM == null) return; Contract.Assume(ActiveMethodVM.Id == methodVM.Id); ActiveMethodVM.Opacity = ActiveMethodVM.OpacityTemp; ActiveMethodVM = null; methodVM.BorderBrush = MethodView.MethodBorderColor.ToBrush(); methodVM.IsActive = false; }
public string GetSourceFilePathForMethod(MethodViewModel methodViewModel) { Method method = MethodModelByIdDict[methodViewModel.Id]; string sourceFile = method.SourceFile; return sourceFile; }
public int GetFirstLineOfMethod(MethodViewModel methodViewModel) { Method method = MethodModelByIdDict[methodViewModel.Id]; var firstLineNumber = method.FirstLineNumber; return firstLineNumber; }
private void OnMethodClick(UILogic uiLogic, MethodViewModel mvm) { string sourcePath = uiLogic.GetSourceFilePathForMethod(mvm); _dte.ItemOperations.OpenFile(sourcePath); //TODO when the adornment layer is stable, enable this line moving. //var firstLineOfMethod = uiLogic.GetFirstLineOfMethod(mvm); //var commandName = "Edit.GoTo " + firstLineOfMethod; //_dte.ExecuteCommand(commandName); }