Beispiel #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);
        }
Beispiel #2
0
        public bool Equals([AllowNull] Scene other)
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return((BgColor == other.BgColor && BgColor != null && other.BgColor != null && BgColor.Equals(other.BgColor)) &&
                   (Camera == other.Camera && Camera != null && other.Camera != null && Camera.Equals(other.Camera)) &&
                   (Domain == other.Domain && Domain != null && other.Domain != null && Domain.Equals(other.Domain)) &&
                   (AspectMode == other.AspectMode && AspectMode != null && other.AspectMode != null && AspectMode.Equals(other.AspectMode)) &&
                   (AspectRatio == other.AspectRatio && AspectRatio != null && other.AspectRatio != null && AspectRatio.Equals(other.AspectRatio)) &&
                   (XAxis == other.XAxis && XAxis != null && other.XAxis != null && XAxis.Equals(other.XAxis)) &&
                   (YAxis == other.YAxis && YAxis != null && other.YAxis != null && YAxis.Equals(other.YAxis)) &&
                   (ZAxis == other.ZAxis && ZAxis != null && other.ZAxis != null && ZAxis.Equals(other.ZAxis)) &&
                   (DragMode == other.DragMode && DragMode != null && other.DragMode != null && DragMode.Equals(other.DragMode)) &&
                   (HoverMode == other.HoverMode && HoverMode != null && other.HoverMode != null && HoverMode.Equals(other.HoverMode)) &&
                   (UiRevision == other.UiRevision && UiRevision != null && other.UiRevision != null && UiRevision.Equals(other.UiRevision)) &&
                   (Equals(Annotations, other.Annotations) || Annotations != null && other.Annotations != null && Annotations.SequenceEqual(other.Annotations)));
        }
