protected virtual FrameworkElement GetDetailContent(BioLinkDataObject model)
        {
            var builder = new TextTableBuilder();

            GetDetailText(model, builder);
            return(builder.GetAsContent());
        }
        protected override void GetDetailText(Data.Model.BioLinkDataObject model, TextTableBuilder builder)
        {
            var e = ViewModel as EllipsoidViewModel;

            if (e != null)
            {
                builder.Add("Equatorial Radius", e.EquatorialRadius + "");
                builder.Add("Eccentricity (squared)", e.EccentricitySquared + "");
            }
        }
示例#3
0
        protected override void GetDetailText(BioLinkDataObject model, TextTableBuilder builder)
        {
            var m = model as Associate;

            if (m != null)
            {
                builder.Add("Name", m.AssocName);
                builder.Add("Description", m.AssocDescription);

                builder.Add("Direction", m.Direction);
                builder.Add("From category", m.FromCategory);
                builder.Add("To category", m.ToCategory);

                builder.Add("Relation From->To", m.RelationFromTo);
                builder.Add("Relation To->From", m.RelationToFrom);

                builder.Add("Region", m.PoliticalRegion);
                builder.Add("Region ID", m.PoliticalRegionID);

                builder.Add("Ref Code", m.RefCode);
                builder.Add("Ref Page", m.RefPage);

                builder.Add("Source", m.Source);
                builder.Add("Is Uncertain", m.Uncertain.ToString());

                var vm = ViewModel as AssociateReportViewModel;
                if (vm != null)
                {
                    if (vm.FromViewModel != null)
                    {
                        builder.Add("\"From\" type", GetLookupTypeFromAssociateCategoryId(m.FromCatID).ToString());
                        builder.Add("\"From\" name", vm.FromViewModel.DisplayLabel);
                        builder.Add("\"From\" object id", vm.FromViewModel.ObjectID);
                    }

                    if (vm.ToViewModel != null)
                    {
                        if (m.ToCatID.HasValue)
                        {
                            builder.Add("\"To\" type", GetLookupTypeFromAssociateCategoryId(m.ToCatID.Value).ToString());
                        }
                        else
                        {
                            builder.Add("\"To\" type", "Description");
                        }
                        builder.Add("\"To\" name", vm.ToViewModel.DisplayLabel);
                        builder.Add("\"To\" object id", vm.ToViewModel.ObjectID);
                    }
                }
            }
        }
示例#4
0
        protected override void GetDetailText(BioLinkDataObject model, TextTableBuilder builder)
        {
            if (model != null) {

                switch (ElemType) {
                    case "Site":
                        var site = model as Site;
                        builder.Add("Political Region", site.PoliticalRegion);
                        if (site.PosY1.HasValue && site.PosX1.HasValue) {
                            builder.Add("Position", string.Format("{0}  {1}", GeoUtils.DecDegToDMS(site.PosX1.Value, CoordinateType.Longitude), GeoUtils.DecDegToDMS(site.PosY1.Value, CoordinateType.Latitude)));
                        } else {
                            builder.Add("Position", "No position recorded.");
                        }
                        break;
                    case "SiteVisit":
                        var visit = model as SiteVisit;
                        builder.Add("Collector(s)", visit.Collector);
                        builder.AddFormat("Start Date", "{0}", DateUtils.BLDateToStr(visit.DateStart, "Not specified"));
                        builder.AddFormat("End Date", "{0}", DateUtils.BLDateToStr(visit.DateEnd, "Not specified"));
                        builder.Add("Site", visit.SiteName);
                        break;
                    case "Material":
                        var mat = model as Data.Model.Material;
                        builder.Add("Site", mat.SiteName);
                        builder.Add("Site Visit", mat.SiteVisitName);
                        builder.Add("Accession No.", mat.AccessionNumber);
                        builder.Add("Registration No.", mat.RegistrationNumber);
                        builder.Add("Identification", mat.TaxaDesc);
                        break;
                    case "Region":
                        var reg = model as Region;
                        if (string.IsNullOrWhiteSpace(reg.Rank)) {
                            builder.Add("Region type", "Not specified");
                        } else {
                            builder.Add("Region type", reg.Rank);
                        }
                        break;
                    case "Trap":
                        var trap = model as Trap;
                        builder.Add("Site", trap.SiteName);
                        builder.Add("Trap type", trap.TrapType);
                        builder.Add("Description", trap.Description);
                        break;
                }
            }
        }
        protected override System.Windows.FrameworkElement GetDetailContent(BioLinkDataObject model)
        {
            var vm   = ViewModel as MultimediaLinkViewModel;
            var grid = new Grid {
                Margin = new Thickness(3)
            };

            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength()
            });
            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength()
            });

            if (vm != null && !string.IsNullOrWhiteSpace(vm.TempFilename))
            {
                var img = new Image {
                    SnapsToDevicePixels = true, UseLayoutRounding = true, Stretch = System.Windows.Media.Stretch.None
                };
                img.Source = GraphicsUtils.GenerateThumbnail(vm.TempFilename, 300);
                grid.Children.Add(img);
            }

            var builder = new TextTableBuilder();

            builder.Add("Type", vm.MultimediaType);
            builder.Add("Caption", RTFUtils.StripMarkup(vm.Caption));

            var details = builder.GetAsContent();

            Grid.SetRow(details, 1);

            grid.Children.Add(details);

            return(grid);
        }
