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

            GetDetailText(model, builder);
            return(builder.GetAsContent());
        }
Exemplo n.º 2
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 void GetDetailText(BioLinkDataObject model, TextTableBuilder builder)
        {
            var refmodel = model as Reference;

            builder.Add("Type", refmodel.RefType);
            builder.Add("Title", RTFUtils.StripMarkup(refmodel.Title));
            builder.Add("Author", refmodel.Author);
            builder.Add("Year", refmodel.YearOfPub);
            builder.Add("Journal", refmodel.JournalName);
        }
        protected override void GetDetailText(BioLinkDataObject model, TextTableBuilder builder)
        {
            var loan = model as Loan;

            builder.Add("Loan number", loan.LoanNumber);
            builder.Add("Permit number", loan.PermitNumber);
            builder.Add("Date initiated", loan.DateInitiated);
            builder.Add("Date due", loan.DateDue);
            builder.AddFormat("Requested by", LoanService.FormatName(loan.RequestorTitle, loan.RequestorGivenName, loan.RequestorName));
            builder.AddFormat("Received by", LoanService.FormatName(loan.ReceiverTitle, loan.RequestorGivenName, loan.ReceiverName));
            builder.AddFormat("Authorized by", LoanService.FormatName(loan.OriginatorTitle, loan.OriginatorGivenName, loan.OriginatorName));
            builder.AddFormat("Status", (ViewModel as LoanViewModel).Status);
        }
Exemplo n.º 5
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);
                    }
                }
            }
        }
Exemplo n.º 6
0
        protected override void GetDetailText(BioLinkDataObject model, TextTableBuilder builder)
        {
            var item = ViewModel as LabelSetItemViewModel;

            if (item != null)
            {
                builder.Add("Position", GeoUtils.FormatCoordinates(item.Lat, item.Long));
                builder.Add("Position2", GeoUtils.FormatCoordinates(item.Lat2, item.Long2));
                builder.Add("Copies", item.NumCopies);
                builder.Add("Print order", item.PrintOrder);
                builder.Add("Taxon", item.TaxaFullName);
                builder.Add("SiteID", item.SiteID);
                builder.Add("SiteVisitID", item.VisitID);
                builder.Add("MaterialID", item.MaterialID);
            }
        }
        protected override void GetDetailText(BioLinkDataObject model, TextTableBuilder builder)
        {
            var viewModel = ViewModel as ContactViewModel;

            builder.Add("Job title", viewModel.JobTitle);
            builder.Add("E-mail", viewModel.EMail);
            builder.Add("Work phone", viewModel.WorkPh);
            builder.Add("Work Fax", viewModel.WorkFax);
            builder.Add("Home phone", viewModel.HomePh);
            builder.Add("Institution", viewModel.Institution);
            builder.Add("Street Address", viewModel.StreetAddress);
            if (viewModel.StreetAddress == null || !viewModel.StreetAddress.Equals(viewModel.PostalAddress, StringComparison.CurrentCultureIgnoreCase))
            {
                builder.Add("Postal Address", viewModel.PostalAddress);
            }
        }
Exemplo n.º 8
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);
        }
Exemplo n.º 10
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);
Exemplo n.º 12
0
 protected abstract void GetDetailText(BioLinkDataObject model, TextTableBuilder builder);
Exemplo n.º 13
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)
 {
 }