private static IEnumerable <int> GetLocalPrintTemplates(CollectorSerializerRoot serializerRoot, string definition)
        {
            serializerRoot.ClearElements();
            serializerRoot.Container <RootContainer>().Deserialize(definition);

            return(serializerRoot.GetElements <ModifyDay>()
                   .Where(c => c.SignNumber.HasValue)
                   .Select(c => c.SignNumber.Value)
                   .Distinct());
        }
Beispiel #2
0
        private static IEnumerable <(string Name, VariableType Type)> GetLocalVariables(CollectorSerializerRoot serializerRoot, string definition)
        {
            serializerRoot.ClearElements();
            serializerRoot.Container <RootContainer>().Deserialize(definition);

            var result = serializerRoot.GetElements <IHavingVariables>();

            var localVariables = new List <(string Name, VariableType Type)>();

            foreach (var r in result)
            {
                localVariables.AddRange(r.GetVariableNames());
            }

            //получили все переменные в этом Правиле
            return(localVariables.Distinct());
        }