Example #1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (TotalWidth != null)
         {
             hashCode = hashCode * 59 + TotalWidth.GetHashCode();
         }
         if (ColWidthName != null)
         {
             hashCode = hashCode * 59 + ColWidthName.GetHashCode();
         }
         if (ColWidthResult != null)
         {
             hashCode = hashCode * 59 + ColWidthResult.GetHashCode();
         }
         if (ColWidthTiming != null)
         {
             hashCode = hashCode * 59 + ColWidthTiming.GetHashCode();
         }
         return(hashCode);
     }
 }
Example #2
0
        /// <summary>
        /// Returns true if OrgApacheSlingHcCoreImplServletResultTxtVerboseSerializerProperties instances are equal
        /// </summary>
        /// <param name="other">Instance of OrgApacheSlingHcCoreImplServletResultTxtVerboseSerializerProperties to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(OrgApacheSlingHcCoreImplServletResultTxtVerboseSerializerProperties other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     TotalWidth == other.TotalWidth ||
                     TotalWidth != null &&
                     TotalWidth.Equals(other.TotalWidth)
                     ) &&
                 (
                     ColWidthName == other.ColWidthName ||
                     ColWidthName != null &&
                     ColWidthName.Equals(other.ColWidthName)
                 ) &&
                 (
                     ColWidthResult == other.ColWidthResult ||
                     ColWidthResult != null &&
                     ColWidthResult.Equals(other.ColWidthResult)
                 ) &&
                 (
                     ColWidthTiming == other.ColWidthTiming ||
                     ColWidthTiming != null &&
                     ColWidthTiming.Equals(other.ColWidthTiming)
                 ));
        }
        protected override void RenderGridStart()
        {
            //modify by zhangh 2013/05/31 table不设置class
            //if(! GridModel.Attributes.ContainsKey("class"))
            //{
            //    GridModel.Attributes["class"] = DefaultCssClass;
            //}

            //空数据,让Table100%显示 add by zhangh 2013/06/03
            //if (!ShouldRenderHeader())
            //{
            //GridModel.Attributes.Add("width", "100%");
            //}
            //else
            //{
            //int w = TotalWidth + VisibleColumns().Where(c => c.IsHide != true).Count() + 1;
            GridModel.Attributes.Add("width", TotalWidth.ToString() + "px");
            //}

            string attrs = BuildHtmlAttributes(GridModel.Attributes);

            if (attrs.Length > 0)
            {
                attrs = " " + attrs;
            }

            RenderText(string.Format("<div class=\"grid-inner\"><table{0}>", attrs));
        }
Example #4
0
        public RangeSliderViewModel(ReadOnlyReactiveProperty <double> duration)
        {
            Duration   = duration;
            StartWidth = TotalWidth.CombineLatest(Duration, TrimStart, (width, dur, start) => {
                var w = (width - RangeSlider.KNOB_POS_MARGIN * 2) * start / dur;
                Debug.WriteLine($"TrimStart:{w:#.#}  (TW={width:#.#},d={dur},s={start})");
                return((width - RangeSlider.KNOB_POS_MARGIN * 2) * start / dur);
            }).ToReadOnlyReactiveProperty();
            EndWidth = TotalWidth.CombineLatest(Duration, TrimEnd, (width, dur, end) => {
                var w = (width - RangeSlider.KNOB_POS_MARGIN * 2) * end / dur;
                Debug.WriteLine($"TrimEnd  :{w:#.#}  (TW={width:#.#},d={dur},s={end})");
                return((width - RangeSlider.KNOB_POS_MARGIN * 2) * end / dur);
            }).ToReadOnlyReactiveProperty();

            TrimStartPosition = TrimStart.ToReadOnlyReactiveProperty();
            TrimEndPosition   = TrimEnd.CombineLatest(Duration, (end, dur) => {
                return(dur - end);
            }).ToReadOnlyReactiveProperty();

            TrimStartText = TrimStart.Select((v) => $"{(long)(v/1000.0)}").ToReadOnlyReactiveProperty();
            TrimEndText   = TrimEndPosition.Select((v) => $"{(long)(v/1000.0)}").ToReadOnlyReactiveProperty();
        }
 protected override void RenderBodyStart()
 {
     if (GridModel.AutoScroll)
     {
         RenderText(string.Format("<tbody class=\"table-body\" style=\"width:{0}px \">", TotalWidth.ToString()));
     }
     else
     {
         RenderText("<tbody>");
     }
 }
        protected override void RenderFootStart()
        {
            string attributes = BuildHtmlAttributes(GridModel.Sections.HeaderRow.Attributes(new GridRowViewData <T>(null, false)));

            if (attributes.Length > 0)
            {
                attributes = " " + attributes;
            }
            if (GridModel.AutoScroll)
            {
                RenderText(string.Format("<tfoot class=\"table-foot\" style=\"width:{0}px \"><tr{1}>", TotalWidth.ToString(), attributes));
            }
            else
            {
                RenderText(string.Format("<tfoot><tr{0}>", attributes));
            }
        }