Beispiel #3
0
        public bool Equals([AllowNull] FunnelArea other)
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return((Type == other.Type && Type != null && other.Type != null && Type.Equals(other.Type)) &&
                   (Visible == other.Visible && Visible != null && other.Visible != null && Visible.Equals(other.Visible)) &&
                   (ShowLegend == other.ShowLegend && ShowLegend != null && other.ShowLegend != null && ShowLegend.Equals(other.ShowLegend)) &&
                   (LegendGroup == other.LegendGroup && LegendGroup != null && other.LegendGroup != null && LegendGroup.Equals(other.LegendGroup)) &&
                   (Opacity == other.Opacity && Opacity != null && other.Opacity != null && Opacity.Equals(other.Opacity)) &&
                   (Name == other.Name && Name != null && other.Name != null && Name.Equals(other.Name)) &&
                   (UId == other.UId && UId != null && other.UId != null && UId.Equals(other.UId)) &&
                   (Equals(Ids, other.Ids) || Ids != null && other.Ids != null && Ids.SequenceEqual(other.Ids)) &&
                   (Equals(CustomData, other.CustomData) || CustomData != null && other.CustomData != null && CustomData.SequenceEqual(other.CustomData)) &&
                   (Meta == other.Meta && Meta != null && other.Meta != null && Meta.Equals(other.Meta)) &&
                   (Equals(MetaArray, other.MetaArray) || MetaArray != null && other.MetaArray != null && MetaArray.SequenceEqual(other.MetaArray)) &&
                   (HoverLabel == other.HoverLabel && HoverLabel != null && other.HoverLabel != null && HoverLabel.Equals(other.HoverLabel)) &&
                   (Stream == other.Stream && Stream != null && other.Stream != null && Stream.Equals(other.Stream)) &&
                   (Equals(Transforms, other.Transforms) || Transforms != null && other.Transforms != null && Transforms.SequenceEqual(other.Transforms)) &&
                   (UiRevision == other.UiRevision && UiRevision != null && other.UiRevision != null && UiRevision.Equals(other.UiRevision)) &&
                   (Equals(Labels, other.Labels) || Labels != null && other.Labels != null && Labels.SequenceEqual(other.Labels)) &&
                   (Label0 == other.Label0 && Label0 != null && other.Label0 != null && Label0.Equals(other.Label0)) &&
                   (DLabel == other.DLabel && DLabel != null && other.DLabel != null && DLabel.Equals(other.DLabel)) &&
                   (Equals(Values, other.Values) || Values != null && other.Values != null && Values.SequenceEqual(other.Values)) &&
                   (Marker == other.Marker && Marker != null && other.Marker != null && Marker.Equals(other.Marker)) &&
                   (Equals(Text, other.Text) || Text != null && other.Text != null && Text.SequenceEqual(other.Text)) &&
                   (HoverText == other.HoverText && HoverText != null && other.HoverText != null && HoverText.Equals(other.HoverText)) &&
                   (Equals(HoverTextArray, other.HoverTextArray) || HoverTextArray != null && other.HoverTextArray != null && HoverTextArray.SequenceEqual(other.HoverTextArray)) &&
                   (ScaleGroup == other.ScaleGroup && ScaleGroup != null && other.ScaleGroup != null && ScaleGroup.Equals(other.ScaleGroup)) &&
                   (TextInfo == other.TextInfo && TextInfo != null && other.TextInfo != null && TextInfo.Equals(other.TextInfo)) &&
                   (TextTemplate == other.TextTemplate && TextTemplate != null && other.TextTemplate != null && TextTemplate.Equals(other.TextTemplate)) &&
                   (Equals(TextTemplateArray, other.TextTemplateArray) || TextTemplateArray != null && other.TextTemplateArray != null && TextTemplateArray.SequenceEqual(other.TextTemplateArray)) &&
                   (HoverInfo == other.HoverInfo && HoverInfo != null && other.HoverInfo != null && HoverInfo.Equals(other.HoverInfo)) &&
                   (Equals(HoverInfoArray, other.HoverInfoArray) || HoverInfoArray != null && other.HoverInfoArray != null && HoverInfoArray.SequenceEqual(other.HoverInfoArray)) &&
                   (HoverTemplate == other.HoverTemplate && HoverTemplate != null && other.HoverTemplate != null && HoverTemplate.Equals(other.HoverTemplate)) &&
                   (Equals(HoverTemplateArray, other.HoverTemplateArray) ||
                    HoverTemplateArray != null && other.HoverTemplateArray != null && HoverTemplateArray.SequenceEqual(other.HoverTemplateArray)) &&
                   (TextPosition == other.TextPosition && TextPosition != null && other.TextPosition != null && TextPosition.Equals(other.TextPosition)) &&
                   (Equals(TextPositionArray, other.TextPositionArray) || TextPositionArray != null && other.TextPositionArray != null && TextPositionArray.SequenceEqual(other.TextPositionArray)) &&
                   (TextFont == other.TextFont && TextFont != null && other.TextFont != null && TextFont.Equals(other.TextFont)) &&
                   (InsideTextFont == other.InsideTextFont && InsideTextFont != null && other.InsideTextFont != null && InsideTextFont.Equals(other.InsideTextFont)) &&
                   (Title == other.Title && Title != null && other.Title != null && Title.Equals(other.Title)) &&
                   (Domain == other.Domain && Domain != null && other.Domain != null && Domain.Equals(other.Domain)) &&
                   (AspectRatio == other.AspectRatio && AspectRatio != null && other.AspectRatio != null && AspectRatio.Equals(other.AspectRatio)) &&
                   (BaseRatio == other.BaseRatio && BaseRatio != null && other.BaseRatio != null && BaseRatio.Equals(other.BaseRatio)) &&
                   (IdsSrc == other.IdsSrc && IdsSrc != null && other.IdsSrc != null && IdsSrc.Equals(other.IdsSrc)) &&
                   (CustomDataSrc == other.CustomDataSrc && CustomDataSrc != null && other.CustomDataSrc != null && CustomDataSrc.Equals(other.CustomDataSrc)) &&
                   (MetaSrc == other.MetaSrc && MetaSrc != null && other.MetaSrc != null && MetaSrc.Equals(other.MetaSrc)) &&
                   (LabelsSrc == other.LabelsSrc && LabelsSrc != null && other.LabelsSrc != null && LabelsSrc.Equals(other.LabelsSrc)) &&
                   (ValuesSrc == other.ValuesSrc && ValuesSrc != null && other.ValuesSrc != null && ValuesSrc.Equals(other.ValuesSrc)) &&
                   (TextSrc == other.TextSrc && TextSrc != null && other.TextSrc != null && TextSrc.Equals(other.TextSrc)) &&
                   (HoverTextSrc == other.HoverTextSrc && HoverTextSrc != null && other.HoverTextSrc != null && HoverTextSrc.Equals(other.HoverTextSrc)) &&
                   (TextTemplateSrc == other.TextTemplateSrc && TextTemplateSrc != null && other.TextTemplateSrc != null && TextTemplateSrc.Equals(other.TextTemplateSrc)) &&
                   (HoverInfoSrc == other.HoverInfoSrc && HoverInfoSrc != null && other.HoverInfoSrc != null && HoverInfoSrc.Equals(other.HoverInfoSrc)) &&
                   (HoverTemplateSrc == other.HoverTemplateSrc && HoverTemplateSrc != null && other.HoverTemplateSrc != null && HoverTemplateSrc.Equals(other.HoverTemplateSrc)) &&
                   (TextPositionSrc == other.TextPositionSrc && TextPositionSrc != null && other.TextPositionSrc != null && TextPositionSrc.Equals(other.TextPositionSrc)));
        }
