Ejemplo n.º 1
0
 public void ResolveReferences(SheetDefinition sheetDef)
 {
     if (Converter != null)
     {
         Converter.ResolveReferences(sheetDef);
     }
 }
Ejemplo n.º 2
0
 public void ResolveReferences(SheetDefinition sheetDef)
 {
     foreach (IDataDefinition member in _Members)
     {
         member.ResolveReferences(sheetDef);
     }
 }
 public SheetDefinition GetOrCreateSheet(string name)
 {
     SheetDefinition def;
     if (!TryGetSheet(name, out def))
         SheetDefinitions.Add(def = new SheetDefinition {
             Name = name
         });
     return def;
 }
Ejemplo n.º 4
0
        public bool TryGetSheet(string name, out SheetDefinition def)
        {
            if (_IsCompiled)
            {
                return(_SheetMap.TryGetValue(name, out def));
            }

            return(_SheetDefinitionMap.TryGetValue(name, out def));
        }
Ejemplo n.º 5
0
        public SheetUpdater(IRelationalSheet prevSheet,
                            SheetDefinition prevDefinition,
                            IRelationalSheet upSheet,
                            SheetDefinition upDefinition)
        {
            _PreviousSheet = prevSheet;
            _PreviousDefinition = prevDefinition;

            _UpdatedSheet = upSheet;
            _UpdatedDefinition = upDefinition;
        }
Ejemplo n.º 6
0
 public SheetDefinition GetOrCreateSheet(string name)
 {
     if (!TryGetSheet(name, out SheetDefinition def))
     {
         def = new SheetDefinition {
             Name = name
         };
         _SheetDefinitions.Add(def);
         _SheetDefinitionMap[name] = def;
     }
     return(def);
 }
Ejemplo n.º 7
0
        public SheetDefinition GetOrCreateSheet(string name)
        {
            SheetDefinition def;

            if (!TryGetSheet(name, out def))
            {
                SheetDefinitions.Add(def = new SheetDefinition {
                    Name = name
                });
            }
            return(def);
        }
Ejemplo n.º 8
0
        public bool TryGetSheet(string name, out SheetDefinition def)
        {
            if (_IsCompiled)
            {
                return(_SheetMap.TryGetValue(name, out def));
            }

            var res =
                SheetDefinitions.Where(_ => string.Equals(_.Name, name)).ToArray();

            def = res.Any() ? res.First() : null;

            return(def != null);
        }
        public static SheetDefinition FromJson(JToken obj)
        {
            SheetDefinition sheetDef = new SheetDefinition()
            {
                Name                     = (string)obj["sheet"],
                DefaultColumn            = (string)obj["defaultColumn"],
                IsGenericReferenceTarget = (bool?)obj["isGenericReferenceTarget"] ?? false,
                DataDefinitions          = new List <PositionedDataDefintion>(obj["definitions"].Select(j => PositionedDataDefintion.FromJson(j)))
            };

            foreach (PositionedDataDefintion dataDef in sheetDef.DataDefinitions)
            {
                dataDef.ResolveReferences(sheetDef);
            }

            return(sheetDef);
        }
        public bool TryGetSheet(string name, out SheetDefinition def)
        {
            if (_IsCompiled)
                return _SheetMap.TryGetValue(name, out def);

            var res =
                SheetDefinitions.Where(_ => string.Equals(_.Name, name)).ToArray();
            def = res.Any() ? res.First() : null;

            return (def != null);
        }
Ejemplo n.º 11
0
 public void ResolveReferences(SheetDefinition sheetDef)
 {
     InnerDefinition.ResolveReferences(sheetDef);
 }
Ejemplo n.º 12
0
 public void ResolveReferences(SheetDefinition sheetDef)
 {
     RepeatedDefinition.ResolveReferences(sheetDef);
 }
Ejemplo n.º 13
0
 public static RelationDefinition FromJson(JToken obj)
 {
     return(new RelationDefinition()
     {
         Version = (string)obj["version"],
         SheetDefinitions = new List <SheetDefinition>(obj["sheets"].Select(j => SheetDefinition.FromJson(j)))
     });
 }