private void gridViewPanel2_CalcRowHeight(object sender, RowHeightEventArgs e)
 {
     if (listOfRowsHeights.Count != gridViewPanel2.RowCount)
     {
         listOfRowsHeights.Add(e.RowHeight);
     }
 }
Ejemplo n.º 2
0
 private void frtGridView_CalcRowHeight(object sender, RowHeightEventArgs e)
 {
     if (e.RowHandle < 0)
     {
         e.RowHeight = 0;
     }
 }
        void gridView1_CalcRowHeight(object sender, RowHeightEventArgs e)
        {
            GridViewInfo viewInfo     = gridView1.GetViewInfo() as GridViewInfo;
            int          totalHeight  = viewInfo.ViewRects.Rows.Height - minRowHeigth;
            int          targetHeight = totalHeight / gridView1.DataRowCount;

            e.RowHeight = Math.Max(minRowHeigth, targetHeight);
        }
Ejemplo n.º 4
0
 private void logView_MeasurePreviewHeight(object sender, RowHeightEventArgs e)
 {
     using (RichTextEditViewInfo vi = new RichTextEditViewInfo(emailLogRenderer.Value)) {
         var view  = ((GridView)sender);
         var email = (AdReminderEmail)view.GetRow(e.RowHandle);
         vi.LoadText(email.EmailSource);
         e.RowHeight = vi.CalcHeight(((GridViewInfo)view.GetViewInfo()).CalcRowPreviewWidth(e.RowHandle) - 1) + 2;
     }
 }
Ejemplo n.º 5
0
        private void onMeasurePreviewHeight(RowHeightEventArgs e)
        {
            if (gridView.PreviewRowEdit == null)
            {
                return;
            }

            var journalPageDTO = _gridViewBinder.ElementAt(e.RowHandle);

            if (journalPageDTO == null)
            {
                return;
            }

            //empiric value (might be a way to retrieve it dynamically but could not find it)
            e.RowHeight = journalPageDTO.LineCount * 15;
        }
Ejemplo n.º 6
0
        private void gridView1_CalcRowHeight(object sender, RowHeightEventArgs e)
        {
            GridView gv = sender as GridView;

            if (gv != null)
            {
                GridViewInfo vi = gv.GetViewInfo() as GridViewInfo;
                if (vi != null)
                {
                    int h = vi.ViewRects.Rows.Height - 1;
                    if (e.RowHeight > h)
                    {
                        e.RowHeight = h;
                    }
                }
            }
        }
Ejemplo n.º 7
0
        private void gridView1_CalcRowHeight(object sender, RowHeightEventArgs e)
        {
            var dataRow = this.gridView1.GetRow(e.RowHandle);

            if (dataRow != null)
            {
                var item = (DataItemModel)this.gridView1.GetRow(e.RowHandle);
                if (item.Show)
                {
                    e.RowHeight = 15 * item.Height;
                }
                else
                {
                    e.RowHeight = 15;
                }
            }
            else
            {
                e.RowHeight = 15;
            }
        }
