Exemple #1
0
        private void AddAttributePairFunc <TProperty>(Tuple <XName, XName> name, Expression <Func <T, TProperty> > propFunc,
                                                      Expression <Func <TProperty, Tuple <string, string> > > toStringsFunc)
        {
            Func <T, Tuple <string, string> > func = ObjectToXmlFuncGenerator <T> .GenerateAttributePairFunc(propFunc, toStringsFunc);

            _attributePairFuncs.Add(name, func);
        }
Exemple #2
0
        private void AddSingleElementFunc <TProperty>(XName name, Expression <Func <T, TProperty> > propFunc,
                                                      XmlMapper <TProperty> mapper) where TProperty : class, new()
        {
            Func <T, XElement> func = ObjectToXmlFuncGenerator <T> .GenerateSingleElemenetFunc(name, propFunc, mapper);

            _elementFuncs.Add(name, func);
        }
Exemple #3
0
        private void AddAttributeFunc <TProperty>(XName name, Expression <Func <T, TProperty> > propFunc,
                                                  Expression <Func <TProperty, string> > toStringFunc = null)
        {
            Func <T, string> func = ObjectToXmlFuncGenerator <T> .GenerateAttributeFunc(propFunc, toStringFunc);

            _attributeFuncs.Add(name, func);
        }
Exemple #4
0
        private void AddCollectionElementFunc <TProperty>(string name,
                                                          Expression <Func <T, ICollection <TProperty> > > propFunc,
                                                          XmlMapper <TProperty> mapper) where TProperty : class, new()
        {
            Func <T, XElement> func = ObjectToXmlFuncGenerator <T> .GenerateCollectionElementFunc(name, propFunc, mapper);

            _elementCollectionFuncs.Add(name, func);
        }