Пример #1
0
        void OnConnectionOpening(object sender, OpenEventArgs e)
        {
            var command = (Open)e.Command;

            // 'command.IdleTimeOut' is the Idle time out specified in the client OPEN frame
            // Server will send heart beats honoring this timeout(every 7/8 of IdleTimeout)
            if (command.IdleTimeOut == null || command.IdleTimeOut == 0)
            {
                command.IdleTimeOut = Constants.DefaultAmqpHeartbeatSendInterval;
            }
            else if (command.IdleTimeOut < Constants.MinimumAmqpHeartbeatSendInterval)
            {
                throw new EdgeHubConnectionException($"Connection idle timeout specified is less than minimum acceptable value: {Constants.MinimumAmqpHeartbeatSendInterval}");
            }

            var amqpConnection = (AmqpConnection)sender;

            // If the AmqpConnection does not use username/password or certs, create a CbsNode for the connection
            // and add it to the Extensions
            if (!(amqpConnection.Principal is SaslPrincipal || amqpConnection.Principal is X509Principal))
            {
                ICbsNode cbsNode = new CbsNode(this.clientCredentialsFactory, this.iotHubHostName, this.authenticator, this.credentialsCache);
                amqpConnection.Extensions.Add(cbsNode);
            }

            IConnectionHandler connectionHandler = new ConnectionHandler(new EdgeAmqpConnection(amqpConnection), this.connectionProvider);

            amqpConnection.Extensions.Add(connectionHandler);
        }
Пример #2
0
 protected override void OnOpen(OpenEventArgs args)
 {
     this.controller.ConnectionStateChanged     += this.ConnectionStateChanged;
     this.controller.ExceptionThrown            += this.ExceptionThrown;
     this.controller.PositionChanged            += this.PositionChanged;
     this.controller.ResponseReceived           += this.ResponseReceived;
     this.controller.VideoStreamingStateChanged += this.Controller_VideoStreamingStateChanged;
 }
Пример #3
0
 /*! \brief Open window in response to an event. */
 protected virtual void OnOpen(OpenEventArgs e)
 {
     if (Opening != null)
     {
         Opening(this, e);
     }
     Wimp.OpenWindow(ref e.OpenWimpBlock);
 }
Пример #4
0
        private void onOpenEvent(object sender, OpenEventArgs e)
        {
            DialogResult dr = openTestDialog.ShowDialog();

            if (dr == DialogResult.OK)
            {
                services.PlaceController.GoTo(new Test.TestPlace(openTestDialog.FileName));
            }
        }
Пример #5
0
        private void OpenMenu_Click(object sender, EventArgs e)
        {
            var OpenDialog = new OpenFileDialog();

            if (OpenDialog.ShowDialog() == DialogResult.OK)
            {
                var Args = new OpenEventArgs(OpenDialog.FileName);
                Open(this, Args);
                Result = Args.Result;
                FillCalculationResult();
                SetCalculationInputData(Args.id);
            }
        }
Пример #6
0
        private void openCorpusToolStripMenuItem_Click(object sender, EventArgs e)
        {
            indexDialog = new FolderBrowserDialog();

            indexDialog.Description = "Select previously indexed corpus";
            DialogResult result = indexDialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                //this.CurrentIndexPath = indexDialog.SelectedPath;

                OpenEventArgs args = new OpenEventArgs();
                args.Path     = indexDialog.SelectedPath;
                chatViewSetUp = false;
                sit.Clear();
                OpenIndexedCorpus?.Invoke(this, args);
            }
        }
        private void _view_OpenIndexedCorpus(object sender, OpenEventArgs e)
        {
            //ProjectInfo.CurrentIndexPath = _main.CurrentIndexPath;
            ProjectInfo.UnloadData();

            _service.UnloadData();
            SituationIndex.UnloadData();
            ProjectInfo.LoadProject(e.Path);
            if (LuceneService.OpenIndex())
            {
                MessageContainer.Messages = new List <DynamicMessage>();
                _main.SetLineCount(ProjectInfo.Data.LineCount);
                _main.FileLoadState = true;


                AddDocumentsToDisplay(2000);
                _main.ShowDates(ProjectInfo.Data.MessagesPerDay.Keys.ToList());
                //_main.UpdateNgramState(_ngrammer.IndexExists);
            }
            else
            {
                MessageBox.Show("No index");
            }
        }
        private void csvDialog_FileOk(object sender, CancelEventArgs e)
        {
            string path = csvDialog.FileName;

            string name       = Path.GetFileNameWithoutExtension(path);
            string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);

            if (Directory.Exists(folderPath + "\\CCA"))
            {
                Directory.CreateDirectory(folderPath + "\\CCA" + "\\" + name);
            }
            else
            {
                MessageBox.Show("Something went wrong. Please restart");
            }

            //this.CurrentIndexPath = folderPath + "\\CCA" + "\\" + name;
            OpenEventArgs args = new OpenEventArgs();

            args.Path     = folderPath + "\\CCA" + "\\" + name;
            args.FilePath = csvDialog.FileName;
            chatViewSetUp = false;
            FileAndIndexSelected?.Invoke(this, args);
        }
Пример #9
0
 void View_Open(object sender, OpenEventArgs e)
 {
     Model.Open(e.FileName, out CalculationInputData id, out Dictionary <StagesVariableValues, OutputParameters> io);
     e.id     = id;
     e.Result = io;
 }
Пример #10
0
 private Task OnOpenAsync(OpenEventArgs arg)
 => Task.CompletedTask;
Пример #11
0
 protected override void OnOpen(OpenEventArgs args)
 {
     this.stateObserver.StateChanged += this.StateChanged;
 }
Пример #12
0
 private void onOpenEvent(object sender, OpenEventArgs e)
 {
     DialogResult dr = openTestDialog.ShowDialog();
     if (dr == DialogResult.OK)
     {
         services.PlaceController.GoTo(new Test.TestPlace(openTestDialog.FileName));
     }
 }
Пример #13
0
    void OnOpen(object sender, OpenEventArgs args)
    {
        Debug.Log($"WebSocket opened");

        OnSocketOpened?.Invoke(args);
    }
 protected override void OnOpen(OpenEventArgs args)
 {
     _videoObserver.VideoSampleReady += Observer_VideoSampleReady;
 }
Пример #15
0
 protected override void OnOpen(OpenEventArgs args)
 {
     this.StateViewModel.Open(args);
     this.VideoViewModel.Open(args);
     this.ControllerViewModel.Open(args);
 }
Пример #16
0
 private void OnOpen(OpenEventArgs e)
 {
     if (Open != null)
     {
         Open(this, e);
     }
 }
 private void _view_FileAndIndexSelected(object sender, OpenEventArgs e)
 {
     this._path     = e.Path;
     this._filepath = e.FilePath;
     _delim.ShowView();
 }
Пример #18
0
 private static void Socket_OnOpen(object sender, OpenEventArgs e)
 {
     linkFlag = true;
 }
Пример #19
0
 private void Socket_OnOpen(object sender, OpenEventArgs e)
 {
     AddLog(string.Format("Connected: {0}\n", address));
 }
Пример #20
0
 protected override void OnOpen(OpenEventArgs args)
 {
     StateViewModel.Open(args);
     VideoViewModel.Open(args);
     ControllerViewModel.Open(args);
 }