internal void copyToSinkObject(ISerializableObject from, ISerializableObject to)
        {
            AttributeWorker w = AttributeWorker.GetInstance(sinkSerializer.Target);//Am besten durch Kopiervorgang ersetzen, der ohne Attributeworker auskommt.

            FieldInfo[] fis = AttributeWorker.RetrieveAllFields(from.GetType());

            foreach (FieldInfo fi in fis)
            {
                if (w.IsAutoincID(fi))
                {
                    continue;                   //Kann man aus Lookup-Tabelle holen
                }
                if (!w.IsPersistentField(fi))
                {
                    continue;                          //wirklich  nötig?
                }
                //DirectSync wird im Moment nicht unterstützt
                if (AttributeWorker.IsRowGuid(fi))
                {
                    continue;                               //Kann man als Lookup-Tabelle definieren
                }
                Object val = fi.GetValue(from);
                fi.SetValue(to, val);
            }
        }
Ejemplo n.º 2
0
        internal void Delete(ISerializableObject iso, ISerializerTransaction transaction)
        {
            if (!IsManaged(iso))
            {
                return;
            }



            AttributeWorker w = AttributeWorker.GetInstance(Target);


            ResolverData <ISerializableObject> data = new ResolverData <ISerializableObject>();

            data.FieldsToResolve = AttributeWorker.RetrieveAllFields(iso.GetType());
            data.HandledItem     = iso;

            DeleteHandler h = new DeleteHandler(this);
            RelationResolver <ISerializableObject> res = new RelationResolver <ISerializableObject>();

            res.Handler = h;


            h.MODE = DeleteHandler.DOWNMODE;
            res.StartRelationResolving(data);


            _objectPool.DeleteObject(iso, _connection, transaction);

            h.MODE = DeleteHandler.UPMODE;
            res.StartRelationResolving(data);
        }
Ejemplo n.º 3
0
        public void Activate(string target)
        {
            _target     = target;
            _connection = (DbConnection)CreateConnection();
            if (_connection.State == ConnectionState.Closed || _connection.State == ConnectionState.Broken)
            {
                try
                {
                    _connection.Close();
                }
                catch (Exception ex)
                {
                }
            }
            _connection.Open();

            //Initialisierung des AttributeWorkers ...
            AttributeWorker.GetInstance(Target);
            VirtualKeyFactory vkf = new VirtualKeyFactory(AttributeWorker.GetInstance(target));

            foreach (Type t in RegisteredTypes)
            {
                vkf.RegisterType(t);
            }

            AttributeWorker.GetInstance(Target).AddVirtualKeyFactory(this, vkf);

            _objectPool = new SortedSerializableObjectPool(this, _registeredTypes);
            ((SortedSerializableObjectPool)_objectPool).Cleaner = new DefaultCleaner();
        }
        public CsvPKey(Type type, String csvKey, String target)
        {
            _csvKey = csvKey;
            _type   = type;
            IDictionary <String, FieldInfo> ids = AttributeWorker.GetInstance(target).GetPrimaryKeyFields(type);

            String[] split = Split(_csvKey, ";", "/;");

            foreach (String s in split)
            {
                String[]  tmp = Split(s, "=", "/=");
                FieldInfo f   = ids[tmp[0]];

                tmp[1] = tmp[1].Replace("/;", ";");
                tmp[1] = tmp[1].Replace("/=", "=");
                tmp[1] = tmp[1].Replace("//", "/");

                Object val;
                if (f.FieldType.IsGenericType && f.FieldType.GetGenericTypeDefinition() == typeof(Nullable <>))
                {
                    Type t = Nullable.GetUnderlyingType(f.FieldType);
                    val = Convert.ChangeType(tmp[1], t, null);
                }
                else
                {
                    val = Convert.ChangeType(tmp[1], f.FieldType, null);
                }

                _fields.Add(f);
                _values.Add(val);
            }
        }
