Example #1
0
 public void Generate(string targetFileName, GenericGenerator generator)
 {
     using (XmlTextReader reader = new XmlTextReader(mSourceFileName))
     {
         using (StreamWriter writer = new StreamWriter(targetFileName))
         {
             Generate(reader, writer, generator);
         }
     }
 }
Example #2
0
 static void Main(string[] args)
 {
     RISMappingGenerator generator1 = new RISMappingGenerator();
     generator1.Generate();
     GenericGenerator [] generators = new GenericGenerator[2];
     generators[0] = new RISObjectsGenerator();
     generators[1] = new DICOMObjectsGenerator();
     foreach(GenericGenerator generator in generators)
     {
         generator.Generate();
     }
 }
Example #3
0
    protected void btCreate_Click(object sender, EventArgs e)
    {
        var connection = ConfigurationHelper.Create(cmbConnections.SelectedValue);

        var generator = new GenericGenerator(connection);

        foreach (ListItem item in list.Items)
        {
            if (item.Selected)
            {
                generator.CreateSchemaTable(item.Value);
            }
        }

        LoadListAdvanced(true);

        lblStatus.InnerText = "Schema created!";
    }
Example #4
0
 public void Generate(XmlTextReader reader, TextWriter writer, GenericGenerator generator)
 {
     ProtocolData result = new ProtocolData();
     Parse(reader, result);
     generator.Write(result, writer);
 }
        public void TestGeneration()
        {
            string input = @"
            func: 'a1: ' + {1}; + '--
            a2: ' + {2}

            baseheight: 40

            type: td
            height: {baseheight}px
            width: 60px

            type: tr
            color: white

            class: container
            background: yellow
            height: ({baseheight} + 20)px

            style: funcStyle
            2: func:(a3|a4)

            style: simple
            color: pink
            ";

            string template = @"
            dummy: 1

            OutputItems: COMP:(COUNT:({{1}})|0|''|SUM:OVER:({{1}}|x|{2}{x} + ' {' + SUM:OVER:({{1}={x}.ALL.NAME}|y|' --
            ' + COMP:({y}|INT:({y})|''|{y}  + ': ') + {{1}={x}.{y}} + ';') + '--
            } --
            ' + '--
            '))

            Output: OutputItems:(type|'') + OutputItems:(class|'.') + OutputItems:(style|'#')";

            string expected = @"td {
            height: 40px;
            width: 60px;
            }

            tr {
            color: white;
            }

            .container {
            background: yellow;
            height: 60px;
            }

            #funcStyle {
            a1: a3;
            a2: a4;
            }

            #simple {
    color: pink;
}

".Replace("\n", "\r").Replace("\r\r", "\n").Replace("\r", "\n"); // Something odd when creating expected so using this to regularise.

            GenericGenerator generator = new GenericGenerator();
            string generated = generator.Generate(input, template).Replace("\r", "");
            string soFar = "";
            //Assert.AreEqual(expected, generated);
            for (int i = 0; i < expected.Length; ++i)
            {
                char e = expected[i];
                char g = generated[i];
Example #6
0
    private void LoadListAdvanced(bool checkStatus)
    {
        list.Items.Clear();

        var connection = ConfigurationHelper.Create(cmbConnections.SelectedValue);

        if (connection != null)
        {
            var generator = new GenericGenerator(connection);

            foreach (string section in generator.GetSchemaCategories())
            {
                ListItem item = new ListItem();
                item.Text = section.ToString();
                if (checkStatus)
                    item.Text += " - " + generator.GetStatus(section).ToString();
                item.Value = section;

                list.Items.Add(item);
            }
        }
    }