Beispiel #1
0
 public Peer(TestRunWithConfiguration tc, RegistrationId registrationId, string name)
 {
     _tc            = tc;
     _name          = name;
     RegistrationId = registrationId;
     VectorValues   = RegistrationIdDistance.GetVectorValues(_tc.CryptoLibrary, registrationId, _tc.NumberOfDimensions).Select(x => (float)x).ToArray();
 }
Beispiel #2
0
            public TestRunWithConfiguration Clone()
            {
                var dest        = new TestRunWithConfiguration();
                var sourceProps = GetType().GetProperties().Where(x => x.CanRead).ToList();
                var destProps   = GetType().GetProperties().Where(x => x.CanWrite).ToList();

                foreach (var sourceProp in sourceProps)
                {
                    if (destProps.Any(x => x.Name == sourceProp.Name))
                    {
                        var p = destProps.First(x => x.Name == sourceProp.Name);
                        if (p.CanWrite)
                        { // check if the property can be set or no.
                            p.SetValue(dest, sourceProp.GetValue(this, null), null);
                        }
                    }
                }
                return(dest);
            }