示例#6
0
        protected override System.Windows.FrameworkElement GetDetailContent(BioLinkDataObject model)
        {
            var vm = ViewModel as MultimediaLinkViewModel;
            var grid = new Grid { Margin = new Thickness(3) };
            grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength() });
            grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength() });

            if (vm != null && !string.IsNullOrWhiteSpace(vm.TempFilename)) {
                var img = new Image { SnapsToDevicePixels = true, UseLayoutRounding = true, Stretch = System.Windows.Media.Stretch.None };
                img.Source = GraphicsUtils.GenerateThumbnail(vm.TempFilename, 300);
                grid.Children.Add(img);
            }

            var builder = new TextTableBuilder();
            builder.Add("Type", vm.MultimediaType);
            builder.Add("Caption", RTFUtils.StripMarkup(vm.Caption));

            var details = builder.GetAsContent();
            Grid.SetRow(details, 1);

            grid.Children.Add(details);

            return grid;
        }
 protected abstract void GetDetailText(BioLinkDataObject model, TextTableBuilder builder);
 protected override void GetDetailText(Data.Model.BioLinkDataObject model, TextTableBuilder builder)
 {
     throw new NotImplementedException();
 }
示例#9
0
 protected abstract void GetDetailText(BioLinkDataObject model, TextTableBuilder builder);
示例#10
0
 protected virtual FrameworkElement GetDetailContent(BioLinkDataObject model)
 {
     var builder = new TextTableBuilder();
     GetDetailText(model, builder);
     return builder.GetAsContent();
 }
 protected override void GetDetailText(BioLinkDataObject model, TextTableBuilder builder)
 {
 }
示例#12
0
 protected override void GetDetailText(Data.Model.BioLinkDataObject model, TextTableBuilder builder)
 {
     var vm = ViewModel as LayerViewModel;
     if (vm != null) {
         var m = vm.Model as VectorLayer;
         if (m != null) {
             builder.Add("Layer type", "Vector");
             builder.Add("Filename", m.DataSource.ConnectionID);
         }
     }
 }
示例#13
0
 protected override void GetDetailText(Data.Model.BioLinkDataObject model, TextTableBuilder builder)
 {
     var vm = ViewModel as LayerViewModel;
     if (vm != null) {
         var m = vm.Model as GdalRasterLayer;
         if (m != null) {
             builder.Add("Layer type", "Raster");
             builder.Add("Filename", m.Filename);
         }
     }
 }
示例#14
0
 protected override void GetDetailText(Data.Model.BioLinkDataObject model, TextTableBuilder builder)
 {
     throw new NotImplementedException();
 }