コード例 #1
0
        public void TestIgnoredColumn_HandlePreAndPostProcessing()
        {
            var ignored = new IgnoredColumn()
            {
                ColumnName    = "Ignored",
                NullFormatter = NullFormatter.ForValue("NULL"),
                OnParsing     = (ctx, value) =>
                {
                    Assert.AreEqual("NULL", value);
                    return(value);
                },
                OnParsed = (ctx, value) =>
                {
                    Assert.IsNull(value);
                    return(value);
                },
                OnFormatting = (ctx, value) =>
                {
                    Assert.IsNull(value);
                    return(value);
                },
                OnFormatted = (ctx, value) =>
                {
                    Assert.AreEqual("NULL", value);
                    return(value);
                }
            };
            object value = ignored.Parse(null, "NULL");

            Assert.IsNull(value);
            string formatted = ignored.Format(null, value);

            Assert.AreEqual("NULL", formatted);
        }
コード例 #2
0
        public IgnoredMapping AddIgnored()
        {
            var    column  = new IgnoredColumn();
            var    mapping = new IgnoredMapping(column, lookup.Count);
            string key     = $"@Ignored_{mapping.FileIndex}";

            lookup.Add(key, mapping);
            ++ignoredCount;
            return(mapping);
        }
コード例 #3
0
 /// ------------------------------------------------------------------------------------
 public void SetIgnoreStateForCurrentRow(bool ignored)
 {
     if (ignored)
     {
         _annotationFile.Tiers.MarkSegmentAsIgnored(CurrentCellAddress.Y);
         Stop();
         EditMode = DataGridViewEditMode.EditProgrammatically;
         EndEdit();
     }
     else
     {
         _annotationFile.Tiers.MarkSegmentAsUnignored(CurrentCellAddress.Y);
         BeginEdit(true);
     }
     IsDirty = true;
     IgnoredColumn.HandleProgramaticValueChange();
     InvalidateRow(CurrentCellAddress.Y);
 }
コード例 #4
0
ファイル: IgnoredMapping.cs プロジェクト: rkiran34/FlatFiles
 public IgnoredMapping(IgnoredColumn column)
 {
     this.column = column;
 }
コード例 #5
0
 public IgnoredMapping(IgnoredColumn column, int fileIndex)
 {
     this.column    = column;
     this.FileIndex = fileIndex;
 }
コード例 #6
0
 public IgnoredMapping(IgnoredColumn column, int physicalIndex)
 {
     this.column   = column;
     PhysicalIndex = physicalIndex;
 }
コード例 #7
0
 public IgnoredMapping(IgnoredColumn column)
 {
     this.column = column;
 }