Beispiel #4
0
        private void Update()
        {
            double epsilon = 1e-30;

            if (m_world_x1.Subtract(m_world_x2).Abs().LessThan(epsilon) ||
                m_world_y1.Subtract(m_world_y2).Abs().LessThan(epsilon) ||
                m_device_x1.Subtract(m_device_x2).Abs().LessThan(epsilon) ||
                m_device_y1.Subtract(m_device_y2).Abs().LessThan(epsilon))
            {
                m_wx1      = m_world_x1;
                m_wy1      = m_world_y1;
                m_wx2      = m_world_x1.Add(1.0);
                m_wy2      = m_world_y2.Add(1.0);
                m_dx1      = m_device_x1;
                m_dy1      = m_device_y1;
                m_kx       = M.One <T>();
                m_ky       = M.One <T>();
                m_is_valid = false;
                return;
            }

            T world_x1  = m_world_x1;
            T world_y1  = m_world_y1;
            T world_x2  = m_world_x2;
            T world_y2  = m_world_y2;
            T device_x1 = m_device_x1;
            T device_y1 = m_device_y1;
            T device_x2 = m_device_x2;
            T device_y2 = m_device_y2;

            if (m_aspect != AspectRatio.Stretch)
            {
                T d;
                m_kx = device_x2.Subtract(device_x1).Divide(world_x2.Subtract(world_x1));
                m_ky = device_y2.Subtract(device_y1).Divide(world_y2.Subtract(world_y1));

                if (m_aspect.Equals(AspectRatio.Meet).Equals(m_kx.LessThan(m_ky)))
                {
                    d = world_y2.Subtract(world_y1).Multiply(m_ky.Divide(m_kx));
                    world_y1.AddEquals(
                        world_y2.Subtract(world_y1).Subtract(d).Multiply(m_align_y)
                        );
                    world_y2 = world_y1.Add(d);
                }
                else
                {
                    d = world_x2.Subtract(world_x1).Multiply(m_kx.Divide(m_ky));
                    world_x1.AddEquals(world_x2.Subtract(world_x1).Subtract(d).Multiply(m_align_x));
                    world_x2 = world_x1.Add(d);
                }
            }
            m_wx1      = world_x1;
            m_wy1      = world_y1;
            m_wx2      = world_x2;
            m_wy2      = world_y2;
            m_dx1      = device_x1;
            m_dy1      = device_y1;
            m_kx       = device_x2.Subtract(device_x1).Divide(world_x2.Subtract(world_x1));
            m_ky       = device_y2.Subtract(device_y1).Divide(world_y2.Subtract(world_y1));
            m_is_valid = true;
        }