示例#1
0
        private void addComponent(IvyComponent comp)
        {
            if (comp is IvyContainer)
            {
                IvyContainer        cont     = (IvyContainer)comp;
                List <IvyComponent> children = cont.getChildren();

                if (children != null)
                {
                    foreach (IvyComponent child in children)
                    {
                        addComponent(child);
                    }
                }
            }

            if (comp.hasName())
            {
                if (components.ContainsKey(comp.getName()))
                {
                    //Ne devrait pas arriver
                    throw new DuplicateNameException();
                }

                components.Add(comp.getName(), comp);
            }
        }
示例#2
0
        public MainWindow()
        {
            InitializeComponent();

            //ThreadStart t = new ThreadStart(connexionServeur);
            IvyComponent comp = IvyXMLParser.parseXML("test.xml");

            if (comp == null)
            {
                return;
            }

            content.Children.Add(comp.getComponent());

            Thread t = new Thread(new ThreadStart(delegate()
            {
                try
                {
                    act = new TestActivity(4);
                    act.connect();
                    act.waitForClients();
                }
                catch (Exception e)
                {
                    System.Windows.MessageBox.Show(e.StackTrace);
                }
            }));

            t.Start();
        }
示例#3
0
        protected void loadContent(string xmlFile)
        {
            IvyComponent comp = IvyXMLParser.parseXML(xmlFile);

            if (comp != null)
            {
                addComponent(comp);
            }
        }