Ejemplo n.º 8
0
 private void gvChat_CalcRowHeight(object sender, RowHeightEventArgs e)
 {
     try
     {
         if (this.ChatRowHeights.ContainsKey(e.RowHandle))
         {
             e.RowHeight = this.ChatRowHeights[e.RowHandle];
         }
         else
         {
             ChatLine row = this.gvPrivateChat.GetRow(e.RowHandle) as ChatLine;
             if (row != null)
             {
                 IText text = row.TextSegments[0];
                 if (text != null)
                 {
                     int index;
                     Font textFont = text.TextFont;
                     string str = text.Text;
                     string str2 = null;
                     Dictionary<int, ChatLink> dictionary = null;
                     List<string> list = null;
                     List<MultiVal<int, int>> list2 = null;
                     SortedList<int, Emote> list3 = null;
                     if (!(!Program.Settings.Chat.Links.ShowChatLinks || (!row.ContainsLinks.HasValue ? false : !row.ContainsLinks.Value)))
                     {
                         dictionary = ChatLink.CreateCharacterIndex(ChatLink.FindLinks(str));
                         row.ContainsLinks = new bool?((dictionary != null) && (dictionary.Count > 0));
                     }
                     if (!(!Program.Settings.Chat.Emotes.ShowEmotes || (!row.ContainsEmotes.HasValue ? false : !row.ContainsEmotes.Value)))
                     {
                         list = new List<string>();
                         list2 = new List<MultiVal<int, int>>();
                         list3 = new SortedList<int, Emote>();
                         foreach (Emote emote in Emote.AllEmotes.Values)
                         {
                             index = str.IndexOf(emote.CharSequence);
                             while (index >= 0)
                             {
                                 list2.Add(new MultiVal<int, int>(index, emote.CharSequence.Length));
                                 list3.Add(index, emote);
                                 index = str.IndexOf(emote.CharSequence, (int) (index + emote.CharSequence.Length));
                                 if (!(!Program.Settings.Chat.Links.ShowChatLinks || (!row.ContainsLinks.HasValue ? false : !row.ContainsLinks.Value)))
                                 {
                                     if (str2 == null)
                                     {
                                         str2 = str;
                                     }
                                     str2 = str2.Replace(emote.CharSequence, "");
                                 }
                             }
                         }
                         row.ContainsEmotes = new bool?((list3 != null) && (list3.Count > 0));
                     }
                     using (Graphics graphics = this.gpgChatGrid.CreateGraphics())
                     {
                         float num6;
                         float num7;
                         float num8;
                         int num9;
                         int num10;
                         ChatLink link;
                         SolidBrush brush;
                         string[] strArray;
                         int num11;
                         SizeF ef;
                         Brush brush2;
                         Font font2;
                         if ((list3 != null) && (list3.Count > 0))
                         {
                             int num2;
                             list2.Add(new MultiVal<int, int>(str.Length, 0));
                             list3.Add(str.Length, null);
                             SortedList<int, MultiVal<int, int>> list4 = new SortedList<int, MultiVal<int, int>>(list2.Count);
                             list4[-1] = new MultiVal<int, int>(0, 0);
                             foreach (MultiVal<int, int> val in list2)
                             {
                                 list4[val.Value1] = val;
                             }
                             for (num2 = 1; num2 < list4.Count; num2++)
                             {
                                 int num3 = list4.Values[num2 - 1].Value1;
                                 index = list4.Values[num2].Value1;
                                 int num4 = list4.Values[num2 - 1].Value2;
                                 int num5 = list4.Values[num2].Value2;
                                 list.Add(str.Substring(num3 + num4, index - (num3 + num4)));
                             }
                             dictionary = ChatLink.CreateCharacterIndex(ChatLink.FindLinks(str2));
                             num6 = textFont.Height + 3;
                             num7 = 0f;
                             num8 = num6;
                             num9 = this.colText.VisibleWidth - 10;
                             num10 = 0;
                             link = null;
                             using (brush = new SolidBrush(text.TextColor))
                             {
                                 for (num2 = 0; num2 < list.Count; num2++)
                                 {
                                     if (list[num2].Length > 0)
                                     {
                                         strArray = DrawUtil.SplitString(list[num2], " ");
                                         for (num11 = 0; num11 < strArray.Length; num11++)
                                         {
                                             if ((dictionary.Count > 0) && dictionary.ContainsKey(num10))
                                             {
                                                 link = dictionary[num10];
                                             }
                                             if (link != null)
                                             {
                                                 using (brush2 = new SolidBrush(link.LinkColor))
                                                 {
                                                     using (font2 = new Font(textFont, FontStyle.Underline))
                                                     {
                                                         ef = DrawUtil.MeasureString(graphics, strArray[num11], font2);
                                                         if (((ef.Width <= num9) || (num7 != 0f)) && ((num7 + ef.Width) > num9))
                                                         {
                                                             num7 = 0f;
                                                             num8 += num6;
                                                         }
                                                         goto Label_05BC;
                                                     }
                                                 }
                                             }
                                             ef = DrawUtil.MeasureString(graphics, strArray[num11], textFont);
                                             if (((ef.Width <= num9) || (num7 != 0f)) && ((num7 + ef.Width) > num9))
                                             {
                                                 num7 = 0f;
                                                 num8 += num6;
                                             }
                                         Label_05BC:
                                             num10 += strArray[num11].Length;
                                             num7 += ef.Width;
                                             if ((link != null) && (num10 >= link.EndIndex))
                                             {
                                                 link = null;
                                             }
                                         }
                                     }
                                     if (list3.Values[num2] != null)
                                     {
                                         float num12 = ((float) textFont.Height) / ((float) list3.Values[num2].Image.Height);
                                         float num13 = list3.Values[num2].Image.Width * num12;
                                         if ((num7 + num13) > num9)
                                         {
                                             num7 = 0f;
                                             num8 += num6;
                                         }
                                         num7 += num13;
                                     }
                                 }
                             }
                             e.RowHeight = Convert.ToInt32(Math.Round((double) num8, MidpointRounding.AwayFromZero));
                         }
                         else if ((dictionary != null) && (dictionary.Count > 0))
                         {
                             num6 = textFont.Height + 3;
                             num7 = 0f;
                             num8 = num6;
                             num9 = this.colText.VisibleWidth - 10;
                             num10 = 0;
                             link = null;
                             using (brush = new SolidBrush(text.TextColor))
                             {
                                 strArray = DrawUtil.SplitString(str, " ");
                                 num11 = 0;
                                 while (num11 < strArray.Length)
                                 {
                                     if ((dictionary.Count > 0) && dictionary.ContainsKey(num10))
                                     {
                                         link = dictionary[num10];
                                     }
                                     if (link != null)
                                     {
                                         using (brush2 = new SolidBrush(link.LinkColor))
                                         {
                                             using (font2 = new Font(textFont, FontStyle.Underline))
                                             {
                                                 ef = DrawUtil.MeasureString(graphics, strArray[num11], font2);
                                                 if (((ef.Width <= num9) || (num7 != 0f)) && ((num7 + ef.Width) > num9))
                                                 {
                                                     num7 = 0f;
                                                     num8 += num6;
                                                 }
                                                 goto Label_0890;
                                             }
                                         }
                                     }
                                     ef = DrawUtil.MeasureString(graphics, strArray[num11], textFont);
                                     if (((ef.Width <= num9) || (num7 != 0f)) && ((num7 + ef.Width) > num9))
                                     {
                                         num7 = 0f;
                                         num8 += num6;
                                     }
                                 Label_0890:
                                     num10 += strArray[num11].Length;
                                     num7 += ef.Width;
                                     if ((link != null) && (num10 >= link.EndIndex))
                                     {
                                         link = null;
                                     }
                                     num11++;
                                 }
                             }
                             e.RowHeight = Convert.ToInt32(Math.Round((double) num8, MidpointRounding.AwayFromZero));
                         }
                         else
                         {
                             num6 = textFont.Height + 3;
                             num7 = 0f;
                             num8 = num6;
                             num9 = this.colText.VisibleWidth - 10;
                             num10 = 0;
                             strArray = DrawUtil.SplitString(str, " ");
                             for (num11 = 0; num11 < strArray.Length; num11++)
                             {
                                 ef = DrawUtil.MeasureString(graphics, strArray[num11], textFont);
                                 if (((ef.Width <= num9) || (num7 != 0f)) && ((num7 + ef.Width) > num9))
                                 {
                                     num7 = 0f;
                                     num8 += num6;
                                 }
                                 num10 += strArray[num11].Length;
                                 num7 += ef.Width;
                             }
                             e.RowHeight = Convert.ToInt32(Math.Round((double) num8, MidpointRounding.AwayFromZero));
                         }
                     }
                 }
             }
             this.ChatRowHeights[e.RowHandle] = e.RowHeight;
         }
     }
     catch (Exception exception)
     {
         ErrorLog.WriteLine(exception);
     }
 }
