Example #1
0
        internal static LinkDescriptor RestoreState(
            LinkDescriptorState state, Dictionary <Guid, EntityDescriptor> idToEntityDescriptor)
        {
            var linkDescriptor = new LinkDescriptor(
                idToEntityDescriptor[state.SourceDescriptorId].Entity,
                state.SourceProperty,
                idToEntityDescriptor[state.TargetDescriptorId].Entity);

            linkDescriptor.RestoreState((DescriptorState)state);

            return(linkDescriptor);
        }
Example #2
0
        internal LinkDescriptorState SaveState(
            Dictionary <object, EntityDescriptor> entityToDescriptor, Dictionary <EntityDescriptor, Guid> descriptorToId)
        {
            var state = new LinkDescriptorState();

            base.SaveState(state);

            state.SourceDescriptorId = descriptorToId[entityToDescriptor[this.source]];
            state.SourceProperty     = this.sourceProperty;
            state.TargetDescriptorId = descriptorToId[entityToDescriptor[this.target]];

            return(state);
        }