Exemple #1
0
        public frmProjIDE(AVRProject myProject, EnviroSettings mySettings)
        {
            this.myProject  = myProject;
            this.mySettings = mySettings;

            InitializeComponent();

            myBuilder           = new ProjectBuilder(myProject, txtOutputMsg, listErrWarn);
            myBuilder.DoneWork += new ProjectBuilder.EventHandler(myBuilder_DoneWork);

            myBurner = new ProjectBurner(myProject);

            serialPortControlPanel = new SerialPortPanel("com0", 9600);
            tabSerialPort.Controls.Add(serialPortControlPanel);
            serialPortControlPanel.SerialPortException += new SerialPortPanel.SerialPortErrorHandler(serialPortControlPanel_SerialPortException);

            myEditorTabsPanel = new EditorTabsPanel(myProject, mySettings);
            splitFileTreeEditorTabs.Panel2.Controls.Add(myEditorTabsPanel);

            try
            {
                helpToolStripMenuItem.DropDownItems.Add(MenuWebLink.GetMenuLinkRoot("Resources", "helplinks.xml"));
            }
            catch (Exception ex)
            {
                txtOutputMsg.Text += "Failed to Load Help->Resource Links\r\n" + ex.ToString();
            }

            FillRecentProjects();

            RefreshFileTree();
        }
Exemple #2
0
        public static ToolStripMenuItem GetMenuLinkRoot(string text)
        {
            ToolStripMenuItem item = new ToolStripMenuItem(text);

            item.Image = GraphicsResx.web;

            XmlDocument xDoc = new XmlDocument();

            if (File.Exists(SettingsManagement.AppDataPath + "helplinks.xml") == false)
            {
                try
                {
                    File.WriteAllText(SettingsManagement.AppDataPath + "helplinks.xml", Properties.Resources.helplinks);
                    xDoc.Load(SettingsManagement.AppDataPath + "helplinks.xml");
                }
                catch
                {
                    xDoc.LoadXml(Properties.Resources.helplinks);
                }
            }
            else
            {
                try
                {
                    xDoc.Load(SettingsManagement.AppDataPath + "helplinks.xml");
                }
                catch (XmlException ex)
                {
                    MessageBox.Show("Error while reading helplinks.xml: " + ex.Message);
                    return(item);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error while reading helplinks.xml: " + ex.Message);
                    return(item);
                }
            }

            try
            {
                XmlElement xDocEle = xDoc.DocumentElement;

                foreach (XmlElement xEle in xDocEle.ChildNodes)
                {
                    MenuWebLink link = new MenuWebLink(xEle.GetAttribute("Text"), xEle.GetAttribute("URL"));
                    link.Add(xEle);

                    item.DropDownItems.Add(link.MenuItem);
                }
            }
            catch (Exception ex)
            {
                ErrorReportWindow.Show(ex, "Error while creating help links");
            }

            return(item);
        }
Exemple #3
0
        public void Add(XmlElement xContainer)
        {
            foreach (XmlElement xEle in xContainer.ChildNodes)
            {
                MenuWebLink child = new MenuWebLink(xEle.GetAttribute("Text"), xEle.GetAttribute("URL"));

                children.Add(child);
                menuItem.DropDownItems.Add(child.MenuItem);

                child.Add(xEle);
            }
        }
        public void Add(XmlElement xContainer)
        {
            foreach (XmlElement xEle in xContainer.ChildNodes)
            {
                MenuWebLink child = new MenuWebLink(xEle.GetAttribute("Text"), xEle.GetAttribute("URL"));

                children.Add(child);
                menuItem.DropDownItems.Add(child.MenuItem);

                child.Add(xEle);
            }
        }
        public static ToolStripMenuItem GetMenuLinkRoot(string text, string filepath)
        {
            ToolStripMenuItem item = new ToolStripMenuItem(text);
            item.Image = global::AVRProjectIDE.Properties.Resources.web;

            XmlDocument xDoc = new XmlDocument();
            xDoc.Load(filepath);
            XmlElement xDocEle = xDoc.DocumentElement;

            foreach (XmlElement xEle in xDocEle.ChildNodes)
            {
                MenuWebLink link = new MenuWebLink(xEle.GetAttribute("Text"), xEle.GetAttribute("URL"));
                link.Add(xEle);

                item.DropDownItems.Add(link.MenuItem);
            }

            return item;
        }
        public static ToolStripMenuItem GetMenuLinkRoot(string text, string filepath)
        {
            ToolStripMenuItem item = new ToolStripMenuItem(text);

            item.Image = global::AVRProjectIDE.Properties.Resources.web;

            XmlDocument xDoc = new XmlDocument();

            xDoc.Load(filepath);
            XmlElement xDocEle = xDoc.DocumentElement;

            foreach (XmlElement xEle in xDocEle.ChildNodes)
            {
                MenuWebLink link = new MenuWebLink(xEle.GetAttribute("Text"), xEle.GetAttribute("URL"));
                link.Add(xEle);

                item.DropDownItems.Add(link.MenuItem);
            }

            return(item);
        }
Exemple #7
0
 public void Add(MenuWebLink mwl)
 {
     children.Add(mwl);
     menuItem.DropDownItems.Add(mwl.MenuItem);
 }
 public void Add(MenuWebLink mwl)
 {
     children.Add(mwl);
     menuItem.DropDownItems.Add(mwl.MenuItem);
 }
        public static ToolStripMenuItem GetMenuLinkRoot(string text)
        {
            ToolStripMenuItem item = new ToolStripMenuItem(text);
            item.Image = GraphicsResx.web;

            XmlDocument xDoc = new XmlDocument();

            if (File.Exists(SettingsManagement.AppDataPath + "helplinks.xml") == false)
            {
                try
                {
                    File.WriteAllText(SettingsManagement.AppDataPath + "helplinks.xml", Properties.Resources.helplinks);
                    xDoc.Load(SettingsManagement.AppDataPath + "helplinks.xml");
                }
                catch
                {
                    xDoc.LoadXml(Properties.Resources.helplinks);
                }
            }
            else
            {
                try
                {
                    xDoc.Load(SettingsManagement.AppDataPath + "helplinks.xml");
                }
                catch (XmlException ex)
                {
                    MessageBox.Show("Error while reading helplinks.xml: " + ex.Message);
                    return item;
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error while reading helplinks.xml: " + ex.Message);
                    return item;
                }
            }

            try
            {
                XmlElement xDocEle = xDoc.DocumentElement;

                foreach (XmlElement xEle in xDocEle.ChildNodes)
                {
                    MenuWebLink link = new MenuWebLink(xEle.GetAttribute("Text"), xEle.GetAttribute("URL"));
                    link.Add(xEle);

                    item.DropDownItems.Add(link.MenuItem);
                }
            }
            catch (Exception ex)
            {
                ErrorReportWindow.Show(ex, "Error while creating help links");
            }

            return item;
        }