private void Init() { if (this.m_DisplayChannel) { this.panChannel.Visible = true; AC.Base.DeviceSearchs.DeviceSearch search = new AC.Base.DeviceSearchs.DeviceSearch(this.m_Application); search.Filters.Add(new AC.Base.DeviceSearchs.ParentIdFilter(0)); foreach (Device device in search.Search()) { this.cmbChannel.Items.Add(new DeviceInfo(device)); } if (this.cmbChannel.Items.Count > 0) { this.cmbChannel.SelectedIndex = 0; } } else { this.panChannel.Visible = false; } if (this.m_ParentDevice != null) { this.panParentDevice.Visible = true; this.txtParentDevice.Text = this.m_ParentDevice.Name + " (" + this.m_ParentDevice.DeviceType.Name + ")"; } else { this.panParentDevice.Visible = false; } ImageList imgSort = new ImageList(); imgSort.Images.Add(Properties.Resources.FolderClosed); imgSort.Images.Add(Properties.Resources.FolderOpen); this.tvSelectDeviceSort.ImageList = imgSort; this.m_imgDeviceTypeLarge = new ImageList(); this.m_imgDeviceTypeSmall = new ImageList(); this.LoadDeviceTypeIcon(this.m_Application.DeviceTypeSort); this.m_imgDeviceTypeLarge.ImageSize = new Size(32, 32); this.m_imgDeviceTypeLarge.ColorDepth = ColorDepth.Depth32Bit; this.lvSelectDeviceType.LargeImageList = this.m_imgDeviceTypeLarge; this.m_imgDeviceTypeSmall.ImageSize = new Size(16, 16); this.m_imgDeviceTypeSmall.ColorDepth = ColorDepth.Depth32Bit; this.lvSelectDeviceType.SmallImageList = this.m_imgDeviceTypeSmall; this.LoadDeviceTypeSort(); }
/// <summary> /// 设置应用程序框架。 /// </summary> /// <param name="application"></param> public void SetApplication(WindowsFormApplicationClass application) { AC.Base.DeviceSearchs.DeviceSearch search = new AC.Base.DeviceSearchs.DeviceSearch(application); search.Filters.Add(new AC.Base.DeviceSearchs.ParentIdFilter(0)); //search.Filters.Add(new AC.Base.DeviceSearchs.StatusFilter(1)); DeviceList deviceList = new DeviceList(); deviceList.SetApplication(application); deviceList.Dock = System.Windows.Forms.DockStyle.Fill; this.Controls.Add(deviceList); deviceList.SetDeviceSearch(search); deviceList.DeviceSearch(1); }