[mapguide-commits] r5766 - in trunk/Tools/Maestro/SDK/Samples: . DwfInspector DwfInspector/Properties SchemaViewer

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue May 10 07:07:12 EDT 2011


Author: jng
Date: 2011-05-10 04:07:12 -0700 (Tue, 10 May 2011)
New Revision: 5766

Added:
   trunk/Tools/Maestro/SDK/Samples/DwfInspector/
   trunk/Tools/Maestro/SDK/Samples/DwfInspector/DwfInspector.csproj
   trunk/Tools/Maestro/SDK/Samples/DwfInspector/Form1.Designer.cs
   trunk/Tools/Maestro/SDK/Samples/DwfInspector/Form1.cs
   trunk/Tools/Maestro/SDK/Samples/DwfInspector/Form1.resx
   trunk/Tools/Maestro/SDK/Samples/DwfInspector/Program.cs
   trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/
   trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/AssemblyInfo.cs
   trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/Resources.Designer.cs
   trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/Resources.resx
   trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/Settings.Designer.cs
   trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/Settings.settings
   trunk/Tools/Maestro/SDK/Samples/DwfInspector/SectionInfoCtrl.Designer.cs
   trunk/Tools/Maestro/SDK/Samples/DwfInspector/SectionInfoCtrl.cs
   trunk/Tools/Maestro/SDK/Samples/DwfInspector/SectionInfoCtrl.resx
Modified:
   trunk/Tools/Maestro/SDK/Samples/Samples.sln
   trunk/Tools/Maestro/SDK/Samples/SchemaViewer/Form1.cs
Log:
#1676: The samples. They keep on coming. This submission adds a DwfInspector sample, using the Drawing Service APIs to inspect a Drawing Source or a DWF file that is uploaded as a temp Drawing Source


Added: trunk/Tools/Maestro/SDK/Samples/DwfInspector/DwfInspector.csproj
===================================================================
--- trunk/Tools/Maestro/SDK/Samples/DwfInspector/DwfInspector.csproj	                        (rev 0)
+++ trunk/Tools/Maestro/SDK/Samples/DwfInspector/DwfInspector.csproj	2011-05-10 11:07:12 UTC (rev 5766)
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{F568A956-4D93-46DF-856A-01883CA61CBB}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>DwfInspector</RootNamespace>
+    <AssemblyName>DwfInspector</AssemblyName>
+    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Maestro.Editors, Version=3.0.0.5728, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\bin\Maestro.Editors.dll</HintPath>
+    </Reference>
+    <Reference Include="Maestro.Login, Version=3.0.0.5728, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\bin\Maestro.Login.dll</HintPath>
+    </Reference>
+    <Reference Include="OSGeo.MapGuide.MaestroAPI, Version=3.0.0.5728, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\bin\OSGeo.MapGuide.MaestroAPI.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Form1.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Form1.Designer.cs">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="Form1.resx">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="SectionInfoCtrl.resx">
+      <DependentUpon>SectionInfoCtrl.cs</DependentUpon>
+    </EmbeddedResource>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+    <Compile Include="SectionInfoCtrl.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SectionInfoCtrl.Designer.cs">
+      <DependentUpon>SectionInfoCtrl.cs</DependentUpon>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="..\..\bin\ConnectionProviders.xml">
+      <Link>ConnectionProviders.xml</Link>
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="..\..\bin\OSGeo.MapGuide.MaestroAPI.Http.dll">
+      <Link>OSGeo.MapGuide.MaestroAPI.Http.dll</Link>
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+  </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.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
\ No newline at end of file

