Ejemplo n.º 1
0
        /// <summary>
        /// Updates the data in the control from its item.
        /// </summary>
        protected override void UpdateData()
        {
            StringBuilder lsbInfo = new StringBuilder();

            if (miItem != null)
            {
                UPnPServiceTreeItem      ldiItem         = (UPnPServiceTreeItem)miItem;
                Service                  lsService       = ((Service)(miItem.LinkedObject));
                RootDescription          lrdRoot         = lsService.Device.RootDeviceDescription();
                ServiceDescription       lsdDescription  = lsService.Description();
                DeviceServiceDescription ldsdDescription = lsService.DeviceServiceDescription();

                lsbInfo.AppendLine("Service URLs");
                AddLine(lsbInfo, ldsdDescription.GetSCPDURL(lrdRoot), "SCPD Url");
                AddLine(lsbInfo, ldsdDescription.GetControlURL(lrdRoot), "Control Url");
                AddLine(lsbInfo, ldsdDescription.GetEventSubURL(lrdRoot), "Event Sub Url");
                lsbInfo.AppendLine();
                lsbInfo.AppendLine(lsdDescription.ToString());

                AddDescriptionProperties(csService, lsdDescription);
                AddDescriptionProperties(csDeviceService, ldsdDescription);
            }

            rtbInfo.Text = lsbInfo.ToString();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Removes a service from the tree view.
        /// </summary>
        /// <param name="service">The service to remove.</param>
        public void RemoveService(Service service)
        {
            TreeNode[] lnFoundNodes = this.Nodes.Find(UPnPServiceTreeItem.KeyFor(service), true);

            foreach (TreeNode lnNode in lnFoundNodes)
            {
                lnNode.Remove();
            }
        }