bool IStringImport <IMappingTarget> .TryImport(string exportedString, out IMappingTarget outputMappedCharacter)
        {
            var parseSuccess = TryImport(exportedString, out CharacterMappingTarget result);

            outputMappedCharacter = parseSuccess ? result : null;
            return(parseSuccess);
        }
        public bool TryImport(string exportedString, out IMappingTarget outputMappedHardwareKey)
        {
            var parseSuccess = TryImport(exportedString, out HardwareKeyMappingTarget parseResult);

            outputMappedHardwareKey = parseResult;
            return(parseSuccess);
        }
예제 #3
0
        protected Mapping(Configuration globalConfig, IMappingSource source, IMappingTarget target)
        {
            GlobalConfig = globalConfig;

            this.Source = source;
            this.Target = target;
        }
예제 #4
0
        public MemberMapping(TypeMapping typeMapping, IMappingSource source, IMappingTarget target)
            : base(typeMapping.GlobalConfig, source.MemberType, target.MemberType)
        {
            this.InstanceTypeMapping = typeMapping;

            this.SourceMember = source;
            this.TargetMember = target;
        }
        public bool Equals(IMappingTarget other)
        {
            if (other is CharacterMappingTarget charMappingTarget)
            {
                return(Equals(charMappingTarget));
            }

            return(Equals(other as HardwareKeyMappingTarget));
        }
예제 #6
0
        public MemberMapping GetTypeToMember(Type sourceType, IMappingTarget targetMember)
        {
            if (TypeToMemberMappings.TryGetValue(targetMember, out var dict))
            {
                if (dict.TryGetValue(sourceType, out var typeToMemberMapping))
                {
                    return(typeToMemberMapping);
                }
            }

            return(null);
        }
        private static bool TryParseSpecial(string exerciseText, ref int iStart, out IMappingTarget mappingTarget)
        {
            mappingTarget = null;
            if (TryGetManualDefinitionText(exerciseText, iStart, out string specialText, out int specialLength))
            {
                var parseSpecialSuccessfull = TryParseManualDefinition(specialText, out mappingTarget);

                if (parseSpecialSuccessfull)
                {
                    iStart += specialLength;
                    return(true);
                }
            }
#pragma warning disable 1591 // Xml Comments
        public void Perform(IMappingTarget mappingTarget, object target, object value)
        {
        }
#pragma warning disable 1591 // Xml Comments
        public void Perform(IMappingTarget mappingTarget, object target, object value)
        {

        }
예제 #10
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="mappingTarget"></param>
 /// <param name="target"></param>
 /// <param name="value"></param>
 public void Perform(IMappingTarget mappingTarget, object target, object value)
 {
     throw new NotImplementedException();
 }
예제 #11
0
#pragma warning disable 1591 // Xml Comments
        public void Perform(IMappingTarget mappingTarget, object target, object value)
        {
            var dynamicTarget = (dynamic)target;
            dynamicTarget.Id = value;
        }
예제 #12
0
#pragma warning disable 1591 // Xml Comments
        public void Perform(IMappingTarget mappingTarget, object target, object sourceValue)
        {
            mappingTarget.SetValue(target, PropertyInfo, sourceValue);
        }
#pragma warning disable 1591 // Xml Comments
        public void Perform(IMappingTarget mappingTarget, object target, object sourceValue)
        {
            mappingTarget.SetValue(target, PropertyInfo, sourceValue);
        }
예제 #14
0
#pragma warning disable 1591 // Xml Comments
        public void Perform(IMappingTarget mappingTarget, object target, object value)
        {
            var dynamicTarget = (dynamic)target;

            dynamicTarget.Id = value;
        }
예제 #15
0
 public TypeMapping(Configuration globalConfig, IMappingSource source, IMappingTarget target)
     : base(globalConfig, source, target)
 {
     this.MemberToMemberMappings = new Dictionary <IMappingTarget, MemberMapping>();
     this.TypeToMemberMappings   = new Dictionary <IMappingTarget, Dictionary <Type, MemberMapping> >();
 }
예제 #16
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="mappingTarget"></param>
 /// <param name="target"></param>
 /// <param name="value"></param>
 public void Perform(IMappingTarget mappingTarget, object target, object value)
 {
     throw new NotImplementedException();
 }
예제 #17
0
 public KeyMapping(IKeyboardKey keyboardKey, IMappingTarget mappedTarget)
 {
     KeyboardKey   = keyboardKey;
     MappingTarget = mappedTarget;
 }