public override int GenerateDriveValue()
 {
     if (SourceCount == 1)
     {
         return(BindingSources.First().getValueInteger());
     }
     else if (SourceCount > 1)
     {
         int sum = 0;
         foreach (BindingSourceData source in this.BindingSourcesSerializable)
         {
             int value = source.RuntimeBindingSource.getValueInteger();
             if (source.IsInverted)
             {
                 value *= -1;
             }
             sum += value;
         }
         if (this.AverageSourceValues)
         {
             sum = sum / BindingSources.Count();
         }
         return(sum + offset);
     }
     else
     {
         throw new System.NullReferenceException("There are no sources defined for this driver.");
     }
 }
 public override bool GenerateDriveValue()
 {
     if (SourceCount >= 1)
     {
         return(BindingSources.First().getValueBoolean() ^ InvertValue);
     }
     else
     {
         throw new System.NullReferenceException("There are no sources defined for this driver.");
     }
 }
 public override string GenerateDriveValue()
 {
     if (this.SourceCount == 1)
     {
         return(BindingSources.First().getValueString());
     }
     else if (this.SourceCount > 1)
     {
         string appendedString = "";
         foreach (IBindingSource b in BindingSources)
         {
             appendedString += b.getValueString();
         }
         return(appendedString);
     }
     else
     {
         throw new System.NullReferenceException("There are no sources defined for this driver.");
     }
 }