Example #1
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            ViewHolder holder;

            if (convertView == null)
            {
                convertView = LayoutInflater.From(parent.Context).Inflate(Android.Resource.Layout.SimpleListItem1, parent, false);

                holder      = new ViewHolder();
                holder.Text = convertView.FindViewById <TextView>(Android.Resource.Id.Text1);

                convertView.Tag = holder;
            }
            else
            {
                holder = convertView.Tag as ViewHolder;
            }

            AspectRatio   ratio = GetItem(position) as AspectRatio;
            StringBuilder sb    = new StringBuilder(ratio.ToString());

            if (ratio.Equals(mCurrentRatio))
            {
                sb.Append(" *");
            }

            holder.Text.Text = sb.ToString();

            return(convertView);
        }
 public void OnAspectRatioSelected(AspectRatio ratio)
 {
     if (mCameraView != null)
     {
         Toast.MakeText(this, ratio.ToString(), ToastLength.Short).Show();
         mCameraView.AspectRatio = ratio;
     }
 }
        public void TestWfsWorkflowConfiguration(StateFormat format, bool logo, Resolution res, AspectRatio aspectRatio)
        {
            var    provider     = new EmbededPresetProvider().AsDictionary();
            var    key          = new Tuple <StateFormat, AspectRatio, Resolution, bool>(format, aspectRatio, res, logo);
            var    wfs          = new WfsService.WfsService("http://wfsctrl01.net.dr.dk:8731/Xpress/SOAP");
            string formattedKey = $"{format}_{res.ToString()}_{aspectRatio.ToString().Substring(6)}{(logo ? "_logo" : "")}".ToLower();
            string workflowName = wfs.GetWorkflowName(provider[key]).ToLower();

            Assert.That(workflowName, Is.EqualTo(formattedKey));
        }
Example #4
0
        public void UpdateDataSet(DicomAttributeCollection dataset)
        {
            dataset.SaveDicomFields(this);

            if (IsColor)
            {
                dataset[DicomTags.PixelRepresentation].SetEmptyValue();;
            }
            else
            {
                dataset[DicomTags.PlanarConfiguration].SetEmptyValue();;
            }

            if (PixelSpacing.IsNull && ImagerPixelSpacing.IsNull)
            {
                dataset[DicomTags.PixelAspectRatio].SetStringValue(AspectRatio.ToString());
            }

            if (!PixelSpacing.IsNull)
            {
                dataset[DicomTags.PixelSpacing].SetStringValue(PixelSpacing.ToString());
            }
            else
            {
                dataset[DicomTags.PixelSpacing].SetEmptyValue();
            }

            if (!ImagerPixelSpacing.IsNull)
            {
                dataset[DicomTags.ImagerPixelSpacing].SetStringValue(ImagerPixelSpacing.ToString());
            }
            else
            {
                dataset[DicomTags.ImagerPixelSpacing].SetEmptyValue();
            }
        }
Example #5
0
 public FlyleafAspectRatio(AspectRatio aspectRatio)
 {
     Value       = aspectRatio.ValueStr;
     Description = aspectRatio.ToString();
 }