Ejemplo n.º 5
0
        public ISerializableObject CreateISerializableObject(Type type)
        {
            AttributeWorker w = AttributeWorker.GetInstance(Target);

            ISerializableObject iso = null;

            try
            {
                iso = (ISerializableObject)Activator.CreateInstance(type);
            }
            catch (InvalidCastException)
            {
                throw new SerializerException();
            }

            _objectPool.Register(iso);

            ResolverData <ISerializableObject> data = new ResolverData <ISerializableObject>();

            data.FieldsToResolve = AttributeWorker.RetrieveAllFields(iso.GetType());
            data.HandledItem     = iso;
            CreateHandler handler = new CreateHandler(this);
            RelationResolver <ISerializableObject> resolver = new RelationResolver <ISerializableObject>();

            resolver.Handler = handler;
            resolver.StartRelationResolving(data);

            return(iso);
        }
Ejemplo n.º 6
0
        internal virtual String Delete(ISerializableObject iso)
        {
            AttributeWorker w   = AttributeWorker.GetInstance(Target);
            StringBuilder   sql = new StringBuilder();

            sql.Append("DELETE FROM ").Append(w.GetTableMapping(iso.GetType(), _praefix));
            sql.Append(" WHERE ");

            FieldInfo[] fis   = AttributeWorker.RetrieveAllFields(iso.GetType());
            bool        start = true;

            foreach (FieldInfo fi in fis)
            {
                if (w.IsID(fi))
                {
                    String col = w.GetColumnMapping(fi);
                    Object val = fi.GetValue(iso);

                    if (val == null)
                    {
                        throw new SerializerException("Not deletable ...");
                    }

                    if (!start)
                    {
                        sql.Append(" AND ");
                    }

                    start = false;
                    sql.Append(col).Append("=").Append(SqlUtil.SqlConvert(val));
                }
            }

            return(sql.ToString());
        }
Ejemplo n.º 7
0
        protected override void SynchronizeImpl()
        {
            ISerializableObject source = StateOwner.SourceObject;
            ISerializableObject sink   = StateOwner.SinkSerializer.CreateISerializableObject(StateOwner.SynchronizedType);

            CopyUtils.PlainCopy(StateOwner.SinkSerializer, KeyCarrier, sink, new FieldLock(source.GetType()), true);
            CopyUtils.PlainCopy(StateOwner.SinkSerializer, source, sink, new FieldLock(source.GetType()), false);

            StateOwner.SinkSerializer.Connector.InsertPlain(sink);
            StateOwner.SinkObject = sink;

            SyncItem si1 = StateOwner.SyncSerializer.CreateISerializableObject <SyncItem>();
            SyncItem si2 = StateOwner.SyncSerializer.CreateISerializableObject <SyncItem>();

            si1.SyncGuid = AttributeWorker.RowGuid(source);
            si2.SyncGuid = AttributeWorker.RowGuid(sink);
            si1.ClassID  = source.GetType().Name;
            si2.ClassID  = source.GetType().Name;

            si1.Hashcode = SyncContainer.ComputeHashCode(StateOwner.SourceSerializer.Target, source);
            si2.Hashcode = SyncContainer.ComputeHashCode(StateOwner.SinkSerializer.Target, sink);

            si1.CounterPart = si2;

            StateOwner.SyncSerializer.Connector.Save(si1);
            StateOwner.SyncSerializer.ConnectOneToOne(si1, si2);
            StateOwner.SyncSerializer.Connector.Save(si2);
            StateOwner.SyncSerializer.ConnectOneToOne(si2, si1);
            StateOwner.SyncSerializer.Connector.Save(si1);

            StateOwner.UpdateFieldStates(StateOwner.SourceSerializer.Target, si1, source);//Deaktiviert
            StateOwner.UpdateFieldStates(StateOwner.SinkSerializer.Target, si2, sink);
        }
        public bool analyzeObjects()
        {
            if (object1.Rowguid != object2.Rowguid)
            {
                throw new Exception("Objects don´t correspond.");
            }
            bool inConflict = false;

            FieldInfo[] fields = AttributeWorker.RetrieveAllFields(ownerType);
            foreach (FieldInfo fi in fields)
            {
                Attribute   at = Attribute.GetCustomAttribute(fi, typeof(ColumnAttribute));
                IDAttribute id = (IDAttribute)Attribute.GetCustomAttribute(fi, typeof(IDAttribute));
                if (at != null)
                {
                    if (id != null && id.Autoinc == true)
                    {
                    }
                    else
                    {
                        Conflict cf = compareFields(fi, object1, object2);
                        if (cf != null)
                        {
                            inConflict = true;
                            this.conflicts.Add(cf);
                        }
                    }
                }
            }
            return(inConflict);
        }
