Exemplo n.º 1
0
        public ImageUI(RelatedImage image)
        {
            this.image = image;
            Title      = "Image " + image.shortName;
            StackLayout imageLayout  = new StackLayout();
            Image       displayImage = new Image
            {
                Source = ImageSource.FromUri(new Uri(Connection.GetPaintedRepresentationImageURL(image.imageID, Helper.ScreenHeight))),
                Aspect = Aspect.AspectFill
            };

            imageLayout.Children.Add(displayImage);
            imageLayout.Padding = new Thickness(0, 10, 0, 20);
            imageLayout.Spacing = 10;
            var pinchGesture = new PinchGestureRecognizer();

            pinchGesture.PinchUpdated += PinchGesture_PinchUpdated;
            imageLayout.GestureRecognizers.Add(pinchGesture);

            Frame editorFrame = new Frame
            {
                HasShadow       = true,
                BackgroundColor = Color.White
            };
            StackLayout editorStack = new StackLayout();
            Label       notesLabel  = new Label
            {
                Text      = "Private Notes",
                TextColor = Color.Black,
                FontSize  = 20
            };

            editorStack.Children.Add(notesLabel);

            notesEditor = new Editor
            {
                BackgroundColor = Color.White,
                HeightRequest   = 100
            };
            var index = Settings.SavedNotesSetting.FindIndex(i => i.ID == image.imageID && i.Type == NotesSaver.NOTES_TYPE.NOTE_TYPE_IMAGE);

            if (index != -1)
            {
                notesEditor.Text = Settings.SavedNotesSetting[index].Note;
            }
            editorStack.Children.Add(notesEditor);
            editorFrame.Content = editorStack;
            imageLayout.Children.Add(editorFrame);

            ScrollView imageScrollView = new ScrollView
            {
                Content = imageLayout
            };

            Content = imageScrollView;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Validates this imaging examination result
        /// </summary>
        /// <param name="path">The path to this object as a string</param>
        /// <param name="messages">the validation messages to date, these may be added to within this method</param>
        void IDiagnosticImagingExaminationResult.Validate(string path, List <ValidationMessage> messages)
        {
            var vb = new ValidationBuilder(path, messages);

            var diagnosticImagingExaminationResult = (IDiagnosticImagingExaminationResult)this;

            vb.ArgumentRequiredCheck("OverallResultStatus", diagnosticImagingExaminationResult.OverallResultStatus);

            if (vb.ArgumentRequiredCheck("ExaminationResultName", ExaminationResultName))
            {
                ExaminationResultName.ValidateMandatory(vb.Path + "ExaminationResultName", messages);
            }

            if (vb.ArgumentRequiredCheck("Modality", Modality))
            {
                Modality.Validate(vb.Path + "Modality", messages);
            }

            if (diagnosticImagingExaminationResult.AnatomicalSite != null)
            {
                for (int index = 0; index < diagnosticImagingExaminationResult.AnatomicalSite.Count; index++)
                {
                    diagnosticImagingExaminationResult.AnatomicalSite[index].Validate(vb.Path + string.Format("AnatomicalSite[{0}]", index), messages);
                }
            }

            // Optional Related Image
            if (RelatedImage != null)
            {
                RelatedImage.Validate(vb.Path + "RelatedImage", messages); // Checks that the ImageUrl is included
            }

            vb.ArgumentRequiredCheck("ExaminationProcedure", ExaminationProcedure);

            if (vb.ArgumentRequiredCheck("ExaminationDetails", ExaminationDetails))
            {
                ExaminationDetails.Validate(vb.Path + "ExaminationDetails", messages);
            }

            vb.ArgumentRequiredCheck("ObservationDateTime", ObservationDateTime);
        }
            public RelatedImageStack(RelatedImage image)
            {
                this.relatedImage = image;
                Spacing           = 2;
                BackgroundColor   = Color.White;

                Label idLabel = new Label
                {
                    TextColor = Color.Black,
                    FontSize  = 20
                };
                var idText = new FormattedString();

                idText.Spans.Add(new Span {
                    Text = "ImageID: ", FontAttributes = FontAttributes.Bold
                });
                idText.Spans.Add(new Span {
                    Text = image.imageID + ""
                });
                idLabel.FormattedText = idText;
                Children.Add(idLabel);

                if (!String.IsNullOrEmpty(image.title))
                {
                    Label titleLabel      = new Label();
                    var   descriptionText = new FormattedString();
                    descriptionText.Spans.Add(new Span {
                        Text = "Title: ", FontAttributes = FontAttributes.Bold
                    });
                    descriptionText.Spans.Add(new Span {
                        Text = image.title + ""
                    });
                    titleLabel.FormattedText = descriptionText;
                    Children.Add(titleLabel);
                }

                if (!String.IsNullOrEmpty(image.shortName))
                {
                    Label shortNameLabel  = new Label();
                    var   descriptionText = new FormattedString();
                    descriptionText.Spans.Add(new Span {
                        Text = "Shortname: ", FontAttributes = FontAttributes.Bold
                    });
                    descriptionText.Spans.Add(new Span {
                        Text = image.shortName + ""
                    });
                    shortNameLabel.FormattedText = descriptionText;
                    Children.Add(shortNameLabel);
                }

                if (!String.IsNullOrEmpty(image.copyright))
                {
                    Label copyRightLabel  = new Label();
                    var   descriptionText = new FormattedString();
                    descriptionText.Spans.Add(new Span {
                        Text = "Copyright: ", FontAttributes = FontAttributes.Bold
                    });
                    descriptionText.Spans.Add(new Span {
                        Text = image.copyright + ""
                    });
                    copyRightLabel.FormattedText = descriptionText;
                    Children.Add(copyRightLabel);
                }

                if (!String.IsNullOrEmpty(image.comment))
                {
                    Label commentLabel    = new Label();
                    var   descriptionText = new FormattedString();
                    descriptionText.Spans.Add(new Span {
                        Text = "Comment: ", FontAttributes = FontAttributes.Bold
                    });
                    descriptionText.Spans.Add(new Span {
                        Text = image.comment + ""
                    });
                    commentLabel.FormattedText = descriptionText;
                    Children.Add(commentLabel);
                }
                if (!String.IsNullOrEmpty(image.date))
                {
                    Label dateLabel       = new Label();
                    var   descriptionText = new FormattedString();
                    descriptionText.Spans.Add(new Span {
                        Text = "Date: ", FontAttributes = FontAttributes.Bold
                    });
                    descriptionText.Spans.Add(new Span {
                        Text = image.date + ""
                    });
                    dateLabel.FormattedText = descriptionText;
                    Children.Add(dateLabel);
                }
                if (Settings.ShowPreviewPicturesSetting)
                {
                    Image prImage = new Image
                    {
                        WidthRequest  = 150,
                        HeightRequest = 150,
                        Source        = ImageSource.FromUri(new Uri(Internal.Connection.GetPaintedRepresentationImageURL(image.imageID, 150)))
                    };
                    Children.Add(prImage);
                }
                else
                {
                    Label l = new Label
                    {
                        Text              = "Preview pictures are disabled in Settings",
                        TextColor         = Color.LightGray,
                        HorizontalOptions = LayoutOptions.Center
                    };
                    Children.Add(l);
                }
            }