コード例 #1
0
 void monitor_DataLoaded(object source, DataLoadedEventArgs e)
 {
     loadEventArgs = e;
 }
コード例 #2
0
ファイル: StatusForm.cs プロジェクト: majianxiong/vulcan
        private void onXmlDataLoaded(object source, DataLoadedEventArgs e)
        {
            /* Filthy dirty hack:  I can't figure out how to get the
             * DataGridView to display an attribute on a nested element.
             * Instead, hack the nested element to have text equal to
             * the attribute that I want to display.
             */
            foreach (XmlNode node in e.Document.SelectNodes("//timestamp"))
            {
                if (node.Attributes["age"] == null)
                {
                    continue;
                }

                XmlNode age = e.Document.CreateNode(XmlNodeType.Element, "age", "");
                age.InnerText = node.Attributes["age"].Value;

                node.ParentNode.AppendChild(age);
            }

            xmlDataSet.Clear();
            xmlDataSet.ReadXml(new XmlNodeReader(e.Document));

            try
            {
                dataGrid.DataSource = xmlDataSet;
                dataGrid.DataMember = "project";
            }
            catch (NotImplementedException)
            {
                // mono throws this
            }

            XmlNode availableLabelsNode = e.Document.SelectSingleNode("//available-labels");
            XmlNode selectedLabelsNode = e.Document.SelectSingleNode("//selected-labels");

            if (availableLabelsNode != null && selectedLabelsNode != null)
            {
                BindProjectLabels(availableLabelsNode, selectedLabelsNode);
            }
        }
コード例 #3
0
        public void SetUp()
        {
            monitor = new StatusMonitorStub();
            monitor.DataLoadError += monitor_DataLoadError;
            monitor.DataLoaded += monitor_DataLoaded;
            monitor.DashboardStatusChanged += monitor_DashboardStatusChanged;
            monitor.NewBuildAvailable += monitor_NewBuildAvailable;
            fakeStatus = new XmlDocument();

            projectNodes = fakeStatus.CreateElement("projects");

            fakeStatus.AppendChild(projectNodes);

            monitor.Document = fakeStatus;

            errorEventArgs = null;
            loadEventArgs = null;
            statusChangedEventArgs = null;
            newBuildEventArgs = null;
        }