Пример #1
0
 public void ResolveReferences(SheetDefinition sheetDef)
 {
     if (Converter != null)
     {
         Converter.ResolveReferences(sheetDef);
     }
 }
Пример #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;
 }
Пример #4
0
        public bool TryGetSheet(string name, out SheetDefinition def)
        {
            if (_IsCompiled)
            {
                return(_SheetMap.TryGetValue(name, out def));
            }

            return(_SheetDefinitionMap.TryGetValue(name, out def));
        }
Пример #5
0
        public SheetUpdater(IRelationalSheet prevSheet,
                            SheetDefinition prevDefinition,
                            IRelationalSheet upSheet,
                            SheetDefinition upDefinition)
        {
            _PreviousSheet = prevSheet;
            _PreviousDefinition = prevDefinition;

            _UpdatedSheet = upSheet;
            _UpdatedDefinition = upDefinition;
        }
Пример #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);
 }
Пример #7
0
        public SheetDefinition GetOrCreateSheet(string name)
        {
            SheetDefinition def;

            if (!TryGetSheet(name, out def))
            {
                SheetDefinitions.Add(def = new SheetDefinition {
                    Name = name
                });
            }
            return(def);
        }
Пример #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);
        }
Пример #11
0
 public void ResolveReferences(SheetDefinition sheetDef)
 {
     InnerDefinition.ResolveReferences(sheetDef);
 }
 public void ResolveReferences(SheetDefinition sheetDef)
 {
     RepeatedDefinition.ResolveReferences(sheetDef);
 }
Пример #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)))
     });
 }