|
From: <mcu...@us...> - 2011-06-28 01:16:23
|
Revision: 1472
http://orm.svn.sourceforge.net/orm/?rev=1472&view=rev
Author: mcurland
Date: 2011-06-28 01:16:16 +0000 (Tue, 28 Jun 2011)
Log Message:
-----------
* Remove check for VSHPROPID_IsNewUnsavedItem and add processing instructions indicate a new file to all templates and wizards. Modifies heuristics for showing import error message added in [1226]
* Modeling project items not installing in VS2010, remove condition from setup
Modified Paths:
--------------
trunk/ORMModel/Shell/ORMDocData.cs
trunk/ORMModel/Shell/ProjectItems/CSharp.zip
trunk/ORMModel/Shell/ProjectItems/JSharp.zip
trunk/ORMModel/Shell/ProjectItems/Modeling.zip
trunk/ORMModel/Shell/ProjectItems/NewFileItems/ORMModel.orm
trunk/ORMModel/Shell/ProjectItems/VS2005/General.zip
trunk/ORMModel/Shell/ProjectItems/VS2008/General.zip
trunk/ORMModel/Shell/ProjectItems/VisualBasic.zip
trunk/ORMModel/Shell/ProjectItems/VisualC.zip
trunk/ORMModel/Shell/ProjectItems/Web/CSharp.zip
trunk/ORMModel/Shell/ProjectItems/Web/JSharp.zip
trunk/ORMModel/Shell/ProjectItems/Web/VisualBasic.zip
trunk/Setup/NORMAItemTemplates.wxi
trunk/Setup/Readme.htm
trunk/Tools/DatabaseImport/DcilObjectModel.cs
Modified: trunk/ORMModel/Shell/ORMDocData.cs
===================================================================
--- trunk/ORMModel/Shell/ORMDocData.cs 2011-06-15 19:14:24 UTC (rev 1471)
+++ trunk/ORMModel/Shell/ORMDocData.cs 2011-06-28 01:16:16 UTC (rev 1472)
@@ -382,8 +382,41 @@
// Convert early so we can accurately check extension elements
int retVal = 0;
bool dontSave = false;
+ bool newFileItem = false;
List<string> unrecognizedNamespaces = null;
ORMDesignerSettings settings = ORMDesignerPackage.DesignerSettings;
+ XmlReaderSettings readerSettings = new XmlReaderSettings();
+ readerSettings.CloseInput = false;
+ // New files are marked with the <?new?> processing instruction before the root element. Find it in the originally
+ // opened file. Note that this was originally checked with the VSHPROPID_IsNewUnsavedItem hierarchy property,
+ // but this is not implemented on all project types and, hence, does not return reliable information. All templates
+ // and wizards generating new files should add this processing instruction to avoid the 'file format change'
+ // warning shown below.
+ if (!isReload)
+ {
+ long startingPosition = inputStream.Position;
+ using (XmlReader reader = XmlReader.Create(inputStream, readerSettings))
+ {
+ bool finishedReading = false;
+ while (!finishedReading && reader.Read())
+ {
+ switch (reader.NodeType)
+ {
+ case XmlNodeType.Element:
+ finishedReading = true;
+ break;
+ case XmlNodeType.ProcessingInstruction:
+ if (reader.Name == "new")
+ {
+ newFileItem = true;
+ finishedReading = true;
+ }
+ break;
+ }
+ }
+ }
+ inputStream.Position = startingPosition;
+ }
using (Stream convertedStream = settings.ConvertStream(inputStream, ServiceProvider))
{
dontSave = convertedStream != null;
@@ -392,9 +425,7 @@
Stream namespaceStrippedStream = null;
try
{
- XmlReaderSettings readerSettings = new XmlReaderSettings();
ExtensionLoader extensionLoader = ORMDesignerPackage.ExtensionLoader;
- readerSettings.CloseInput = false;
Dictionary<string, ExtensionModelBinding> documentExtensions = null;
using (XmlReader reader = XmlReader.Create(stream, readerSettings))
{
@@ -522,13 +553,6 @@
}
}
}
- IVsHierarchy hierarchy;
- uint itemId;
- object isNewObject;
- bool newFileItem = null != (hierarchy = this.Hierarchy) &&
- VSConstants.VSITEMID_NIL != (itemId = this.ItemId) &&
- ErrorHandler.Succeeded(hierarchy.GetProperty(itemId, (int)__VSHPROPID.VSHPROPID_IsNewUnsavedItem, out isNewObject)) &&
- (bool)isNewObject;
if (dontSave && !newFileItem)
{
string message;
Modified: trunk/ORMModel/Shell/ProjectItems/CSharp.zip
===================================================================
(Binary files differ)
Modified: trunk/ORMModel/Shell/ProjectItems/JSharp.zip
===================================================================
(Binary files differ)
Modified: trunk/ORMModel/Shell/ProjectItems/Modeling.zip
===================================================================
(Binary files differ)
Modified: trunk/ORMModel/Shell/ProjectItems/NewFileItems/ORMModel.orm
===================================================================
--- trunk/ORMModel/Shell/ProjectItems/NewFileItems/ORMModel.orm 2011-06-15 19:14:24 UTC (rev 1471)
+++ trunk/ORMModel/Shell/ProjectItems/NewFileItems/ORMModel.orm 2011-06-28 01:16:16 UTC (rev 1472)
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
+<?new?>
<ormRoot:ORM2 xmlns:orm="http://schemas.neumont.edu/ORM/2006-04/ORMCore" xmlns:ormDiagram="http://schemas.neumont.edu/ORM/2006-04/ORMDiagram" xmlns:ormRoot="http://schemas.neumont.edu/ORM/2006-04/ORMRoot">
<orm:ORMModel id="modelId" Name="$fileinputname$"/>
<ormDiagram:ORMDiagram id="diagramId" IsCompleteView="false" Name="$fileinputname$" BaseFontName="Tahoma" BaseFontSize="0.0972222238779068">
Modified: trunk/ORMModel/Shell/ProjectItems/VS2005/General.zip
===================================================================
(Binary files differ)
Modified: trunk/ORMModel/Shell/ProjectItems/VS2008/General.zip
===================================================================
(Binary files differ)
Modified: trunk/ORMModel/Shell/ProjectItems/VisualBasic.zip
===================================================================
(Binary files differ)
Modified: trunk/ORMModel/Shell/ProjectItems/VisualC.zip
===================================================================
(Binary files differ)
Modified: trunk/ORMModel/Shell/ProjectItems/Web/CSharp.zip
===================================================================
(Binary files differ)
Modified: trunk/ORMModel/Shell/ProjectItems/Web/JSharp.zip
===================================================================
(Binary files differ)
Modified: trunk/ORMModel/Shell/ProjectItems/Web/VisualBasic.zip
===================================================================
(Binary files differ)
Modified: trunk/Setup/NORMAItemTemplates.wxi
===================================================================
--- trunk/Setup/NORMAItemTemplates.wxi 2011-06-15 19:14:24 UTC (rev 1471)
+++ trunk/Setup/NORMAItemTemplates.wxi 2011-06-28 01:16:16 UTC (rev 1472)
@@ -67,12 +67,10 @@
<?ifdef ModelingProjectSupport?>
<Directory Id="Modeling" Name="Modeling">
<Component Id="NORMAVSProjectItemsModelingComponent" Guid="D74F0161-7C3D-4981-$(var.VersionGuidSuffix)" DiskId="1" Win64="$(var.Win64)" KeyPath="yes">
- <Condition>Installed</Condition>
<File Id="Modeling.zip" Name="ORMModel.zip" Source="..\ORMModel\Shell\ProjectItems\Modeling.zip"
DefaultLanguage="0" CompanionFile="ORMSolutions.ORMArchitect.Core$(var.VSExt).dll"/>
</Component>
<Component Id="NORMADBImportProjectItemsModelingComponent" Guid="960D82F8-25D0-4F2B-$(var.VersionGuidSuffix)" DiskId="1" Win64="$(var.Win64)" KeyPath="yes">
- <Condition>Installed</Condition>
<File Id="DBImportModeling.zip" Name="ORMModelFromDatabase.zip" ShortName="DBImpMod.zip" Source="..\Tools\DatabaseImport\ProjectItems\$(var.VSShortName)\Modeling.zip"
DefaultLanguage="0" CompanionFile="ORMSolutions.ORMArchitect.DatabaseImport$(var.VSExt).dll"/>
</Component>
Modified: trunk/Setup/Readme.htm
===================================================================
--- trunk/Setup/Readme.htm 2011-06-15 19:14:24 UTC (rev 1471)
+++ trunk/Setup/Readme.htm 2011-06-28 01:16:16 UTC (rev 1472)
@@ -44,7 +44,7 @@
<hr/>
<h2>June 2011 CTP Changes</h2>
-<div>The June 2011 CTP release includes all modifications through changeset 1471. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div>
+<div>The June 2011 CTP release includes all modifications through changeset 1472. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div>
<ul>
<li><a href="#DisplayAsObjectType 2011-06">Display Objectified Fact Type as Object Type</a> </li>
<li><a href="#LinkFactTypeDisplay 2011-06">Link Fact Type Display</a> </li>
@@ -74,6 +74,7 @@
<li>The meta file created by the <em>Copy Image</em> command did not have a transparent background on all versions, lines were rendered visibly different from those in the designer.</li>
<li>The <em>ExpandRefMode</em> property did not work well with multiple shapes for the object type (or objectified fact type) on the same diagram. If there are multiple shapes on the diagram, the first shape to set <em>ExpandRefMode</em> to true will add the reference mode fact type and value type, and the last to clear this property will remove them. The reference mode fact type will only attach to those shapes with <em>ExpandRefMode</em> set to true.</li>
<li>Multiple shapes representing a single backing element (FactType, ObjectType, etc) on the same diagram caused a null reference exception if the backing element was deleted. Duplicate shapes needed to be deleted to enable deletion of the backing element.</li>
+<li>The final dialog shown by the database import wizard launched by a VB or C# project offered to disable the <em>Save</em> button to prevent data loss (caused by an inconsistent implementation of VSHPROPID_IsNewUnsavedItem across different project types). Template and wizard-generated files are now marked with a <em><?new?></em> processing instruction to avoid any project-type dependencies.</li>
</ol>
</li>
</ul>
@@ -633,8 +634,7 @@
<h3><a id="VS2010 Bugs">Unresolved issues in Visual Studio 2010</a></h3>
<p>These are areas that are incomplete and known issues with Visual Studio 2010.</p>
<ol>
-<li>If an .orm file is opened simultaneously with more than one other file (such as when opening a solution) and is the active file immediately after load, then the ORM designer tool windows and menu items will not activate properly. Activating a second document (of any type) and reactivating the ORM designer will fix the problem. <em>This is a Visual Studio 2010 bug</em> (I can reproduce similar behavior with missing menus with one XML and one Text file).</li>
-<li>The final dialog shown by the database import wizard offers to disable the <em>Save</em> button to prevent data loss. You should say No to this question. The database import wizard uses NORMA's file upgrade mechanism to load the file, and the dialog shown is meant for a file upgrade process. VS2010 is returning a 'not implemented' error for a request on the VSHPROPID_IsNewUnsavedItem property, and I know of no other way to distinguish between an imported file and a new file that uses the import mechanism (such as the DB import wizard).</li>
+<li>If the .orm designer is opened simultaneously with more than one other file (such as when opening a solution) and is the active file immediately after load, then the ORM designer tool windows and menu items will not activate properly. Activating a second document (of any type) and reactivating the ORM designer will fix the problem. <em>This is a Visual Studio 2010 bug</em> (I can reproduce similar behavior with missing menus with one XML and one Text file).</li>
<li>The <em>ORM Diagram Spy</em> window will occasionally go blank after extended use with multiple open ORM files. A restart of the environment is required to recover the window. If you can reliably reproduce this issue please report the scenario.</li>
<li>The NORMA help files are not installed or integrated with Visual Studio 2010. [The installer merge modules used for help integration in VS2005 and VS2008 are not included with the VS2010 SDK.]</li>
<li>The FrequencyConstraint and Reading shapes are larger in Visual Studio 2010.</li>
Modified: trunk/Tools/DatabaseImport/DcilObjectModel.cs
===================================================================
--- trunk/Tools/DatabaseImport/DcilObjectModel.cs 2011-06-15 19:14:24 UTC (rev 1471)
+++ trunk/Tools/DatabaseImport/DcilObjectModel.cs 2011-06-28 01:16:16 UTC (rev 1472)
@@ -58,7 +58,11 @@
schema.Namespaces.Add("dml", "http://schemas.orm.net/DIL/DMIL");
schema.Namespaces.Add("ddl", "http://schemas.orm.net/DIL/DDIL");
XmlSerializer s = new XmlSerializer(typeof(DcilSchema));
- s.Serialize(stream, schema);
+ using (XmlWriter writer = XmlWriter.Create(stream, new XmlWriterSettings()))
+ {
+ writer.WriteProcessingInstruction("new", "");
+ s.Serialize(writer, schema);
+ }
}
/// <summary>
/// Instantiates a new instance of <see cref="DcilSchema"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|