Ejemplo n.º 9
0
        public UpdateStates UpdateObject(ISerializableObject iso, DbConnection connection, ISerializerTransaction transaction)
        {
            UpdateStates    state = UpdateStates.UPDATED;
            AttributeWorker w     = AttributeWorker.GetInstance(Target);
            DbCommand       com   = connection.CreateCommand();
            Guid            g     = AttributeWorker.RowGuid(iso);
            GenericWeakReference <ISerializableObject> tmp;

            try
            {
                tmp = _persistentObjects[g];
            }
            catch (KeyNotFoundException ex)
            {
                throw new UpdateException("update failed. object is not known by the system and must be loaded first", ex);
            }
            com.CommandText = _owner.SerializeUpdate(iso, ref state, tmp);
            transaction.Guard(com);
            //Console.WriteLine(com.CommandText);
            try
            {
                if (com.ExecuteNonQuery() < 1)
                {
                    state = UpdateStates.NO_ROWS_AFFECTED;
                    return(state);
                }
                return(state);
            }
            catch (Exception ex)
            {
                throw new SerializerException("update failed", ex);
            }
        }
Ejemplo n.º 10
0
        internal bool Exists(String column, Object value, String table, ISerializerTransaction transaction)
        {
            AttributeWorker w = AttributeWorker.GetInstance(Target);
            StringBuilder   b = new StringBuilder();

            b.Append("SELECT ").Append(column).Append(" FROM ").Append(table).Append(" WHERE ").Append(column).Append("=");
            b.Append(SqlUtil.SqlConvert(value));

            DbCommand com = _connection.CreateCommand();

            transaction.Guard(com);
            com.CommandText = b.ToString();
            //Console.WriteLine(com.CommandText);


            DbDataReader r = com.ExecuteReader();

            if (r.Read())
            {
                r.Close();
                return(true);
            }
            r.Close();
            return(false);
        }
        public CsvPimaryKey(ISerializableObject iso, String target)
        {
            _type = iso.GetType();

            IDictionary <String, FieldInfo> ids = AttributeWorker.GetInstance(target).GetPrimaryKeyFields(iso.GetType());

            List <String> tmpList = new List <String>(ids.Count);
            StringBuilder csvKey  = new StringBuilder();
            String        tmp;

            foreach (String id in ids.Keys)
            {
                StringBuilder tmpBuilder = new StringBuilder();

                _fields.Add(ids[id]);
                _values.Add(ids[id].GetValue(iso));

                try
                {
                    //if (ids[id].GetValue(iso) is DateTime)
                    //{
                    //    DateTime dt = (DateTime)ids[id].GetValue(iso);
                    //    tmp = SqlUtil.SqlConvert(dt);
                    //}
                    //else
                    //    tmp = ids[id].GetValue(iso).ToString();
                    tmp = SqlUtil.SqlConvert(ids[id].GetValue(iso)).ToString();
                }
                catch (NullReferenceException ex)
                {
                    throw new KeyNotFoundException("", ex);
                }

                //Maskierung der Kommata
                tmp = tmp.Replace("/", "//");
                tmp = tmp.Replace(";", "/;");
                tmp = tmp.Replace("=", "/=");

                tmpBuilder.Append(id).Append("=");
                tmpBuilder.Append(tmp);
                tmpList.Add(tmpBuilder.ToString());
            }

            tmpList.Sort();

            bool initial = true;

            foreach (String s in tmpList)
            {
                if (!initial)
                {
                    csvKey.Append(";");
                }
                initial = false;
                csvKey.Append(s);
            }

            _csvKey = csvKey.ToString();
        }
Ejemplo n.º 12
0
        public override String ToSqlString(Serializer.Serializer serializer, Type type, String target)
        {
            AttributeWorker w = AttributeWorker.GetInstance(target);

            IList <Type> path = w.ComputeVirtualKeyPath(serializer, _type, type); //ComputePath(type, _type, target);

            return(ComputeSqlJoin(serializer, path, _sqlString, target).ToString());
        }
