public static bool TrySetValue <TIndex, TValue>(IIndexable <TIndex, TValue> instance, TIndex index, TValue value) where TIndex : IIndex { Contracts.Requires.That(instance != null); IIndexableContracts.TrySetValue(instance, index); if (instance.IsIndexValid(index)) { instance[index] = value; return(true); } else { return(false); } }
public static void IndexerSet <TIndex, TValue>(IIndexable <TIndex, TValue> instance, TIndex index) where TIndex : IIndex { Contracts.Requires.That(instance != null); Contracts.Requires.That(instance.IsIndexValid(index)); }