Exemple #1
0
        private void goButton_Click(object sender, EventArgs e)
        {
            var checkedButton1 = this.connGroupBox1.Controls.OfType <RadioButtonConn>()
                                 .FirstOrDefault(rb => rb.Checked);
            var checkedButton2 = this.connGroupBox2.Controls.OfType <RadioButtonConn>()
                                 .FirstOrDefault(rb2 => rb2.Checked);

            Acs.RetCode_t rc;
            if (this.blockAllCheckBox.Checked)
            {
                rc = Att.attSelectiveListeningRetrieve(this._parent.privData, checkedButton1.Connection, true, checkedButton1.Connection);
            }
            else
            {
                rc = Att.attSelectiveListeningRetrieve(this._parent.privData, checkedButton1.Connection, false, checkedButton2.Connection);
            }
            this._parent.Log("attSelectiveListeningRetrieve result = " + rc._value);
            if (rc._value < 0)
            {
                return;
            }
            var invokeId = new Acs.InvokeID_t();

            rc = Csta.cstaEscapeService(this._parent.acsHandle, invokeId, this._parent.privData);
            this._parent.Log("cstaEscapeService result = " + rc._value);
            if (rc._value < 0)
            {
                return;
            }

            ushort eventBufferSize = Csta.CSTA_MAX_HEAP;
            var    eventBuf        = new Csta.EventBuffer_t();
            ushort numEvents;

            rc = Acs.acsGetEventBlock(this._parent.acsHandle, eventBuf, ref eventBufferSize, this._parent.privData, out numEvents);
            this._parent.Log("acsGetEventBlock result = " + rc._value);
            if (rc._value < 0)
            {
                return;
            }

            if (eventBuf.evt.eventHeader.eventClass.eventClass == Csta.CSTACONFIRMATION && eventBuf.evt.eventHeader.eventType.eventType == Csta.CSTA_ESCAPE_SVC_CONF)
            {
                MessageBox.Show("attSelectiveListeningRetrieve Succeded");
            }
            else
            {
                MessageBox.Show("attSelectiveListeningRetrieve Failed. Error was: " + eventBuf.evt.cstaConfirmation.universalFailure.error);
            }
        }
        private void snapShotDataTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            if (e.Button != MouseButtons.Right)
            {
                return;
            }
            snapShotDataTree.SelectedNode = e.Node;
            if (!(e.Node is CallNode))
            {
                return;
            }
            CallNode tmpNode = (CallNode)e.Node;

            Csta.ConnectionID_t selectedConnId = tmpNode.connection;
            ContextMenuStrip    snapShotDataTreeContextMenu        = new ContextMenuStrip();
            ToolStripItem       cstaClearCallContextMenuItem       = snapShotDataTreeContextMenu.Items.Add("cstaClearCall");
            ToolStripItem       cstaClearConnectionContextMenuItem = snapShotDataTreeContextMenu.Items.Add("cstaClearConnection");

            cstaClearCallContextMenuItem.Click += (s, ev) =>
            {
                Csta.EventBuffer_t evtbuf = Csta.clearCall(this.parentForm.acsHandle, selectedConnId);
                if (evtbuf.evt.eventHeader.eventClass.eventClass == Csta.CSTACONFIRMATION && evtbuf.evt.eventHeader.eventType.eventType == Csta.CSTA_CLEAR_CALL_CONF)
                {
                    snapShotDataTree.Nodes.Remove(tmpNode);
                }
            };

            cstaClearConnectionContextMenuItem.Click += (s, ev) =>
            {
                Csta.EventBuffer_t evtbuf = Csta.clearConnection(parentForm.acsHandle, parentForm.privData, selectedConnId);
                if (evtbuf.evt.eventHeader.eventClass.eventClass == Csta.CSTACONFIRMATION && evtbuf.evt.eventHeader.eventType.eventType == Csta.CSTA_CLEAR_CONNECTION_CONF)
                {
                    snapShotDataTree.Nodes.Remove(tmpNode);
                }
            };

            snapShotDataTreeContextMenu.Show(Cursor.Position);
        }