Exemplo n.º 1
0
        public static bool GetData(StyleQuery importLine)
        {
            string[] path   = importLine.left.Split(new[] { '.', ':' }, StringSplitOptions.RemoveEmptyEntries);
            string   form   = path[0];
            Form     target = Application.OpenForms.Cast <Form>().FirstOrDefault(x => x.Name == form);

            if (target == null)
            {
                return(false);
            }

            string control = path[1];
            Dictionary <string, Func <Form, decimal> > keywords = FormKeywords;

            if (control == "screen")
            {
                control  = path[2];
                keywords = ScreenKeywords;
            }

            return(ComparisonTypes[importLine.comparisonType](
                       keywords[control](target),
                       decimal.Parse(importLine.right)
                       ));
        }
Exemplo n.º 2
0
        public StyleScriptImportDataObject(string statement, string rootDir)
        {
            string[] parts = statement.Split('(', ')');
            string[] files;
            if (parts.Length == 3)
            {
                ImportCondition = new StyleQuery(parts[1]);
                files           = parts.Skip(2).ToArray();
            }
            else
            {
                ImportCondition = null;
                files           = parts;
            }

            ImportFiles = files.Select(
                x =>
            {
                string path = Path.Combine(rootDir, x.Trim());
                return(StyleScriptParser.Parse(File.ReadAllText(path), rootDir));
            }
                ).ToArray();
        }