Ejemplo n.º 1
0
        public TBSystem readSystem(string i_szSystem)
        {
            BlockType type = BlockType.Auxiliary;
            m_System = new TBSystem(i_szSystem);
            #region DocSystemOpen
            if (log.IsDebugEnabled) log.Debug("Trying to open systemfile: " + m_szDir + "Systems\\" + i_szSystem);
            FileStream fs = new FileStream(m_szDir + "Systems\\" + i_szSystem,
                                            FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
            m_xmlDocSystems.Load(fs);
            fs.Close();
            #endregion
            XmlNodeList nodes = m_xmlDocSystems.ChildNodes[1].ChildNodes;

            foreach (XmlNode node in nodes) {
                if (node.NodeType == XmlNodeType.Comment) continue;
                switch (node.Attributes[0].Value) {
                    case "auxiliary":
                        type = BlockType.Auxiliary;
                        break;
                    case "portfolio_manager":
                        type = BlockType.PortfolioManager;
                        break;
                    case "entry_exit":
                        type = BlockType.EntryExit;
                        break;
                    case "money_manager":
                        type = BlockType.MoneyManager;
                        break;
                    case "risk_manager":
                        type = BlockType.RiskManager;
                        break;
                }
                #region DocBloxOpen
                if (log.IsDebugEnabled) log.Debug("Trying to open bloxfile: " + m_szDir + "Blox\\" + node.InnerText + ".tbx");
                m_xmlDocBlox = new XmlDocument();
                fs = new FileStream(m_szDir + "Blox\\" + node.InnerText + ".tbx",
                                    FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
                m_xmlDocBlox.Load(fs);
                fs.Close();
                #endregion
                m_System.addBlox(readBlock(type, node.InnerText));
            }

            m_System.createGlobalVars();

            return m_System;
        }
Ejemplo n.º 2
0
        //private PageDef[] m_Blox;
        public BloxDef(TBSystem _sys, string _szOutputDir)
        {
            string sysDir = _szOutputDir;
            sysDir += _sys.SystemName.Substring(0, _sys.SystemName.Length - 4);
            m_szOutputDir = sysDir;
            m_System = _sys;

            Directory.CreateDirectory(sysDir);
            pages = new PageDef[3];
            string bla = Environment.CurrentDirectory;
            pages[0] = new PageDef("Main", "Main", "main.html", new XHTMLGenerator(sysDir + "\\"));
            pages[1] = new PageDef("BloxList", "List of Blox", "bloxlist.html", new XHTMLGenerator(sysDir + "\\"));
            pages[2] = new PageDef("VarList", "List of all Variables", "varlist.html", new XHTMLGenerator(sysDir + "\\"));
            for (int i = 0; i < 3; i++) Pages.getInstance().addPage(pages[i]);
            m_pMain = pages[0];
            m_pBloxList = pages[1];
            m_pVarList = pages[2];
        }