text: public void RestoreState(State state){if (state == null){return;}do{if (!attributeImpls.ContainsKey(state.attribute.GetType())){throw new ArgumentException("State contains Attribute of type " + state.attribute.GetType().Name + " that is not in in this AttributeSource");}state.attribute.CopyTo(attributeImpls[state.attribute.GetType()]);state = state.next;} while (state != null);}