Esempio n. 1
0
        //**********************************************************************************
        public override void xaml(StreamWriter w, Size pSize)
        {
            //******************************************************************************
            // Note: There is a significant difference between WPF and Form for labels.
            //       Need to adjust font settings for label text to show up...
            //******************************************************************************
            fontfamily = "Microsoft Sans Serif";
            fontsize   = "7.8";
            string o = "\t\t<Label ";

            //******************************************************************************
            // Write base XAML attributes and margins...
            //******************************************************************************
            o += xamlAttributes();
            o += margins(pSize);
            o += ">";
            //******************************************************************************
            // Add any text
            //******************************************************************************
            o += XAML.encodeText(text);
            o += "</Label>";
            //******************************************************************************
            // Close out control and write the line...
            //******************************************************************************
            w.WriteLine(o);
        }
Esempio n. 2
0
        //**********************************************************************************
        private void create_WPF_Project()
        {
            XmlTextWriter w = new XmlTextWriter(destination_project.FullName,
                                                Encoding.UTF8);
            XmlDocument d = new XmlDocument();
            int         i = 1;

            foreach (Project p in projects)
            {
                output("Create project: " + i++);
                //**************************************************************************
                // Parse the designer files - builds form object module...
                //**************************************************************************
                foreach (cForm f in p.forms)
                {
                    createForm(f);
                    string filename = destination_project.DirectoryName + "\\" +
                                      Project.formFile(f.definition_file, ".xaml");
                    XAML.output(f, filename);
                    Conversion.convertFormFile(f, source_project, destination_project);
                    p.ns = f.sNameSpace;
                }
                //**************************************************************************
                Conversion.convertConfiguration(p);
                XmlNode n = addNode(d, p);
                d.AppendChild(n);
                copyProjectfiles(p);
            }
            w.Formatting = Formatting.Indented;
            w.WriteStartDocument();
            d.Save(w);
            w.Close();
        }
Esempio n. 3
0
        //**********************************************************************************
        public override void xaml(StreamWriter w, Size pSize)
        {
            string o = "\t\t<ListBox ";

            //******************************************************************************
            // Write base XAML attributes and margins...
            //******************************************************************************
            o += xamlAttributes();
            o += margins(pSize);
            //******************************************************************************
            // Write specific control settings...
            //******************************************************************************
            if (selectionMode != String.Empty)
            {
                o += "SelectionMode=\"" + selectionMode + "\" ";
            }
            if (selectedindexchangedEvent != String.Empty)
            {
                o += "SelectionChanged=\"" + selectedindexchangedEvent + "\" ";
            }
            //******************************************************************************
            // Control contains child items - if there are none just close
            //******************************************************************************
            if (items.Count == 0)
            {
                o += "/>";
            }
            else
            {
                o += ">\n";     // terminate XML statement
                //**************************************************************************
                // Add child items
                //**************************************************************************
                foreach (string item in items)
                {
                    o += "\t\t\t<ListBoxItem>";
                    o += XAML.encodeText(item);
                    o += "</ListBoxItem>";
                    o += "\n";
                }
                //**************************************************************************
                // Close control
                //**************************************************************************
                o += "\t\t</ListBox>";
            }
            //******************************************************************************
            w.WriteLine(o);
        }
Esempio n. 4
0
        //**********************************************************************************
        public override void xaml(StreamWriter w, Size pSize)
        {
            string o = "\t\t<TextBox ";

            //******************************************************************************
            // Write base XAML attributes and margins...
            //******************************************************************************
            o += xamlAttributes();
            o += margins(pSize);
            //******************************************************************************
            // Write specific control settings...
            //******************************************************************************
            if (IsReadOnly)
            {
                o += "IsReadOnly=\"True\" ";
            }
            if (AcceptsReturn)
            {
                o += "AcceptsReturn=\"True\" ";
            }
            if (WordWrap)
            {
                o += "TextWrapping=\"Wrap\" ";
            }

            if (RighttoLeft)
            {
                o += "FlowDirection=\"RightToLeft\" ";
            }

            if (CharacterCasing != String.Empty)
            {
                o += "CharacterCasing=\"" + CharacterCasing + "\" ";
            }

            o += ">";
            //******************************************************************************
            // Add any text
            //******************************************************************************
            o += XAML.encodeText(text);
            //******************************************************************************
            // Close out control and write the line...
            //******************************************************************************
            o += "</TextBox>";
            w.WriteLine(o);
        }
Esempio n. 5
0
        //**********************************************************************************
        public override void xaml(StreamWriter w, Size pSize)
        {
            string o = "\t\t<Button ";

            //******************************************************************************
            // Write base XAML attributes and margins...
            //******************************************************************************
            o += xamlAttributes();
            o += margins(pSize);
            o += ">";
            //******************************************************************************
            // Add any text
            //******************************************************************************
            o += XAML.encodeText(text);
            //******************************************************************************
            // Close out control and write the line...
            //******************************************************************************
            o += "</Button>";
            w.WriteLine(o);
        }
Esempio n. 6
0
        //**********************************************************************************
        public override void xaml(StreamWriter w, Size pSize)
        {
            string o = "\t\t<CheckBox ";

            //******************************************************************************
            // Write base XAML attributes and margins...
            //******************************************************************************
            o += xamlAttributes();
            o += margins(pSize);
            //******************************************************************************
            // Write specific control settings...
            //******************************************************************************
            if (IsChecked)
            {
                o += "IsChecked=\"True\" ";
            }
            if (IsThreeState)
            {
                o += "IsThreeState=\"True\" ";
            }

            if (checkEvent != String.Empty)
            {
                o += "Checked=\"" + checkEvent + "\" ";
            }
            o += ">";
            //******************************************************************************
            // Add any text
            //******************************************************************************
            o += XAML.encodeText(text);
            //******************************************************************************
            // Close out control and write the line...
            //******************************************************************************
            o += "</CheckBox>";
            w.WriteLine(o);
        }