/// <summary>
        /// Displays the address space with the specified view
        /// </summary>
        public void Show(Session session, BrowseViewType viewType, NodeId viewId)
        {   
            if (session == null) throw new ArgumentNullException("session");
            
            if (m_session != null)
            {
                m_session.SessionClosing -= m_SessionClosing;
            }

            m_session = session;            
            m_session.SessionClosing += m_SessionClosing;
            
            BrowseCTRL.SetView(session, viewType, viewId);
        }
        /// <summary>
        /// Displays the address space with the specified view
        /// </summary>
        public void Show(Session session, BrowseViewType viewType, NodeId viewId)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }

            if (m_session != null)
            {
                m_session.SessionClosing -= m_SessionClosing;
            }

            m_session = session;
            m_session.SessionClosing += m_SessionClosing;

            BrowseCTRL.SetView(session, viewType, viewId);
        }
Beispiel #3
0
        /// <summary>
        /// Displays the dialog.
        /// </summary>
        public NodeIdCollection ShowDialog(
            Session          session, 
            BrowseViewType   browseView, 
            NodeIdCollection nodesIds,
            NodeClass        nodeClassMask)
        {
            if (session == null) throw new ArgumentNullException("session");

            m_session = session;

            BrowseCTRL.SetView(session, browseView, null);
            NodeListCTRL.Initialize(session, nodesIds, nodeClassMask);
            
            if (ShowDialog() != DialogResult.OK)
            {
                return null;
            }
                        
            return NodeListCTRL.GetNodeIds();
        }
Beispiel #4
0
        /// <summary>
        /// Displays the dialog.
        /// </summary>
        public NodeIdCollection ShowDialog(
            Session session,
            BrowseViewType browseView,
            NodeIdCollection nodesIds,
            NodeClass nodeClassMask)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }

            m_session = session;

            BrowseCTRL.SetView(session, browseView, null);
            NodeListCTRL.Initialize(session, nodesIds, nodeClassMask);

            if (ShowDialog() != DialogResult.OK)
            {
                return(null);
            }

            return(NodeListCTRL.GetNodeIds());
        }
Beispiel #5
0
        /// <summary>
        /// Sets the view for the control.
        /// </summary>
        public void SetView(Session session, BrowseViewType viewType, NodeId viewId)
        {
            Clear();

            // check if session is connected.
            if (session == null || !session.Connected)
            {
                return;
            }

            Browser browser = new Browser(session);

            browser.BrowseDirection   = BrowseDirection.Forward;
            browser.ReferenceTypeId   = null;
            browser.IncludeSubtypes   = true;
            browser.NodeClassMask     = 0;
            browser.ContinueUntilDone = false;

            NodeId rootId = Objects.RootFolder;

            ShowReferences = false;

            switch (viewType)
            {
            case BrowseViewType.All:
            {
                ShowReferences = true;
                break;
            }

            case BrowseViewType.Objects:
            {
                rootId = Objects.ObjectsFolder;
                browser.ReferenceTypeId = ReferenceTypeIds.HierarchicalReferences;
                break;
            }

            case BrowseViewType.Types:
            {
                rootId = Objects.TypesFolder;
                browser.ReferenceTypeId = ReferenceTypeIds.HierarchicalReferences;
                break;
            }

            case BrowseViewType.ObjectTypes:
            {
                rootId = ObjectTypes.BaseObjectType;
                browser.ReferenceTypeId = ReferenceTypeIds.HasChild;
                break;
            }

            case BrowseViewType.EventTypes:
            {
                rootId = ObjectTypes.BaseEventType;
                browser.ReferenceTypeId = ReferenceTypeIds.HasChild;
                break;
            }

            case BrowseViewType.DataTypes:
            {
                rootId = DataTypeIds.BaseDataType;
                browser.ReferenceTypeId = ReferenceTypeIds.HasChild;
                break;
            }

            case BrowseViewType.ReferenceTypes:
            {
                rootId = ReferenceTypeIds.References;
                browser.ReferenceTypeId = ReferenceTypeIds.HasChild;
                break;
            }

            case BrowseViewType.ServerDefinedView:
            {
                rootId              = viewId;
                browser.View        = new ViewDescription();
                browser.View.ViewId = viewId;
                ShowReferences      = true;
                break;
            }
            }

            SetRoot(browser, rootId);
        }
Beispiel #6
0
        /// <summary>
        /// Sets the view for the control.
        /// </summary>
        public void SetView(Session session, BrowseViewType viewType, NodeId viewId)
        {            
            Clear();

            // check if session is connected.
            if (session == null || !session.Connected)
            {
                return;
            }

            Browser browser = new Browser(session);

            browser.BrowseDirection   = BrowseDirection.Forward;
            browser.ReferenceTypeId   = null;
            browser.IncludeSubtypes   = true;
            browser.NodeClassMask     = 0;
            browser.ContinueUntilDone = false;
            
            NodeId rootId = Objects.RootFolder;
            ShowReferences = false;

            switch (viewType)
            {
                case BrowseViewType.All:
                {
                    ShowReferences = true;
                    break;
                }

                case BrowseViewType.Objects:
                {
                    rootId = Objects.ObjectsFolder;
                    browser.ReferenceTypeId = ReferenceTypeIds.HierarchicalReferences;
                    break;
                }

                case BrowseViewType.Types:
                {
                    rootId = Objects.TypesFolder;
                    browser.ReferenceTypeId = ReferenceTypeIds.HierarchicalReferences;
                    break;
                }

                case BrowseViewType.ObjectTypes:
                {
                    rootId = ObjectTypes.BaseObjectType;
                    browser.ReferenceTypeId = ReferenceTypeIds.HasChild;
                    break;
                }

                case BrowseViewType.EventTypes:
                {
                    rootId = ObjectTypes.BaseEventType;
                    browser.ReferenceTypeId = ReferenceTypeIds.HasChild;
                    break;
                }

                case BrowseViewType.DataTypes:
                {
                    rootId = DataTypeIds.BaseDataType;
                    browser.ReferenceTypeId = ReferenceTypeIds.HasChild;
                    break;
                }

                case BrowseViewType.ReferenceTypes:
                {
                    rootId = ReferenceTypeIds.References;
                    browser.ReferenceTypeId = ReferenceTypeIds.HasChild;
                    break;
                }

                case BrowseViewType.ServerDefinedView:
                {
                    rootId = viewId;
                    browser.View = new ViewDescription();
                    browser.View.ViewId = viewId;
                    ShowReferences = true;
                    break;
                }
            }
            
            SetRoot(browser, rootId);
        }