[mapguide-commits] r10175 - in branches/4.0/MgDev/Portable: OSGeo.MapGuide.Viewer OSGeo.MapGuide.Viewer.Portable Samples Samples/AdvancedSample Samples/AdvancedSample/Properties Samples/BasicSample Samples/BasicSample/Properties Samples/FreeFormExample Samples/FreeFormExample/Properties Samples/SampleExtension
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu Aug 21 06:39:09 PDT 2025
Author: jng
Date: 2025-08-21 06:39:07 -0700 (Thu, 21 Aug 2025)
New Revision: 10175
Added:
branches/4.0/MgDev/Portable/Samples/MgPortableSamples.sln
Removed:
branches/4.0/MgDev/Portable/OSGeo.MapGuide.Viewer/MgReadOnlyStream.cs
branches/4.0/MgDev/Portable/Samples/AdvancedSample/app.config
branches/4.0/MgDev/Portable/Samples/BasicSample/app.config
branches/4.0/MgDev/Portable/Samples/FreeFormExample/app.config
branches/4.0/MgDev/Portable/Samples/MgDesktopSamples.sln
Modified:
branches/4.0/MgDev/Portable/OSGeo.MapGuide.Viewer.Portable/OSGeo.MapGuide.Viewer.Portable.csproj
branches/4.0/MgDev/Portable/OSGeo.MapGuide.Viewer/OSGeo.MapGuide.Viewer.csproj
branches/4.0/MgDev/Portable/Samples/
branches/4.0/MgDev/Portable/Samples/AdvancedSample/
branches/4.0/MgDev/Portable/Samples/AdvancedSample/AdvancedSample.csproj
branches/4.0/MgDev/Portable/Samples/AdvancedSample/MainForm.cs
branches/4.0/MgDev/Portable/Samples/AdvancedSample/Program.cs
branches/4.0/MgDev/Portable/Samples/AdvancedSample/Properties/Resources.Designer.cs
branches/4.0/MgDev/Portable/Samples/AdvancedSample/Properties/Settings.Designer.cs
branches/4.0/MgDev/Portable/Samples/BasicSample/
branches/4.0/MgDev/Portable/Samples/BasicSample/BasicSample.csproj
branches/4.0/MgDev/Portable/Samples/BasicSample/MainForm.Designer.cs
branches/4.0/MgDev/Portable/Samples/BasicSample/MainForm.cs
branches/4.0/MgDev/Portable/Samples/BasicSample/Program.cs
branches/4.0/MgDev/Portable/Samples/BasicSample/Properties/Resources.Designer.cs
branches/4.0/MgDev/Portable/Samples/BasicSample/Properties/Settings.Designer.cs
branches/4.0/MgDev/Portable/Samples/FreeFormExample/
branches/4.0/MgDev/Portable/Samples/FreeFormExample/FreeFormExample.csproj
branches/4.0/MgDev/Portable/Samples/FreeFormExample/MainForm.Designer.cs
branches/4.0/MgDev/Portable/Samples/FreeFormExample/MainForm.cs
branches/4.0/MgDev/Portable/Samples/FreeFormExample/Program.cs
branches/4.0/MgDev/Portable/Samples/FreeFormExample/Properties/Resources.Designer.cs
branches/4.0/MgDev/Portable/Samples/FreeFormExample/Properties/Settings.Designer.cs
branches/4.0/MgDev/Portable/Samples/SampleExtension/
branches/4.0/MgDev/Portable/Samples/SampleExtension/AnalyzingFeatures.cs
branches/4.0/MgDev/Portable/Samples/SampleExtension/BufferHelper.cs
branches/4.0/MgDev/Portable/Samples/SampleExtension/CustomOutput.cs
branches/4.0/MgDev/Portable/Samples/SampleExtension/DigitizingAndRedlining.cs
branches/4.0/MgDev/Portable/Samples/SampleExtension/MgPlotToDwfComponent.cs
branches/4.0/MgDev/Portable/Samples/SampleExtension/MgProfileComponent.cs
branches/4.0/MgDev/Portable/Samples/SampleExtension/MgStartupComponent.cs
branches/4.0/MgDev/Portable/Samples/SampleExtension/ModifyingMapsAndLayers.cs
branches/4.0/MgDev/Portable/Samples/SampleExtension/ResourceIdDialog.cs
branches/4.0/MgDev/Portable/Samples/SampleExtension/SampleExtension.csproj
branches/4.0/MgDev/Portable/Samples/SampleExtension/SamplesTaskPane.cs
branches/4.0/MgDev/Portable/Samples/SampleExtension/sample_readme.txt
branches/4.0/MgDev/Portable/Samples/samples_readme.txt
Log:
More MgPortable fixes:
- Remove duplicate MgReadOnlyStream from OSGeo.MapGuide.Viewer. The base MapGuide API .net binding has this helper class
- Migrate samples over to .net 4.8 legacy projects with <PackageReference /> support
- Replace all instances of "mg-desktop" with "MapGuide Portable" in sample code and docs
Deleted: branches/4.0/MgDev/Portable/OSGeo.MapGuide.Viewer/MgReadOnlyStream.cs
===================================================================
--- branches/4.0/MgDev/Portable/OSGeo.MapGuide.Viewer/MgReadOnlyStream.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/OSGeo.MapGuide.Viewer/MgReadOnlyStream.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,270 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2010, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.IO;
-using OSGeo.MapGuide;
-
-namespace OSGeo.MapGuide.Viewer
-{
- /// <summary>
- /// A read-only, rewindable stream
- /// </summary>
- public abstract class ReadOnlyRewindableStream : Stream
- {
- /// <summary>
- /// Resets the internal position of the stream
- /// </summary>
- public abstract void Rewind();
-
- /// <summary>
- /// Gets whether this stream supports reading
- /// </summary>
- public override bool CanRead
- {
- get { return true; }
- }
-
- /// <summary>
- /// Gets whether this stream supports seeking
- /// </summary>
- public override bool CanSeek
- {
- get { return false; }
- }
-
- /// <summary>
- /// Gets whether this stream supports writing
- /// </summary>
- public override bool CanWrite
- {
- get { return false; }
- }
-
- /// <summary>
- /// Gets whether this stream is rewindable. If not, calls to <see cref="Rewind"/> throw a
- /// <see cref="T:System.InvalidOperationException"/>
- /// </summary>
- public abstract bool CanRewind { get; }
-
- /// <summary>
- /// Gets or sets the position (not implemented)
- /// </summary>
- public override long Position
- {
- get
- {
- throw new NotImplementedException();
- }
- set
- {
- throw new NotImplementedException();
- }
- }
-
- /// <summary>
- /// Seeks to the specified offset in the stream (not implemented)
- /// </summary>
- /// <param name="offset"></param>
- /// <param name="origin"></param>
- /// <returns></returns>
- public override long Seek(long offset, SeekOrigin origin)
- {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Sets the length of the stream (not implemented)
- /// </summary>
- /// <param name="value"></param>
- public override void SetLength(long value)
- {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Writes the specified buffer into the stream (not implemented)
- /// </summary>
- /// <param name="buffer"></param>
- /// <param name="offset"></param>
- /// <param name="count"></param>
- public override void Write(byte[] buffer, int offset, int count)
- {
- throw new NotImplementedException();
- }
- }
-
- /// <summary>
- /// Represents a method that returns a <see cref="OSGeo.MapGuide.MgByteReader"/> instance
- /// </summary>
- /// <returns></returns>
- public delegate MgByteReader GetByteReaderMethod();
-
- /// <summary>
- /// A read-only <see cref="System.IO.Stream"/> adapter for the <see cref="OSGeo.MapGuide.MgByteReader"/>
- /// class.
- /// </summary>
- public class MgReadOnlyStream : ReadOnlyRewindableStream
- {
- private MgByteReader _reader;
-
- /// <summary>
- /// Creates a new instance
- /// </summary>
- /// <param name="method"></param>
- public MgReadOnlyStream(GetByteReaderMethod method)
- {
- _reader = method();
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="MgReadOnlyStream"/> class.
- /// </summary>
- /// <param name="reader">The reader.</param>
- public MgReadOnlyStream(MgByteReader reader)
- {
- _reader = reader;
- }
-
- /// <summary>
- /// Releases unmanaged resources and performs other cleanup operations before the
- /// <see cref="MgReadOnlyStream"/> is reclaimed by garbage collection.
- /// </summary>
- ~MgReadOnlyStream()
- {
- Dispose(false);
- }
-
- /// <summary>
- /// Releases the unmanaged resources used by the <see cref="T:System.IO.Stream"/> and optionally releases the managed resources.
- /// </summary>
- /// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- _reader.Dispose();
- }
- base.Dispose(disposing);
- }
-
- /// <summary>
- /// When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device.
- /// </summary>
- /// <exception cref="T:System.IO.IOException">
- /// An I/O error occurs.
- /// </exception>
- public override void Flush()
- {
-
- }
-
- /// <summary>
- /// When overridden in a derived class, gets the length in bytes of the stream.
- /// </summary>
- /// <returns>
- /// A long value representing the length of the stream in bytes.
- /// </returns>
- ///
- /// <exception cref="T:System.NotSupportedException">
- /// A class derived from Stream does not support seeking.
- /// </exception>
- ///
- /// <exception cref="T:System.ObjectDisposedException">
- /// Methods were called after the stream was closed.
- /// </exception>
- public override long Length
- {
- //NOTE: MgByteReader only returns remaining length! Should we
- //be keeping track of position and adding on this value?
- get { return _reader.GetLength(); }
- }
-
- /// <summary>
- /// Gets whether this stream is rewindable. If not, calls to <see cref="Rewind"/> throw a
- /// <see cref="T:System.InvalidOperationException"/>
- /// </summary>
- public override bool CanRewind
- {
- get { return _reader.IsRewindable(); }
- }
-
- /// <summary>
- /// Resets the internal position of the stream
- /// </summary>
- public override void Rewind()
- {
- if (!CanRewind)
- throw new InvalidOperationException(Strings.ErrorStreamNotRewindable);
-
- _reader.Rewind();
- }
-
- /// <summary>
- /// When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
- /// </summary>
- /// <param name="buffer">An array of bytes. When this method returns, the buffer contains the specified byte array with the values between <paramref name="offset"/> and (<paramref name="offset"/> + <paramref name="count"/> - 1) replaced by the bytes read from the current source.</param>
- /// <param name="offset">The zero-based byte offset in <paramref name="buffer"/> at which to begin storing the data read from the current stream.</param>
- /// <param name="count">The maximum number of bytes to be read from the current stream.</param>
- /// <returns>
- /// The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.
- /// </returns>
- /// <exception cref="T:System.ArgumentException">
- /// The sum of <paramref name="offset"/> and <paramref name="count"/> is larger than the buffer length.
- /// </exception>
- ///
- /// <exception cref="T:System.ArgumentNullException">
- /// <paramref name="buffer"/> is null.
- /// </exception>
- ///
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// <paramref name="offset"/> or <paramref name="count"/> is negative.
- /// </exception>
- ///
- /// <exception cref="T:System.IO.IOException">
- /// An I/O error occurs.
- /// </exception>
- ///
- /// <exception cref="T:System.NotSupportedException">
- /// The stream does not support reading.
- /// </exception>
- ///
- /// <exception cref="T:System.ObjectDisposedException">
- /// Methods were called after the stream was closed.
- /// </exception>
- public override int Read(byte[] buffer, int offset, int count)
- {
- int read = 0;
- //For good times, please always have the offset as 0
- if (offset == 0)
- {
- read = _reader.Read(buffer, count);
- }
- else //So you want to play the hard way eh? Bad performance for you!
- {
- byte[] b = new byte[count];
- read = _reader.Read(b, count);
- Array.Copy(b, 0, buffer, offset, read);
- }
- return read;
- }
- }
-}
Modified: branches/4.0/MgDev/Portable/OSGeo.MapGuide.Viewer/OSGeo.MapGuide.Viewer.csproj
===================================================================
--- branches/4.0/MgDev/Portable/OSGeo.MapGuide.Viewer/OSGeo.MapGuide.Viewer.csproj 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/OSGeo.MapGuide.Viewer/OSGeo.MapGuide.Viewer.csproj 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFramework>net6.0-windows</TargetFramework>
+ <TargetFrameworks>net6.0-windows;net48</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<DebugType>portable</DebugType>
<UseWindowsForms>true</UseWindowsForms>
+ <LangVersion>latest</LangVersion>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Version>4.0.0.0</Version>
<PackageProjectUrl>https://mapguide.osgeo.org/</PackageProjectUrl>
Modified: branches/4.0/MgDev/Portable/OSGeo.MapGuide.Viewer.Portable/OSGeo.MapGuide.Viewer.Portable.csproj
===================================================================
--- branches/4.0/MgDev/Portable/OSGeo.MapGuide.Viewer.Portable/OSGeo.MapGuide.Viewer.Portable.csproj 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/OSGeo.MapGuide.Viewer.Portable/OSGeo.MapGuide.Viewer.Portable.csproj 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFramework>net6.0-windows</TargetFramework>
+ <TargetFrameworks>net6.0-windows;net48</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<DebugType>portable</DebugType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+ <LangVersion>latest</LangVersion>
<Version>4.0.0.0</Version>
<PackageProjectUrl>https://mapguide.osgeo.org/</PackageProjectUrl>
<RepositoryUrl>https://mapguide.osgeo.org/</RepositoryUrl>
Index: branches/4.0/MgDev/Portable/Samples
===================================================================
--- branches/4.0/MgDev/Portable/Samples 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples 2025-08-21 13:39:07 UTC (rev 10175)
Property changes on: branches/4.0/MgDev/Portable/Samples
___________________________________________________________________
Added: svn:ignore
## -0,0 +1 ##
+.vs
Index: branches/4.0/MgDev/Portable/Samples/AdvancedSample
===================================================================
--- branches/4.0/MgDev/Portable/Samples/AdvancedSample 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/AdvancedSample 2025-08-21 13:39:07 UTC (rev 10175)
Property changes on: branches/4.0/MgDev/Portable/Samples/AdvancedSample
___________________________________________________________________
Modified: svn:ignore
## -1,2 +1,3 ##
bin
obj
+.vs
Modified: branches/4.0/MgDev/Portable/Samples/AdvancedSample/AdvancedSample.csproj
===================================================================
--- branches/4.0/MgDev/Portable/Samples/AdvancedSample/AdvancedSample.csproj 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/AdvancedSample/AdvancedSample.csproj 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Debug\</OutputPath>
@@ -20,7 +20,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AdvancedSample</RootNamespace>
<AssemblyName>AdvancedSample</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
@@ -44,6 +44,8 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
+ <NuGetPackageImportStamp>
+ </NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
@@ -50,47 +52,20 @@
<OutputPath>bin\x64\Debug\</OutputPath>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet>
+ <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet>
+ <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
- <Reference Include="OSGeo.MapGuide.Desktop, Version=2.4.0.6964, Culture=neutral, PublicKeyToken=e75f9fd7cf82dc3f, processorArchitecture=x86">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Lib\OSGeo.MapGuide.Desktop.dll</HintPath>
- <Private>False</Private>
- </Reference>
- <Reference Include="OSGeo.MapGuide.Foundation, Version=2.4.0.6962, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=x86">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Lib\OSGeo.MapGuide.Foundation.dll</HintPath>
- <Private>False</Private>
- </Reference>
- <Reference Include="OSGeo.MapGuide.Geometry, Version=2.4.0.6962, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=x86">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Lib\OSGeo.MapGuide.Geometry.dll</HintPath>
- <Private>False</Private>
- </Reference>
- <Reference Include="OSGeo.MapGuide.PlatformBase, Version=2.4.0.6962, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=x86">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Lib\OSGeo.MapGuide.PlatformBase.dll</HintPath>
- <Private>False</Private>
- </Reference>
- <Reference Include="OSGeo.MapGuide.Viewer, Version=2.4.0.6964, Culture=neutral, PublicKeyToken=e75f9fd7cf82dc3f, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Lib\OSGeo.MapGuide.Viewer.dll</HintPath>
- <Private>False</Private>
- </Reference>
- <Reference Include="OSGeo.MapGuide.Viewer.Desktop, Version=2.4.0.6964, Culture=neutral, PublicKeyToken=e75f9fd7cf82dc3f, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Lib\OSGeo.MapGuide.Viewer.Desktop.dll</HintPath>
- <Private>False</Private>
- </Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
+ <Reference Include="System.Numerics" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
@@ -116,7 +91,6 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
- <None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -149,6 +123,14 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
+ <ItemGroup>
+ <PackageReference Include="OSGeo.MapGuide.Viewer">
+ <Version>4.0.0</Version>
+ </PackageReference>
+ <PackageReference Include="OSGeo.MapGuide.Viewer.Portable">
+ <Version>4.0.0</Version>
+ </PackageReference>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
@@ -158,15 +140,7 @@
</Target>
-->
<PropertyGroup>
- <PostBuildEvent>if not exist "$(TargetDir)FDO" md "$(TargetDir)FDO"
-xcopy /s /y "$(SolutionDir)Lib\FDO" "$(TargetDir)FDO"
-if not exist "$(TargetDir)Dictionaries" md "$(TargetDir)Dictionaries"
-xcopy /s /y "$(SolutionDir)Lib\Dictionaries" "$(TargetDir)Dictionaries"
-if not exist "$(TargetDir)Resources" md "$(TargetDir)Resources"
-xcopy /s /y "$(SolutionDir)Lib\Resources" "$(TargetDir)Resources"
-if not exist "$(TargetDir)Schema" md "$(TargetDir)Schema"
-xcopy /s /y "$(SolutionDir)Lib\Schema" "$(TargetDir)Schema"
-copy /y "$(SolutionDir)Lib\*.dll" "$(TargetDir)"
-copy /y "$(SolutionDir)Lib\Platform.ini" "$(TargetDir)"</PostBuildEvent>
+ <PostBuildEvent>
+ </PostBuildEvent>
</PropertyGroup>
</Project>
\ No newline at end of file
Modified: branches/4.0/MgDev/Portable/Samples/AdvancedSample/MainForm.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/AdvancedSample/MainForm.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/AdvancedSample/MainForm.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,14 +1,10 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
+using OSGeo.MapGuide;
+using OSGeo.MapGuide.Viewer;
+using OSGeo.MapGuide.Viewer.Portable;
+using System;
+using System.IO;
using System.Text;
using System.Windows.Forms;
-using OSGeo.MapGuide.Viewer;
-using OSGeo.MapGuide;
-using OSGeo.MapGuide.Viewer.Desktop;
-using System.IO;
namespace AdvancedSample
{
@@ -27,8 +23,8 @@
mgPropertyPane1, //The MgPropertyPane
mgDefaultToolbar1); //The MgDefaultToolbar
- MgdServiceFactory factory = new MgdServiceFactory();
- MgdResourceService resSvc = (MgdResourceService)factory.CreateService(MgServiceType.ResourceService);
+ MgPortableServiceFactory factory = new MgPortableServiceFactory();
+ MgPortableResourceService resSvc = (MgPortableResourceService)factory.CreateService(MgServiceType.ResourceService);
MgResourceIdentifier mapDefId = new MgResourceIdentifier("Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition");
//If this map definition doesn't exist, we ask the user to
//load the Sheboygan package
@@ -52,7 +48,7 @@
}
//Create our runtime map
- MgdMap map = new MgdMap(mapDefId);
+ MgPortableMap map = new MgPortableMap(mapDefId);
//Create our viewer provider
MgMapViewerProvider provider = new MgPortableMapViewerProvider(map);
//Initialize our viewer with this provider
@@ -148,7 +144,7 @@
MessageBox.Show("Distance is: " + dist + " meters");
}
- private MgdLayer _pointLayer;
+ private MgPortableLayer _pointLayer;
private void btnDrawPoint_Click(object sender, EventArgs e)
{
@@ -175,7 +171,7 @@
//Here's where we differ from the official MapGuide API
//instead of a monolithic UpdateFeatures() that tries to
//do everything, we have individual InsertFeatures/DeleteFeatures/UpdateFeatures
- //methods. So here's the mg-desktop way
+ //methods. So here's the MapGuide Portable way
MgFeatureReader result = _pointLayer.InsertFeatures(props);
result.Close();
@@ -196,11 +192,11 @@
private void CreateRedlineLayer()
{
MgMapBase map = mgMapViewer1.GetMap();
- MgdServiceFactory fact = new MgdServiceFactory();
- MgdFeatureService featSvc = (MgdFeatureService)fact.CreateService(MgServiceType.FeatureService);
+ MgPortableServiceFactory fact = new MgPortableServiceFactory();
+ MgPortableFeatureService featSvc = (MgPortableFeatureService)fact.CreateService(MgServiceType.FeatureService);
MgResourceService resSvc = (MgResourceService)fact.CreateService(MgServiceType.ResourceService);
- //Note that mg-desktop does not have a concept of sessions like the
+ //Note that MapGuide Portable does not have a concept of sessions like the
//official MapGuide API, but it *does* allow session-based resources
//as a way of having temporary resources. Such resources will reside
//in a special directory for session resources (specified in Platform.ini)
@@ -261,7 +257,7 @@
resSvc.SetResource(ldfId, source.GetReader(), null);
//Now create the runtime layer and add to map
- _pointLayer = new MgdLayer(ldfId, resSvc);
+ _pointLayer = new MgPortableLayer(ldfId, resSvc);
_pointLayer.LegendLabel = "Redlining";
_pointLayer.Name = "Redline";
_pointLayer.Visible = true;
Modified: branches/4.0/MgDev/Portable/Samples/AdvancedSample/Program.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/AdvancedSample/Program.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/AdvancedSample/Program.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,7 +1,6 @@
-using System;
-using System.Collections.Generic;
+using OSGeo.MapGuide;
+using System;
using System.Windows.Forms;
-using OSGeo.MapGuide;
namespace AdvancedSample
{
@@ -13,11 +12,11 @@
[STAThread]
static void Main()
{
- MgdPlatform.Initialize("Platform.ini");
+ MgPortablePlatform.Initialize("Platform.ini");
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
- MgdPlatform.Terminate();
+ MgPortablePlatform.Terminate();
}
}
}
Modified: branches/4.0/MgDev/Portable/Samples/AdvancedSample/Properties/Resources.Designer.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/AdvancedSample/Properties/Resources.Designer.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/AdvancedSample/Properties/Resources.Designer.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:4.0.30319.18444
+// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -19,7 +19,7 @@
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
Modified: branches/4.0/MgDev/Portable/Samples/AdvancedSample/Properties/Settings.Designer.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/AdvancedSample/Properties/Settings.Designer.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/AdvancedSample/Properties/Settings.Designer.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:4.0.30319.18444
+// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -12,7 +12,7 @@
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
Deleted: branches/4.0/MgDev/Portable/Samples/AdvancedSample/app.config
===================================================================
--- branches/4.0/MgDev/Portable/Samples/AdvancedSample/app.config 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/AdvancedSample/app.config 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,3 +0,0 @@
-<?xml version="1.0"?>
-<configuration>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
Index: branches/4.0/MgDev/Portable/Samples/BasicSample
===================================================================
--- branches/4.0/MgDev/Portable/Samples/BasicSample 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/BasicSample 2025-08-21 13:39:07 UTC (rev 10175)
Property changes on: branches/4.0/MgDev/Portable/Samples/BasicSample
___________________________________________________________________
Modified: svn:ignore
## -1,2 +1,3 ##
bin
obj
+.vs
Modified: branches/4.0/MgDev/Portable/Samples/BasicSample/BasicSample.csproj
===================================================================
--- branches/4.0/MgDev/Portable/Samples/BasicSample/BasicSample.csproj 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/BasicSample/BasicSample.csproj 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Debug\</OutputPath>
@@ -20,7 +20,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BasicSample</RootNamespace>
<AssemblyName>BasicSample</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
@@ -44,6 +44,8 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
+ <NuGetPackageImportStamp>
+ </NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
@@ -50,47 +52,20 @@
<OutputPath>bin\x64\Debug\</OutputPath>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet>
+ <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet>
+ <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
- <Reference Include="OSGeo.MapGuide.Desktop, Version=2.4.0.6964, Culture=neutral, PublicKeyToken=e75f9fd7cf82dc3f, processorArchitecture=x86">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Lib\OSGeo.MapGuide.Desktop.dll</HintPath>
- <Private>False</Private>
- </Reference>
- <Reference Include="OSGeo.MapGuide.Foundation, Version=2.4.0.6962, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=x86">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Lib\OSGeo.MapGuide.Foundation.dll</HintPath>
- <Private>False</Private>
- </Reference>
- <Reference Include="OSGeo.MapGuide.Geometry, Version=2.4.0.6962, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=x86">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Lib\OSGeo.MapGuide.Geometry.dll</HintPath>
- <Private>False</Private>
- </Reference>
- <Reference Include="OSGeo.MapGuide.PlatformBase, Version=2.4.0.6962, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=x86">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Lib\OSGeo.MapGuide.PlatformBase.dll</HintPath>
- <Private>False</Private>
- </Reference>
- <Reference Include="OSGeo.MapGuide.Viewer, Version=2.4.0.6964, Culture=neutral, PublicKeyToken=e75f9fd7cf82dc3f, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Lib\OSGeo.MapGuide.Viewer.dll</HintPath>
- <Private>False</Private>
- </Reference>
- <Reference Include="OSGeo.MapGuide.Viewer.Desktop, Version=2.4.0.6964, Culture=neutral, PublicKeyToken=e75f9fd7cf82dc3f, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Lib\OSGeo.MapGuide.Viewer.Desktop.dll</HintPath>
- <Private>False</Private>
- </Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
+ <Reference Include="System.Numerics" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
@@ -116,7 +91,6 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
- <None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -144,6 +118,11 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
+ <ItemGroup>
+ <PackageReference Include="OSGeo.MapGuide.Viewer.Portable">
+ <Version>4.0.0</Version>
+ </PackageReference>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
@@ -153,15 +132,7 @@
</Target>
-->
<PropertyGroup>
- <PostBuildEvent>if not exist "$(TargetDir)FDO" md "$(TargetDir)FDO"
-xcopy /s /y "$(SolutionDir)Lib\FDO" "$(TargetDir)FDO"
-if not exist "$(TargetDir)Dictionaries" md "$(TargetDir)Dictionaries"
-xcopy /s /y "$(SolutionDir)Lib\Dictionaries" "$(TargetDir)Dictionaries"
-if not exist "$(TargetDir)Resources" md "$(TargetDir)Resources"
-xcopy /s /y "$(SolutionDir)Lib\Resources" "$(TargetDir)Resources"
-if not exist "$(TargetDir)Schema" md "$(TargetDir)Schema"
-xcopy /s /y "$(SolutionDir)Lib\Schema" "$(TargetDir)Schema"
-copy /y "$(SolutionDir)Lib\*.dll" "$(TargetDir)"
-copy /y "$(SolutionDir)Lib\Platform.ini" "$(TargetDir)"</PostBuildEvent>
+ <PostBuildEvent>
+ </PostBuildEvent>
</PropertyGroup>
</Project>
\ No newline at end of file
Modified: branches/4.0/MgDev/Portable/Samples/BasicSample/MainForm.Designer.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/BasicSample/MainForm.Designer.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/BasicSample/MainForm.Designer.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -176,7 +176,7 @@
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.mgDefaultToolbar1);
this.Name = "MainForm";
- this.Text = "mg-desktop Sample";
+ this.Text = "MapGuide Portable Sample";
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
Modified: branches/4.0/MgDev/Portable/Samples/BasicSample/MainForm.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/BasicSample/MainForm.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/BasicSample/MainForm.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,13 +1,8 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
+using OSGeo.MapGuide;
+using OSGeo.MapGuide.Viewer;
+using OSGeo.MapGuide.Viewer.Portable;
+using System;
using System.Windows.Forms;
-using OSGeo.MapGuide.Viewer;
-using OSGeo.MapGuide;
-using OSGeo.MapGuide.Viewer.Desktop;
namespace BasicSample
{
@@ -26,8 +21,8 @@
mgPropertyPane1, //The MgPropertyPane
mgDefaultToolbar1); //The MgDefaultToolbar
- MgdServiceFactory factory = new MgdServiceFactory();
- MgdResourceService resSvc = (MgdResourceService)factory.CreateService(MgServiceType.ResourceService);
+ MgPortableServiceFactory factory = new MgPortableServiceFactory();
+ MgPortableResourceService resSvc = (MgPortableResourceService)factory.CreateService(MgServiceType.ResourceService);
MgResourceIdentifier mapDefId = new MgResourceIdentifier("Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition");
//If this map definition doesn't exist, we ask the user to
//load the Sheboygan package
@@ -51,7 +46,7 @@
}
//Create our runtime map
- MgdMap map = new MgdMap(mapDefId);
+ MgPortableMap map = new MgPortableMap(mapDefId);
//Create our viewer provider
MgMapViewerProvider provider = new MgPortableMapViewerProvider(map);
//Initialize our viewer with this provider
Modified: branches/4.0/MgDev/Portable/Samples/BasicSample/Program.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/BasicSample/Program.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/BasicSample/Program.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,7 +1,6 @@
-using System;
-using System.Collections.Generic;
+using OSGeo.MapGuide;
+using System;
using System.Windows.Forms;
-using OSGeo.MapGuide;
namespace BasicSample
{
@@ -13,11 +12,11 @@
[STAThread]
static void Main()
{
- MgdPlatform.Initialize("Platform.ini");
+ MgPortablePlatform.Initialize("Platform.ini");
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
- MgdPlatform.Terminate();
+ MgPortablePlatform.Terminate();
}
}
}
Modified: branches/4.0/MgDev/Portable/Samples/BasicSample/Properties/Resources.Designer.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/BasicSample/Properties/Resources.Designer.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/BasicSample/Properties/Resources.Designer.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:4.0.30319.18444
+// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -19,7 +19,7 @@
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
Modified: branches/4.0/MgDev/Portable/Samples/BasicSample/Properties/Settings.Designer.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/BasicSample/Properties/Settings.Designer.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/BasicSample/Properties/Settings.Designer.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:4.0.30319.18444
+// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -12,7 +12,7 @@
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
Deleted: branches/4.0/MgDev/Portable/Samples/BasicSample/app.config
===================================================================
--- branches/4.0/MgDev/Portable/Samples/BasicSample/app.config 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/BasicSample/app.config 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,3 +0,0 @@
-<?xml version="1.0"?>
-<configuration>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
Index: branches/4.0/MgDev/Portable/Samples/FreeFormExample
===================================================================
--- branches/4.0/MgDev/Portable/Samples/FreeFormExample 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/FreeFormExample 2025-08-21 13:39:07 UTC (rev 10175)
Property changes on: branches/4.0/MgDev/Portable/Samples/FreeFormExample
___________________________________________________________________
Modified: svn:ignore
## -1,2 +1,3 ##
bin
obj
+.vs
Modified: branches/4.0/MgDev/Portable/Samples/FreeFormExample/FreeFormExample.csproj
===================================================================
--- branches/4.0/MgDev/Portable/Samples/FreeFormExample/FreeFormExample.csproj 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/FreeFormExample/FreeFormExample.csproj 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FreeFormExample</RootNamespace>
<AssemblyName>FreeFormExample</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
@@ -33,6 +33,8 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
+ <NuGetPackageImportStamp>
+ </NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
@@ -60,6 +62,7 @@
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet>
+ <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
@@ -69,42 +72,14 @@
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet>
+ <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
- <Reference Include="OSGeo.MapGuide.Desktop, Version=2.4.0.0, Culture=neutral, PublicKeyToken=e75f9fd7cf82dc3f, processorArchitecture=x86">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Lib\OSGeo.MapGuide.Desktop.dll</HintPath>
- <Private>False</Private>
- </Reference>
- <Reference Include="OSGeo.MapGuide.Foundation, Version=2.4.0.7019, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=x86">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Lib\OSGeo.MapGuide.Foundation.dll</HintPath>
- <Private>False</Private>
- </Reference>
- <Reference Include="OSGeo.MapGuide.Geometry, Version=2.4.0.7019, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=x86">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Lib\OSGeo.MapGuide.Geometry.dll</HintPath>
- <Private>False</Private>
- </Reference>
- <Reference Include="OSGeo.MapGuide.PlatformBase, Version=2.4.0.7019, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=x86">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Lib\OSGeo.MapGuide.PlatformBase.dll</HintPath>
- <Private>False</Private>
- </Reference>
- <Reference Include="OSGeo.MapGuide.Viewer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e75f9fd7cf82dc3f, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Lib\OSGeo.MapGuide.Viewer.dll</HintPath>
- <Private>False</Private>
- </Reference>
- <Reference Include="OSGeo.MapGuide.Viewer.Desktop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e75f9fd7cf82dc3f, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Lib\OSGeo.MapGuide.Viewer.Desktop.dll</HintPath>
- <Private>False</Private>
- </Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
+ <Reference Include="System.Numerics" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
@@ -130,7 +105,6 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
- <None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -191,6 +165,11 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
+ <ItemGroup>
+ <PackageReference Include="OSGeo.MapGuide.Viewer.Portable">
+ <Version>4.0.0</Version>
+ </PackageReference>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
@@ -200,15 +179,7 @@
</Target>
-->
<PropertyGroup>
- <PostBuildEvent>if not exist "$(TargetDir)FDO" md "$(TargetDir)FDO"
-xcopy /s /y "$(SolutionDir)Lib\FDO" "$(TargetDir)FDO"
-if not exist "$(TargetDir)Dictionaries" md "$(TargetDir)Dictionaries"
-xcopy /s /y "$(SolutionDir)Lib\Dictionaries" "$(TargetDir)Dictionaries"
-if not exist "$(TargetDir)Resources" md "$(TargetDir)Resources"
-xcopy /s /y "$(SolutionDir)Lib\Resources" "$(TargetDir)Resources"
-if not exist "$(TargetDir)Schema" md "$(TargetDir)Schema"
-xcopy /s /y "$(SolutionDir)Lib\Schema" "$(TargetDir)Schema"
-copy /y "$(SolutionDir)Lib\*.dll" "$(TargetDir)"
-copy /y "$(SolutionDir)Lib\Platform.ini" "$(TargetDir)"</PostBuildEvent>
+ <PostBuildEvent>
+ </PostBuildEvent>
</PropertyGroup>
</Project>
\ No newline at end of file
Modified: branches/4.0/MgDev/Portable/Samples/FreeFormExample/MainForm.Designer.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/FreeFormExample/MainForm.Designer.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/FreeFormExample/MainForm.Designer.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -294,7 +294,7 @@
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.statusStrip1);
this.Name = "MainForm";
- this.Text = "mg-desktop free-form map viewer example";
+ this.Text = "MapGuide Portable free-form map viewer example";
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.ResumeLayout(false);
Modified: branches/4.0/MgDev/Portable/Samples/FreeFormExample/MainForm.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/FreeFormExample/MainForm.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/FreeFormExample/MainForm.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,14 +1,11 @@
-using System;
-using System.Collections.Generic;
+using OSGeo.MapGuide;
+using OSGeo.MapGuide.Viewer;
+using OSGeo.MapGuide.Viewer.Portable;
+using System;
using System.ComponentModel;
-using System.Data;
using System.Drawing;
-using System.Text;
+using System.Globalization;
using System.Windows.Forms;
-using OSGeo.MapGuide.Viewer.Desktop;
-using OSGeo.MapGuide;
-using OSGeo.MapGuide.Viewer;
-using System.Globalization;
namespace FreeFormExample
{
@@ -31,8 +28,8 @@
this, //The IMapStatusBar
mgPropertyPane1); //The MgPropertyPane
- MgdServiceFactory factory = new MgdServiceFactory();
- MgdResourceService resSvc = (MgdResourceService)factory.CreateService(MgServiceType.ResourceService);
+ MgPortableServiceFactory factory = new MgPortableServiceFactory();
+ MgPortableResourceService resSvc = (MgPortableResourceService)factory.CreateService(MgServiceType.ResourceService);
MgResourceIdentifier mapDefId = new MgResourceIdentifier("Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition");
//If this map definition doesn't exist, we ask the user to
//load the Sheboygan package
@@ -56,7 +53,7 @@
}
//Create our runtime map
- MgdMap map = new MgdMap(mapDefId);
+ MgPortableMap map = new MgPortableMap(mapDefId);
//Create our viewer provider
MgMapViewerProvider provider = new MgPortableMapViewerProvider(map);
//Initialize our viewer with this provider
Modified: branches/4.0/MgDev/Portable/Samples/FreeFormExample/Program.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/FreeFormExample/Program.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/FreeFormExample/Program.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,7 +1,6 @@
-using System;
-using System.Collections.Generic;
+using OSGeo.MapGuide;
+using System;
using System.Windows.Forms;
-using OSGeo.MapGuide;
namespace FreeFormExample
{
@@ -13,11 +12,11 @@
[STAThread]
static void Main()
{
- MgdPlatform.Initialize("Platform.ini");
+ MgPortablePlatform.Initialize("Platform.ini");
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
- MgdPlatform.Terminate();
+ MgPortablePlatform.Terminate();
}
}
}
Modified: branches/4.0/MgDev/Portable/Samples/FreeFormExample/Properties/Resources.Designer.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/FreeFormExample/Properties/Resources.Designer.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/FreeFormExample/Properties/Resources.Designer.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:4.0.30319.18444
+// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -19,7 +19,7 @@
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
Modified: branches/4.0/MgDev/Portable/Samples/FreeFormExample/Properties/Settings.Designer.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/FreeFormExample/Properties/Settings.Designer.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/FreeFormExample/Properties/Settings.Designer.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:4.0.30319.18444
+// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -12,7 +12,7 @@
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
Deleted: branches/4.0/MgDev/Portable/Samples/FreeFormExample/app.config
===================================================================
--- branches/4.0/MgDev/Portable/Samples/FreeFormExample/app.config 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/FreeFormExample/app.config 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,3 +0,0 @@
-<?xml version="1.0"?>
-<configuration>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
Deleted: branches/4.0/MgDev/Portable/Samples/MgDesktopSamples.sln
===================================================================
--- branches/4.0/MgDev/Portable/Samples/MgDesktopSamples.sln 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/MgDesktopSamples.sln 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,56 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Express 2012 for Windows Desktop
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdvancedSample", "AdvancedSample\AdvancedSample.csproj", "{AB9B45B7-38BF-4FFD-B809-A23F74A6C505}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicSample", "BasicSample\BasicSample.csproj", "{BE473CB6-718D-4654-9B0F-F1F9A327BD07}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeFormExample", "FreeFormExample\FreeFormExample.csproj", "{41EF1524-D186-4079-BAA9-1A99F0AC31CA}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleExtension", "SampleExtension\SampleExtension.csproj", "{942C10FD-F7F5-4E68-806D-32EB23A1DD35}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|x64 = Debug|x64
- Debug|x86 = Debug|x86
- Release|x64 = Release|x64
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {AB9B45B7-38BF-4FFD-B809-A23F74A6C505}.Debug|x64.ActiveCfg = Debug|x64
- {AB9B45B7-38BF-4FFD-B809-A23F74A6C505}.Debug|x64.Build.0 = Debug|x64
- {AB9B45B7-38BF-4FFD-B809-A23F74A6C505}.Debug|x86.ActiveCfg = Debug|x86
- {AB9B45B7-38BF-4FFD-B809-A23F74A6C505}.Debug|x86.Build.0 = Debug|x86
- {AB9B45B7-38BF-4FFD-B809-A23F74A6C505}.Release|x64.ActiveCfg = Release|x64
- {AB9B45B7-38BF-4FFD-B809-A23F74A6C505}.Release|x64.Build.0 = Release|x64
- {AB9B45B7-38BF-4FFD-B809-A23F74A6C505}.Release|x86.ActiveCfg = Release|x86
- {AB9B45B7-38BF-4FFD-B809-A23F74A6C505}.Release|x86.Build.0 = Release|x86
- {BE473CB6-718D-4654-9B0F-F1F9A327BD07}.Debug|x64.ActiveCfg = Debug|x64
- {BE473CB6-718D-4654-9B0F-F1F9A327BD07}.Debug|x64.Build.0 = Debug|x64
- {BE473CB6-718D-4654-9B0F-F1F9A327BD07}.Debug|x86.ActiveCfg = Debug|x86
- {BE473CB6-718D-4654-9B0F-F1F9A327BD07}.Debug|x86.Build.0 = Debug|x86
- {BE473CB6-718D-4654-9B0F-F1F9A327BD07}.Release|x64.ActiveCfg = Release|x64
- {BE473CB6-718D-4654-9B0F-F1F9A327BD07}.Release|x64.Build.0 = Release|x64
- {BE473CB6-718D-4654-9B0F-F1F9A327BD07}.Release|x86.ActiveCfg = Release|x86
- {BE473CB6-718D-4654-9B0F-F1F9A327BD07}.Release|x86.Build.0 = Release|x86
- {41EF1524-D186-4079-BAA9-1A99F0AC31CA}.Debug|x64.ActiveCfg = Debug|x64
- {41EF1524-D186-4079-BAA9-1A99F0AC31CA}.Debug|x64.Build.0 = Debug|x64
- {41EF1524-D186-4079-BAA9-1A99F0AC31CA}.Debug|x86.ActiveCfg = Debug|x86
- {41EF1524-D186-4079-BAA9-1A99F0AC31CA}.Debug|x86.Build.0 = Debug|x86
- {41EF1524-D186-4079-BAA9-1A99F0AC31CA}.Release|x64.ActiveCfg = Release|x64
- {41EF1524-D186-4079-BAA9-1A99F0AC31CA}.Release|x64.Build.0 = Release|x64
- {41EF1524-D186-4079-BAA9-1A99F0AC31CA}.Release|x86.ActiveCfg = Release|x86
- {41EF1524-D186-4079-BAA9-1A99F0AC31CA}.Release|x86.Build.0 = Release|x86
- {942C10FD-F7F5-4E68-806D-32EB23A1DD35}.Debug|x64.ActiveCfg = Debug|x64
- {942C10FD-F7F5-4E68-806D-32EB23A1DD35}.Debug|x64.Build.0 = Debug|x64
- {942C10FD-F7F5-4E68-806D-32EB23A1DD35}.Debug|x86.ActiveCfg = Debug|x86
- {942C10FD-F7F5-4E68-806D-32EB23A1DD35}.Debug|x86.Build.0 = Debug|x86
- {942C10FD-F7F5-4E68-806D-32EB23A1DD35}.Release|x64.ActiveCfg = Release|x64
- {942C10FD-F7F5-4E68-806D-32EB23A1DD35}.Release|x64.Build.0 = Release|x64
- {942C10FD-F7F5-4E68-806D-32EB23A1DD35}.Release|x86.ActiveCfg = Release|x86
- {942C10FD-F7F5-4E68-806D-32EB23A1DD35}.Release|x86.Build.0 = Release|x86
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
Copied: branches/4.0/MgDev/Portable/Samples/MgPortableSamples.sln (from rev 10174, branches/4.0/MgDev/Portable/Samples/MgDesktopSamples.sln)
===================================================================
--- branches/4.0/MgDev/Portable/Samples/MgPortableSamples.sln (rev 0)
+++ branches/4.0/MgDev/Portable/Samples/MgPortableSamples.sln 2025-08-21 13:39:07 UTC (rev 10175)
@@ -0,0 +1,56 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Express 2012 for Windows Desktop
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdvancedSample", "AdvancedSample\AdvancedSample.csproj", "{AB9B45B7-38BF-4FFD-B809-A23F74A6C505}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicSample", "BasicSample\BasicSample.csproj", "{BE473CB6-718D-4654-9B0F-F1F9A327BD07}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeFormExample", "FreeFormExample\FreeFormExample.csproj", "{41EF1524-D186-4079-BAA9-1A99F0AC31CA}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleExtension", "SampleExtension\SampleExtension.csproj", "{942C10FD-F7F5-4E68-806D-32EB23A1DD35}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {AB9B45B7-38BF-4FFD-B809-A23F74A6C505}.Debug|x64.ActiveCfg = Debug|x64
+ {AB9B45B7-38BF-4FFD-B809-A23F74A6C505}.Debug|x64.Build.0 = Debug|x64
+ {AB9B45B7-38BF-4FFD-B809-A23F74A6C505}.Debug|x86.ActiveCfg = Debug|x86
+ {AB9B45B7-38BF-4FFD-B809-A23F74A6C505}.Debug|x86.Build.0 = Debug|x86
+ {AB9B45B7-38BF-4FFD-B809-A23F74A6C505}.Release|x64.ActiveCfg = Release|x64
+ {AB9B45B7-38BF-4FFD-B809-A23F74A6C505}.Release|x64.Build.0 = Release|x64
+ {AB9B45B7-38BF-4FFD-B809-A23F74A6C505}.Release|x86.ActiveCfg = Release|x86
+ {AB9B45B7-38BF-4FFD-B809-A23F74A6C505}.Release|x86.Build.0 = Release|x86
+ {BE473CB6-718D-4654-9B0F-F1F9A327BD07}.Debug|x64.ActiveCfg = Debug|x64
+ {BE473CB6-718D-4654-9B0F-F1F9A327BD07}.Debug|x64.Build.0 = Debug|x64
+ {BE473CB6-718D-4654-9B0F-F1F9A327BD07}.Debug|x86.ActiveCfg = Debug|x86
+ {BE473CB6-718D-4654-9B0F-F1F9A327BD07}.Debug|x86.Build.0 = Debug|x86
+ {BE473CB6-718D-4654-9B0F-F1F9A327BD07}.Release|x64.ActiveCfg = Release|x64
+ {BE473CB6-718D-4654-9B0F-F1F9A327BD07}.Release|x64.Build.0 = Release|x64
+ {BE473CB6-718D-4654-9B0F-F1F9A327BD07}.Release|x86.ActiveCfg = Release|x86
+ {BE473CB6-718D-4654-9B0F-F1F9A327BD07}.Release|x86.Build.0 = Release|x86
+ {41EF1524-D186-4079-BAA9-1A99F0AC31CA}.Debug|x64.ActiveCfg = Debug|x64
+ {41EF1524-D186-4079-BAA9-1A99F0AC31CA}.Debug|x64.Build.0 = Debug|x64
+ {41EF1524-D186-4079-BAA9-1A99F0AC31CA}.Debug|x86.ActiveCfg = Debug|x86
+ {41EF1524-D186-4079-BAA9-1A99F0AC31CA}.Debug|x86.Build.0 = Debug|x86
+ {41EF1524-D186-4079-BAA9-1A99F0AC31CA}.Release|x64.ActiveCfg = Release|x64
+ {41EF1524-D186-4079-BAA9-1A99F0AC31CA}.Release|x64.Build.0 = Release|x64
+ {41EF1524-D186-4079-BAA9-1A99F0AC31CA}.Release|x86.ActiveCfg = Release|x86
+ {41EF1524-D186-4079-BAA9-1A99F0AC31CA}.Release|x86.Build.0 = Release|x86
+ {942C10FD-F7F5-4E68-806D-32EB23A1DD35}.Debug|x64.ActiveCfg = Debug|x64
+ {942C10FD-F7F5-4E68-806D-32EB23A1DD35}.Debug|x64.Build.0 = Debug|x64
+ {942C10FD-F7F5-4E68-806D-32EB23A1DD35}.Debug|x86.ActiveCfg = Debug|x86
+ {942C10FD-F7F5-4E68-806D-32EB23A1DD35}.Debug|x86.Build.0 = Debug|x86
+ {942C10FD-F7F5-4E68-806D-32EB23A1DD35}.Release|x64.ActiveCfg = Release|x64
+ {942C10FD-F7F5-4E68-806D-32EB23A1DD35}.Release|x64.Build.0 = Release|x64
+ {942C10FD-F7F5-4E68-806D-32EB23A1DD35}.Release|x86.ActiveCfg = Release|x86
+ {942C10FD-F7F5-4E68-806D-32EB23A1DD35}.Release|x86.Build.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
Index: branches/4.0/MgDev/Portable/Samples/SampleExtension
===================================================================
--- branches/4.0/MgDev/Portable/Samples/SampleExtension 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/SampleExtension 2025-08-21 13:39:07 UTC (rev 10175)
Property changes on: branches/4.0/MgDev/Portable/Samples/SampleExtension
___________________________________________________________________
Modified: svn:ignore
## -1,2 +1,3 ##
bin
obj
+.vs
Modified: branches/4.0/MgDev/Portable/Samples/SampleExtension/AnalyzingFeatures.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/SampleExtension/AnalyzingFeatures.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/SampleExtension/AnalyzingFeatures.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,13 +1,8 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Drawing;
-using System.Data;
-using System.Text;
-using System.Windows.Forms;
+using OSGeo.MapGuide;
using OSGeo.MapGuide.Viewer;
-using OSGeo.MapGuide;
using OSGeo.MapGuide.Viewer.AppLayoutEngine;
+using System;
+using System.Windows.Forms;
namespace SampleExtension
{
@@ -55,8 +50,8 @@
MgLayerCollection mapLayers = map.GetLayers();
MgMapViewerProvider provider = _viewer.GetProvider();
MgResourceService resourceService = (MgResourceService)provider.CreateService(MgServiceType.ResourceService);
- //Casting to MgdFeatureService because we want to use convenience APIs
- MgFeatureService featureService = (MgdFeatureService)provider.CreateService(MgServiceType.FeatureService);
+ //Casting to MgPortableFeatureService because we want to use convenience APIs
+ MgFeatureService featureService = (MgPortableFeatureService)provider.CreateService(MgServiceType.FeatureService);
String mapWktSrs = map.GetMapSRS();
MgAgfReaderWriter agfReaderWriter = new MgAgfReaderWriter();
@@ -73,7 +68,7 @@
// If it does not exist, create a feature source and
// a layer to hold the buffer.
- MgdLayer bufferLayer = null;
+ MgPortableLayer bufferLayer = null;
int layerIndex = mapLayers.IndexOf("Buffer");
if (layerIndex < 0)
{
@@ -86,7 +81,7 @@
}
else
{
- bufferLayer = (MgdLayer)map.GetLayers().GetItem(layerIndex);
+ bufferLayer = (MgPortableLayer)map.GetLayers().GetItem(layerIndex);
bufferLayer.DeleteFeatures("ID like '%'");
}
@@ -173,8 +168,8 @@
MgLayerCollection mapLayers = map.GetLayers();
MgMapViewerProvider provider = _viewer.GetProvider();
MgResourceService resourceService = (MgResourceService)provider.CreateService(MgServiceType.ResourceService);
- //Casting to MgdFeatureService because we want to use convenience APIs
- MgFeatureService featureService = (MgdFeatureService)provider.CreateService(MgServiceType.FeatureService);
+ //Casting to MgPortableFeatureService because we want to use convenience APIs
+ MgFeatureService featureService = (MgPortableFeatureService)provider.CreateService(MgServiceType.FeatureService);
string sessionId = Guid.NewGuid().ToString();
String mapWktSrs = map.GetMapSRS();
@@ -190,7 +185,7 @@
// a layer to hold the buffer.
BufferHelper helper = new BufferHelper();
- MgdLayer bufferLayer = null;
+ MgPortableLayer bufferLayer = null;
int layerIndex = map.GetLayers().IndexOf("Buffer");
if (layerIndex < 0)
{
@@ -203,7 +198,7 @@
}
else
{
- bufferLayer = (MgdLayer)map.GetLayers().GetItem(layerIndex);
+ bufferLayer = (MgPortableLayer)map.GetLayers().GetItem(layerIndex);
bufferLayer.DeleteFeatures("ID like '%'");
}
@@ -212,7 +207,7 @@
// If it does not exist, create a feature source and
// a layer to hold the parcel markers.
- MgdLayer parcelMarkerLayer = null;
+ MgPortableLayer parcelMarkerLayer = null;
layerIndex = map.GetLayers().IndexOf("ParcelMarker");
if (layerIndex < 0)
{
@@ -223,7 +218,7 @@
}
else
{
- parcelMarkerLayer = (MgdLayer)map.GetLayers().GetItem(layerIndex);
+ parcelMarkerLayer = (MgPortableLayer)map.GetLayers().GetItem(layerIndex);
parcelMarkerLayer.DeleteFeatures("ID like '%'");
}
@@ -233,7 +228,7 @@
{
// Only check selected features in the Parcels layer.
- MgdLayer layer = (MgdLayer)selectedLayers.GetItem(i);
+ MgPortableLayer layer = (MgPortableLayer)selectedLayers.GetItem(i);
if (layer.GetName() == "Parcels")
{
Modified: branches/4.0/MgDev/Portable/Samples/SampleExtension/BufferHelper.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/SampleExtension/BufferHelper.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/SampleExtension/BufferHelper.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,8 +1,7 @@
-using System;
-using System.Collections.Generic;
+using OSGeo.MapGuide;
+using System;
+using System.IO;
using System.Text;
-using OSGeo.MapGuide;
-using System.IO;
using System.Xml;
namespace SampleExtension
@@ -43,7 +42,7 @@
featureService.CreateFeatureSource(bufferFeatureResId, sdfParams);
}
- public MgdLayer CreateBufferLayer(MgResourceService resourceService, MgResourceIdentifier bufferFeatureResId, String sessionId)
+ public MgPortableLayer CreateBufferLayer(MgResourceService resourceService, MgResourceIdentifier bufferFeatureResId, String sessionId)
{
// Load the layer definition template into
// a XmlDocument object, find the "ResourceId" element, and
@@ -83,7 +82,7 @@
// Create an MgLayer object based on the new layer definition
// and return it to the caller.
- MgdLayer bufferLayer = new MgdLayer(tempLayerResId, resourceService);
+ MgPortableLayer bufferLayer = new MgPortableLayer(tempLayerResId, resourceService);
bufferLayer.SetName("Buffer");
bufferLayer.SetLegendLabel("Buffer");
bufferLayer.SetDisplayInLegend(true);
@@ -126,7 +125,7 @@
featureService.CreateFeatureSource(parcelMarkerDataResId, sdfParams);
}
- public MgdLayer CreateParcelMarkerLayer(MgResourceService resourceService, MgResourceIdentifier parcelMarkerDataResId, String sessionId)
+ public MgPortableLayer CreateParcelMarkerLayer(MgResourceService resourceService, MgResourceIdentifier parcelMarkerDataResId, String sessionId)
{
// Load the ParcelMarker layer definition template into
// a XmlDocument object, find the "ResourceId" element, and
@@ -166,7 +165,7 @@
// Create an MgLayer object based on the new layer definition
// and return it to the caller.
- MgdLayer parcelMarkerLayer = new MgdLayer(tempLayerResId, resourceService);
+ MgPortableLayer parcelMarkerLayer = new MgPortableLayer(tempLayerResId, resourceService);
parcelMarkerLayer.SetName("ParcelMarker");
parcelMarkerLayer.SetLegendLabel("ParcelMarker");
parcelMarkerLayer.SetDisplayInLegend(true);
Modified: branches/4.0/MgDev/Portable/Samples/SampleExtension/CustomOutput.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/SampleExtension/CustomOutput.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/SampleExtension/CustomOutput.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,14 +1,8 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
+using OSGeo.MapGuide;
+using OSGeo.MapGuide.Viewer;
+using System;
using System.Drawing;
-using System.Data;
-using System.Text;
using System.Windows.Forms;
-using OSGeo.MapGuide.Viewer;
-using OSGeo.MapGuide.Viewer.Desktop;
-using OSGeo.MapGuide;
-using System.IO;
namespace SampleExtension
{
@@ -25,11 +19,11 @@
private void btnRenderMap1_Click(object sender, EventArgs e)
{
- //Note we're casting to mg-desktop specific subclasses as this is what mg-desktop rendering APIs expect
- MgdMap map = (MgdMap)_viewer.GetMap();
- MgdSelection selection = (MgdSelection)_viewer.GetSelection();
+ //Note we're casting to MapGuide Portable specific subclasses as this is what MapGuide Portable rendering APIs expect
+ MgPortableMap map = (MgPortableMap)_viewer.GetMap();
+ MgPortableSelection selection = (MgPortableSelection)_viewer.GetSelection();
MgMapViewerProvider provider = _viewer.GetProvider();
- MgdRenderingService renderSvc = (MgdRenderingService)provider.CreateService(MgServiceType.RenderingService);
+ MgPortableRenderingService renderSvc = (MgPortableRenderingService)provider.CreateService(MgServiceType.RenderingService);
MgPoint centerPt = map.ViewCenter;
MgCoordinate centerCoord = centerPt.Coordinate;
@@ -64,11 +58,11 @@
private void btnRenderMap2_Click(object sender, EventArgs e)
{
- //Note we're casting to mg-desktop specific subclasses as this is what mg-desktop rendering APIs expect
- MgdMap map = (MgdMap)_viewer.GetMap();
- MgdSelection selection = (MgdSelection)_viewer.GetSelection();
+ //Note we're casting to MapGuide Portable specific subclasses as this is what MapGuide Portable rendering APIs expect
+ MgPortableMap map = (MgPortableMap)_viewer.GetMap();
+ MgPortableSelection selection = (MgPortableSelection)_viewer.GetSelection();
MgMapViewerProvider provider = _viewer.GetProvider();
- MgdRenderingService renderSvc = (MgdRenderingService)provider.CreateService(MgServiceType.RenderingService);
+ MgPortableRenderingService renderSvc = (MgPortableRenderingService)provider.CreateService(MgServiceType.RenderingService);
MgPoint centerPt = map.ViewCenter;
MgCoordinate centerCoord = centerPt.Coordinate;
@@ -103,11 +97,11 @@
private void btnRenderMap3_Click(object sender, EventArgs e)
{
- //Note we're casting to mg-desktop specific subclasses as this is what mg-desktop rendering APIs expect
- MgdMap map = (MgdMap)_viewer.GetMap();
- MgdSelection selection = (MgdSelection)_viewer.GetSelection();
+ //Note we're casting to MapGuide Portable specific subclasses as this is what MapGuide Portable rendering APIs expect
+ MgPortableMap map = (MgPortableMap)_viewer.GetMap();
+ MgPortableSelection selection = (MgPortableSelection)_viewer.GetSelection();
MgMapViewerProvider provider = _viewer.GetProvider();
- MgdRenderingService renderSvc = (MgdRenderingService)provider.CreateService(MgServiceType.RenderingService);
+ MgPortableRenderingService renderSvc = (MgPortableRenderingService)provider.CreateService(MgServiceType.RenderingService);
MgPoint centerPt = map.ViewCenter;
MgCoordinate centerCoord = centerPt.Coordinate;
@@ -142,11 +136,11 @@
private void btnRenderMap4_Click(object sender, EventArgs e)
{
- //Note we're casting to mg-desktop specific subclasses as this is what mg-desktop rendering APIs expect
- MgdMap map = (MgdMap)_viewer.GetMap();
- MgdSelection selection = (MgdSelection)_viewer.GetSelection();
+ //Note we're casting to MapGuide Portable specific subclasses as this is what MapGuide Portable rendering APIs expect
+ MgPortableMap map = (MgPortableMap)_viewer.GetMap();
+ MgPortableSelection selection = (MgPortableSelection)_viewer.GetSelection();
MgMapViewerProvider provider = _viewer.GetProvider();
- MgdRenderingService renderSvc = (MgdRenderingService)provider.CreateService(MgServiceType.RenderingService);
+ MgPortableRenderingService renderSvc = (MgPortableRenderingService)provider.CreateService(MgServiceType.RenderingService);
MgPoint centerPt = map.ViewCenter;
MgCoordinate centerCoord = centerPt.Coordinate;
@@ -181,9 +175,9 @@
private void btnSinglePlot_Click(object sender, EventArgs e)
{
- MgdMap map = (MgdMap)_viewer.GetMap();
+ MgPortableMap map = (MgPortableMap)_viewer.GetMap();
MgMapViewerProvider provider = _viewer.GetProvider();
- MgdMappingService mappingSvc = (MgdMappingService)provider.CreateService(MgServiceType.MappingService);
+ MgPortableMappingService mappingSvc = (MgPortableMappingService)provider.CreateService(MgServiceType.MappingService);
MgResourceIdentifier layoutId = new MgResourceIdentifier("Library://Samples/Sheboygan/Layouts/SheboyganMap.PrintLayout");
using (SaveFileDialog save = new SaveFileDialog())
{
@@ -190,10 +184,10 @@
save.Filter = "DWF Files (*.dwf)|*.dwf";
if (save.ShowDialog() == DialogResult.OK)
{
- MgdDwfVersion dwfVer = new MgdDwfVersion("6.01", "1.2");
+ MgPortableDwfVersion dwfVer = new MgPortableDwfVersion("6.01", "1.2");
- MgdLayout layout = new MgdLayout(layoutId, "City of Sheboygan", MgdPageUnitsType.Inches);
- MgdPlotSpecification plotSpec = new MgdPlotSpecification(8.5f, 11.0f, MgdPageUnitsType.Inches, 0.5f, 0.5f, 0.5f, 0.5f);
+ MgPortableLayout layout = new MgPortableLayout(layoutId, "City of Sheboygan", MgPortablePageUnitsType.Inches);
+ MgPortablePlotSpecification plotSpec = new MgPortablePlotSpecification(8.5f, 11.0f, MgPortablePageUnitsType.Inches, 0.5f, 0.5f, 0.5f, 0.5f);
MgByteReader result = mappingSvc.GeneratePlot(map, plotSpec, layout, dwfVer);
MgByteSink sink = new MgByteSink(result);
@@ -206,9 +200,9 @@
private void btnMultiPlot_Click(object sender, EventArgs e)
{
- MgdMap map = (MgdMap)_viewer.GetMap();
+ MgPortableMap map = (MgPortableMap)_viewer.GetMap();
MgMapViewerProvider provider = _viewer.GetProvider();
- MgdMappingService mappingSvc = (MgdMappingService)provider.CreateService(MgServiceType.MappingService);
+ MgPortableMappingService mappingSvc = (MgPortableMappingService)provider.CreateService(MgServiceType.MappingService);
MgResourceIdentifier layoutId = new MgResourceIdentifier("Library://Samples/Sheboygan/Layouts/SheboyganMap.PrintLayout");
using (SaveFileDialog save = new SaveFileDialog())
{
@@ -215,14 +209,14 @@
save.Filter = "DWF Files (*.dwf)|*.dwf";
if (save.ShowDialog() == DialogResult.OK)
{
- MgdDwfVersion dwfVer = new MgdDwfVersion("6.01", "1.2");
+ MgPortableDwfVersion dwfVer = new MgPortableDwfVersion("6.01", "1.2");
- MgdLayout layout = new MgdLayout(layoutId, "City of Sheboygan", MgdPageUnitsType.Inches);
- MgdPlotSpecification plotSpec = new MgdPlotSpecification(8.5f, 11.0f, MgdPageUnitsType.Inches, 0.5f, 0.5f, 0.5f, 0.5f);
+ MgPortableLayout layout = new MgPortableLayout(layoutId, "City of Sheboygan", MgPortablePageUnitsType.Inches);
+ MgPortablePlotSpecification plotSpec = new MgPortablePlotSpecification(8.5f, 11.0f, MgPortablePageUnitsType.Inches, 0.5f, 0.5f, 0.5f, 0.5f);
- MgdMapPlotCollection plotCollection = new MgdMapPlotCollection();
+ MgPortableMapPlotCollection plotCollection = new MgPortableMapPlotCollection();
- MgdMapPlot plot1 = new MgdMapPlot(map, plotSpec, layout);
+ MgPortableMapPlot plot1 = new MgPortableMapPlot(map, plotSpec, layout);
plot1.SetCenterAndScale(map.GetViewCenter().GetCoordinate(), map.GetViewScale() * 2);
plotCollection.Add(plot1);
@@ -229,8 +223,8 @@
// Create a second map for the second sheet in the DWF. This second sheet uses the print layout
// to display a page title and legend.
- MgdMap map2 = new MgdMap(map.GetMapDefinition(), "Sheet 2");
- MgdMapPlot plot2 = new MgdMapPlot(map2, plotSpec, layout);
+ MgPortableMap map2 = new MgPortableMap(map.GetMapDefinition(), "Sheet 2");
+ MgPortableMapPlot plot2 = new MgPortableMapPlot(map2, plotSpec, layout);
plot2.SetCenterAndScale(map.GetViewCenter().GetCoordinate(), map.GetViewScale());
plotCollection.Add(plot2);
Modified: branches/4.0/MgDev/Portable/Samples/SampleExtension/DigitizingAndRedlining.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/SampleExtension/DigitizingAndRedlining.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/SampleExtension/DigitizingAndRedlining.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -17,7 +17,7 @@
private MgGeometryFactory _geomFact;
private MgWktReaderWriter _wktRW;
private MgAgfReaderWriter _agfRW;
- private MgdLayer _redlineLayer;
+ private MgPortableLayer _redlineLayer;
public DigitizingAndRedlining(IMapViewer viewer)
{
@@ -32,7 +32,7 @@
MgLayerCollection layers = map.GetLayers();
if (layers.IndexOf("Redline") >= 0)
{
- _redlineLayer = (MgdLayer)layers.GetItem("Redline");
+ _redlineLayer = (MgPortableLayer)layers.GetItem("Redline");
}
CheckDigitizingState();
}
@@ -71,9 +71,9 @@
{
if (_redlineLayer == null)
{
- MgdMap map = (MgdMap)_viewer.GetMap();
+ MgPortableMap map = (MgPortableMap)_viewer.GetMap();
MgMapViewerProvider provider = _viewer.GetProvider();
- MgdFeatureService featSvc = (MgdFeatureService)provider.CreateService(MgServiceType.FeatureService);
+ MgPortableFeatureService featSvc = (MgPortableFeatureService)provider.CreateService(MgServiceType.FeatureService);
MgResourceService resSvc = (MgResourceService)provider.CreateService(MgServiceType.ResourceService);
string sessionId = Guid.NewGuid().ToString();
@@ -117,7 +117,7 @@
resSvc.SetResource(ldfId, source.GetReader(), null);
//Now create the runtime layer and add to map
- _redlineLayer = new MgdLayer(ldfId, resSvc);
+ _redlineLayer = new MgPortableLayer(ldfId, resSvc);
_redlineLayer.LegendLabel = "Redlining";
_redlineLayer.Name = "Redline";
_redlineLayer.Visible = true;
Modified: branches/4.0/MgDev/Portable/Samples/SampleExtension/MgPlotToDwfComponent.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/SampleExtension/MgPlotToDwfComponent.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/SampleExtension/MgPlotToDwfComponent.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -25,12 +25,12 @@
save.Filter = "DWF Files (*.dwf)|*.dwf";
if (save.ShowDialog() == DialogResult.OK)
{
- var mappingSvc = (MgdMappingService)this.Viewer.GetProvider().CreateService(MgServiceType.MappingService);
- var map = (MgdMap)this.Viewer.GetMap();
- var dwfVer = new MgdDwfVersion("6.01", "1.2");
+ var mappingSvc = (MgPortableMappingService)this.Viewer.GetProvider().CreateService(MgServiceType.MappingService);
+ var map = (MgPortableMap)this.Viewer.GetMap();
+ var dwfVer = new MgPortableDwfVersion("6.01", "1.2");
- var layout = new MgdLayout(layoutId, "TestPlot", MgdPageUnitsType.Inches);
- var plotSpec = new MgdPlotSpecification(8.5f, 11.0f, MgdPageUnitsType.Inches, 0.5f, 0.5f, 0.5f, 0.5f);
+ var layout = new MgPortableLayout(layoutId, "TestPlot", MgPortablePageUnitsType.Inches);
+ var plotSpec = new MgPortablePlotSpecification(8.5f, 11.0f, MgPortablePageUnitsType.Inches, 0.5f, 0.5f, 0.5f, 0.5f);
var result = mappingSvc.GeneratePlot(map, plotSpec, layout, dwfVer);
var sink = new MgByteSink(result);
Modified: branches/4.0/MgDev/Portable/Samples/SampleExtension/MgProfileComponent.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/SampleExtension/MgProfileComponent.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/SampleExtension/MgProfileComponent.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,8 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
+using OSGeo.MapGuide;
using OSGeo.MapGuide.Viewer;
-using OSGeo.MapGuide;
namespace SampleExtension
{
@@ -17,9 +14,9 @@
{
var provider = this.Viewer.GetProvider();
var map = this.Viewer.GetMap();
- var prof = (MgdProfilingService)provider.CreateService(MgServiceType.ProfilingService);
- var opts = new MgdRenderingOptions("PNG", 2, new MgColor(this.Viewer.SelectionColor));
- var result = prof.ProfileRenderDynamicOverlay((MgdMap)map, (MgdSelection)this.Viewer.GetSelection(), opts);
+ var prof = (MgPortableProfilingService)provider.CreateService(MgServiceType.ProfilingService);
+ var opts = new MgPortableRenderingOptions("PNG", 2, new MgColor(this.Viewer.SelectionColor));
+ var result = prof.ProfileRenderDynamicOverlay((MgPortableMap)map, (MgPortableSelection)this.Viewer.GetSelection(), opts);
new XmlResponseDialog(result).ShowDialog();
}
}
Modified: branches/4.0/MgDev/Portable/Samples/SampleExtension/MgStartupComponent.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/SampleExtension/MgStartupComponent.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/SampleExtension/MgStartupComponent.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -10,7 +10,7 @@
{
public override void Invoke()
{
- MessageBox.Show(Layers.StartupText, "mg-desktop API Samples");
+ MessageBox.Show(Layers.StartupText, "MapGuide Portable API Samples");
}
}
}
Modified: branches/4.0/MgDev/Portable/Samples/SampleExtension/ModifyingMapsAndLayers.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/SampleExtension/ModifyingMapsAndLayers.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/SampleExtension/ModifyingMapsAndLayers.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -43,9 +43,9 @@
return;
}
- //NOTE: mg-desktop has no formal concept of a session repository, but we still
+ //NOTE: MapGuide Portable has no formal concept of a session repository, but we still
//support session-based resources as a form of temporary resource (for the duration
- //of the application). Session ids in mg-desktop can be any arbitrary string
+ //of the application). Session ids in MapGuide Portable can be any arbitrary string
string sessionId = Guid.NewGuid().ToString();
XmlDocument domDocument = new XmlDocument();
@@ -93,7 +93,7 @@
resourceService.SetResource(resourceID, byteSource.GetReader(), null);
//Insert this layer to our map
- MgdLayer newLayer = new MgdLayer(resourceID, resourceService);
+ MgPortableLayer newLayer = new MgPortableLayer(resourceID, resourceService);
newLayer.Name = layerName;
newLayer.LegendLabel = legendLabel;
newLayer.DisplayInLegend = true;
@@ -138,9 +138,9 @@
MgLayerCollection layers = map.GetLayers();
MgLayerGroupCollection groups = map.GetLayerGroups();
- //NOTE: mg-desktop has no formal concept of a session repository, but we still
+ //NOTE: MapGuide Portable has no formal concept of a session repository, but we still
//support session-based resources as a form of temporary resource (for the duration
- //of the application). Session ids in mg-desktop can be any arbitrary string
+ //of the application). Session ids in MapGuide Portable can be any arbitrary string
string sessionId = Guid.NewGuid().ToString();
if (layers.IndexOf(layerName) >= 0)
@@ -197,7 +197,7 @@
resourceService.SetResource(resourceID, byteSource.GetReader(), null);
//Insert this layer to our map
- MgdLayer newLayer = new MgdLayer(resourceID, resourceService);
+ MgPortableLayer newLayer = new MgPortableLayer(resourceID, resourceService);
newLayer.Name = layerName;
newLayer.LegendLabel = legendLabel;
newLayer.DisplayInLegend = true;
@@ -242,9 +242,9 @@
MgLayerCollection layers = map.GetLayers();
MgLayerGroupCollection groups = map.GetLayerGroups();
- //NOTE: mg-desktop has no formal concept of a session repository, but we still
+ //NOTE: MapGuide Portable has no formal concept of a session repository, but we still
//support session-based resources as a form of temporary resource (for the duration
- //of the application). Session ids in mg-desktop can be any arbitrary string
+ //of the application). Session ids in MapGuide Portable can be any arbitrary string
string sessionId = Guid.NewGuid().ToString();
if (layers.IndexOf(layerName) >= 0)
@@ -302,7 +302,7 @@
resourceService.SetResource(resourceID, byteSource.GetReader(), null);
//Insert this layer to our map
- MgdLayer newLayer = new MgdLayer(resourceID, resourceService);
+ MgPortableLayer newLayer = new MgPortableLayer(resourceID, resourceService);
newLayer.Name = layerName;
newLayer.LegendLabel = legendLabel;
newLayer.DisplayInLegend = true;
@@ -335,16 +335,16 @@
MgMapViewerProvider provider = _viewer.GetProvider();
MgResourceService resourceService = (MgResourceService)provider.CreateService(MgServiceType.ResourceService);
- //We use MgdFeatureService instead of MgFeatureService as this sample demonstrates APIs unique to mg-desktop
- MgdFeatureService featureService = (MgdFeatureService)provider.CreateService(MgServiceType.FeatureService);
+ //We use MgPortableFeatureService instead of MgFeatureService as this sample demonstrates APIs unique to MapGuide Portable
+ MgPortableFeatureService featureService = (MgPortableFeatureService)provider.CreateService(MgServiceType.FeatureService);
MgMapBase map = _viewer.GetMap();
MgLayerCollection layers = map.GetLayers();
MgLayerGroupCollection groups = map.GetLayerGroups();
- //NOTE: mg-desktop has no formal concept of a session repository, but we still
+ //NOTE: MapGuide Portable has no formal concept of a session repository, but we still
//support session-based resources as a form of temporary resource (for the duration
- //of the application). Session ids in mg-desktop can be any arbitrary string
+ //of the application). Session ids in MapGuide Portable can be any arbitrary string
string sessionId = Guid.NewGuid().ToString();
if (layers.IndexOf(layerName) >= 0)
@@ -430,7 +430,7 @@
featureService.UpdateFeatures(resourceIdentifier, featureCommandCollection, false);
*/
- // Here's the mg-desktop way
+ // Here's the MapGuide Portable way
MgFeatureReader insertResult = featureService.InsertFeatures(resourceIdentifier, "Points", batchPropertyCollection);
insertResult.Close();
@@ -495,7 +495,7 @@
resourceService.SetResource(resourceID, byteSource.GetReader(), null);
//Insert this layer to our map
- MgdLayer newLayer = new MgdLayer(resourceID, resourceService);
+ MgPortableLayer newLayer = new MgPortableLayer(resourceID, resourceService);
newLayer.Name = layerName;
newLayer.LegendLabel = legendLabel;
newLayer.DisplayInLegend = true;
Modified: branches/4.0/MgDev/Portable/Samples/SampleExtension/ResourceIdDialog.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/SampleExtension/ResourceIdDialog.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/SampleExtension/ResourceIdDialog.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -30,7 +30,7 @@
var resId = new MgResourceIdentifier(txtResourceId.Text);
resId.Validate();
- var fact = new MgdServiceFactory();
+ var fact = new MgPortableServiceFactory();
var resSvc = (MgResourceService)fact.CreateService(MgServiceType.ResourceService);
if (!resSvc.ResourceExists(resId))
{
Modified: branches/4.0/MgDev/Portable/Samples/SampleExtension/SampleExtension.csproj
===================================================================
--- branches/4.0/MgDev/Portable/Samples/SampleExtension/SampleExtension.csproj 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/SampleExtension/SampleExtension.csproj 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SampleExtension</RootNamespace>
<AssemblyName>SampleExtension</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
@@ -29,6 +29,8 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
+ <NuGetPackageImportStamp>
+ </NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
@@ -75,32 +77,9 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
- <Reference Include="OSGeo.MapGuide.Desktop">
- <HintPath>..\Lib\OSGeo.MapGuide.Desktop.dll</HintPath>
- <Private>False</Private>
- </Reference>
- <Reference Include="OSGeo.MapGuide.Foundation">
- <HintPath>..\Lib\OSGeo.MapGuide.Foundation.dll</HintPath>
- <Private>False</Private>
- </Reference>
- <Reference Include="OSGeo.MapGuide.Geometry">
- <HintPath>..\Lib\OSGeo.MapGuide.Geometry.dll</HintPath>
- <Private>False</Private>
- </Reference>
- <Reference Include="OSGeo.MapGuide.PlatformBase">
- <HintPath>..\Lib\OSGeo.MapGuide.PlatformBase.dll</HintPath>
- <Private>False</Private>
- </Reference>
- <Reference Include="OSGeo.MapGuide.Viewer">
- <HintPath>..\Lib\OSGeo.MapGuide.Viewer.dll</HintPath>
- <Private>False</Private>
- </Reference>
- <Reference Include="OSGeo.MapGuide.Viewer.Desktop">
- <HintPath>..\Lib\OSGeo.MapGuide.Viewer.Desktop.dll</HintPath>
- <Private>False</Private>
- </Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
+ <Reference Include="System.Numerics" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@@ -309,20 +288,15 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
+ <ItemGroup>
+ <PackageReference Include="OSGeo.MapGuide.Viewer.Portable">
+ <Version>4.0.0</Version>
+ </PackageReference>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
- <PostBuildEvent>if not exist "$(TargetDir)FDO" md "$(TargetDir)FDO"
-xcopy /s /y "$(SolutionDir)Lib\FDO" "$(TargetDir)FDO"
-if not exist "$(TargetDir)Dictionaries" md "$(TargetDir)Dictionaries"
-xcopy /s /y "$(SolutionDir)Lib\Dictionaries" "$(TargetDir)Dictionaries"
-if not exist "$(TargetDir)Resources" md "$(TargetDir)Resources"
-xcopy /s /y "$(SolutionDir)Lib\Resources" "$(TargetDir)Resources"
-if not exist "$(TargetDir)Schema" md "$(TargetDir)Schema"
-xcopy /s /y "$(SolutionDir)Lib\Schema" "$(TargetDir)Schema"
-copy /y "$(SolutionDir)Lib\*.dll" "$(TargetDir)"
-copy /y "$(SolutionDir)Lib\Platform.ini" "$(TargetDir)"
-copy /y "$(SolutionDir)Lib\MgAppLayout.exe" "$(TargetDir)"
-copy /y "$(SolutionDir)Lib\Sheboygan.AppLayout" "$(TargetDir)"</PostBuildEvent>
+ <PostBuildEvent>
+ </PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Modified: branches/4.0/MgDev/Portable/Samples/SampleExtension/SamplesTaskPane.cs
===================================================================
--- branches/4.0/MgDev/Portable/Samples/SampleExtension/SamplesTaskPane.cs 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/SampleExtension/SamplesTaskPane.cs 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,14 +1,9 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Drawing;
-using System.Data;
-using System.Text;
-using System.Windows.Forms;
+using OSGeo.MapGuide;
using OSGeo.MapGuide.Viewer;
using OSGeo.MapGuide.Viewer.AppLayoutEngine;
-using OSGeo.MapGuide;
-using OSGeo.MapGuide.Viewer.Desktop;
+using OSGeo.MapGuide.Viewer.Portable;
+using System;
+using System.Windows.Forms;
namespace SampleExtension
{
@@ -20,7 +15,7 @@
{
InitializeComponent();
_viewer = viewer;
- this.Title = "mg-desktop API Samples";
+ this.Title = "MapGuide Portable API Samples";
}
private void OnActionClick(object sender, EventArgs e)
@@ -38,7 +33,7 @@
{
_viewer.ClearSelection();
MgResourceIdentifier mdfId = new MgResourceIdentifier("Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition");
- MgdMap map = new MgdMap(mdfId);
+ MgPortableMap map = new MgPortableMap(mdfId);
MgPortableMapViewerProvider provider = new MgPortableMapViewerProvider(map);
Shell.Instance.ReloadViewer(provider);
}
Modified: branches/4.0/MgDev/Portable/Samples/SampleExtension/sample_readme.txt
===================================================================
--- branches/4.0/MgDev/Portable/Samples/SampleExtension/sample_readme.txt 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/SampleExtension/sample_readme.txt 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,15 +1,13 @@
SampleExtension readme
======================
-SampleExtension is an AppLayout extension that demonstrates usages of the mg-desktop API.
+SampleExtension is an AppLayout extension that demonstrates usages of the MapGuide Portable API.
-It is effectively the "MapGuide Developer's Guide" samples converted over for use inside mg-desktop. If you ever look at the code, you will see that it isn't really that much different (just ASP.net-isms replaced with WinForms-isms)
+It is effectively the "MapGuide Developer's Guide" samples converted over for use inside MapGuide Portable. If you ever look at the code, you will see that it isn't really that much different (just ASP.net-isms replaced with WinForms-isms)
Building the SampleExtension
============================
-In Visual Studio, open the SampleExtension.csproj if you downloaded the .net 2.0 binary distribution (or SampleExtension.Net40.csproj if you downloaded the .net 4.0 binary distribution)
+The extension already references the MapGuide Portable nuget package (and transitively its MapGuide API nuget packages), so just build the project.
-Fix the broken references with the matching dlls from your mg-desktop binary distribution. This should allow you to build the SampleExtension project.
-
Once built, you will have a SampleExtension.dll in your output directory, the components defined in this dll can then be referenced from within the AppLayout engine. The Sheboygan.AppLayout already does this.
\ No newline at end of file
Modified: branches/4.0/MgDev/Portable/Samples/samples_readme.txt
===================================================================
--- branches/4.0/MgDev/Portable/Samples/samples_readme.txt 2025-08-18 13:53:11 UTC (rev 10174)
+++ branches/4.0/MgDev/Portable/Samples/samples_readme.txt 2025-08-21 13:39:07 UTC (rev 10175)
@@ -1,21 +1,17 @@
-mg-desktop samples README
+MapGuide Portable samples README
=========================
-The following samples all require the Sheboygan sample dataset. For these samples to build, copy your mg-desktop files (and its subfolders) into the Lib directory, you must use the correct build of mg-desktop for the version of VS you are using to open this solution file:
+The following samples all require the Sheboygan sample dataset
- - MgPortableSamples.sln: mg-desktop .net Framework 4.0, VC11 build
-
-Note that in order to use mg-desktop, your main executable must have CPU architecture set to x86 (because these are .net wrappers to 32-bit unmanaged dlls). All the executable projects in this solution have their CPU architecture set to x86
-
BasicSample
===========
-Demonstrates a basic Windows Forms Application that embeds the mg-desktop map viewer
+Demonstrates a basic Windows Forms Application that embeds the MapGuide Portable map viewer
AdvancedSample
==============
-Demonstrates a Windows Forms Application that embeds the mg-desktop map viewer and shows how to do things like measuring and digitizing
+Demonstrates a Windows Forms Application that embeds the MapGuide Portable map viewer and shows how to do things like measuring and digitizing
FreeFormSample
==============
@@ -25,7 +21,7 @@
SampleExtension
===============
-The MapGuide Developer's Guide fully ported to mg-desktop in the form of an mg-desktop AppLayout extension module. This is the most comprehensive demonstration of the mg-desktop API
+The MapGuide Developer's Guide fully ported to MapGuide Portable in the form of an MapGuide Portable AppLayout extension module. This is the most comprehensive demonstration of the MapGuide Portable API
To run this particular sample extension, build it in Visual Studio, then run from the command-line of the project's output directory:
More information about the mapguide-commits
mailing list