Added: trunk/Tools/Maestro/SDK/Samples/DwfInspector/Form1.Designer.cs
===================================================================
--- trunk/Tools/Maestro/SDK/Samples/DwfInspector/Form1.Designer.cs	                        (rev 0)
+++ trunk/Tools/Maestro/SDK/Samples/DwfInspector/Form1.Designer.cs	2011-05-10 11:07:12 UTC (rev 5766)
@@ -0,0 +1,240 @@
+namespace DwfInspector
+{
+    partial class Form1
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.btnInspect = new System.Windows.Forms.Button();
+            this.btnUpload = new System.Windows.Forms.Button();
+            this.btnBrowseDwf = new System.Windows.Forms.Button();
+            this.btnBrowseDs = new System.Windows.Forms.Button();
+            this.txtDwfPath = new System.Windows.Forms.TextBox();
+            this.txtDrawingSource = new System.Windows.Forms.TextBox();
+            this.rdDwfFile = new System.Windows.Forms.RadioButton();
+            this.rdDrawingSource = new System.Windows.Forms.RadioButton();
+            this.groupBox2 = new System.Windows.Forms.GroupBox();
+            this.lstSections = new System.Windows.Forms.ListBox();
+            this.groupBox3 = new System.Windows.Forms.GroupBox();
+            this.lstLayers = new System.Windows.Forms.ListBox();
+            this.grpSectionDetails = new System.Windows.Forms.GroupBox();
+            this.groupBox1.SuspendLayout();
+            this.groupBox2.SuspendLayout();
+            this.groupBox3.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                        | System.Windows.Forms.AnchorStyles.Right)));
+            this.groupBox1.Controls.Add(this.btnInspect);
+            this.groupBox1.Controls.Add(this.btnUpload);
+            this.groupBox1.Controls.Add(this.btnBrowseDwf);
+            this.groupBox1.Controls.Add(this.btnBrowseDs);
+            this.groupBox1.Controls.Add(this.txtDwfPath);
+            this.groupBox1.Controls.Add(this.txtDrawingSource);
+            this.groupBox1.Controls.Add(this.rdDwfFile);
+            this.groupBox1.Controls.Add(this.rdDrawingSource);
+            this.groupBox1.Location = new System.Drawing.Point(13, 13);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(874, 88);
+            this.groupBox1.TabIndex = 0;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "DWF File";
+            // 
+            // btnInspect
+            // 
+            this.btnInspect.Location = new System.Drawing.Point(446, 26);
+            this.btnInspect.Name = "btnInspect";
+            this.btnInspect.Size = new System.Drawing.Size(55, 23);
+            this.btnInspect.TabIndex = 1;
+            this.btnInspect.Text = "Inspect";
+            this.btnInspect.UseVisualStyleBackColor = true;
+            this.btnInspect.Click += new System.EventHandler(this.btnInspect_Click);
+            // 
+            // btnUpload
+            // 
+            this.btnUpload.Location = new System.Drawing.Point(446, 50);
+            this.btnUpload.Name = "btnUpload";
+            this.btnUpload.Size = new System.Drawing.Size(55, 23);
+            this.btnUpload.TabIndex = 6;
+            this.btnUpload.Text = "Upload";
+            this.btnUpload.UseVisualStyleBackColor = true;
+            this.btnUpload.Click += new System.EventHandler(this.btnUpload_Click);
+            // 
+            // btnBrowseDwf
+            // 
+            this.btnBrowseDwf.Location = new System.Drawing.Point(385, 50);
+            this.btnBrowseDwf.Name = "btnBrowseDwf";
+            this.btnBrowseDwf.Size = new System.Drawing.Size(55, 23);
+            this.btnBrowseDwf.TabIndex = 5;
+            this.btnBrowseDwf.Text = "Browse";
+            this.btnBrowseDwf.UseVisualStyleBackColor = true;
+            this.btnBrowseDwf.Click += new System.EventHandler(this.btnBrowseDwf_Click);
+            // 
+            // btnBrowseDs
+            // 
+            this.btnBrowseDs.Location = new System.Drawing.Point(385, 26);
+            this.btnBrowseDs.Name = "btnBrowseDs";
+            this.btnBrowseDs.Size = new System.Drawing.Size(55, 23);
+            this.btnBrowseDs.TabIndex = 4;
+            this.btnBrowseDs.Text = "Browse";
+            this.btnBrowseDs.UseVisualStyleBackColor = true;
+            this.btnBrowseDs.Click += new System.EventHandler(this.btnBrowseDs_Click);
+            // 
+            // txtDwfPath
+            // 
+            this.txtDwfPath.Location = new System.Drawing.Point(140, 52);
+            this.txtDwfPath.Name = "txtDwfPath";
+            this.txtDwfPath.ReadOnly = true;
+            this.txtDwfPath.Size = new System.Drawing.Size(238, 20);
+            this.txtDwfPath.TabIndex = 3;
+            // 
+            // txtDrawingSource
+            // 
+            this.txtDrawingSource.Location = new System.Drawing.Point(140, 28);
+            this.txtDrawingSource.Name = "txtDrawingSource";
+            this.txtDrawingSource.ReadOnly = true;
+            this.txtDrawingSource.Size = new System.Drawing.Size(238, 20);
+            this.txtDrawingSource.TabIndex = 2;
+            // 
+            // rdDwfFile
+            // 
+            this.rdDwfFile.AutoSize = true;
+            this.rdDwfFile.Location = new System.Drawing.Point(18, 53);
+            this.rdDwfFile.Name = "rdDwfFile";
+            this.rdDwfFile.Size = new System.Drawing.Size(106, 17);
+            this.rdDwfFile.TabIndex = 1;
+            this.rdDwfFile.TabStop = true;
+            this.rdDwfFile.Text = "Upload DWF File";
+            this.rdDwfFile.UseVisualStyleBackColor = true;
+            this.rdDwfFile.CheckedChanged += new System.EventHandler(this.rdDrawingSource_CheckedChanged);
+            // 
+            // rdDrawingSource
+            // 
+            this.rdDrawingSource.AutoSize = true;
+            this.rdDrawingSource.Location = new System.Drawing.Point(18, 29);
+            this.rdDrawingSource.Name = "rdDrawingSource";
+            this.rdDrawingSource.Size = new System.Drawing.Size(101, 17);
+            this.rdDrawingSource.TabIndex = 0;
+            this.rdDrawingSource.TabStop = true;
+            this.rdDrawingSource.Text = "Drawing Source";
+            this.rdDrawingSource.UseVisualStyleBackColor = true;
+            this.rdDrawingSource.CheckedChanged += new System.EventHandler(this.rdDrawingSource_CheckedChanged);
+            // 
+            // groupBox2
+            // 
+            this.groupBox2.Controls.Add(this.lstSections);
+            this.groupBox2.Location = new System.Drawing.Point(13, 108);
+            this.groupBox2.Name = "groupBox2";
+            this.groupBox2.Size = new System.Drawing.Size(168, 131);
+            this.groupBox2.TabIndex = 1;
+            this.groupBox2.TabStop = false;
+            this.groupBox2.Text = "DWF Sections";
+            // 
+            // lstSections
+            // 
+            this.lstSections.DisplayMember = "Name";
+            this.lstSections.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.lstSections.FormattingEnabled = true;
+            this.lstSections.Location = new System.Drawing.Point(3, 16);
+            this.lstSections.Name = "lstSections";
+            this.lstSections.Size = new System.Drawing.Size(162, 108);
+            this.lstSections.TabIndex = 0;
+            this.lstSections.SelectedIndexChanged += new System.EventHandler(this.lstSections_SelectedIndexChanged);
+            // 
+            // groupBox3
+            // 
+            this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                        | System.Windows.Forms.AnchorStyles.Left)));
+            this.groupBox3.Controls.Add(this.lstLayers);
+            this.groupBox3.Location = new System.Drawing.Point(13, 245);
+            this.groupBox3.Name = "groupBox3";
+            this.groupBox3.Size = new System.Drawing.Size(168, 346);
+            this.groupBox3.TabIndex = 2;
+            this.groupBox3.TabStop = false;
+            this.groupBox3.Text = "DWF Layers";
+            // 
+            // lstLayers
+            // 
+            this.lstLayers.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.lstLayers.FormattingEnabled = true;
+            this.lstLayers.Location = new System.Drawing.Point(3, 16);
+            this.lstLayers.Name = "lstLayers";
+            this.lstLayers.Size = new System.Drawing.Size(162, 316);
+            this.lstLayers.TabIndex = 0;
+            // 
+            // grpSectionDetails
+            // 
+            this.grpSectionDetails.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                        | System.Windows.Forms.AnchorStyles.Left)
+                        | System.Windows.Forms.AnchorStyles.Right)));
+            this.grpSectionDetails.Location = new System.Drawing.Point(188, 108);
+            this.grpSectionDetails.Name = "grpSectionDetails";
+            this.grpSectionDetails.Size = new System.Drawing.Size(699, 483);
+            this.grpSectionDetails.TabIndex = 3;
+            this.grpSectionDetails.TabStop = false;
+            this.grpSectionDetails.Text = "Section Details";
+            // 
+            // Form1
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(907, 603);
+            this.Controls.Add(this.grpSectionDetails);
+            this.Controls.Add(this.groupBox3);
+            this.Controls.Add(this.groupBox2);
+            this.Controls.Add(this.groupBox1);
+            this.Name = "Form1";
+            this.Text = "DwfInspector Example";
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.PerformLayout();
+            this.groupBox2.ResumeLayout(false);
+            this.groupBox3.ResumeLayout(false);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.Button btnUpload;
+        private System.Windows.Forms.Button btnBrowseDwf;
+        private System.Windows.Forms.Button btnBrowseDs;
+        private System.Windows.Forms.TextBox txtDwfPath;
+        private System.Windows.Forms.TextBox txtDrawingSource;
+        private System.Windows.Forms.RadioButton rdDwfFile;
+        private System.Windows.Forms.RadioButton rdDrawingSource;
+        private System.Windows.Forms.Button btnInspect;
+        private System.Windows.Forms.GroupBox groupBox2;
+        private System.Windows.Forms.ListBox lstSections;
+        private System.Windows.Forms.GroupBox groupBox3;
+        private System.Windows.Forms.ListBox lstLayers;
+        private System.Windows.Forms.GroupBox grpSectionDetails;
+    }
+}
+

