protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.Parameter is ParametersNavigating parametersNav) { if (parametersNav[0] is int id) { Method = new EF.Context <Models.Method>().FindByID(id) ?? new Models.Method(); } else if (parametersNav[0] is Models.Method method) { Method = new EF.Context <Models.Method>().FindByID(method.ID) ?? new Models.Method(); if (parametersNav[1] is Models.Group newGroup) { Method.Group = newGroup.Name; } if (parametersNav[1] is Models.Types newType) { Method.Type = newType.Name; } } } if (Method == null) { Method = new Models.Method(); } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.Parameter is ParametersNavigating parametersNav) { _selectedItemMethod = parametersNav[0] as Models.Method; } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.Parameter is ParametersNavigating parametersNav) { _parentMethod = parametersNav[0] as Models.Method; if (parametersNav[1] is Models.Group || parametersNav[1] is Models.Types) { SetItemSourceInParameter(parametersNav, 2); } else { SetItemSourceInParameter(parametersNav, 1); } } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.Parameter is ParametersNavigating parametersNav) { if (parametersNav[0] is int id) { Group = new EF.Context <Models.Group>().FindByID(id); _parentMethod = parametersNav[1] as Models.Method; } else if (parametersNav[0] is string groupName) { Group = new EF.Context <Models.Group>().FindByName(groupName); _parentMethod = parametersNav[1] as Models.Method; } else { if (parametersNav[0] is Type typeParam) { _backPage = typeParam; _parentMethod = parametersNav[1] as Models.Method; if (parametersNav[2] != null) { Group = new EF.Context <Models.Group>().FindByID((int)parametersNav[2]); } } else { _parentMethod = parametersNav[0] as Models.Method; } } } if (Group == null) { Group = new Models.Group(); } }
internal void GetTextInClipboard() { string originalText = new Clipboard().GetText(); if (string.IsNullOrWhiteSpace(originalText)) { return; } MethodInClipboard = new Models.Method(); string text = originalText; text = RemoveStartText(text); int countDot = text.Count(f => f == '.'); int countOpeningBracket = text.Count(f => f == '('); int countClosingBracket = text.Count(f => f == ')'); if (countDot >= 1 && countOpeningBracket == 1 && countClosingBracket == 1) { string textObjectName = text.GetTextBefore(); if (textObjectName.Count(f => f == '=') > 0) { MethodInClipboard.ObjectName = textObjectName.GetTextAfter('='); } else { MethodInClipboard.ObjectName = textObjectName; } text = text.RemoveStartText(MethodInClipboard.ObjectName, '.'); MethodInClipboard.MethodName = text.GetTextBefore('('); } }