Exemple #1
0
        public void ToObjectTest()
        {
            var sharpObject = SharpObject.Copy(new { test1 = 1, test2 = "test", test3 = true });
            var obj         = sharpObject.ToObject <TestObject>();

            Assert.AreEqual(obj.Test1, 1);
        }
Exemple #2
0
        public List <SharpObject> GetColumnMapping(string path)
        {
            SharpNodeMap result;

            if (!_mapSets.TryGetValue(path, out result))
            {
                return(new List <SharpObject>());
            }

            return(result.Columns.Select(x => SharpObject.Copy(new
            {
                x.FieldName,
                x.Width,
                x.Offset,
            })).ToList());
        }
Exemple #3
0
 public static SharpObject AsSharpObject(this object obj)
 {
     return(SharpObject.Copy(obj).Clone());
 }
Exemple #4
0
 public SharpObjectPathSet(string path, IEnumerable <object> values)
 {
     Path   = path;
     Values = values.Select(x => SharpObject.Copy(x));
 }
Exemple #5
0
 public SharpObjectPath(string path, object value)
 {
     Path  = path;
     Value = SharpObject.Copy(value);
 }