Ejemplo n.º 1
0
        /// <summary>
        ///
        ///
        /// </summary>
        /// <param name="lstSelectedIndex"></param>
        ///
        private void PopulateStampData()
        {
            CopyOptions.StampContents.Clear();

            if (CopyOptions.setStamps)
            {
                foreach (DataGridViewRow row in stamps_Datagrid.Rows)
                {
                    if (row.Cells[1].Value != null && row.Cells[1].Value.ToString() != string.Empty && row.Cells[1].Value.ToString() != "None")
                    {
                        StampContents stamp = new StampContents();
                        stamp.StampType        = EnumUtil.GetByDescription <StampType>(row.Cells[0].Value.ToString());
                        stamp.StampContentType = row.Cells[1].Value.ToString();
                        CopyOptions.StampContents.Add(stamp);
                    }
                }
                CopyOptions.StampContents.TrimExcess();
            }
        }
Ejemplo n.º 2
0
        private void LoadStampsData()
        {
            stamps_CheckBox.Checked = CopyOptions.setStamps ? true : false;
            stamps_Groupbox.Enabled = CopyOptions.setStamps ? true : false;

            stamps_Datagrid.Rows.Clear();
            foreach (StampType type in EnumUtil.GetValues <StampType>().ToList())
            {
                StampContents content = CopyOptions.StampContents.FirstOrDefault(x => x.StampType.Equals(type));
                if (content == null)
                {
                    stamps_Datagrid.Rows.Add(type.GetDescription(), "None");
                }
                else
                {
                    StampContents stamp = content;
                    stamps_Datagrid.Rows.Add(stamp.StampType.GetDescription(), stamp.StampContentType);
                }
            }
        }