Exemplo n.º 1
0
        // From String
        private static ICProp <CT, T> CreateCPropFromString <CT, T>(IPropFactory propFactory,
                                                                    string value, bool useDefault,
                                                                    string propertyName, object extraInfo,
                                                                    PropStorageStrategyEnum storageStrategy, bool isTypeSolid,
                                                                    Delegate comparer, bool useRefEquality = true) where CT : class, IReadOnlyList <T>, IList <T>, IEnumerable <T>, IList, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged
        {
            CT initialValue;

            if (useDefault)
            {
                initialValue = propFactory.ValueConverter.GetDefaultValue <CT, T>(propertyName);
            }
            else
            {
                initialValue = propFactory.GetValueFromString <CT, T>(value);
            }

            return(propFactory.Create <CT, T>(initialValue, propertyName, extraInfo, storageStrategy, isTypeSolid,
                                              GetComparerForCollections <CT>(comparer, propFactory, useRefEquality)));
        }