Exemple #1
0
 private void RenderRowsProperties(RowProperties rowProperties)
 {
     if (rowProperties.Height != null)
     {
         _writer.WriteAttributeString("ss:Height", (rowProperties.Height.Value + 12).ToString());
     }
 }
Exemple #2
0
        /// <summary>
        /// Creates the row properties.
        /// </summary>
        /// <param name="style">The style.</param>
        /// <param name="propertyNode">The property node.</param>
        /// <returns></returns>
        private RowProperties CreateRowProperties(IStyle style, XmlNode propertyNode)
        {
            RowProperties rowProperties = new RowProperties(style);

            rowProperties.Node = propertyNode;

            return(rowProperties);
        }
        /// <summary>
        /// Creates the row properties.
        /// </summary>
        /// <param name="style">The style.</param>
        /// <param name="propertyNode">The property node.</param>
        /// <returns></returns>
        private static RowProperties CreateRowProperties(IStyle style, XElement propertyNode)
        {
            RowProperties rowProperties = new RowProperties(style)
            {
                Node = propertyNode
            };

            return(rowProperties);
        }
        public RowPropertiesForm(RowProperties rowProperties)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.buttonOK.Text                 = Res.Get(StringId.OKButtonText);
            this.buttonCancel.Text             = Res.Get(StringId.CancelButton);
            this.groupBoxHeight.Text           = Res.Get(StringId.Height);
            this.labelPixels.Text              = Res.Get(StringId.Pixels);
            this.radioButtonFixedHeight.Text   = Res.Get(StringId.RowPropertiesFixedHeight);
            this.radioButtonSizeToContent.Text = Res.Get(StringId.RowPropertiesSizeToContent);
            this.Text = Res.Get(StringId.RowPropertiesTitle);

            RowHeight = rowProperties.Height;
            cellPropertiesControl.CellProperties = rowProperties.CellProperties;
        }
        private void SetCellColorByHash(DataGridViewRow addedRow, string strHash)
        {
            List <DataGridViewRow> list;

            if (!dicResult.ContainsKey(strHash))
            {
                list = new List <DataGridViewRow>();
                list.Add(addedRow);
                dicResult[strHash] = list;
            }
            else
            {
                list = dicResult[strHash];
                list.Add(addedRow);
            }
            if (list.Count > 1)
            {
                RowProperties tag = (RowProperties)list[0].Tag;
                if (tag.colorIndex < 0)
                {
                    foreach (DataGridViewRow row in list)
                    {
                        ((RowProperties)row.Tag).colorIndex = colorIndex;
                        row.Cells[2].Style.BackColor        = colors[colorIndex];
                    }
                    colorIndex++;
                    if (colorIndex > (colors.Length - 1))
                    {
                        colorIndex = 0;
                    }
                }
                else
                {
                    ((RowProperties)addedRow.Tag).colorIndex = tag.colorIndex;
                    addedRow.Cells[2].Style.BackColor        = colors[tag.colorIndex];
                }
            }
        }
        protected override void DrawRowValueCellCore(CustomDrawRowValueCellEventArgs e, BaseEditPainter pb, BaseEditViewInfo bvi, BaseViewInfo vi)
        {
            MyPropertyGridControl grid       = (MyPropertyGridControl)vi.Grid;
            RowProperties         properties = e.Row.GetRowProperties(e.CellIndex);
            DescriptorContext     context    = grid.GetDescriptorContext(properties);
            UITypeEditor          editor     = grid.GetUITypeEditor(context);

            if (editor != null && editor.GetPaintValueSupported())
            {
                int                 indent = 1;
                Size                size   = new Size(e.Bounds.Size.Height - 2 * indent, e.Bounds.Size.Height - 2 * indent);
                Rectangle           bounds = new Rectangle(e.Bounds.X + indent, e.Bounds.Y + indent, size.Width, size.Height);
                PaintValueEventArgs args   = new PaintValueEventArgs(context, grid.GetCellValue(properties.Row, 0), e.Cache.Graphics, bounds);
                editor.PaintValue(args);
                e.Cache.DrawRectangle(Pens.DarkGray, bounds);
                Rectangle textBounds = new Rectangle(e.Bounds.X + bounds.Width + 2 * indent + indent, e.Bounds.Y, e.Bounds.Width - bounds.Width + 2 * indent, e.Bounds.Height);
                grid.Appearance.RecordValue.DrawString(e.Cache, grid.GetCellDisplayText(properties.Row, 0), textBounds);
            }
            else
            {
                base.DrawRowValueCellCore(e, pb, bvi, vi);
            }
        }
 public void ShowFileHashForm(string[] paths)
 {
     if (!fCancellationPending)
     {
         ClearNewColor();
         Text = MakeHashTypeText() + QTUtility.TextResourcesDic["FileHashComputer"][9];
         SetButtonsEnabled(false);
         List <string>          list = new List <string>();
         List <DataGridViewRow> rows = new List <DataGridViewRow>();
         bool flag = chbFullPath.Checked;
         if (paths != null)
         {
             dgvHash.SuspendLayout();
             foreach (string str in paths)
             {
                 FileInfo info = new FileInfo(str);
                 if (info.Exists)
                 {
                     DateTime lastWriteTime       = info.LastWriteTime;
                     List <DataGridViewRow> list3 = new List <DataGridViewRow>();
                     List <DataGridViewRow> list4 = new List <DataGridViewRow>();
                     int  rowIndex = -1;
                     bool flag2    = false;
                     foreach (DataGridViewRow row in dgvHash.Rows)
                     {
                         if (!flag2 && row.Cells[1].ToolTipText.PathEquals(str))
                         {
                             if ((row.Tag != null) && (lastWriteTime != ((RowProperties)row.Tag).modTime))
                             {
                                 list3.Add(row);
                                 row.Selected = false;
                             }
                             else if (((DataGridViewProgressBarCell)row.Cells[2]).CalculatingStatus == HashCalcStatus.Aborted)
                             {
                                 list4.Add(row);
                             }
                             else
                             {
                                 row.Selected = true;
                                 flag2        = true;
                             }
                         }
                         else
                         {
                             row.Selected = false;
                         }
                     }
                     foreach (DataGridViewRow row2 in list4)
                     {
                         rowIndex = row2.Index;
                         dgvHash.Rows.Remove(row2);
                     }
                     if (!flag2)
                     {
                         DataGridViewRow item = new DataGridViewRow();
                         item.CreateCells(dgvHash, new object[] { QTUtility.ImageListGlobal.Images[QTUtility.GetImageKey(str, Path.GetExtension(str))], flag ? str : Path.GetFileName(str), VALUE_EMPTY });
                         item.Cells[0].Style.BackColor = clrNew;
                         item.Cells[1].ToolTipText     = str;
                         item.Tag = new RowProperties(lastWriteTime);
                         if (list3.Count > 0)
                         {
                             RowProperties tag = (RowProperties)list3[0].Tag;
                             if (tag.colorIndexModTimeDiffers < 0)
                             {
                                 list3.Add(item);
                                 foreach (DataGridViewRow row4 in list3)
                                 {
                                     ((RowProperties)row4.Tag).colorIndexModTimeDiffers = colorIndexModTimeDiffers;
                                     row4.Cells[1].Style.BackColor = colors[colorIndexModTimeDiffers];
                                 }
                                 colorIndexModTimeDiffers++;
                                 if (colorIndexModTimeDiffers > (colors.Length - 1))
                                 {
                                     colorIndexModTimeDiffers = 0;
                                 }
                             }
                             else
                             {
                                 ((RowProperties)item.Tag).colorIndexModTimeDiffers = tag.colorIndexModTimeDiffers;
                                 item.Cells[1].Style.BackColor = colors[tag.colorIndexModTimeDiffers];
                             }
                         }
                         if (rowIndex != -1)
                         {
                             dgvHash.Rows.Insert(rowIndex, item);
                         }
                         else
                         {
                             dgvHash.Rows.Add(item);
                         }
                         dgvHash.FirstDisplayedScrollingRowIndex = dgvHash.Rows.IndexOf(item);
                         list.Add(str);
                         rows.Add(item);
                         clmn3_Hash.InitializeProgress((DataGridViewProgressBarCell)item.Cells[2]);
                     }
                 }
             }
             if (list.Count > 0)
             {
                 if (iThreadsCounter > 0)
                 {
                     qPendings.Enqueue(new PathRowPairs(list, rows));
                 }
                 else
                 {
                     iThreadsCounter++;
                     new HashInvoker(ComputeHashCore).BeginInvoke(list.ToArray(), rows.ToArray(), cmbHashType.SelectedIndex, AsyncComplete, null);
                 }
             }
             dgvHash.ResumeLayout();
         }
         Show();
         PInvoke.SetWindowPos(Handle, chbTopMost.Checked ? ((IntPtr)(-1)) : IntPtr.Zero, 0, 0, 0, 0, 0x53);
         if (list.Count == 0)
         {
             ComputeFinished();
         }
     }
 }
        private List<RowProperties> RunFilter_GetValues(String queryGetLogTableValues, String lastPosition)
        {
            DataTable dataTable;
            List<RowProperties> rowPropList;
            RowProperties rowProp;
            try
            {
                WriteLogFile("RunFilter_GetValues() -->> ", "is STARTED");
                rowPropList = new List<RowProperties>();
                int count = 0;
                dataTable = GetDataTable(dataBaseNameforMainServer, queryGetLogTableValues);

                if (dataTable != null)
                {
                    foreach (DataRow row in dataTable.Rows)
                    {
                        count++;
                        rowProp = new RowProperties();
                        rowProp.ID = row[Rsc.LogTbl_ID].ToString();
                        rowProp.dateTime = row[Rsc.LogTbl_DateTime].ToString();
                        rowProp.category = row[Rsc.LogTbl_EventCateg].ToString();
                        rowProp.userName = row[Rsc.LogTbl_UserName].ToString();
                        rowProp.computerName = row[Rsc.LogTbl_CompName].ToString();
                        rowProp.windowName = row[Rsc.LogTbl_WindowName].ToString();
                        rowProp.primaryKeyValue = row[Rsc.LogTbl_PriKeyVal].ToString();
                        rowProp.dataWindowName = row[Rsc.LogTbl_DataWindowName].ToString();
                        rowProp.recordNumber = row[Rsc.LogTbl_RecordNumber].ToString();
                        if (rowProp.primaryKeyValue.Contains("WB") || rowProp.primaryKeyValue.Contains("S"))
                        {
                            continue;
                            //rowProp.primaryKeyValue = rowProp.primaryKeyValue.Split(new Char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
                        }
                        if (rowProp.primaryKeyValue == "")
                        {
                            continue;
                        }
                        rowPropList.Add(rowProp);
                        if (count > 100)
                        {
                            break;
                        }
                    }

                    WriteLogFile("RunFilter_GetValues() -->> ", " Record count is : " + count.ToString());
                    WriteLogFile("RunFilter_GetValues() -->> ", "is successfully FINISHED.");
                    return rowPropList;
                }
                WriteLogFile("RunFilter_GetValues() -->> ", "is successfully FINISHED.");
                return null;
            }
            catch (Exception ex)
            {
                WriteLogFile("RunFilter_GetValues() -->> ", ex);
                return null;
            }
        }
 public DescriptorContext GetDescriptorContext(RowProperties properties)
 {
     return(DataModeHelper.GetDescriptorContext(properties.FieldName));
 }