示例#1
0
        /// <summary>
        /// Registers external data provider (IRegisterDataProvider)
        /// </summary>
        /// <param name="dataProvider">data provider</param>
        public void RegisterDataProvider(IGraphDataProvider dataProvider)
        {
            if (dataProvider == null)
            {
                throw new InvalidArgumentException("parameter is null");
            }
            dataProvider.OnReceiveData += DataProvider_OnReceiveData;

            // Subcribe to pre loaded data
            if (dataProvider is IGraphDataArrayProvider)
            {
                ((IGraphDataArrayProvider)dataProvider).OnGraphDataArrayReceived += DataService_OnGraphDataArrayReceived;
            }
        }
示例#2
0
        private void GetGraphData(IGraphDataProvider oGraphDataProvider)
        {
            wbWebBrowser.GoHome();

            String sGraphData;

            if ( !oGraphDataProvider.TryGetGraphData(out sGraphData) )
            {
            return;
            }

            using ( StreamWriter oStreamWriter =
            new StreamWriter(TempXmlFileName) )
            {
            oStreamWriter.Write(sGraphData);
            }

            wbWebBrowser.Navigate(TempXmlFileName);
        }
示例#3
0
        private void GetGraphData(IGraphDataProvider oGraphDataProvider)
        {
            wbWebBrowser.GoHome();

            String sGraphData;

            if (!oGraphDataProvider.TryGetGraphData(out sGraphData))
            {
                return;
            }

            using (StreamWriter oStreamWriter =
                       new StreamWriter(TempXmlFileName))
            {
                oStreamWriter.Write(sGraphData);
            }

            wbWebBrowser.Navigate(TempXmlFileName);
        }
 public void RegisterDataProvider(IGraphDataProvider dataProvider)
 {
 }
示例#5
0
 public void RegisterDataProvider(IGraphDataProvider dataProvider)
 {
     this.dataService.RegisterDataProvider(dataProvider);
 }
示例#6
0
 public void RegisterDataProvider(IGraphDataProvider dataProvider)
 {
     this.graphControlWinForms.RegisterDataProvider(dataProvider);
 }
示例#7
0
        //*************************************************************************
        //  Method: ImportFromGraphDataProvider()
        //
        /// <summary>
        /// Imports a graph from an IGraphDataProvider implementation.
        /// </summary>
        //*************************************************************************
        public void ImportFromGraphDataProvider(
            IGraphDataProvider graphDataProvider
            )
        {
            Debug.Assert(graphDataProvider != null);
            AssertValid();

            if ( !this.ExcelApplicationIsReady(true) )
            {
            return;
            }

            ShowWaitCursor = true;

            try
            {
            String sGraphDataAsGraphML;

            if (!graphDataProvider.TryGetGraphData(out sGraphDataAsGraphML) )
            {
                return;
            }

            IGraph oGraph = ( new GraphMLGraphAdapter() ).LoadGraphFromString(
                sGraphDataAsGraphML);

            ImportGraph(oGraph,

                ( String[] )oGraph.GetRequiredValue(
                    ReservedMetadataKeys.AllEdgeMetadataKeys,
                    typeof( String[] ) ),

                ( String[] )oGraph.GetRequiredValue(
                    ReservedMetadataKeys.AllVertexMetadataKeys,
                    typeof( String[] ) )
                );
            }
            catch (Exception oException)
            {
            ErrorUtil.OnException(oException);
            }
            finally
            {
            ShowWaitCursor = false;
            }
        }