예제 #1
0
        public frmMain()
        {
            InitializeComponent();

            CoreUtility.Initialize();
            CoreUtility.CheckAndFixCulture();

            m_renderer = (MapSurfer.Rendering.Renderer)MapSurfer.Rendering.RendererManager.CreateDefaultInstance();

            m_mapViewer                  = new MapViewer();
            m_mapViewer.Dock             = DockStyle.Fill;
            m_mapViewer.RedrawOnAttach   = true;
            m_mapViewer.ActiveTool       = MapTool.Zoom;
            m_mapViewer.RedrawOnResizing = true;
            this.Controls.Add(m_mapViewer);

            // Initialize file types
            FileTypeManager <Map> ftmMap = FileTypeManagerCache.GetFileTypeManager <Map>();

            ftmMap.AddSearchPath(typeof(Map).Assembly.GetLocation());
            ftmMap.AddSearchPath(MSNEnvironment.GetFolderPath(MSNSpecialFolder.StylingFormats));
            ftmMap.InitializeFileTypes();

            // Load map project
            string fileName = Path.Combine(MSNUtility.GetMSNInstallPath(), @"Samples\Data\Projects\Andora.msnpx");

            if (File.Exists(fileName))
            {
                LoadProject(fileName);

                Envelope env = new Envelope(978779.133679862, 6990983.0938755, 990289.718456316, 6997278.67914107); //map.Extent
                m_mapViewer.ZoomToEnvelope(env);
            }
        }
        static Program()
        {
            // Register assembly loader
            // Uncomment if needed
            string version = MSNUtility.TryDetectInstalledVersion();

            MSNUtility.SetCurrentMSNVersion(version);
            AssemblyLoader.Register(AppDomain.CurrentDomain, version);
        }
예제 #3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            string version = MSNUtility.TryDetectInstalledVersion(); // or one can define version manually MSNUtility.SetCurrentMSNVersion(..)

            MSNUtility.SetCurrentMSNVersion(version);
            AssemblyLoader.Register(AppDomain.CurrentDomain, version);

            Application.Run(new frmDatasourceViewer());
        }
예제 #4
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            string version = MSNUtility.TryDetectInstalledVersion(); // or one can define version manually MSNUtility.SetCurrentMSNVersion(..)

            MSNUtility.SetCurrentMSNVersion("2.6");
            AssemblyLoader.AddSearchPath(Path.Combine(MSNUtility.GetMSNInstallPath(), "Studio"));
            AssemblyLoader.Register(AppDomain.CurrentDomain, version);

            Application.Run(new frmMain());
        }