Ejemplo n.º 9
0
 void Form1_CalcRowHeight(object sender, RowHeightEventArgs e)
 {
     e.RowHeight = (int)(e.RowHeight * 1.5);
 }
Ejemplo n.º 10
0
 private void gridView1_CalcRowHeight(object sender, RowHeightEventArgs e)
 {
     var dataRow = this.gridView1.GetRow(e.RowHandle);
     if (dataRow != null){
         var item = (DataItemModel)this.gridView1.GetRow(e.RowHandle);
         if (item.Show)
             e.RowHeight = 15 * item.Height;
         else e.RowHeight = 15;
     }
     else e.RowHeight = 15;
 }
Ejemplo n.º 11
0
 private void gridView1_CalcRowHeight(object sender, RowHeightEventArgs e)
 {
     var dr = gridView1.GetDataRow(e.RowHandle);
     if(dr[0].ToString()=="1")
     {
        e.RowHeight = 10;
     }
 }
Ejemplo n.º 12
0
 private void gvResults_CalcRowHeight(object sender, RowHeightEventArgs e)
 {
     int height;
     int num = 4;
     string text = "0kb";
     using (Graphics graphics = base.CreateGraphics())
     {
         height = (int) DrawUtil.MeasureString(graphics, text, this.DownloadSizeFont).Height;
     }
     int num3 = (VaultImages.download_up.Height + height) + (num * 3);
     if (e.RowHeight < num3)
     {
         e.RowHeight = num3;
     }
 }
Ejemplo n.º 13
0
 private void logView_MeasurePreviewHeight(object sender, RowHeightEventArgs e)
 {
     using (RichTextEditViewInfo vi = new RichTextEditViewInfo(emailLogRenderer.Value)) {
         var view = ((GridView)sender);
         var email = (AdReminderEmail)view.GetRow(e.RowHandle);
         vi.LoadText(email.EmailSource);
         e.RowHeight = vi.CalcHeight(((GridViewInfo)view.GetViewInfo()).CalcRowPreviewWidth(e.RowHandle) - 1) + 2;
     }
 }
Ejemplo n.º 14
0
 private static void GridView_CalcRowHeight(object sender, RowHeightEventArgs e)
 {
     e.RowHeight = 5;
 }
Ejemplo n.º 15
0
 private void gridView1_CalcRowHeight(object sender, RowHeightEventArgs e)
 {
     e.RowHeight = GetRowBestHeight(_gridView, e.RowHandle);
 }
Ejemplo n.º 16
0
 void linkedView_MeasurePreviewHeight(object sender, RowHeightEventArgs e)
 {
     e.RowHeight = GetPanelHeight(e.RowHandle);
 }