Пример #1
0
 // Change
 protected override bool InternalChange(Program program, IRow oldRow, IRow newRow, BitArray valueFlags, string columnName)
 {
     if (PropagateChange)
     {
         // select the current row from the base node using the given row
         IRow sourceRow = new Row(program.ValueManager, SourceNode.DataType.RowType);
         try
         {
             newRow.CopyTo(sourceRow);
             IRow currentRow = null;
             if (!program.ServerProcess.ServerSession.Server.IsEngine)
             {
                 currentRow = SourceNode.Select(program, sourceRow);
             }
             try
             {
                 if (currentRow == null)
                 {
                     currentRow = new Row(program.ValueManager, SourceNode.DataType.RowType);
                 }
                 newRow.CopyTo(currentRow);
                 BitArray localValueFlags = valueFlags != null ? new BitArray(currentRow.DataType.Columns.Count) : null;
                 if (localValueFlags != null)
                 {
                     for (int index = 0; index < localValueFlags.Length; index++)
                     {
                         int rowIndex = newRow.DataType.Columns.IndexOfName(currentRow.DataType.Columns[index].Name);
                         localValueFlags[index] = rowIndex >= 0 ? valueFlags[rowIndex] : false;
                     }
                 }
                 bool changed = SourceNode.Change(program, oldRow, currentRow, localValueFlags, columnName);
                 if (changed)
                 {
                     currentRow.CopyTo(newRow);
                 }
                 return(changed);
             }
             finally
             {
                 currentRow.Dispose();
             }
         }
         finally
         {
             sourceRow.Dispose();
         }
     }
     return(false);
 }