示例#1
0
        /// <summary>
        /// Fires that a map has occurred
        /// </summary>
        private static void FireMappedToModel(object sender, Guid key, IdentifiedData modelInstance)
        {
            ModelMapEventArgs e = new ModelMapEventArgs()
            {
                ObjectType = modelInstance.GetType(), Key = key, ModelObject = modelInstance
            };

            MappedToModel?.BeginInvoke(sender, e, null, null);
        }
示例#2
0
        /// <summary>
        /// Fires the pre map returning whether cancellation is necessary
        /// </summary>
        private static object FireMappingToModel(object sender, Guid key, IdentifiedData modelInstance)
        {
            ModelMapEventArgs e = new ModelMapEventArgs()
            {
                ObjectType = modelInstance.GetType(), ModelObject = modelInstance, Key = key
            };

            MappingToModel?.Invoke(sender, e);
            if (e.Cancel)
            {
                return(e.ModelObject);
            }
            else
            {
                return(null);
            }
        }