Exemplo n.º 1
0
        private void Window_Loaded(object sender, RoutedEventArgs args)
        {
            if (OGContext == null)
            {
                try
                {
                    OGContextFactory.CreateRemoteEngineContext();
                    throw new ArgumentException("Unexpectedly succeeded this time");
                }
                catch (Exception e)
                {
                    MessageBox.Show(string.Format("Failed to connect to remote server:\n\t{0}\nHave you updated app.config?", e.Message), "Failed to connect to server");
                }

                Close();
                return;
            }

            Title = string.Format("OpenGamma Analytics ({0})", OGContext.RootUri);

            _remoteViewProcessor = OGContext.ViewProcessor;
            var viewNames = _remoteViewProcessor.ViewDefinitionRepository.GetDefinitionNames();
            var liveDataSources = _remoteViewProcessor.LiveMarketDataSourceRegistry.GetNames();

            _remoteSecuritySource = OGContext.SecuritySource;
            viewSelector.DataContext = viewNames;

            liveMarketDataSelector.DataContext = liveDataSources;

            WindowLocationPersister.InitAndPersistPosition(this, Settings);

            var viewToSelect = viewNames.Where(v => Settings.PreviousViewName == v).FirstOrDefault();
            viewSelector.SelectedItem = viewToSelect;
        }
Exemplo n.º 2
0
 public RemoteViewClient(OpenGammaFudgeContext fudgeContext, RestTarget clientUri, MQTemplate mqTemplate, RemoteViewProcessor viewProcessor) : base(fudgeContext, clientUri, mqTemplate, (o, l) => new ResultEvent(o).ApplyTo(l))
 {
     _viewProcessor = viewProcessor;
 }