Ejemplo n.º 13
0
        internal void AdjustKeyDownward(ISerializableObject iso)
        {
            AttributeWorker w    = AttributeWorker.GetInstance(_sinkSerializer.Target);
            IVirtualKey     vKey = w.CreateVirtualKey(_sinkSerializer, _synchronizedType, iso.GetType());

            vKey.InitVirtualKeyBySource(FetchObject(_sinkSerializer, _sinkGuid));
            vKey.ApplyVirtualKeyToTarget(iso);
        }
        public override void UpdateOneToMany(Object iterator, ISerializableObject owner, Type storedType, Serializer serializer)
        {
            IVirtualKey vKey = AttributeWorker.GetInstance(serializer.Target).CreateVirtualKey(serializer, owner.GetType(), storedType);

            vKey.InitVirtualKeyBySource(owner);

            ((IDirectAccessIteratorConfiguration)iterator).Restriction = Restrictions.RestrictionFactory.SqlRestriction(storedType, vKey.ToSqlStringForward(serializer.Target));
        }
Ejemplo n.º 15
0
 internal void AddISerializableObject(ISerializableObject iso)
 {
     if (!_pooledObjects.ContainsKey(AttributeWorker.RowGuid(iso)))
     {
         SyncContainer container = new SyncContainer(iso, _syncSerializer, _serializer);
         _pooledObjects[AttributeWorker.RowGuid(iso)] = container;
     }
 }
Ejemplo n.º 16
0
        internal virtual String SerializeInsert(ISerializableObject iso, string table)
        {
            AttributeWorker w      = AttributeWorker.GetInstance(Target);
            StringBuilder   sql    = new StringBuilder();
            StringBuilder   values = new StringBuilder();

            sql.Append("INSERT INTO ").Append(table);
            sql.Append(" (");

            FieldInfo[] fis = AttributeWorker.RetrieveAllFields(iso.GetType());

            bool start = true;

            foreach (FieldInfo fi in fis)
            {
                if (w.IsAutoincID(fi))
                {
                    continue;
                }

                try
                {
                    String col = w.GetColumnMapping(fi);
                    Object val = fi.GetValue(iso);



                    if (val == null && (w.IsID(fi) && !w.IsAutoincID(fi)))
                    {
                        throw new SerializerException("PRIMARY KEY FIELD NOT SET!!!!!!!!");
                    }

                    if (!start)
                    {
                        sql.Append(", ");
                        values.Append(", ");
                    }
                    else
                    {
                        start = false;
                    }

                    sql.Append(col);
                    values.Append(SqlUtil.SqlConvert(val));
                }
                catch (SerializerException) { }
            }

            sql.Append(") VALUES (");

            sql.Append(values);

            sql.Append(")");

            return(sql.ToString());
        }
Ejemplo n.º 17
0
        protected StringBuilder ComputeSqlJoin(Serializer.Serializer serializer, IList <Type> path, String restriction, String target)
        {
            AttributeWorker w = AttributeWorker.GetInstance(target);

            QueryGenerator ret = new QueryGenerator();

            ret.AddQueryComponent(new PlaceHolderComponent());

            //StringBuilder b = new StringBuilder();
            //b.Append(" @@@");

            for (int i = 0; i < path.Count - 1; i++)
            {
                Type from = path[i];
                Type to   = path[i + 1];
                //if (i > 0)
                //{
                //    b.Replace(" @@@", " WHERE  @@@");
                //}

                IVirtualKey    vKey = w.CreateVirtualKey(serializer, from, to);
                QueryGenerator gen1 = vKey.ToSqlRestriction(target, from, to, serializer);
                ret.ReplacePlaceHolders(gen1);
                //b.Replace(" @@@", vKey.ToSqlRestriction(target, from, to));

                if (i == path.Count - 2)
                {
                    QueryGenerator gen2 = new QueryGenerator();
                    gen2.AddQueryComponent(new SqlStringComponent(" WHERE "));
                    gen2.AddQueryComponent(new SqlStringComponent(restriction));
                    ret.ReplacePlaceHolders(gen2);

                    //b.Replace(" @@@", " WHERE  @@@");
                    //b.Replace(" @@@", restriction);
                }
            }

            if (path.Count == 1)
            {
                QueryGenerator gen3 = new QueryGenerator();
                gen3.AddQueryComponent(new SqlStringComponent(" WHERE "));
                gen3.AddQueryComponent(new SqlStringComponent(restriction));
                ret.ReplacePlaceHolders(gen3);

                //b.Replace(" @@@", " WHERE  @@@");
                //b.Replace(" @@@", restriction);
            }


            //Entferne das führende " WHERE "

            return(ret.ToSqlString());

            //return b.Remove(0,7);
        }
