public void SetValue(object target, object value) { // Make sure the default value is cloned since arrays are not truly read only. if (value != null && object.ReferenceEquals(value, defaultValue)) { value = defaultValue.Clone(); } baseProvider.SetValue(target, value); }
protected static IList <string> TranslateTokenStringsToTarget(string[] tokenStrings, OutputModelFactory factory) { string[] result = (string[])tokenStrings.Clone(); for (int i = 0; i < tokenStrings.Length; i++) { result[i] = TranslateTokenStringToTarget(tokenStrings[i], factory); } int lastTrueEntry = result.Length - 1; while (lastTrueEntry >= 0 && result[lastTrueEntry] == null) { lastTrueEntry--; } if (lastTrueEntry < result.Length - 1) { Array.Resize(ref result, lastTrueEntry + 1); } return(result); }
public virtual object Clone() { return(new BitSet((ulong[])_bits.Clone())); }