Added: trunk/Tools/Maestro/SDK/Samples/DwfInspector/Form1.cs
===================================================================
--- trunk/Tools/Maestro/SDK/Samples/DwfInspector/Form1.cs	                        (rev 0)
+++ trunk/Tools/Maestro/SDK/Samples/DwfInspector/Form1.cs	2011-05-10 11:07:12 UTC (rev 5766)
@@ -0,0 +1,176 @@
+#region Disclaimer / License
+// Copyright (C) 2011, 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.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using OSGeo.MapGuide.MaestroAPI;
+using System.IO;
+using Maestro.Editors.Generic;
+using OSGeo.MapGuide.MaestroAPI.Services;
+using OSGeo.MapGuide.ObjectModels.DrawingSource;
+using OSGeo.MapGuide.ObjectModels;
+
+namespace DwfInspector
+{
+    public partial class Form1 : Form
+    {
+        public Form1()
+        {
+            InitializeComponent();
+        }
+
+        private IServerConnection _conn;
+        private IDrawingService _dwSvc;
+
+        protected override void OnLoad(EventArgs e)
+        {
+            //Anytime we work with the Maestro API, we require an IServerConnection
+            //reference. The Maestro.Login.LoginDialog provides a UI to obtain such a 
+            //reference.
+
+            //If you need to obtain an IServerConnection reference programmatically and
+            //without user intervention, use the ConnectionProviderRegistry class
+            var login = new Maestro.Login.LoginDialog();
+            if (login.ShowDialog() == DialogResult.OK)
+            {
+                _conn = login.Connection;
+
+                //Connections carry a capability property that tells you what is and isn't supported. 
+                //Here we need to check if this connection supports the IDrawingService interface. If
+                //it doesn't we can't continue.
+                if (Array.IndexOf(_conn.Capabilities.SupportedServices, (int)ServiceType.Drawing) < 0)
+                {
+                    MessageBox.Show("This particular connection does not support the Drawing Service API");
+                    Application.Exit();
+                    return;
+                }
+
+                //For any non-standard service interface, we call GetService() passing in the service type and casting
+                //it to the required service interface.
+                _dwSvc = (IDrawingService)_conn.GetService((int)ServiceType.Drawing);
+            }
+            else //This sample does not work without an IServerConnection
+            {
+                Application.Exit();
+            }
+        }
+
+        private void rdDrawingSource_CheckedChanged(object sender, EventArgs e)
+        {
+            btnBrowseDs.Enabled = btnBrowseDwf.Enabled = btnUpload.Enabled = false;
+            if (rdDrawingSource.Checked)
+                btnBrowseDs.Enabled = true;
+            else if (rdDwfFile.Checked)
+                btnBrowseDwf.Enabled = btnUpload.Enabled = true;
+        }
+
+        private void btnBrowseDs_Click(object sender, EventArgs e)
+        {
+            //The ResourcePicker class, functions like a file dialog allowing the user
+            //to easily select a given resource. In our case, we want the user to select
+            //a Drawing Source
+            using (var picker = new ResourcePicker(_conn.ResourceService,
+                                                   ResourceTypes.DrawingSource,
+                                                   ResourcePickerMode.OpenResource))
+            {
+                if (picker.ShowDialog() == DialogResult.OK)
+                {
+                    txtDrawingSource.Text = picker.ResourceID;
+                }
+            }
+        }
+
+        private void btnBrowseDwf_Click(object sender, EventArgs e)
+        {
+            using (var open = new OpenFileDialog())
+            {
+                open.Filter = "DWF Files (*.dwf)|*.dwf";
+                if (open.ShowDialog() == DialogResult.OK)
+                {
+                    txtDwfPath.Text = open.FileName;
+                }
+            }
+        }
+
+        private void btnUpload_Click(object sender, EventArgs e)
+        {
+            if (!File.Exists(txtDwfPath.Text))
+            {
+                MessageBox.Show("File does not exist");
+                return;
+            }
+
+            // Create a MapGuide Drawing Source and store it in the session repository
+            // The DWF file we upload must be the same name as the SourceName property
+            // in the DrawingSource and the resource data name that we are uploading as
+
+            IDrawingSource ds = ObjectFactory.CreateDrawingSource(_conn);
+            ds.SourceName = Path.GetFileName(txtDwfPath.Text);
+
+            string resId = "Session:" + _conn.SessionID + "//InspectedDwf.DrawingSource";
+            _conn.ResourceService.SaveResourceAs(ds, resId);
+            _conn.ResourceService.SetResourceData(resId, ds.SourceName, OSGeo.MapGuide.ObjectModels.Common.ResourceDataType.File, File.OpenRead(txtDwfPath.Text));
+
+            txtDrawingSource.Text = resId;
+            rdDrawingSource.Checked = true;
+        }
+
+        private void btnInspect_Click(object sender, EventArgs e)
+        {
+            if (string.IsNullOrEmpty(txtDrawingSource.Text) || !_conn.ResourceService.ResourceExists(txtDrawingSource.Text))
+            {
+                MessageBox.Show("Could not find the specified drawing source. Please select a valid drawing source or upload a DWF file");
+                return;
+            }
+
+            //Call the EnumerateDrawingSections API of Drawing Service
+            var sections = _dwSvc.EnumerateDrawingSections(txtDrawingSource.Text);
+
+            //Bind the Section property which is a BindingList, to the sections ListBox
+            lstSections.DataSource = sections.Section;
+        }
+
+        private void lstSections_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            var section = lstSections.SelectedItem as OSGeo.MapGuide.ObjectModels.Common.DrawingSectionListSection;
+            if (section != null)
+            {
+                //Enumerate the drawing layers of this section and bind the result to the layers ListBox
+                var layers = _dwSvc.EnumerateDrawingLayers(txtDrawingSource.Text, section.Name);
+                lstLayers.DataSource = layers;
+
+                //Load the section info control, which will show more information about this section
+                var ctrl = new SectionInfoCtrl(_dwSvc, txtDrawingSource.Text, section);
+                ctrl.Dock = DockStyle.Fill;
+                grpSectionDetails.Controls.Clear();
+                grpSectionDetails.Controls.Add(ctrl);
+            }
+            else
+            {
+                lstLayers.DataSource = null;
+                grpSectionDetails.Controls.Clear();
+            }
+        }
+    }
+}