Ejemplo n.º 18
0
 public bool IsManagedObject(ISerializableObject iso)
 {
     try
     {
         return(_persistentObjects[AttributeWorker.RowGuid(iso)].Target != null);
     }
     catch (KeyNotFoundException)
     {
         return(false);
     }
 }
Ejemplo n.º 19
0
        public void InsertObject(ISerializableObject iso, DbConnection connection, ISerializerTransaction transaction)
        {
            AttributeWorker w   = AttributeWorker.GetInstance(Target);
            DbCommand       com = connection.CreateCommand();

            com.CommandText = _owner.SerializeInsert(iso);
            transaction.Guard(com);
            //Console.WriteLine(com.CommandText);
            try
            {
                //Console.WriteLine(com.ExecuteNonQuery());
                com.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new SerializerException("insert failed", ex);
            }



            FieldInfo autoincField;
            Guid      g = AttributeWorker.RowGuid(iso);

            if ((autoincField = w.GetAutoincField(iso.GetType())) != null)
            {
                StringBuilder b = new StringBuilder();

                b.Append("SELECT * FROM ").Append(w.GetTableMapping(iso.GetType(), _owner.Praefix)).Append(" WHERE ");
                b.Append(w.GetColumnMapping(AttributeWorker.RowGuid(iso.GetType()))).Append("='");
                b.Append(g.ToString()).Append("'");

                com.CommandText = b.ToString();
                DbDataReader r = com.ExecuteReader();

                if (r.Read())
                {
                    Object o = r[w.GetColumnMapping(w.GetAutoincField(iso.GetType()))];
                    autoincField.SetValue(iso, o);
                }
                else
                {
                    r.Close();
                    throw new SerializerException("Insert core method failed! error unknown...");
                }

                r.Close();
            }


            GenericWeakReference <ISerializableObject> tmp = new GenericWeakReference <ISerializableObject>(iso);

            _persistentObjects[g] = tmp;
            MemoriseKeys(iso, w, tmp);
        }
Ejemplo n.º 20
0
        public void RegisterType(Type t)
        {
            FieldInfo f = AttributeWorker.RowGuid(t);

            if (f == null)
            {
                throw new TypeDefException("Type " + t + " has no row guid column!");
            }

            _registeredTypes.Add(t);
        }
Ejemplo n.º 21
0
        private ISerializableObject FetchObject(Serializer s, Guid guid)
        {
            FieldInfo     fi  = AttributeWorker.RowGuid(_synchronizedType);
            String        col = AttributeWorker.GetInstance(s.Target).GetColumnMapping(fi);
            StringBuilder tmp = new StringBuilder();

            tmp.Append(col).Append("='").Append(guid).Append("'");;
            IRestriction        res = RestrictionFactory.SqlRestriction(_synchronizedType, tmp.ToString());
            ISerializableObject iso = s.Connector.Load(_synchronizedType, res);

            return(iso);
        }
        //public IDirectAccessIterator<IdentificationUnit> Identification
        //{
        //    get { return _IdentificationUnits; }
        //}

        //public IDirectAccessIterator<CollTaxonomicGroup_Enum> CollTaxonomicGroups
        //{
        //    get { return _CollTaxonomicGroups; }
        //}

        //public CollTaxonomicGroup_Enum CollTaxonomicGroup
        //{
        //    get { return _CollTaxonomicGroup; }
        //}

        #endregion



        #region ToString override

        public override string ToString()
        {
            if (this.DisplayText != null)
            {
                String text = "CollTaxonomicGroup: " + this.DisplayText;
                return(text);
            }
            else
            {
                return(AttributeWorker.ToStringHelper(this, 30));
            }
        }
        //public IDirectAccessIterator<IdentificationUnit> IdentificationUnits
        //{
        //    get { return _IdentificationUnits; }
        //}

        #endregion

        #region ToString Override

        public override string ToString()
        {
            if (this.DisplayText != null)
            {
                String text = "CollUnitRelationType: " + this.DisplayText;
                return(text);
            }
            else
            {
                return(AttributeWorker.ToStringHelper(this, 30));
            }
        }
