public void PointToStringConverterTest() { var pointConverter = new IPointToStringConverter(); Assert.IsNotNull(pointConverter); IPoint point = new PointClass(); Assert.IsNotNull(point); point.PutCoords(1300757, 554219); Models.AddInPoint addinPoint = new Models.AddInPoint(); addinPoint.Point = point; string output = pointConverter.Convert(addinPoint.Point as object, typeof(string), null, null) as string; Assert.IsFalse(output.Equals("NA")); }
private void ShowPopUp(AddInPoint addinPoint) { var dictionary = addinPoint.FieldsDictionary; FieldsCollection = new ObservableCollection <FieldsCollection>(); if (dictionary != null) { var valOutput = dictionary.Where(x => x.Key == PointFieldName).Select(x => x.Value.Item1).FirstOrDefault(); IPointToStringConverter pointConverter = new IPointToStringConverter(); ViewDetailsTitle = pointConverter.Convert(valOutput, typeof(string), null, null) as string; foreach (var item in dictionary) { if (item.Value.Item2) { FieldsCollection.Add(new FieldsCollection() { FieldName = item.Key, FieldValue = Convert.ToString(item.Value.Item1) }); } } } else { ViewDetailsTitle = addinPoint.Text; } IsWarningVisible = FieldsCollection.Any() ? Visibility.Collapsed : Visibility.Visible; if (!IsDialogViewOpen) { IsDialogViewOpen = true; PageNumber = 1; DialogView = new AdditionalFieldsView(); DialogView.DataContext = this; DialogView.Closed += diagView_Closed; DialogView.Show(); } else { DialogView.DataContext = this; RaisePropertyChanged(() => FieldsCollection); RaisePropertyChanged(() => ViewDetailsTitle); } }