Added: trunk/Tools/Maestro/SDK/Samples/DwfInspector/Form1.resx
===================================================================
--- trunk/Tools/Maestro/SDK/Samples/DwfInspector/Form1.resx	                        (rev 0)
+++ trunk/Tools/Maestro/SDK/Samples/DwfInspector/Form1.resx	2011-05-10 11:07:12 UTC (rev 5766)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>
\ No newline at end of file

Added: trunk/Tools/Maestro/SDK/Samples/DwfInspector/Program.cs
===================================================================
--- trunk/Tools/Maestro/SDK/Samples/DwfInspector/Program.cs	                        (rev 0)
+++ trunk/Tools/Maestro/SDK/Samples/DwfInspector/Program.cs	2011-05-10 11:07:12 UTC (rev 5766)
@@ -0,0 +1,39 @@
+#region Disclaimer / License
+// Copyright (C) 2011, 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.Windows.Forms;
+
+namespace DwfInspector
+{
+    static class Program
+    {
+        /// <summary>
+        /// The main entry point for the application.
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            Application.EnableVisualStyles();
+            Application.SetCompatibleTextRenderingDefault(false);
+            Application.Run(new Form1());
+        }
+    }
+}

Added: trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/AssemblyInfo.cs
===================================================================
--- trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/AssemblyInfo.cs	                        (rev 0)
+++ trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/AssemblyInfo.cs	2011-05-10 11:07:12 UTC (rev 5766)
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("DwfInspector")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("DwfInspector")]
+[assembly: AssemblyCopyright("Copyright ©  2011")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("6e7c4dac-5379-4ac1-91b7-9a6f40aec540")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

Added: trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/Resources.Designer.cs
===================================================================
--- trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/Resources.Designer.cs	                        (rev 0)
+++ trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/Resources.Designer.cs	2011-05-10 11:07:12 UTC (rev 5766)
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:2.0.50727.4952
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace DwfInspector.Properties
+{
+
+
+    /// <summary>
+    ///   A strongly-typed resource class, for looking up localized strings, etc.
+    /// </summary>
+    // This class was auto-generated by the StronglyTypedResourceBuilder
+    // 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", "2.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources
+    {
+
+        private static global::System.Resources.ResourceManager resourceMan;
+
+        private static global::System.Globalization.CultureInfo resourceCulture;
+
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources()
+        {
+        }
+
+        /// <summary>
+        ///   Returns the cached ResourceManager instance used by this class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager
+        {
+            get
+            {
+                if ((resourceMan == null))
+                {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DwfInspector.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+
+        /// <summary>
+        ///   Overrides the current thread's CurrentUICulture property for all
+        ///   resource lookups using this strongly typed resource class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture
+        {
+            get
+            {
+                return resourceCulture;
+            }
+            set
+            {
+                resourceCulture = value;
+            }
+        }
+    }
+}

Added: trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/Resources.resx
===================================================================
--- trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/Resources.resx	                        (rev 0)
+++ trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/Resources.resx	2011-05-10 11:07:12 UTC (rev 5766)
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>
\ No newline at end of file

Added: trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/Settings.Designer.cs
===================================================================
--- trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/Settings.Designer.cs	                        (rev 0)
+++ trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/Settings.Designer.cs	2011-05-10 11:07:12 UTC (rev 5766)
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:2.0.50727.4952
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace DwfInspector.Properties
+{
+
+
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+    {
+
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+        public static Settings Default
+        {
+            get
+            {
+                return defaultInstance;
+            }
+        }
+    }
+}

Added: trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/Settings.settings
===================================================================
--- trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/Settings.settings	                        (rev 0)
+++ trunk/Tools/Maestro/SDK/Samples/DwfInspector/Properties/Settings.settings	2011-05-10 11:07:12 UTC (rev 5766)
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

Added: trunk/Tools/Maestro/SDK/Samples/DwfInspector/SectionInfoCtrl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/SDK/Samples/DwfInspector/SectionInfoCtrl.Designer.cs	                        (rev 0)
+++ trunk/Tools/Maestro/SDK/Samples/DwfInspector/SectionInfoCtrl.Designer.cs	2011-05-10 11:07:12 UTC (rev 5766)
@@ -0,0 +1,137 @@
+namespace DwfInspector
+{
+    partial class SectionInfoCtrl
+    {
+        /// <summary> 
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Component Designer generated code
+
+        /// <summary> 
+        /// Required method for Designer support - do not modify 
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.groupBox2 = new System.Windows.Forms.GroupBox();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.pictureBox1 = new System.Windows.Forms.PictureBox();
+            this.grdResources = new System.Windows.Forms.DataGridView();
+            this.groupBox3 = new System.Windows.Forms.GroupBox();
+            this.txtXml = new System.Windows.Forms.TextBox();
+            this.groupBox2.SuspendLayout();
+            this.groupBox1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.grdResources)).BeginInit();
+            this.groupBox3.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // groupBox2
+            // 
+            this.groupBox2.Controls.Add(this.grdResources);
+            this.groupBox2.Location = new System.Drawing.Point(7, 12);
+            this.groupBox2.Name = "groupBox2";
+            this.groupBox2.Size = new System.Drawing.Size(671, 127);
+            this.groupBox2.TabIndex = 1;
+            this.groupBox2.TabStop = false;
+            this.groupBox2.Text = "Section Resources";
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.pictureBox1);
+            this.groupBox1.Location = new System.Drawing.Point(7, 145);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(249, 204);
+            this.groupBox1.TabIndex = 2;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "Thumbnail";
+            // 
+            // pictureBox1
+            // 
+            this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.pictureBox1.Location = new System.Drawing.Point(3, 16);
+            this.pictureBox1.Name = "pictureBox1";
+            this.pictureBox1.Size = new System.Drawing.Size(243, 185);
+            this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
+            this.pictureBox1.TabIndex = 0;
+            this.pictureBox1.TabStop = false;
+            // 
+            // grdResources
+            // 
+            this.grdResources.AllowUserToAddRows = false;
+            this.grdResources.AllowUserToDeleteRows = false;
+            this.grdResources.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.grdResources.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.grdResources.Location = new System.Drawing.Point(3, 16);
+            this.grdResources.Name = "grdResources";
+            this.grdResources.ReadOnly = true;
+            this.grdResources.Size = new System.Drawing.Size(665, 108);
+            this.grdResources.TabIndex = 0;
+            this.grdResources.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdResources_CellClick);
+            this.grdResources.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdResources_CellClick);
+            // 
+            // groupBox3
+            // 
+            this.groupBox3.Controls.Add(this.txtXml);
+            this.groupBox3.Location = new System.Drawing.Point(263, 146);
+            this.groupBox3.Name = "groupBox3";
+            this.groupBox3.Size = new System.Drawing.Size(418, 321);
+            this.groupBox3.TabIndex = 3;
+            this.groupBox3.TabStop = false;
+            this.groupBox3.Text = "XML Content";
+            // 
+            // txtXml
+            // 
+            this.txtXml.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.txtXml.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.txtXml.Location = new System.Drawing.Point(3, 16);
+            this.txtXml.Multiline = true;
+            this.txtXml.Name = "txtXml";
+            this.txtXml.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+            this.txtXml.Size = new System.Drawing.Size(412, 302);
+            this.txtXml.TabIndex = 0;
+            // 
+            // SectionInfoCtrl
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.groupBox3);
+            this.Controls.Add(this.groupBox1);
+            this.Controls.Add(this.groupBox2);
+            this.Name = "SectionInfoCtrl";
+            this.Size = new System.Drawing.Size(684, 480);
+            this.groupBox2.ResumeLayout(false);
+            this.groupBox1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.grdResources)).EndInit();
+            this.groupBox3.ResumeLayout(false);
+            this.groupBox3.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.GroupBox groupBox2;
+        private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.PictureBox pictureBox1;
+        private System.Windows.Forms.DataGridView grdResources;
+        private System.Windows.Forms.GroupBox groupBox3;
+        private System.Windows.Forms.TextBox txtXml;
+    }
+}

