Ejemplo n.º 1
0
        /// <summary>
        /// Occurs when this command is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            //initialize the hook-helper
            if (m_globeHookHelper == null)
            {
                m_globeHookHelper = new GlobeHookHelper();
            }

            //set the hook
            m_globeHookHelper.Hook = hook;


            //get the ArcGIS path from the registry
            RegistryKey key  = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\ESRI\ArcObjectsSDK10.2");
            string      path = Convert.ToString(key.GetValue("InstallDir"));

            //set the path to the featureclass used by the GPS simulator
            m_shapefileName = System.IO.Path.Combine(path, "Samples\\data\\USAMajorHighways\\usa_major_highways.shp");

            //get the GlobeDisplsy from the hook helper
            m_globeDisplay = m_globeHookHelper.GlobeDisplay;

            //initialize the real-time manager
            if (null == m_realTimeFeedManager)
            {
                m_realTimeFeedManager = new RealTimeFeedManagerClass();
            }

            //use the built in simulator of the real-time manager
            m_realTimeFeedManager.RealTimeFeed = m_realTimeFeedManager.RealTimeFeedSimulator as IRealTimeFeed;

            m_realTimeFeed = m_realTimeFeedManager.RealTimeFeed;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Occurs when this command is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            //initialize the hook-helper
            if (m_globeHookHelper == null)
            {
                m_globeHookHelper = new GlobeHookHelper();
            }

            //set the hook
            m_globeHookHelper.Hook = hook;


            //set the path to the featureclass used by the GPS simulator
            string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            m_shapefileName = System.IO.Path.Combine(path, @"ArcGIS\data\USAMajorHighways\usa_major_highways.shp");
            System.Diagnostics.Debug.WriteLine(string.Format("File path for data root: {0}", m_shapefileName));
            if (!File.Exists(m_shapefileName))
            {
                throw new Exception(string.Format("Fix code to point to your sample data: {0} was not found", m_shapefileName));
            }

            //get the GlobeDisplsy from the hook helper
            m_globeDisplay = m_globeHookHelper.GlobeDisplay;

            //initialize the real-time manager
            if (null == m_realTimeFeedManager)
            {
                m_realTimeFeedManager = new RealTimeFeedManagerClass();
            }

            //use the built in simulator of the real-time manager
            m_realTimeFeedManager.RealTimeFeed = m_realTimeFeedManager.RealTimeFeedSimulator as IRealTimeFeed;

            m_realTimeFeed = m_realTimeFeedManager.RealTimeFeed;
        }
    /// <summary>
    /// Occurs when this command is created
    /// </summary>
    /// <param name="hook">Instance of the application</param>
    public override void OnCreate(object hook)
    {
      //initialize the hook-helper
      if (m_globeHookHelper == null)
        m_globeHookHelper = new GlobeHookHelper();

      //set the hook
      m_globeHookHelper.Hook = hook;

      
      //get the ArcGIS path from the registry
      RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\ESRI\ArcObjectsSDK10.2");
      string path = Convert.ToString(key.GetValue("InstallDir"));

      //set the path to the featureclass used by the GPS simulator
      m_shapefileName = System.IO.Path.Combine(path, "Samples\\data\\USAMajorHighways\\usa_major_highways.shp");

      //get the GlobeDisplsy from the hook helper
      m_globeDisplay = m_globeHookHelper.GlobeDisplay;

      //initialize the real-time manager
      if (null == m_realTimeFeedManager)
        m_realTimeFeedManager = new RealTimeFeedManagerClass();

      //use the built in simulator of the real-time manager
      m_realTimeFeedManager.RealTimeFeed = m_realTimeFeedManager.RealTimeFeedSimulator as IRealTimeFeed;

      m_realTimeFeed = m_realTimeFeedManager.RealTimeFeed;
    }