Ejemplo n.º 24
0
        //public IDirectAccessIterator<CollectionEventLocalisation> CollectionEventLocalisation
        //{
        //    get { return _CollectionEventLocalisations; }
        //}
        //public IDirectAccessIterator<LocalisationSystem> LocalisationSystemChildren
        //{
        //    get { return _LocalisationSystemChildren; }
        //}
        //public LocalisationSystem LocalisationSystemParent
        //{
        //    get { return _LocalisationSystemParent; }
        //    set { _LocalisationSystemParent = value; }
        //}

        #endregion

        #region ToString override

        public override string ToString()
        {
            if (this.DisplayText != null)
            {
                String text = "LocalisationSystem: " + this.DisplayText;
                return(text);
            }
            else
            {
                return(AttributeWorker.ToStringHelper(this, 30));
            }
        }
        //public IDirectAccessIterator<Identification> Identifications
        //{
        //    get { return _Identifications; }
        //}

        #endregion

        #region ToString Override

        public override string ToString()
        {
            if (this.DisplayText != null)
            {
                String text = "CollIdentificationCategory " + this.DisplayText;
                return(text);
            }
            else
            {
                return(AttributeWorker.ToStringHelper(this, 30));
            }
        }
Ejemplo n.º 26
0
 public override string ToString()
 {
     if (this._TaxonNameCache != null)
     {
         String text = "TaxonNames: " + this._TaxonNameCache;
         return(text);
     }
     else
     {
         return(AttributeWorker.ToStringHelper(this, 30));
     }
 }
 public override string ToString()
 {
     if (this._Name != null)
     {
         String text = "SamplingPlot: " + this._Name;
         return(text);
     }
     else
     {
         return(AttributeWorker.ToStringHelper(this, 30));
     }
 }
Ejemplo n.º 28
0
        //public IDirectAccessIterator<AnalysisTaxonomicGroup> AnalysisTaxonomicGroup
        //{
        //    get { return _analysisTaxonomicGroups; }
        //}
        //public IDirectAccessIterator<Analysis> AnalysisChildren
        //{
        //    get { return _Analysis; }
        //}
        //public IDirectAccessIterator<AnalysisResult> AnalysisResults
        //{
        //    get { return _AnalysisResults; }
        //}
        //public IDirectAccessIterator<IdentificationUnitAnalysis> IdentificationUnitAnalysis
        //{
        //    get { return _IdentificationUnitAnalysis; }

        //}
        //public Analysis AnalysisParent
        //{
        //    get { return _analysisParent; }
        //    set { _analysisParent = value; }
        //}

        #endregion

        #region ToString override

        public override string ToString()
        {
            if (this.DisplayText != null)
            {
                String text = "Analysis: " + this.DisplayText;
                return(text);
            }
            else
            {
                return(AttributeWorker.ToStringHelper(this, 30));
            }
        }
Ejemplo n.º 29
0
        private static void MemoriseKeys(ISerializableObject iso, AttributeWorker w, GenericWeakReference <ISerializableObject> gwr)
        {
            IDictionary <String, FieldInfo> pkf = w.GetPrimaryKeyFields(iso.GetType());

            foreach (FieldInfo fi in pkf.Values)
            {
                if (w.IsAutoincID(fi))
                {
                    continue;
                }
                gwr.Properties[fi.Name] = fi.GetValue(iso);
            }
        }
Ejemplo n.º 30
0
        //Konstruktor
        internal SyncContainer(ISerializableObject iso, Serializer syncSerializer, Serializer sourceSerializer)
        {
            SyncState = new PrematureState(this);

            _synchronizedType = iso.GetType();
            _sourceGuid       = AttributeWorker.RowGuid(iso);

            _syncSerializer   = syncSerializer;
            _sourceSerializer = sourceSerializer;

            _parents  = new List <SyncContainer>();
            _children = new List <SyncContainer>();
        }
        private static void MemoriseKeys(ISerializableObject iso, AttributeWorker w, GenericWeakReference<ISerializableObject> gwr)
        {
            IDictionary<String, FieldInfo> pkf = w.GetPrimaryKeyFields(iso.GetType());

            foreach (FieldInfo fi in pkf.Values)
            {
                if (w.IsAutoincID(fi)) continue;
                gwr.Properties[fi.Name] = fi.GetValue(iso);
            }
        }