Added: trunk/Tools/Maestro/SDK/Samples/DwfInspector/SectionInfoCtrl.cs
===================================================================
--- trunk/Tools/Maestro/SDK/Samples/DwfInspector/SectionInfoCtrl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/SDK/Samples/DwfInspector/SectionInfoCtrl.cs	2011-05-10 11:07:12 UTC (rev 5766)
@@ -0,0 +1,105 @@
+#region Disclaimer / License
+// Copyright (C) 2011, 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.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+using OSGeo.MapGuide.MaestroAPI.Services;
+using System.IO;
+
+namespace DwfInspector
+{
+    /// <summary>
+    /// This control shows more information about the specified DWF section
+    /// </summary>
+    public partial class SectionInfoCtrl : UserControl
+    {
+        private SectionInfoCtrl()
+        {
+            InitializeComponent();
+        }
+
+        private IDrawingService _drawSvc;
+        private string _drawingSourceId;
+        private OSGeo.MapGuide.ObjectModels.Common.DrawingSectionListSection _section;
+
+        public SectionInfoCtrl(IDrawingService drawSvc, string drawingSourceId, OSGeo.MapGuide.ObjectModels.Common.DrawingSectionListSection section)
+            : this()
+        {
+            _drawSvc = drawSvc;
+            _drawingSourceId = drawingSourceId;
+            _section = section;
+        }
+
+        protected override void OnLoad(EventArgs e)
+        {
+            //Call the EnumerateDrawingSectionResources API of Drawing Service and bind the result to the grid view
+            var list = _drawSvc.EnumerateDrawingSectionResources(_drawingSourceId, _section.Name);
+            grdResources.DataSource = list.SectionResource;
+        }
+
+        private void grdResources_CellClick(object sender, DataGridViewCellEventArgs e)
+        {
+            if (e.RowIndex < 0 || e.ColumnIndex < 0)
+                return;
+
+            var row = grdResources.Rows[e.RowIndex];
+
+            //Because we bound a strongly-typed list to the grid view, each DataGridViewRow has a DataBoundItem property
+            //which is the indivdual object from the list we bound to
+            var res = row.DataBoundItem as OSGeo.MapGuide.ObjectModels.Common.DrawingSectionResourceListSectionResource;
+            pictureBox1.Image = null;
+            txtXml.Text = string.Empty;
+
+            //Depending on role, show a preview of the item
+            if (res != null)
+            {
+                //These are image streams. We can convert these to System.Drawing.Image objects for display
+                //in a System.Windows.Forms.PictureBox
+                if (res.Role == "thumbnail" || res.Role == "preview")
+                {
+                    using (var stream = _drawSvc.GetSectionResource(_drawingSourceId, res.Href))
+                    {
+                        pictureBox1.Image = Image.FromStream(stream);
+                    }
+                }
+                else if (res.Role == "descriptor" || res.Role == "AutoCAD Viewport Data") 
+                {
+                    //These are plain-text content, which we can house in a System.IO.StreamReader that can 
+                    //get the text content.
+                    using (var stream = _drawSvc.GetSectionResource(_drawingSourceId, res.Href))
+                    {
+                        using (var sr = new StreamReader(stream))
+                        {
+                            txtXml.Text = sr.ReadToEnd();
+                        }
+                    }
+                }
+                else //We have no idea how to preview these at the moment.
+                {
+                    txtXml.Text = "This resource cannot be previewed";
+                }
+            }
+        }
+    }
+}

