}           //	end Main

        private void AddressSpaceTreeViewBeforeExpand(object sender, TreeViewCancelEventArgs e)
        {
            addressSpaceTreeView.Cursor = Cursors.WaitCursor;

            TreeNode rootNode = e.Node;
            AddressSpaceElementBrowseOptions browseOptions = new AddressSpaceElementBrowseOptions();

            browseOptions.ElementTypeFilter = EnumAddressSpaceElementType.BRANCH;

            AddressSpaceElement[] addressSpaceElements = null;
            if (ResultCode.SUCCEEDED(m_session.Browse((AddressSpaceElement)rootNode.Tag, browseOptions, out addressSpaceElements, m_executionOptions)))
            {
                rootNode.Nodes.Clear();
                for (int i = 0; i < addressSpaceElements.Length; i++)
                {
                    TreeNode node = new TreeNode(addressSpaceElements[i].Name, 1, 1);
                    node.Tag = addressSpaceElements[i];
                    rootNode.Nodes.Add(node);
                    node.Nodes.Add(new TreeNode(""));
                    string[] conditions = null;
                    string   sourcePath = addressSpaceElements[i].QualifiedName;
                    if (ResultCode.SUCCEEDED(m_session.QueryAeSourceConditions(sourcePath, out conditions, m_executionOptions)))
                    {
                        for (int j = 0; j < conditions.Length; j++)
                        {
                            TreeNode condition = new TreeNode(conditions[j], 3, 3);
                            condition.Tag = String.Empty;
                            node.Nodes.Add(condition);
                        } // end for
                    }     // end if
                }         // end for
            }             // end if
            AddressSpaceElementBrowseOptions browseOptions1 = new AddressSpaceElementBrowseOptions();

            browseOptions1.ElementTypeFilter = EnumAddressSpaceElementType.LEAF;
            if (ResultCode.SUCCEEDED(m_session.Browse((AddressSpaceElement)rootNode.Tag, browseOptions1, out addressSpaceElements, m_executionOptions)))
            {
                for (int i = 0; i < addressSpaceElements.Length; i++)
                {
                    TreeNode node = new TreeNode(addressSpaceElements[i].Name, 2, 2);
                    node.Tag = addressSpaceElements[i];
                    rootNode.Nodes.Add(node);
                    string[] conditions = null;
                    string   sourcePath = addressSpaceElements[i].QualifiedName;
                    if (ResultCode.SUCCEEDED(m_session.QueryAeSourceConditions(sourcePath, out conditions, m_executionOptions)))
                    {
                        for (int j = 0; j < conditions.Length; j++)
                        {
                            TreeNode condition = new TreeNode(conditions[j], 3, 3);
                            condition.Tag = String.Empty;
                            node.Nodes.Add(condition);
                        } // end for
                    }     //end if
                }         // end for
            }             //	end if

            addressSpaceTreeView.Cursor = Cursors.Default;
        } // end AddressSpaceTreeViewBeforeExpand
        /// <summary>
        /// Get Ae AreaSpace Data
        /// </summary>
        private void GetAeAreaSpaceData(TreeNode node, AeSession session)
        {
            AddressSpaceElementBrowseOptions browseOptions = new AddressSpaceElementBrowseOptions();

            browseOptions.ElementTypeFilter = Softing.OPCToolbox.Client.EnumAddressSpaceElementType.BRANCH;

            AddressSpaceElement elem = null;

            if (!node.Equals(browseTreeView.Nodes[0]))
            {
                elem = node.Tag as AddressSpaceElement;
            }
            AddressSpaceElement[] addressSpaceElements = null;
            if (ResultCode.SUCCEEDED(session.Browse((AddressSpaceElement)elem,
                                                    browseOptions,
                                                    out addressSpaceElements,
                                                    executionOptions)))
            {
                node.Nodes.Clear();
                for (int i = 0; i < addressSpaceElements.Length; i++)
                {
                    TreeNode newNode = new TreeNode(addressSpaceElements[i].Name, NODE_INDEX, NODE_INDEX);
                    newNode.Name = addressSpaceElements[i].Name;
                    newNode.Tag  = addressSpaceElements[i];
                    node.Nodes.Add(newNode);
                    newNode.Nodes.Add(new TreeNode(""));
                    string[] conditions = null;
                    string   sourcePath = GetSourcePath(newNode);
                    if (ResultCode.SUCCEEDED(session.QueryAeSourceConditions(sourcePath, out conditions, executionOptions)))
                    {
                        for (int j = 0; j < conditions.Length; j++)
                        {
                            TreeNode conditionNode = new TreeNode(conditions[j], PROP_INDEX, PROP_INDEX);
                            conditionNode.Name = conditions[j];
                            conditionNode.Tag  = String.Empty;
                            newNode.Nodes.Add(conditionNode);
                        }
                    }
                }
            }
            AddressSpaceElementBrowseOptions browseOpt = new AddressSpaceElementBrowseOptions();

            browseOpt.ElementTypeFilter = Softing.OPCToolbox.Client.EnumAddressSpaceElementType.LEAF;
            if (ResultCode.SUCCEEDED(session.Browse((AddressSpaceElement)elem,
                                                    browseOpt,
                                                    out addressSpaceElements,
                                                    executionOptions)))
            {
                for (int i = 0; i < addressSpaceElements.Length; i++)
                {
                    TreeNode newNode = new TreeNode(addressSpaceElements[i].Name, TAG_INDEX, TAG_INDEX);
                    newNode.Name = addressSpaceElements[i].Name;
                    newNode.Tag  = addressSpaceElements[i];
                    node.Nodes.Add(newNode);
                    string[] conditions = null;
                    string   sourcePath = GetSourcePath(newNode);
                    if (ResultCode.SUCCEEDED(session.QueryAeSourceConditions(sourcePath, out conditions, executionOptions)))
                    {
                        for (int j = 0; j < conditions.Length; j++)
                        {
                            TreeNode conditionNode = new TreeNode(conditions[j], PROP_INDEX, PROP_INDEX);
                            conditionNode.Name = conditions[j];
                            conditionNode.Tag  = String.Empty;
                            newNode.Nodes.Add(conditionNode);
                        }
                    }
                }
            }
        }