/// <summary> /// Populates the tree with the event categories supported by the server. /// </summary> private void ShowEventCategories(TreeNodeCollection nodes, TsCAeEventType eventType) { Technosoftware.DaAeHdaClient.Ae.TsCAeCategory[] categories = null; // fetch categories. try { categories = mServer_.QueryEventCategories((int)eventType); } catch (Exception e) { MessageBox.Show(e.Message); return; } // check for trivial case. if (categories.Length == 0) { return; } // create event type node. TreeNode root = new TreeNode(eventType.ToString()) { ImageIndex = Resources.IMAGE_OPEN_YELLOW_FOLDER, SelectedImageIndex = Resources.IMAGE_CLOSED_YELLOW_FOLDER, Tag = eventType }; nodes.Add(root); // add categories to tree. foreach (Technosoftware.DaAeHdaClient.Ae.TsCAeCategory category in categories) { // create node. TreeNode node = new TreeNode(category.Name) { ImageIndex = Resources.IMAGE_ENVELOPE, SelectedImageIndex = Resources.IMAGE_ENVELOPE, Tag = category }; // add dummy child to ensure '+' sign is visible. node.Nodes.Add(new TreeNode()); // add to tree. root.Nodes.Add(node); } }
/// <summary> /// Populates the list box with the categories. /// </summary> private void FetchCategories(TsCAeServer server, TsCAeEventType eventType) { OpcClientSdk.Ae.TsCAeCategory[] categories = server.QueryEventCategories((int)eventType); foreach (OpcClientSdk.Ae.TsCAeCategory category in categories) { ListViewItem item = new ListViewItem(category.ID.ToString()); item.SubItems.Add(category.Name); item.SubItems.Add(eventType.ToString()); item.Tag = category; CategoriesLV.Items.Add(item); } }
/// <summary> /// Populates the list box with the categories. /// </summary> private void FetchCategories(TsCAeServer server, TsCAeEventType eventType) { Technosoftware.DaAeHdaClient.Ae.TsCAeCategory[] categories = server.QueryEventCategories((int)eventType); foreach (Technosoftware.DaAeHdaClient.Ae.TsCAeCategory category in categories) { ListViewItem item = new ListViewItem(category.ID.ToString()); item.SubItems.Add(category.Name); item.SubItems.Add(eventType.ToString()); item.Tag = category; categoriesLv_.Items.Add(item); } }
/// <summary> /// Populates the tree with the event categories supported by the server. /// </summary> private void BrowseEvents(TreeNodeCollection nodes, TsCAeEventType eventType) { // fetch categories. Technosoftware.DaAeHdaClient.Ae.TsCAeCategory[] categories = mServer_.QueryEventCategories((int)eventType); if (categories.Length == 0) { return; } // create event type node. TreeNode root = new TreeNode(eventType.ToString()) { ImageIndex = Resources.IMAGE_OPEN_YELLOW_FOLDER, SelectedImageIndex = Resources.IMAGE_CLOSED_YELLOW_FOLDER, Tag = eventType }; nodes.Add(root); // add categories to tree. foreach (Technosoftware.DaAeHdaClient.Ae.TsCAeCategory category in categories) { // create node. TreeNode node = new TreeNode(category.Name) { ImageIndex = Resources.IMAGE_ENVELOPE, SelectedImageIndex = Resources.IMAGE_ENVELOPE, Tag = category }; // add dummy child to ensure '+' sign is visible. if (eventType == TsCAeEventType.Condition) { node.Nodes.Add(new TreeNode()); } // add to tree. root.Nodes.Add(node); } }
/// <summary> /// Displays the categories for the specified event type. /// </summary> private void ShowAvailableCategories(TsCAeEventType eventType) { try { Technosoftware.DaAeHdaClient.Ae.TsCAeCategory[] categories = mServer_.QueryEventCategories((int)eventType); foreach (Technosoftware.DaAeHdaClient.Ae.TsCAeCategory category in categories) { ListViewItem item = new ListViewItem(category.Name); item.SubItems.Add(eventType.ToString()); item.Tag = category; categoriesLv_.Items.Add(item); } } catch { // ignore errors. } }
/// <summary> /// Displays the categories for the specified event type. /// </summary> private void ShowAvailableCategories(TsCAeEventType eventType) { try { OpcClientSdk.Ae.TsCAeCategory[] categories = m_server.QueryEventCategories((int)eventType); foreach (OpcClientSdk.Ae.TsCAeCategory category in categories) { ListViewItem item = new ListViewItem(category.Name); item.SubItems.Add(eventType.ToString()); item.Tag = category; CategoriesLV.Items.Add(item); } } catch { // ignore errors. } }