Added: trunk/Tools/Maestro/SDK/Samples/DwfInspector/SectionInfoCtrl.resx
===================================================================
--- trunk/Tools/Maestro/SDK/Samples/DwfInspector/SectionInfoCtrl.resx	                        (rev 0)
+++ trunk/Tools/Maestro/SDK/Samples/DwfInspector/SectionInfoCtrl.resx	2011-05-10 11:07:12 UTC (rev 5766)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/SDK/Samples/Samples.sln
===================================================================
--- trunk/Tools/Maestro/SDK/Samples/Samples.sln	2011-05-09 15:18:08 UTC (rev 5765)
+++ trunk/Tools/Maestro/SDK/Samples/Samples.sln	2011-05-10 11:07:12 UTC (rev 5766)
@@ -7,6 +7,8 @@
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchemaViewer", "SchemaViewer\SchemaViewer.csproj", "{6105DB0C-65F5-47DF-B3AE-36A430EC16E0}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DwfInspector", "DwfInspector\DwfInspector.csproj", "{F568A956-4D93-46DF-856A-01883CA61CBB}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -25,6 +27,10 @@
 		{6105DB0C-65F5-47DF-B3AE-36A430EC16E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{6105DB0C-65F5-47DF-B3AE-36A430EC16E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{6105DB0C-65F5-47DF-B3AE-36A430EC16E0}.Release|Any CPU.Build.0 = Release|Any CPU
+		{F568A956-4D93-46DF-856A-01883CA61CBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{F568A956-4D93-46DF-856A-01883CA61CBB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{F568A956-4D93-46DF-856A-01883CA61CBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{F568A956-4D93-46DF-856A-01883CA61CBB}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

Modified: trunk/Tools/Maestro/SDK/Samples/SchemaViewer/Form1.cs
===================================================================
--- trunk/Tools/Maestro/SDK/Samples/SchemaViewer/Form1.cs	2011-05-09 15:18:08 UTC (rev 5765)
+++ trunk/Tools/Maestro/SDK/Samples/SchemaViewer/Form1.cs	2011-05-10 11:07:12 UTC (rev 5766)
@@ -62,7 +62,7 @@
         {
             //The ResourcePicker class, functions like a file dialog allowing the user
             //to easily select a given resource. In our case, we want the user to select
-            //a Map Definition
+            //a Feature Source
             using (var picker = new ResourcePicker(_conn.ResourceService,
                                                    ResourceTypes.FeatureSource,
                                                    ResourcePickerMode.OpenResource))



More information about the mapguide-commits mailing list