protected virtual void RefreshSerializerData() { this.m_data.PropertyChanged -= new PropertyChangedEventHandler(m_data_PropertyChanged); string names = null; string values = null; byte[] bytes = null; ProfileSerializer.ConvertFromProfilePropertyCollection(this.m_extendedAttributes, out names, out values, out bytes, this.BinarySupported); this.m_data.PropertyNames = names; this.m_data.PropertyValuesString = values; this.m_data.PropertyValuesBinary = bytes; this.m_data.PropertyChanged -= new PropertyChangedEventHandler(m_data_PropertyChanged); this.m_data.PropertyChanged += new PropertyChangedEventHandler(m_data_PropertyChanged); }
protected virtual void RefreshProperties() { this.m_extendedAttributes.PropertyChanged -= new PropertyChangedEventHandler(extendedAttributes_PropertyChanged); IProfileStorage data = this.SerializerData ?? new ProfileSerializerData(); var attributes = ProfileSerializer.ConvertToProfilePropertyCollection(data.PropertyNames, data.PropertyValuesString, data.PropertyValuesBinary); ProfilePropertyCollection collection = attributes ?? new ProfilePropertyCollection(); this.m_extendedAttributes.Clear(); foreach (string name in collection.Names) { this.m_extendedAttributes.Add(name, collection[name]); } this.m_extendedAttributes.PropertyChanged -= new PropertyChangedEventHandler(extendedAttributes_PropertyChanged); this.m_extendedAttributes.PropertyChanged += new PropertyChangedEventHandler(extendedAttributes_PropertyChanged); }