diff --git a/data/options/SharpDevelopControlLibrary.sdcl b/data/options/SharpDevelopControlLibrary.sdcl index 04b42668d7..5494a05d91 100644 --- a/data/options/SharpDevelopControlLibrary.sdcl +++ b/data/options/SharpDevelopControlLibrary.sdcl @@ -3,6 +3,7 @@ <Assembly assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <Assembly assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <Assembly assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <Assembly assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </Assemblies> <Categories> <Category name="Windows Forms" enabled="True"> @@ -52,10 +53,6 @@ <ToolComponent class="System.Windows.Forms.ImageList" assembly="0" enabled="True" /> <ToolComponent class="System.Windows.Forms.HelpProvider" assembly="0" enabled="True" /> <ToolComponent class="System.Windows.Forms.OpenFileDialog" assembly="0" enabled="True" /> - <ToolComponent class="System.Windows.Forms.PageSetupDialog" assembly="0" enabled="True" /> - <ToolComponent class="System.Windows.Forms.PrintDialog" assembly="0" enabled="True" /> - <ToolComponent class="System.Windows.Forms.PrintPreviewControl" assembly="0" enabled="True" /> - <ToolComponent class="System.Windows.Forms.PrintPreviewDialog" assembly="0" enabled="True" /> <ToolComponent class="System.Windows.Forms.SaveFileDialog" assembly="0" enabled="True" /> <ToolComponent class="System.Windows.Forms.Timer" assembly="0" enabled="True" /> </Category> @@ -81,5 +78,12 @@ <ToolComponent class="System.IO.Ports.SerialPort" assembly="2" enabled="True" /> <ToolComponent class="System.Windows.Forms.Timer" assembly="0" enabled="True" /> </Category> + <Category name="Printing" enabled="True"> + <ToolComponent class="System.Windows.Forms.PageSetupDialog" assembly="0" enabled="True" /> + <ToolComponent class="System.Windows.Forms.PrintDialog" assembly="0" enabled="True" /> + <ToolComponent class="System.Drawing.Printing.PrintDocument" assembly="3" enabled="True" /> + <ToolComponent class="System.Windows.Forms.PrintPreviewControl" assembly="0" enabled="True" /> + <ToolComponent class="System.Windows.Forms.PrintPreviewDialog" assembly="0" enabled="True" /> + </Category> </Categories> </SharpDevelopControlLibrary> diff --git a/data/resources/StringResources.cn-gb.resources b/data/resources/StringResources.cn-gb.resources index ba68d4b95c..de33ccffd6 100644 Binary files a/data/resources/StringResources.cn-gb.resources and b/data/resources/StringResources.cn-gb.resources differ diff --git a/data/resources/StringResources.de.resources b/data/resources/StringResources.de.resources index 2bee253689..8cb0636015 100644 Binary files a/data/resources/StringResources.de.resources and b/data/resources/StringResources.de.resources differ diff --git a/data/resources/StringResources.es-mx.resources b/data/resources/StringResources.es-mx.resources index 83086ee74f..2e8303310e 100644 Binary files a/data/resources/StringResources.es-mx.resources and b/data/resources/StringResources.es-mx.resources differ diff --git a/data/resources/StringResources.es.resources b/data/resources/StringResources.es.resources index f94aa19191..77a5832bea 100644 Binary files a/data/resources/StringResources.es.resources and b/data/resources/StringResources.es.resources differ diff --git a/data/resources/StringResources.fr.resources b/data/resources/StringResources.fr.resources index 453d375e31..479b060424 100644 Binary files a/data/resources/StringResources.fr.resources and b/data/resources/StringResources.fr.resources differ diff --git a/data/resources/StringResources.kr.resources b/data/resources/StringResources.kr.resources index 1c436810d3..72fdad9f77 100644 Binary files a/data/resources/StringResources.kr.resources and b/data/resources/StringResources.kr.resources differ diff --git a/data/resources/StringResources.nl.resources b/data/resources/StringResources.nl.resources index 9048aaeabd..165130631d 100644 Binary files a/data/resources/StringResources.nl.resources and b/data/resources/StringResources.nl.resources differ diff --git a/data/resources/StringResources.no.resources b/data/resources/StringResources.no.resources index f145fb216c..28aa9626c4 100644 Binary files a/data/resources/StringResources.no.resources and b/data/resources/StringResources.no.resources differ diff --git a/data/resources/StringResources.pt-br.resources b/data/resources/StringResources.pt-br.resources index 330dc95b49..0cd8c836fc 100644 Binary files a/data/resources/StringResources.pt-br.resources and b/data/resources/StringResources.pt-br.resources differ diff --git a/data/resources/StringResources.pt.resources b/data/resources/StringResources.pt.resources index 0d86527c5d..e0f106b8fe 100644 Binary files a/data/resources/StringResources.pt.resources and b/data/resources/StringResources.pt.resources differ diff --git a/data/resources/StringResources.se.resources b/data/resources/StringResources.se.resources index 5c545c6def..ccdc98d0cd 100644 Binary files a/data/resources/StringResources.se.resources and b/data/resources/StringResources.se.resources differ diff --git a/data/schemas/firewall.xsd b/data/schemas/firewall.xsd index f111dfec20..e9f8b7ae87 100644 --- a/data/schemas/firewall.xsd +++ b/data/schemas/firewall.xsd @@ -82,7 +82,7 @@ </xs:simpleType> </xs:attribute> - <xs:attribute name="Port" type="xs:integer"> + <xs:attribute name="Port" type="xs:string"> <xs:annotation> <xs:documentation> Port to allow through the firewall for this exception. If you use Port, you @@ -96,15 +96,13 @@ <xs:documentation> IP protocol used for this firewall exception. If not specified, "tcp" is assumed. If you use Protocol, you must also specify Port and you cannot - also use File or Program. Note that using "any" requires Windows Firewall - with Advanced Security on Windows Vista and will fail on Windows XP. + also use File or Program. </xs:documentation> </xs:annotation> <xs:simpleType> <xs:restriction base="xs:NMTOKEN"> <xs:enumeration value="tcp" /> <xs:enumeration value="udp" /> - <xs:enumeration value="any" /> </xs:restriction> </xs:simpleType> </xs:attribute> diff --git a/data/schemas/iis.xsd b/data/schemas/iis.xsd index 20ba99b137..cd0911faf9 100644 --- a/data/schemas/iis.xsd +++ b/data/schemas/iis.xsd @@ -431,6 +431,7 @@ Used to install and unintall certificates. </xs:documentation> <xs:appinfo> + <xse:parent namespace="http://schemas.microsoft.com/wix/2006/wi" ref="Component" /> <xse:seeAlso ref="CertificateRef"/> </xs:appinfo> </xs:annotation> @@ -740,7 +741,22 @@ <xs:attribute name="Id" use="required" type="xs:string"/> <xs:attribute name="IP" type="xs:string"> <xs:annotation> - <xs:documentation>For IP address "All Unassigned", do not specify this attribute or specify its value as "*".</xs:documentation> + <xs:documentation> + The IP address to locate an existing WebSite or create a new WebSite. When the WebAddress is part of a WebSite element + used to locate an existing web site the following rules are used: + <html:ul> + <html:li>When this attribute is not specified only the “All Unassigned” IP address will be located.</html:li> + <html:li>When this attribute is explicitly specified only the specified IP address will be located.</html:li> + <html:li>When this attribute has the value “*” then any IP address including the “All Unassigned” IP address will be located</html:li> + </html:ul> + When the WebAddress is part of a WebSite element used to create a new web site the following rules are used: + <html:ul> + <html:li>When this attribute is not specified or the value is "*" the "All Unassigned" IP address will be used.</html:li> + <html:li>When this attribute is explicitly specified the IP address will use that value.</html:li> + </html:ul> + The IP attribute can contain a formatted string that is processed at install time to insert the values of properties using + [PropertyName] syntax. + </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="Port" use="required" type="xs:string"/> @@ -918,7 +934,14 @@ </xs:attribute> <xs:attribute name="SiteId" type="xs:string"> <xs:annotation> - <xs:documentation>Optional attribute to directly specify the site id of the WebSite. Use this to ensure all web sites in a web garden get the same site id. Be sure the site id is unique. Must be a number or a formatted value that resolves to a number or blank.</xs:documentation> + <xs:documentation> + Optional attribute to directly specify the site id of the WebSite. Use this to ensure all web + sites in a web garden get the same site id. If a number is provided, the site id must be unique + on all target machines. If "*" is used, the Description attribute will be hashed to create a unique + value for the site id. This value must be a positive number or a "*" or a formatted value that resolves + to "-1" (for the same behavior as "*") or a positive number or blank. If this attribute is absent then + the web site will be located using the WebAddress element associated with the web site. + </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="StartOnInstall" type="YesNoType"> diff --git a/data/schemas/netfx.xsd b/data/schemas/netfx.xsd index 01fb3c1d52..405f61cfd9 100644 --- a/data/schemas/netfx.xsd +++ b/data/schemas/netfx.xsd @@ -51,9 +51,9 @@ <xs:annotation> <xs:documentation> The identifier of the directory to use for locating dependent assemblies. - For DLL assemblies and assemblies installed to the GAC, this attribute - should be set to the directory of the application which loads this assembly. - For EXE assemblies, this attribute does not need to be set because NGen + For DLL assemblies and assemblies installed to the Global Assembly Cache (GAC), + this attribute should be set to the directory of the application which loads this + assembly. For EXE assemblies, this attribute does not need to be set because NGen will use the directory of the assembly file by default. </xs:documentation> </xs:annotation> diff --git a/data/schemas/util.xsd b/data/schemas/util.xsd index 20ae911b68..8b972637a3 100644 --- a/data/schemas/util.xsd +++ b/data/schemas/util.xsd @@ -124,6 +124,13 @@ </xs:documentation> </xs:annotation> </xs:attribute> + <xs:attribute name="KeyPath" type="YesNoType"> + <xs:annotation> + <xs:documentation> + Marks the EventSource registry as the key path of the component it belongs to. + </xs:documentation> + </xs:annotation> + </xs:attribute> <xs:attribute name="Log" type="xs:string" use="required"> <xs:annotation> <xs:documentation>Name of the event source's log.</xs:documentation> @@ -291,12 +298,28 @@ <xse:parent namespace="http://schemas.microsoft.com/wix/2006/wi" ref="Module" /> <xse:parent namespace="http://schemas.microsoft.com/wix/2006/wi" ref="Product" /> </xs:appinfo> - <xs:documentation>Group for all kinds of things</xs:documentation> + <xs:documentation> + Finds user groups on the local machine or specified Active Directory domain. The local machine will be + searched for the group first then fallback to looking in Active Directory. This element is not capable + of creating new groups but can be used to add new or existing users to an existing group. + </xs:documentation> </xs:annotation> <xs:complexType> - <xs:attribute name="Id" type="xs:string" use="required"/> - <xs:attribute name="Name" type="xs:string" use="required"/> - <xs:attribute name="Domain" type="xs:string"/> + <xs:attribute name="Id" type="xs:string" use="required"> + <xs:annotation> + <xs:documentation>Unique identifier in your installation package for this group.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="Name" type="xs:string" use="required"> + <xs:annotation> + <xs:documentation>A <html:a href='http://msdn.microsoft.com/library/aa368609.aspx' target='_blank'>Formatted</html:a> string that contains the name of the group to be found.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="Domain" type="xs:string"> + <xs:annotation> + <xs:documentation>An optional <html:a href='http://msdn.microsoft.com/library/aa368609.aspx' target='_blank'>Formatted</html:a> string that specifies the domain for the group.</xs:documentation> + </xs:annotation> + </xs:attribute> </xs:complexType> </xs:element> @@ -460,6 +483,7 @@ <xs:annotation> <xs:appinfo> <xse:parent namespace="http://schemas.microsoft.com/wix/2006/wi" ref="File" /> + <xse:deprecated ref="PerformanceCounter" /> </xs:appinfo> <xs:documentation>Used to install Perfmon counters.</xs:documentation> </xs:annotation> @@ -657,6 +681,8 @@ <xs:annotation> <xs:documentation>Service configuration information for failure actions.</xs:documentation> <xs:appinfo> + <xse:parent namespace="http://schemas.microsoft.com/wix/2006/wi" ref="Component" /> + <xse:parent namespace="http://schemas.microsoft.com/wix/2006/wi" ref="ServiceInstall" /> <xse:remarks> <html:dl> <html:dd>Nesting a ServiceConfig element under a ServiceInstall element will result in the service being installed to be configured.</html:dd> @@ -751,19 +777,33 @@ </xs:sequence> <xs:attribute name="Id" type="xs:string" use="required"/> <xs:attribute name="Name" use="required" type="xs:string"> + <xs:annotation> + <xs:documentation>A <a href="http://msdn2.microsoft.com/library/aa368609.aspx" target="_blank">Formatted</a> string that contains the name of the user account.</xs:documentation> + </xs:annotation> </xs:attribute> <xs:attribute name="Domain" type="xs:string"> + <xs:annotation> + <xs:documentation>A <a href="http://msdn2.microsoft.com/library/aa368609.aspx" target="_blank">Formatted</a> string that contains the local machine or Active Directory domain for the user.</xs:documentation> + </xs:annotation> </xs:attribute> <xs:attribute name="Password" type="xs:string"> <xs:annotation> <xs:documentation>Usually a Property that is passed in on the command-line to keep it more secure.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="PasswordNeverExpires" type="YesNoType"/> - <xs:attribute name="CanNotChangePassword" type="YesNoType"/> + <xs:attribute name="PasswordNeverExpires" type="YesNoType"> + <xs:annotation> + <xs:documentation>The account's password never expires. Equivalent to UF_DONT_EXPIRE_PASSWD.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="CanNotChangePassword" type="YesNoType"> + <xs:annotation> + <xs:documentation>The user cannot change the account's password. Equivalent to UF_PASSWD_CANT_CHANGE.</xs:documentation> + </xs:annotation> + </xs:attribute> <xs:attribute name="RemoveOnUninstall" type="YesNoType"> <xs:annotation> - <xs:documentation>Indicates whether the user account should be left behind on uninstall.</xs:documentation> + <xs:documentation>Indicates whether the user account should be removed or left behind on uninstall.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="FailIfExists" type="YesNoType"> @@ -786,7 +826,11 @@ <xs:documentation>Indicates whether the user must change their password on their first login.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="Disabled" type="YesNoType"/> + <xs:attribute name="Disabled" type="YesNoType"> + <xs:annotation> + <xs:documentation>The account is disabled. Equivalent to UF_ACCOUNTDISABLE.</xs:documentation> + </xs:annotation> + </xs:attribute> <xs:attribute name="CreateUser" type="YesNoType"> <xs:annotation> <xs:documentation>Indicates whether or not to create the user. User creation can be skipped if all that is desired is to join a user to groups.</xs:documentation> @@ -812,7 +856,7 @@ </xs:attribute> <xs:attribute name="ElementPath" use="required" type="xs:string"> <xs:annotation> - <xs:documentation>The XPath of the element to be modified. Note that this is a formatted field and therefore, square brackets in the XPath must be escapted.</xs:documentation> + <xs:documentation>The XPath of the element to be modified. Note that this is a formatted field and therefore, square brackets in the XPath must be escaped.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="File" use="required" type="xs:string"> diff --git a/data/schemas/wix.xsd b/data/schemas/wix.xsd index f6860af577..a7ea0c6c8d 100644 --- a/data/schemas/wix.xsd +++ b/data/schemas/wix.xsd @@ -2415,9 +2415,10 @@ </xs:appinfo> </xs:annotation> <xs:complexType> - <xs:sequence> + <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element ref="Icon" minOccurs="0" /> - </xs:sequence> + <xs:element ref="ShortcutProperty" minOccurs="0" /> + </xs:choice> <xs:attribute name="Id" type="xs:string" use="required"> <xs:annotation><xs:documentation>Unique identifier for the shortcut. This value will serve as the primary key for the row.</xs:documentation></xs:annotation> @@ -2581,6 +2582,27 @@ </xs:complexType> </xs:element> + <xs:element name="ShortcutProperty"> + <xs:annotation> + <xs:appinfo> + <xse:seeAlso ref="Shortcut"/> + <xse:msiRef table="MsiShortcutProperty" /> + </xs:appinfo> + <xs:documentation>Property values for a shortcut.</xs:documentation> + </xs:annotation> + <xs:complexType mixed="true"> + <xs:attribute name="Id" type="xs:string"> + <xs:annotation><xs:documentation>Unique identifier for MsiShortcutProperty table. If omitted, a stable identifier will be generated from the parent shortcut identifier and Key value.</xs:documentation></xs:annotation> + </xs:attribute> + <xs:attribute name="Key" type="xs:string" use="required"> + <xs:annotation><xs:documentation>Sets a default value for the property. The value will be overwritten if the Property is used for a search.</xs:documentation></xs:annotation> + </xs:attribute> + <xs:attribute name="Value" type="xs:string"> + <xs:annotation><xs:documentation>Sets a default value for the property. The value will be overwritten if the Property is used for a search.</xs:documentation></xs:annotation> + </xs:attribute> + </xs:complexType> + </xs:element> + <xs:element name="Permission"> <xs:annotation> <xs:documentation> @@ -2662,6 +2684,41 @@ </xs:complexType> </xs:element> + <xs:element name="PermissionEx"> + <xs:annotation> + <xs:documentation> + Sets ACLs on File, Registry, or CreateFolder. When under a Registry element, this cannot be used + if the Action attribute's value is remove or removeKeyOnInstall. This element is only available + when installing with MSI 5.0. For downlevel support, see the PermissionEx element from the + WixUtilExtension. + </xs:documentation> + <xs:appinfo> + <xse:msiRef table="MsiLockPermissionsEx" href="http://msdn.microsoft.com/library/aa369774.aspx"/> + </xs:appinfo> + </xs:annotation> + <xs:complexType> + <xs:sequence> + <xs:element ref="Condition" minOccurs="0"> + <xs:annotation><xs:documentation> + Optional condition that controls whether the permissions are applied. + </xs:documentation></xs:annotation> + </xs:element> + </xs:sequence> + + <xs:attribute name="Id" type="xs:string"> + <xs:annotation><xs:documentation> + Primary key used to identify this particular entry. If this is not specified the parent element's Id attribute + will be used instead. + </xs:documentation></xs:annotation> + </xs:attribute> + <xs:attribute name="Sddl" type="xs:string" use="required"> + <xs:annotation><xs:documentation> + Security descriptor to apply to parent object. + </xs:documentation></xs:annotation> + </xs:attribute> + </xs:complexType> + </xs:element> + <xs:element name="CopyFile"> <xs:annotation> <xs:appinfo> @@ -2790,6 +2847,9 @@ <xs:element ref="Permission"> <xs:annotation><xs:documentation>Used to configure the ACLs for this file.</xs:documentation></xs:annotation> </xs:element> + <xs:element ref="PermissionEx"> + <xs:annotation><xs:documentation>Can also configure the ACLs for this file.</xs:documentation></xs:annotation> + </xs:element> <xs:element ref="CopyFile"> <xs:annotation><xs:documentation>Used to create a duplicate of this file elsewhere.</xs:documentation></xs:annotation> </xs:element> @@ -2919,7 +2979,7 @@ <xs:annotation> <xs:documentation> Specifies if this File is a Win32 Assembly or .NET Assembly that needs to be installed into the - Global Assembly Cache. If the value is '.net' or 'win32', this file must also be the key path of the Component. + Global Assembly Cache (GAC). If the value is '.net' or 'win32', this file must also be the key path of the Component. </xs:documentation> </xs:annotation> <xs:simpleType> @@ -2962,7 +3022,7 @@ <xs:documentation> Specifies the file identifier of the application file. This assembly will be isolated to the same directory as the application file. - If this attribute is absent, the assembly will be installed to the Global Assembly Cache. + If this attribute is absent, the assembly will be installed to the Global Assembly Cache (GAC). This attribute may only be specified if the Assembly attribute is set to '.net' or 'win32'. </xs:documentation> </xs:annotation> @@ -3006,7 +3066,7 @@ <xs:annotation><xs:documentation>Specifies the Media this File should be sourced on. This attribute overrides the default DiskId attribute from the parent Component element. If no DiskId attribute is specifed, the default is "1".</xs:documentation></xs:annotation> </xs:attribute> <xs:attribute name="Source" type="xs:string"> - <xs:annotation><xs:documentation>Specifies the path to the File in the build process. This attribute must be set if no source information can be gathered from parent directories.</xs:documentation></xs:annotation> + <xs:annotation><xs:documentation>Specifies the path to the File in the build process. Overrides default source path set by parent directories and Name attribute. This attribute must be set if no source information can be gathered from parent directories. For more information, see <a href="\html\specifying_source_files.htm">Specifying source files</a>.</xs:documentation></xs:annotation> </xs:attribute> <xs:attribute name="src" type="xs:string"> <xs:annotation> @@ -3072,6 +3132,9 @@ <xs:element ref="Permission" minOccurs="0" maxOccurs="unbounded"> <xs:annotation><xs:documentation>ACL permission</xs:documentation></xs:annotation> </xs:element> + <xs:element ref="PermissionEx"> + <xs:annotation><xs:documentation>Can also configure the ACLs for this registry key.</xs:documentation></xs:annotation> + </xs:element> <xs:any namespace="##other" processContents="lax"> <xs:annotation> <xs:documentation> @@ -3158,6 +3221,9 @@ <xs:complexType mixed="true"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element ref="Permission"/> + <xs:element ref="PermissionEx"> + <xs:annotation><xs:documentation>Can also configure the ACLs for this registry value.</xs:documentation></xs:annotation> + </xs:element> <xs:element ref="MultiStringValue"/> <xs:any namespace="##other" processContents="lax"> <xs:annotation> @@ -3422,6 +3488,9 @@ <xs:complexType> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element ref="Permission"/> + <xs:element ref="PermissionEx"> + <xs:annotation><xs:documentation>Can also configure the ACLs for this registry key.</xs:documentation></xs:annotation> + </xs:element> <xs:element ref="RegistryValue"/> <xs:element ref="Registry"/> <xs:any namespace="##other" processContents="lax"> @@ -3769,6 +3838,9 @@ <xs:element ref="Permission" minOccurs="0" maxOccurs="unbounded"> <xs:annotation><xs:documentation>ACL permission</xs:documentation></xs:annotation> </xs:element> + <xs:element ref="PermissionEx"> + <xs:annotation><xs:documentation>Can also configure the ACLs for this folder.</xs:documentation></xs:annotation> + </xs:element> <xs:any namespace="##other" processContents="lax"> <xs:annotation> <xs:documentation> @@ -4486,8 +4558,12 @@ <xs:attribute name="Id" type="Guid" use="required"> <xs:annotation><xs:documentation>The Class identifier (CLSID) of a COM server.</xs:documentation></xs:annotation> </xs:attribute> - <xs:attribute name="Context" use="required"> - <xs:annotation><xs:documentation>The server context(s) for this server.</xs:documentation></xs:annotation> + <xs:attribute name="Context"> + <xs:annotation><xs:documentation> + The server context(s) for this COM server. This attribute is optional for VB6 libraries that are marked "PublicNotCreateable". + Class elements marked Advertised must specify at least one server context. It is most common for there to be a single value + for the Context attribute. + </xs:documentation></xs:annotation> <xs:simpleType> <xs:list> <xs:simpleType> @@ -4659,6 +4735,9 @@ <xs:attribute name="Name" type="xs:string" use="required"> <xs:annotation><xs:documentation>Name for COM Interface.</xs:documentation></xs:annotation> </xs:attribute> + <xs:attribute name="BaseInterface" type="Guid"> + <xs:annotation><xs:documentation>Identifies the interface from which the current interface is derived.</xs:documentation></xs:annotation> + </xs:attribute> <xs:attribute name="ProxyStubClassId" type="Guid"> <xs:annotation><xs:documentation>GUID CLSID for proxy stub to COM Interface.</xs:documentation></xs:annotation> </xs:attribute> @@ -4741,6 +4820,8 @@ <xs:element ref="ServiceDependency"> <xs:annotation><xs:documentation>ordered list of dependencies when installing services</xs:documentation></xs:annotation> </xs:element> + <xs:element ref="ServiceConfig"/> + <xs:element ref="ServiceConfigFailureActions"/> <xs:any namespace="##other" processContents="lax"> <xs:annotation> <xs:documentation> @@ -4750,8 +4831,11 @@ </xs:annotation> </xs:any> </xs:choice> - <xs:attribute name="Id" type="xs:string" use="required"> - <xs:annotation><xs:documentation>Unique identifier for this service.</xs:documentation></xs:annotation> + <xs:attribute name="Id" type="xs:string"> + <xs:annotation><xs:documentation> + Unique identifier for this service configuration. This value will default to the Name attribute if not + specified. + </xs:documentation></xs:annotation> </xs:attribute> <xs:attribute name="Name" type="xs:string" use="required"> <xs:annotation><xs:documentation>This column is the string that gives the service name to install.</xs:documentation></xs:annotation> @@ -5015,6 +5099,177 @@ </xs:complexType> </xs:element> + <xs:element name="RequiredPrivilege" type="xs:string"> + <xs:annotation> + <xs:documentation> + Privilege required by service configured by ServiceConfig parent. Valid values are a <a href="http://msdn.microsoft.com/en-us/library/bb530716.aspx">privilege constant</a> or a + Formatted property that resolves to a privilege constant. + </xs:documentation> + <xs:appinfo> + <xse:msiRef table="MsiServiceConfig" href="http://msdn.microsoft.com/library/aa371634.aspx"/> + </xs:appinfo> + </xs:annotation> + </xs:element> + + <xs:element name="ServiceConfig"> + <xs:annotation> + <xs:documentation> + Configures a service being installed or one that already exists. + </xs:documentation> + <xs:appinfo> + <xse:msiRef table="MsiServiceConfig" href="http://msdn.microsoft.com/library/aa371637.aspx"/> + </xs:appinfo> + </xs:annotation> + <xs:complexType> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element ref="RequiredPrivilege"> + <xs:annotation><xs:documentation>List of privileges to apply to service.</xs:documentation></xs:annotation> + </xs:element> + </xs:choice> + + <xs:attribute name="Id" type="xs:string"> + <xs:annotation><xs:documentation> + Unique identifier for this service configuration. This value will default to the ServiceName attribute if not + specified. + </xs:documentation></xs:annotation> + </xs:attribute> + <xs:attribute name="DelayedAutoStart" type="xs:string"> + <xs:annotation><xs:documentation> + This attribute specifies whether an auto-start service should delay its start until after all other auto-start + services. This attribute only affects auto-start services. Allowed values are "yes", "no" or a Formatted property that + resolves to "1" (for "yes") or "0" (for "no"). If this attribute is not present the setting is not configured. + </xs:documentation></xs:annotation> + </xs:attribute> + <xs:attribute name="FailureActionsWhen" type="xs:string"> + <xs:annotation><xs:documentation> + This attribute specifies when failure actions should be applied. Allowed values are "failedToStop", "failedToStopOrReturnedError" + or a Formatted property that resolves to "1" (for "failedToStopOrReturnedError") or "0" (for "failedToStop"). If this attribute + is not present the setting is not configured. + </xs:documentation></xs:annotation> + </xs:attribute> + <xs:attribute name="PreShutdownDelay" type="xs:string"> + <xs:annotation><xs:documentation> + This attribute specifies time in milliseconds that the Service Control Manager (SCM) waits after notifying the service of a system + shutdown. If this attribute is not present the default value, 3 minutes, is used. + </xs:documentation></xs:annotation> + </xs:attribute> + <xs:attribute name="OnInstall" type="YesNoType"> + <xs:annotation><xs:documentation> + Specifies whether to configure the service when the parent Component is installed. This attribute may be combined with OnReinstall + and OnUninstall. + </xs:documentation></xs:annotation> + </xs:attribute> + <xs:attribute name="OnReinstall" type="YesNoType"> + <xs:annotation><xs:documentation> + Specifies whether to configure the service when the parent Component is reinstalled. This attribute may be combined with OnInstall + and OnUninstall. + </xs:documentation></xs:annotation> + </xs:attribute> + <xs:attribute name="OnUninstall" type="YesNoType"> + <xs:annotation><xs:documentation> + Specifies whether to configure the service when the parent Component is uninstalled. This attribute may be combined with OnInstall + and OnReinstall. + </xs:documentation></xs:annotation> + </xs:attribute> + <xs:attribute name="ServiceName" type="xs:string"> + <xs:annotation><xs:documentation> + Specifies the name of the service to configure. This value will default to the ServiceInstall/@Name attribute when nested under + a ServiceInstall element. + </xs:documentation></xs:annotation> + </xs:attribute> + <xs:attribute name="ServiceSid" type="xs:string"> + <xs:annotation><xs:documentation> + Specifies the service SID to apply to the service. Valid values are "none", "restricted", "unrestricted" or a Formatted property + that resolves to "0" (for "none"), "3" (for "restricted") or "1" (for "unrestricted"). If this attribute is not present the + setting is not configured. + </xs:documentation></xs:annotation> + </xs:attribute> + </xs:complexType> + </xs:element> + + <xs:element name="Failure"> + <xs:annotation><xs:documentation>Failure action for a ServiceConfigFailureActions element.</xs:documentation></xs:annotation> + <xs:complexType> + <xs:attribute name="Action" type="xs:string" use="required"> + <xs:annotation><xs:documentation> + Specifies the action to take when the service fails. Valid values are "none", "restartComputer", "restartService", "runCommand" or a Formatted property + that resolves to "0" (for "none"), "1" (for "restartService"), "2" (for "restartComputer") or "3" (for "runCommand"). + </xs:documentation></xs:annotation> + </xs:attribute> + <xs:attribute name="Delay" type="xs:string" use="required"> + <xs:annotation><xs:documentation> + Specifies the time in milliseconds to wait before performing the value from the Action attribute. + </xs:documentation></xs:annotation> + </xs:attribute> + </xs:complexType> + </xs:element> + + <xs:element name="ServiceConfigFailureActions"> + <xs:annotation> + <xs:documentation> + Configures the failure actions for a service being installed or one that already exists. + </xs:documentation> + <xs:appinfo> + <xse:msiRef table="MsiServiceConfigFailureActions" href="http://msdn.microsoft.com/library/aa371637.aspx"/> + </xs:appinfo> + </xs:annotation> + <xs:complexType> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element ref="Failure"> + <xs:annotation><xs:documentation>Ordered list of failure actions to apply to service.</xs:documentation></xs:annotation> + </xs:element> + </xs:choice> + + <xs:attribute name="Id" type="xs:string"> + <xs:annotation><xs:documentation> + Unique identifier for this service configuration. This value will default to the ServiceName attribute if not + specified. + </xs:documentation></xs:annotation> + </xs:attribute> + <xs:attribute name="Command" type="xs:string"> + <xs:annotation><xs:documentation> + This attribute specifies command to execute when a "runCommand" failure action hit. If an empty string is provided it clears + the existing command. If this attribute is not present the setting is not changed. + </xs:documentation></xs:annotation> + </xs:attribute> + <xs:attribute name="OnInstall" type="YesNoType"> + <xs:annotation><xs:documentation> + Specifies whether to configure the service when the parent Component is installed. This attribute may be combined with OnReinstall + and OnUninstall. + </xs:documentation></xs:annotation> + </xs:attribute> + <xs:attribute name="OnReinstall" type="YesNoType"> + <xs:annotation><xs:documentation> + Specifies whether to configure the service when the parent Component is reinstalled. This attribute may be combined with OnInstall + and OnUninstall. + </xs:documentation></xs:annotation> + </xs:attribute> + <xs:attribute name="OnUninstall" type="YesNoType"> + <xs:annotation><xs:documentation> + Specifies whether to configure the service when the parent Component is uninstalled. This attribute may be combined with OnInstall + and OnReinstall. + </xs:documentation></xs:annotation> + </xs:attribute> + <xs:attribute name="RebootMessage" type="xs:string"> + <xs:annotation><xs:documentation> + Specifies the message to show for a reboot failure action. If an empty string is provided it clears any existing reboot message. If this + attribute is not present the setting is not changed. + </xs:documentation></xs:annotation> + </xs:attribute> + <xs:attribute name="ResetPeriod" type="xs:string"> + <xs:annotation><xs:documentation> + Specifies the time in seconds to reset the failure count. If this attribute is not present the failure count will not be reset. + </xs:documentation></xs:annotation> + </xs:attribute> + <xs:attribute name="ServiceName" type="xs:string"> + <xs:annotation><xs:documentation> + Specifies the name of the service to configure. This value will default to the ServiceInstall/@Name attribute when nested under + a ServiceInstall element. + </xs:documentation></xs:annotation> + </xs:attribute> + </xs:complexType> + </xs:element> + <xs:element name="Environment"> <xs:annotation> <xs:documentation> @@ -5281,6 +5536,8 @@ <xs:element ref="RemoveRegistryValue"/> <xs:element ref="ReserveCost"/> <xs:element ref="ServiceControl"/> + <xs:element ref="ServiceConfig"/> + <xs:element ref="ServiceConfigFailureActions"/> <xs:element ref="ServiceInstall"/> <xs:element ref="Shortcut"/> <xs:element ref="SymbolPath"/> @@ -5736,7 +5993,7 @@ </xs:annotation> </xs:attribute> <xs:attribute name="FileSource" type="xs:string"> - <xs:annotation><xs:documentation>Used to set the file system source for this directory's child elements.</xs:documentation></xs:annotation> + <xs:annotation><xs:documentation>Used to set the file system source for this directory's child elements. For more information, see <a href="\html\specifying_source_files.htm">Specifying source files</a>.</xs:documentation></xs:annotation> </xs:attribute> <xs:attribute name="LongName" type="LongFileNameType"> <xs:annotation> @@ -5855,7 +6112,7 @@ </xs:annotation> </xs:attribute> <xs:attribute name="FileSource" type="xs:string"> - <xs:annotation><xs:documentation>Used to set the file system source for this DirectoryRef's child elements.</xs:documentation></xs:annotation> + <xs:annotation><xs:documentation>Used to set the file system source for this DirectoryRef's child elements. For more information, see <a href="\html\specifying_source_files.htm">Specifying source files</a>.</xs:documentation></xs:annotation> </xs:attribute> <xs:attribute name="src" type="xs:string"> <xs:annotation> @@ -8480,6 +8737,7 @@ If the Property attribute is specified, set the value of this attribute to the new value for the property. To set a property to null, do not set this attribute (the ControlEvent Argument column will be set to '{}'). Otherwise, this attribute's value should be the argument for the event specified in the Event attribute. + If the event doesn't take an attribute, a common value to use is "0". </xs:documentation> </xs:annotation> </xs:attribute> @@ -9300,6 +9558,7 @@ <xs:enumeration value="DefaultDir"/> <xs:enumeration value="RegPath"/> <xs:enumeration value="Formatted"/> + <xs:enumeration value="FormattedSddl"/> <xs:enumeration value="Template"/> <xs:enumeration value="Condition"/> <xs:enumeration value="Guid"/> diff --git a/doc/AssemblyBaseAddresses.txt b/doc/AssemblyBaseAddresses.txt deleted file mode 100644 index e75cbd320b..0000000000 --- a/doc/AssemblyBaseAddresses.txt +++ /dev/null @@ -1,69 +0,0 @@ -To be on the safe side and leave enough space for the future, -the in-memory size of an assembly used here should be 8 times the disk image size. -That should allow an assembly to grow to more than twice its old size without having to update this list. - -Sysinternals Processexplorer can show relocated assemblies in yellow in the DLL View. - -adr = 0x5000000 -def AddModule(kbsize as int): - print "0x${adr.ToString('x')} - 0x${(adr + 3 * kbsize * 1024).ToString('x')}" - adr += 8 * kbsize * 1024 - adr = 0x80000 * System.Math.Ceiling(cast(double,adr) / 0x80000) - -def AddModules(*names as (string)): - for name in names: - System.Console.Write("${name}:\t") - AddModule(System.IO.FileInfo("d:\\serralongue\\sharpdevelop\\bin\\" + name + ".dll").Length / 1024) - -All addresses are between 0x0500 0000 and 0x0fff ffff - -AssemblyName: startaddress - endaddress -ICSharpCode.Core: 0x5000000 - 0x504e000 -ICSharpCode.SharpDevelop: 0x5100000 - 0x5472000 -ICSharpCode.NRefactory: 0x5a80000 - 0x5b9a000 -ICSharpCode.TextEditor: 0x5d80000 - 0x5e67000 -ICSharpCode.SharpDevelop.Sda: 0x6000000 - 0x601e000 -WeifenLuo.WinFormsUI.Docking: 0x6080000 - 0x6107000 -ICSharpCode.Build.Tasks: 0x6200000 - 0x621b000 - -CSharpBinding: 0x6280000 - 0x62bc000 -ILAsmBinding: 0x6380000 - 0x639b000 -VBNetBinding: 0x6400000 - 0x643f000 -NRefactoryToBooConverter: 0x6500000 - 0x6536000 -BooBinding: 0x6600000 - 0x664e000 - -FormsDesigner: 0x6700000 - 0x676f000 -ResourceEditor: 0x6880000 - 0x689e000 -XmlEditor: 0x6900000 - 0x6948000 - -ICSharpCode.AddInMananger: 0x6a00000 - 0x6a24000 -AddInScout: 0x6a80000 - 0x6a8b400 -CodeCoverage: 0x6b00000 - 0x6b30000 -TreeListView (debugger): 0x6b80000 - 0x6be6000 -Debugger.Code: 0x6d00000 - 0x6ddb000 -Debugger.AddIn: 0x6f80000 - 0x6faa000 -FileTypeRegisterer: 0x7000000 - 0x7009000 -HighlightingEditor: 0x7080000 - 0x70ec000 -HtmlHelp2: 0x7200000 - 0x723f000 -HtmlHelp2JScriptGlobals: 0x7300000 - 0x7306c00 -MonoAddIn: 0x7380000 - 0x7395000 -NAntAddIn: 0x7400000 - 0x7427000 -PInvokeAddIn: 0x7480000 - 0x749b000 -RegExpTk: 0x7500000 - 0x7524000 -SharpQuery: 0x7580000 - 0x75b0000 -SharpReportCore: 0x7600000 - 0x7654000 -SharpReport: 0x7700000 - 0x773c000 -SharpReportAddIn: 0x7800000 - 0x781e000 -ReportGenerator: 0x7880000 - 0x78a1000 -StartPage: 0x7900000 - 0x791e000 -UnitTesting: 0x7980000 - 0x799b000 -Mono.Cecil: 0x7a00000 - 0x7b38000 -WixBinding: 0x7d80000 - 0x7dc2000 -ICSharpCode.SharpDevelop.Dom: 0x7e80000 - 0x7f19000 -CodeAnalysis: 0x8000000 - 0x8021000 -IconEditor: 0x8080000 - 0x80a1000 -IconEditor.AddIn: 0x8100000 - 0x810c000 -SharpDbTools: 0x8180000 - 0x819e000 -ICSharpCode.SD.Widgets: 0x8240000 - 0x827c000 - -Next free address: 0x08300000 diff --git a/doc/SharpDevelopInfoResources.txt b/doc/SharpDevelopInfoResources.txt index 23f74bc174..58e3b42204 100644 --- a/doc/SharpDevelopInfoResources.txt +++ b/doc/SharpDevelopInfoResources.txt @@ -12,8 +12,8 @@ http://wiki.sharpdevelop.net/ScreenRecordingsForDevelopers.ashx ++ ROADMAPS ++ -http://wiki.sharpdevelop.net/RoadmapVersion2x.ashx http://wiki.sharpdevelop.net/RoadmapVersion3x.ashx +http://wiki.sharpdevelop.net/RoadmapVersion4x.ashx ++ HELPING ++ diff --git a/doc/copyright.txt b/doc/copyright.txt index a37de83939..cfb3bb4096 100644 --- a/doc/copyright.txt +++ b/doc/copyright.txt @@ -1,4 +1,4 @@ -Copyright 2002-2008 by +Copyright 2002-2009 by AlphaSierraPapa, Christoph Wille Vordernberger Strasse 27/8 diff --git a/doc/readme.rtf b/doc/readme.rtf index 0e122cdc44..ee6ade25a6 100644 --- a/doc/readme.rtf +++ b/doc/readme.rtf @@ -1,43 +1,44 @@ -{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;} +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;} {\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Bitstream Vera Sans;} {\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} {\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} {\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} -{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f275\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} -{\f276\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f278\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f279\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f280\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} -{\f281\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f282\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f283\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f285\fbidi \fswiss\fcharset238\fprq2 Arial CE;} -{\f286\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}{\f288\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f289\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f290\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);} -{\f291\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}{\f292\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f293\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f615\fbidi \froman\fcharset238\fprq2 Cambria Math CE;} -{\f616\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f618\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f619\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f622\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;} -{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} -{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} -{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} -{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} -{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} -{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;} -{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;} -{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} -{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} -{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} -{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} -{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} -{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} -{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} -{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} -{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;} -{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} -{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} -{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}} -{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0; -\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1 -\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs24\alang1025 \ltrch\fcs0 -\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs24\alang1025 \ltrch\fcs0 -\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\* -\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1 -\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe1033\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp1033 +{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f328\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\f329\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f331\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f332\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f333\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\f334\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f335\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f336\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f338\fbidi \fswiss\fcharset238\fprq2 Arial CE;} +{\f339\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}{\f341\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f342\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f343\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);} +{\f344\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}{\f345\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f346\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f668\fbidi \froman\fcharset238\fprq2 Cambria Math CE;} +{\f669\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f671\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f672\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f675\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;} +{\f676\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;} +{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;} +{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;} +{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;} +{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0; +\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\*\defchp +\fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 +\rtlch\fcs1 \af31507\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 +\rtlch\fcs1 \af31507\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 +Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv +\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe1033\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext11 \ssemihidden \sunhideused \sqformat Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af31503\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}} -{\*\rsidtbl \rsid4815376\rsid5386203}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator Christoph Wille}{\creatim\yr2008\mo8\dy16\hr11\min32} -{\revtim\yr2008\mo8\dy16\hr11\min33}{\version2}{\edmins1}{\nofpages3}{\nofwords302}{\nofchars1761}{\nofcharsws2059}{\vern32895}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}} +{\*\rsidtbl \rsid2445895\rsid3302646\rsid4815376\rsid5386203}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator Christoph Wille} +{\creatim\yr2008\mo8\dy16\hr11\min32}{\revtim\yr2009\mo2\dy9\hr16\min9}{\version3}{\edmins3}{\nofpages3}{\nofwords294}{\nofchars1739}{\nofcharsws2029}{\vern32895}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}} \paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect \deftab1250\widowctrl\ftnbj\aenddoc\trackmoves1\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120 \dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\rsidroot4815376 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}} @@ -47,9 +48,10 @@ \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs120 \ltrch\fcs0 \b\fs120\cf1\insrsid5386203 \hich\af39\dbch\af31505\loch\f39 SharpDevelop \par \hich\af39\dbch\af31505\loch\f39 3.0 \par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\cf1\insrsid5386203 -\par }\pard \ltrpar\qc \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\lang2057\langfe1033\langnp2057\insrsid4815376 {\pict{\*\picprop\shplid1025{\sp{\sn shapeType}{\sv 75}}{\sp{\sn fFlipH}{\sv 0}} -{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv 1}}}\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0 -\picw14115\pich7763\picwgoal8002\pichgoal4401\wmetafile8\bliptag-484778159{\*\blipuid e31adf5141645d968e5b351951fadcdb}010009000003008903000000c103020000001610000026060f002220574d464301000000000001006b5c000000001900000000200000c8e50200c80503000100 +\par }\pard \ltrpar\qc \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\lang2057\langfe1033\langnp2057\insrsid2445895 {\pict{\*\picprop\shplid1025{\sp{\sn shapeType}{\sv 75}}{\sp{\sn fFlipH}{\sv 0}} +{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv 1}}{\sp{\sn fLayoutInCell}{\sv 1}}}\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0 +\picw14115\pich7763\picwgoal8002\pichgoal4401\wmetafile8\bliptag1689737403\blipupi95{\*\blipuid 64b758bba058ea259859c641d3d895ad} +010009000003008903000000c103020000001610000026060f002220574d464301000000000001006b5c000000001900000000200000c8e50200c80503000100 00006c000000000000000000000014020000240100000000000000000000854900005828000020454d4600000100c80503000c00000001000000000000000000 0000000000000005000000040000c401000069010000000000000000000000000000e3e306001c830500460000002c00000020000000454d462b014001001c00 0000100000000210c0db010000006000000060000000460000006c54000060540000454d462b224004000c000000000000001e4009000c000000000000002440 @@ -7307,18 +7309,19 @@ ffffffffffffffffffffffffffffffffffffffffffffffffffff0c00000040092900aa0000000000 \par \par \par }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\cf1\insrsid5386203 \hich\af0\dbch\af31505\loch\f0 -This work is licensed under the Creative Commons Attribution License. To view a copy of this license, visit http://creativecommons.org/licenses/by/2.0/at/ or send a letter to Creative Commons, 559 Nath\hich\af0\dbch\af31505\loch\f0 -an Abbott Way, Stanford, California 94305, USA.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\cf1\insrsid5386203 +This work is licensed under the Creative Commons Attribution License. To view a copy of this license, visit http://creativecommons.org/licenses/by/2.0/at/ or send a letter to Creative Commons, 559 Nathan\hich\af0\dbch\af31505\loch\f0 + Abbott Way, Stanford, California 94305, USA.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\cf1\insrsid5386203 \par }\pard\plain \ltrpar\s1\ql \li0\ri0\sb240\sa60\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 { \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\f0\fs32\cf1\insrsid5386203 \page }{\rtlch\fcs1 \ab\af1\afs32 \ltrch\fcs0 \b\f1\fs32\cf1\insrsid5386203 \hich\af1\dbch\af31505\loch\f1 Introduction}{\rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\f0\fs32\cf1\insrsid5386203 \par }\pard\plain \ltrpar\qj \fi1\li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 \rtlch\fcs1 \af31507\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\cf1\lang2057\langfe1033\langnp2057\insrsid5386203 \hich\af0\dbch\af31505\loch\f0 The #develop project started on September 11}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\cf1\lang2057\langfe1033\super\langnp2057\insrsid5386203 -\hich\af0\dbch\af31505\loch\f0 th}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\cf1\lang2057\langfe1033\langnp2057\insrsid5386203 \hich\af0\dbch\af31505\loch\f0 \hich\f0 , 2000. The project was initiated by Mike Kr\'fc\loch\f0 -ger, who is the main developer and architect of #develop to date. In the course of the project, Mike w\hich\af0\dbch\af31505\loch\f0 as joined by several contributors, who have helped a great deal to make the 1.0 release a successful one \hich\f0 \endash -\loch\f0 though it took us four years and a few architectural changes along the way. +\hich\af0\dbch\af31505\loch\f0 th}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\cf1\lang2057\langfe1033\langnp2057\insrsid5386203 \hich\af0\dbch\af31505\loch\f0 \hich\f0 , 2000. The project was initiated by Mike Kr\'fc\loch\f0 ger\hich\af0\dbch\af31505\loch\f0 +. In the course of the project, \hich\af0\dbch\af31505\loch\f0 several contributors}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\cf1\lang2057\langfe1033\langnp2057\insrsid3302646 \hich\af0\dbch\af31505\loch\f0 joined in (we always welcome new developers!)}{ +\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\cf1\lang2057\langfe1033\langnp2057\insrsid5386203 \hich\af0\dbch\af31505\loch\f0 , who have helped a great deal to make the 1.0 release a successful one \hich\f0 \endash \loch\f0 + though it took us four years and a few architectural changes along the way. \par -\par \hich\af0\dbch\af31505\loch\f0 What you got on your machine is now version 3.0 \hich\f0 \endash \hich\af0\dbch\af31505\loch\f0 a vastly enhanced product, and we encourage you to take the feature tour. +\par \hich\af0\dbch\af31505\loch\f0 What you got on your machine is now version 3.0 \hich\f0 \endash \loch\f0 a vastly enhanced product\hich\af0\dbch\af31505\loch\f0 , and we encourage you to take the feature tour. \par \par \par }{\rtlch\fcs1 \ab\ai\af0 \ltrch\fcs0 \b\i\f0\cf1\lang2057\langfe1033\langnp2057\insrsid5386203 \hich\af0\dbch\af31505\loch\f0 The #develop team @@ -7328,8 +7331,9 @@ ger, who is the main developer and architect of #develop to date. In the course \par }\pard\plain \ltrpar\s1\ql \li0\ri0\sb240\sa60\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 { \rtlch\fcs1 \ab\af1\afs32 \ltrch\fcs0 \b\f1\fs32\cf1\insrsid5386203 \hich\af1\dbch\af31505\loch\f1 Overview}{\rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\f0\fs32\cf1\insrsid5386203 \par }\pard\plain \ltrpar\qj \fi1\li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 \rtlch\fcs1 \af31507\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 -\ltrch\fcs0 \f0\cf1\lang2057\langfe1033\langnp2057\insrsid5386203 \hich\af0\dbch\af31505\loch\f0 #develop (short for SharpDevelop) is a free Integrate\hich\af0\dbch\af31505\loch\f0 -d Development Environment (IDE) for C#, VB.NET, Boo, Python and F# projects on Microsoft's .NET platform. It is written (almost) entirely in C#, and comes with features you would expect in an IDE plus a few more. +\ltrch\fcs0 \f0\cf1\lang2057\langfe1033\langnp2057\insrsid5386203 \hich\af0\dbch\af31505\loch\f0 #develop (short for SharpDevelop) is a free Integrate\hich\af0\dbch\af31505\loch\f0 d Development Environment (IDE) for C#, VB.NET, Boo, }{\rtlch\fcs1 \af0 +\ltrch\fcs0 \f0\cf1\lang2057\langfe1033\langnp2057\insrsid3302646 \hich\af0\dbch\af31505\loch\f0 Iron}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\cf1\lang2057\langfe1033\langnp2057\insrsid5386203 \hich\af0\dbch\af31505\loch\f0 +Python and F# projects on Microsoft's .NET platform. It is written (almost) entirely in C#, and comes with features you would expect in an IDE plus a few more. \par }\pard\plain \ltrpar\s1\ql \li0\ri0\sb240\sa60\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 { \rtlch\fcs1 \ab\af1\afs32 \ltrch\fcs0 \b\f1\fs32\cf1\insrsid5386203 \hich\af1\dbch\af31505\loch\f1 Features \par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 @@ -7464,8 +7468,8 @@ fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffffec69d9888b8b3d4c859eaf6cd158be0f00000000000000000000000080d5 -372a83ffc801feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000 +ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffffec69d9888b8b3d4c859eaf6cd158be0f0000000000000000000000003071 +8b5ac88ac901feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file diff --git a/samples/LineCounter/LineCounter.csproj b/samples/LineCounter/LineCounter.csproj index 7d141be14c..3910cea1d2 100644 --- a/samples/LineCounter/LineCounter.csproj +++ b/samples/LineCounter/LineCounter.csproj @@ -6,8 +6,8 @@ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{880A7EAF-D0B4-46AC-A9B6-B6156512037A}</ProjectGuid> - <OutputPath>..\..\AddIns\</OutputPath> <AllowUnsafeBlocks>False</AllowUnsafeBlocks> + <OutputPath>..\..\AddIns\Samples\LineCounter</OutputPath> <NoStdLib>False</NoStdLib> <RegisterForComInterop>False</RegisterForComInterop> <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> @@ -18,7 +18,6 @@ <TreatWarningsAsErrors>false</TreatWarningsAsErrors> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> - <BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath> <IntermediateOutputPath>obj\Debug\</IntermediateOutputPath> <Optimize>False</Optimize> <DefineConstants>DEBUG,TRACE,IMPR1,IMPR2,IMPR3</DefineConstants> @@ -27,7 +26,6 @@ <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)' == 'Release' "> - <BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath> <IntermediateOutputPath>obj\Release\</IntermediateOutputPath> <Optimize>True</Optimize> <DefineConstants>TRACE,IMPR1,IMPR2,IMPR3</DefineConstants> diff --git a/samples/SharpSnippetCompiler/SharpSnippetCompiler.Core/MainViewContent.cs b/samples/SharpSnippetCompiler/SharpSnippetCompiler.Core/MainViewContent.cs index 322a53952a..c180a0c301 100644 --- a/samples/SharpSnippetCompiler/SharpSnippetCompiler.Core/MainViewContent.cs +++ b/samples/SharpSnippetCompiler/SharpSnippetCompiler.Core/MainViewContent.cs @@ -215,6 +215,11 @@ namespace ICSharpCode.SharpSnippetCompiler.Core { } + public IDocument GetDocumentForFile(OpenedFile file) + { + return null; + } + public void JumpTo(int line, int column) { textEditor.ActiveTextAreaControl.JumpTo(line, column); diff --git a/samples/SharpSnippetCompiler/SharpSnippetCompiler.Core/Workbench.cs b/samples/SharpSnippetCompiler/SharpSnippetCompiler.Core/Workbench.cs index 49014ecbbc..21133f5290 100644 --- a/samples/SharpSnippetCompiler/SharpSnippetCompiler.Core/Workbench.cs +++ b/samples/SharpSnippetCompiler/SharpSnippetCompiler.Core/Workbench.cs @@ -48,6 +48,10 @@ namespace ICSharpCode.SharpSnippetCompiler.Core get { return views; } } + public ICollection<IViewContent> PrimaryViewContents { + get { return views.AsReadOnly(); } + } + public IList<IWorkbenchWindow> WorkbenchWindowCollection { get { throw new NotImplementedException(); @@ -95,6 +99,11 @@ namespace ICSharpCode.SharpSnippetCompiler.Core throw new NotImplementedException(); } + public void ShowView(IViewContent content, bool switchToOpenedView) + { + throw new NotImplementedException(); + } + public void UnloadPad(PadDescriptor content) { throw new NotImplementedException(); diff --git a/samples/SharpSnippetCompiler/SharpSnippetCompiler/WorkbenchLayout.cs b/samples/SharpSnippetCompiler/SharpSnippetCompiler/WorkbenchLayout.cs index 14840f9b10..cc343a6aa3 100644 --- a/samples/SharpSnippetCompiler/SharpSnippetCompiler/WorkbenchLayout.cs +++ b/samples/SharpSnippetCompiler/SharpSnippetCompiler/WorkbenchLayout.cs @@ -108,6 +108,11 @@ namespace ICSharpCode.SharpSnippetCompiler throw new NotImplementedException(); } + public IWorkbenchWindow ShowView(IViewContent content, bool switchToOpenedView) + { + throw new NotImplementedException(); + } + public void LoadConfiguration() { Console.WriteLine("WorkbenchLayout.LoadConfiguration not implemented"); diff --git a/samples/SharpSnippetCompiler/SharpSnippetCompiler/WorkbenchWindow.cs b/samples/SharpSnippetCompiler/SharpSnippetCompiler/WorkbenchWindow.cs index 5242154421..62e220b0ef 100644 --- a/samples/SharpSnippetCompiler/SharpSnippetCompiler/WorkbenchWindow.cs +++ b/samples/SharpSnippetCompiler/SharpSnippetCompiler/WorkbenchWindow.cs @@ -64,12 +64,8 @@ namespace ICSharpCode.SharpSnippetCompiler } public IViewContent ActiveViewContent { - get { - throw new NotImplementedException(); - } - set { - throw new NotImplementedException(); - } + get { return null; } + set { } } public Icon Icon { diff --git a/src/AddIns/BackendBindings/Boo/BooBinding/Project/PostBuildEvent.proj b/src/AddIns/BackendBindings/Boo/BooBinding/Project/PostBuildEvent.proj index a585d08204..1f0b39861d 100644 --- a/src/AddIns/BackendBindings/Boo/BooBinding/Project/PostBuildEvent.proj +++ b/src/AddIns/BackendBindings/Boo/BooBinding/Project/PostBuildEvent.proj @@ -7,6 +7,7 @@ <MyCopyItem Include="$(MSBuildProjectDirectory)\..\..\RequiredLibraries\*.targets" /> <MyCopyItem Include="$(MSBuildProjectDirectory)\..\..\RequiredLibraries\Boo.Microsoft.Build.Tasks.dll" /> <MyCopyItem Include="$(MSBuildProjectDirectory)\..\..\RequiredLibraries\Boo.Lang.Extensions.dll" /> + <MyCopyItem Include="$(MSBuildProjectDirectory)\..\..\RequiredLibraries\Boo.Lang.PatternMatching.dll" /> </ItemGroup> <Target Name="MyPostBuildTarget"> <Copy SourceFiles="@(MyCopyItem)" DestinationFolder="$(OutputPath)" /> diff --git a/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/BooParser.cs b/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/BooParser.cs index f0e4f4dc39..afbd80ee32 100644 --- a/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/BooParser.cs +++ b/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/BooParser.cs @@ -158,7 +158,7 @@ namespace Grunwald.BooBinding.CodeCompletion private ICompilationUnit Parse(IProjectContent projectContent, string fileName, int[] lineLength, BooCompiler compiler) { compiler.Parameters.OutputWriter = new StringWriter(); - compiler.Parameters.TraceSwitch.Level = System.Diagnostics.TraceLevel.Off; + compiler.Parameters.TraceLevel = System.Diagnostics.TraceLevel.Off; Compile compilePipe = new Compile(); BooParsingStep parsingStep = (BooParsingStep)compilePipe[0]; diff --git a/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/ConvertVisitor.cs b/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/ConvertVisitor.cs index 3736935aed..b477e23094 100644 --- a/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/ConvertVisitor.cs +++ b/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/ConvertVisitor.cs @@ -501,6 +501,7 @@ namespace Grunwald.BooBinding.CodeCompletion if (node.Setter != null && node.Setter.Body != null) { property.SetterRegion = GetClientRegion(node.Setter); } + property.IsIndexer = (node.Name == "self"); OuterClass.Properties.Add(property); property.UserData = node; } diff --git a/src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/ConvertVisitorStatements.cs b/src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/ConvertVisitorStatements.cs index 66e02443e9..d7390ab5e0 100644 --- a/src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/ConvertVisitorStatements.cs +++ b/src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/ConvertVisitorStatements.cs @@ -104,10 +104,10 @@ namespace NRefactoryToBooConverter macro.Name = name; ConvertExpressions(arguments, macro.Arguments); if (embedded is BlockStatement) { - macro.Block = ConvertBlock((BlockStatement)embedded); + macro.Body = ConvertBlock((BlockStatement)embedded); } else { - macro.Block = new B.Block(); - macro.Block.Add((B.Statement)embedded.AcceptVisitor(this, null)); + macro.Body = new B.Block(); + macro.Body.Add((B.Statement)embedded.AcceptVisitor(this, null)); } return macro; } diff --git a/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.CodeDom.dll b/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.CodeDom.dll new file mode 100755 index 0000000000..e5a4952b20 Binary files /dev/null and b/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.CodeDom.dll differ diff --git a/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.Compiler.dll b/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.Compiler.dll new file mode 100755 index 0000000000..b98738cd70 Binary files /dev/null and b/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.Compiler.dll differ diff --git a/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.Extensions.dll b/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.Extensions.dll new file mode 100755 index 0000000000..20a58ac940 Binary files /dev/null and b/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.Extensions.dll differ diff --git a/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.Interpreter.dll b/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.Interpreter.dll new file mode 100755 index 0000000000..71e61958e9 Binary files /dev/null and b/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.Interpreter.dll differ diff --git a/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.Parser.dll b/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.Parser.dll new file mode 100755 index 0000000000..77e04c5346 Binary files /dev/null and b/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.Parser.dll differ diff --git a/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.PatternMatching.dll b/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.PatternMatching.dll new file mode 100644 index 0000000000..9f201dbbd8 Binary files /dev/null and b/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.PatternMatching.dll differ diff --git a/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.Useful.dll b/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.Useful.dll new file mode 100755 index 0000000000..166653cf78 Binary files /dev/null and b/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.Useful.dll differ diff --git a/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.dll b/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.dll new file mode 100755 index 0000000000..91676cccdd Binary files /dev/null and b/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Lang.dll differ diff --git a/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Microsoft.Build.Tasks.dll b/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Microsoft.Build.Tasks.dll new file mode 100755 index 0000000000..59536d07e5 Binary files /dev/null and b/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Microsoft.Build.Tasks.dll differ diff --git a/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Microsoft.Build.targets b/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Microsoft.Build.targets new file mode 100644 index 0000000000..37103299e0 --- /dev/null +++ b/src/AddIns/BackendBindings/Boo/RequiredLibraries/Boo.Microsoft.Build.targets @@ -0,0 +1,259 @@ +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + + <UsingTask + TaskName="Microsoft.Build.Tasks.CreateBooManifestResourceName" + AssemblyFile="Boo.Microsoft.Build.Tasks.dll" /> + + <UsingTask + TaskName="Boo.Microsoft.Build.Tasks.Booc" + AssemblyFile="Boo.Microsoft.Build.Tasks.dll"/> + + <UsingTask + TaskName="Boo.Microsoft.Build.Tasks.ExecBoo" + AssemblyFile="Boo.Microsoft.Build.Tasks.dll"/> + + <PropertyGroup> + <MSBuildAllProjects Condition="'$(BooBinPath)' != ''"> + $(MSBuildAllProjects);$(BooBinPath)\Boo.Microsoft.Build.targets + </MSBuildAllProjects> + <MSBuildAllProjects Condition="'$(BooBinPath)' == ''"> + $(MSBuildAllProjects);$(MSBuildBinPath)\Boo.Microsoft.Build.targets + </MSBuildAllProjects> + <DefaultLanguageSourceExtension>.boo</DefaultLanguageSourceExtension> + <Language>Boo</Language> + </PropertyGroup> + + <!-- + The CreateManifestResourceNames target create the manifest resource names + from the .RESX files. + + [IN] + @(ResxWithNoCulture) - The names the non-culture .RESX files. + @(ResxWithCulture) - The names the culture .RESX files. + @(NonResxWithNoCulture) - The names of the non-culture non-RESX + files (like bitmaps, etc). + + @(NonResxWithCulture) - The names of the culture non-RESX + files (like bitmaps, etc). + + [OUT] + @(ManifestResourceWithNoCultureName) - The corresponding manifest + resource name (.RESOURCE) + + @(ManifestResourceWithCultureName) - The corresponding manifest + resource name (.RESOURCE) + + @(ManifestNonResxWithNoCulture) - The corresponding manifest + resource name. + + @(ManifestNonResxWithCulture) - The corresponding manifest + resource name. + + For Boo applications the transformation is like: + + Resources1.resx => RootNamespace.Resources1 => Build into main assembly + + SubFolder\Resources1.resx => + RootNamespace.SubFolder.Resources1 => + Build into main assembly + + Resources1.fr.resx => + RootNamespace.Resources1.fr => + Build into satellite assembly + + Resources1.notaculture.resx => + RootNamespace.Resources1.notaculture => + Build into main assembly + + For other project systems, this transformation may be different. + --> + + <PropertyGroup> + <CreateManifestResourceNamesDependsOn> + </CreateManifestResourceNamesDependsOn> + </PropertyGroup> + + <Target + Name="CreateManifestResourceNames" + DependsOnTargets="$(CreateManifestResourceNamesDependsOn)" + > + <CallTarget Targets="CreateManifestResourceNames_35" Condition="'$(MSBuildToolsVersion)' == '3.5'"/> + <CallTarget Targets="CreateManifestResourceNames_20" Condition="'$(MSBuildToolsVersion)' != '3.5'"/> + </Target> + + <Target + Name="CreateManifestResourceNames_20" + Condition="' + @(ResxWithNoCulture) + @(ResxWithCulture) + @(NonResxWithNoCulture) + @(NonResxWithCulture)'!=''" + > + <!-- Create the target resource names for non-culture resx files --> + <CreateBooManifestResourceName + Condition="'@(ResxWithNoCulture)'!=''" + ResourceFiles="@(ResxWithNoCulture)" + RootNamespace="$(RootNamespace)"> + + <Output + TaskParameter="ManifestResourceNames" + ItemName="ManifestResourceWithNoCultureName"/> + + </CreateBooManifestResourceName> + + <!-- Create the target resource names for culture resx files. --> + <CreateBooManifestResourceName + Condition="'@(ResxWithCulture)'!=''" + ResourceFiles="@(ResxWithCulture)" + RootNamespace="$(RootNamespace)"> + + <Output + TaskParameter="ManifestResourceNames" + ItemName="ManifestResourceWithCultureName"/> + + </CreateBooManifestResourceName> + + <!-- Create the target resource names for non-culture non-resx files. --> + <CreateBooManifestResourceName + Condition="'@(NonResxWithNoCulture)'!=''" + ResourceFiles="@(NonResxWithNoCulture)" + RootNamespace="$(RootNamespace)"> + + <Output + TaskParameter="ManifestResourceNames" + ItemName="ManifestNonResxWithNoCulture"/> + + </CreateBooManifestResourceName> + + <!-- Create the target resource names for culture non-resx files. --> + <CreateBooManifestResourceName + Condition="'@(NonResxWithCulture)'!=''" + ResourceFiles="@(NonResxWithCulture)" + RootNamespace="$(RootNamespace)"> + + <Output + TaskParameter="ManifestResourceNames" + ItemName="ManifestNonResxWithCulture"/> + + </CreateBooManifestResourceName> + </Target> + + <Target + Name="CreateManifestResourceNames_35" + Condition="'@(EmbeddedResource)' != ''" + > + <ItemGroup> + <_Temporary Remove="@(_Temporary)" /> + </ItemGroup> + + <CreateBooManifestResourceName + ResourceFiles="@(EmbeddedResource)" + RootNamespace="$(RootNamespace)" + Condition="'%(EmbeddedResource.ManifestResourceName)' == ''"> + + <Output TaskParameter="ResourceFilesWithManifestResourceNames" ItemName="_Temporary" /> + + </CreateBooManifestResourceName> + + <ItemGroup> + <EmbeddedResource Remove="@(EmbeddedResource)" Condition="'%(EmbeddedResource.ManifestResourceName)' == ''"/> + <EmbeddedResource Include="@(_Temporary)" /> + <_Temporary Remove="@(_Temporary)" /> + </ItemGroup> + </Target> + + + <PropertyGroup> + + <!-- + "None" is not technically a valid DebugType, so we can't pass it + in as such to the compiler. So here, we modify the properties so + they make sense. + --> + <DebugSymbols Condition="'$(DebugType)' == 'none'">false</DebugSymbols> + <DebugType Condition="'$(DebugType)' == 'none'"></DebugType> + + <!-- Provide a facility to override UseHostCompilerIfAvailable--> + <UseHostCompilerIfAvailable + Condition="'$(UseHostCompilerIfAvailable)' == ''"> + true + </UseHostCompilerIfAvailable> + + </PropertyGroup> + + <ItemGroup> + <DocFileItem + Include="$(DocumentationFile)" + Condition="'$(DocumentationFile)'!=''"> + + <InProject>false</InProject> + </DocFileItem> + </ItemGroup> + + <PropertyGroup> + <CoreCompileDependsOn> + _ComputeNonExistentFileProperty + </CoreCompileDependsOn> + </PropertyGroup> + + <PropertyGroup Condition=" '$(BoocToolPath)' != '' "> + <ReferencePath>$(ReferencePath);$(BoocToolPath)</ReferencePath> + </PropertyGroup> + <PropertyGroup Condition=" '$(BoocToolPath)' == '' "> + <ReferencePath>$(ReferencePath);$(BooBinPath)</ReferencePath> + </PropertyGroup> + + <Target + Name="CoreCompile" + Inputs="$(MSBuildAllProjects); + @(Compile); + @(ManifestResourceWithNoCulture); + $(ApplicationIcon); + $(AssemblyOriginatorKeyFile); + @(ManifestNonResxWithNoCultureOnDisk); + @(ReferencePath); + @(CompiledLicenseFile)" + Outputs="@(IntermediateAssembly)" + DependsOnTargets="$(CoreCompileDependsOn)" + > + + <Booc + OutputAssembly="@(IntermediateAssembly)" + References="@(ReferencePath)" + Resources= "@(ManifestResourceWithNoCulture); + @(ManifestNonResxWithNoCultureOnDisk); + @(CompiledLicenseFile)" + ResponseFiles="$(CompilerResponseFile)" + Sources="@(Compile)" + TargetType="$(OutputType)" + ToolPath="$(BoocToolPath)" + Pipeline="$(Pipeline)" + WhiteSpaceAgnostic="$(WhiteSpaceAgnostic)" + Ducky="$(Ducky)" + Verbosity="$(BoocVerbosity)" + Culture="$(AssemblyCulture)" + SourceDirectory="$(SourceDirectory)" + KeyFile="$(AssemblyOriginatorKeyFile)" + KeyContainer="$(AssemblyKeyContainerName)" + EmitDebugInformation="$(DebugSymbols)" + DelaySign="$(DelaySign)" + NoStandardLib="$(NoStdLib)" + DefineSymbols="$(DefineConstants)" + GenerateFullPaths="$(GenerateFullPaths)" + /> + + <Copy + Condition=" '$(BoocToolPath)' == '' " + SkipUnchangedFiles="true" + SourceFiles="$(BooBinPath)\Boo.Lang.dll" + DestinationFolder="$(OutputPath)"/> + + <Copy + Condition=" '$(BoocToolPath)' != '' " + SkipUnchangedFiles="true" + SourceFiles="$(BoocToolPath)\Boo.Lang.dll" + DestinationFolder="$(OutputPath)"/> + </Target> + + <Import Project="$(MSBuildBinPath)\Microsoft.Common.targets" /> +</Project> diff --git a/src/AddIns/BackendBindings/Boo/RequiredLibraries/booc.exe b/src/AddIns/BackendBindings/Boo/RequiredLibraries/booc.exe new file mode 100755 index 0000000000..e496eb9f37 Binary files /dev/null and b/src/AddIns/BackendBindings/Boo/RequiredLibraries/booc.exe differ diff --git a/src/AddIns/BackendBindings/Boo/RequiredLibraries/booc.exe.config b/src/AddIns/BackendBindings/Boo/RequiredLibraries/booc.exe.config new file mode 100644 index 0000000000..22436a8382 --- /dev/null +++ b/src/AddIns/BackendBindings/Boo/RequiredLibraries/booc.exe.config @@ -0,0 +1,6 @@ +<configuration> +<startup> +<supportedRuntime version="v2.0.50727"/> +<supportedRuntime version="v1.1.4322"/> +</startup> +</configuration> diff --git a/src/AddIns/BackendBindings/Boo/RequiredLibraries/booc.rsp b/src/AddIns/BackendBindings/Boo/RequiredLibraries/booc.rsp new file mode 100644 index 0000000000..20f1460e8c --- /dev/null +++ b/src/AddIns/BackendBindings/Boo/RequiredLibraries/booc.rsp @@ -0,0 +1,20 @@ +# This file contains command-line options that the Boo +# command-line compiler (booc) will process as part +# of every compilation, unless the "-noconfig" option +# is specified. + +# Reference the common Framework libraries +#-r:System (already included by boo) +#-r:System.Data +-r:System.Drawing +#-r:System.Management +#-r:System.Messaging +#-r:System.Runtime.Remoting +#-r:System.Runtime.Serialization.Formatters.Soap +# does not work nicely on mono +-r:System.Security +#-r:System.ServiceProcess +#-r:System.Web +#-r:System.Web.Services +#-r:System.Windows.Forms +-r:System.Xml diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpCompletionBinding.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpCompletionBinding.cs index 4a6e6cc51a..bf0ae7847f 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpCompletionBinding.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpCompletionBinding.cs @@ -307,7 +307,7 @@ namespace CSharpBinding public RenamedClass(IClass c, string newName) : base(c.CompilationUnit, c.ClassType, c.Modifiers, c.Region, c.DeclaringType) { this.newName = newName; - this.Documentation = c.Documentation; + CopyDocumentationFrom(c); this.FullyQualifiedName = c.FullyQualifiedName; } diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/EventHandlerCompletitionDataProvider.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/EventHandlerCompletitionDataProvider.cs index a6f080b886..06501ab92e 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/EventHandlerCompletitionDataProvider.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/EventHandlerCompletitionDataProvider.cs @@ -113,7 +113,9 @@ namespace CSharpBinding newHandlerTextBuilder.ToString(), 2+newHandlerName.Length, newHandlerName.Length, - "new " + eventHandlerFullyQualifiedTypeName + "(" + newHandlerName +StringParser.Parse(")\n${res:CSharpBinding.GenerateNewHandlerInstructions}\n") + CodeCompletionData.GetDocumentation(resolvedClass.Documentation), + "new " + eventHandlerFullyQualifiedTypeName + + "(" + newHandlerName + StringParser.Parse(")\n${res:CSharpBinding.GenerateNewHandlerInstructions}\n") + + CodeCompletionData.ConvertDocumentation(resolvedClass.Documentation), resolveResult, newHandlerCodeBuilder.ToString() )); diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Project/CSharpProject.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Project/CSharpProject.cs index 6d569a37b8..07efeaaee4 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Project/CSharpProject.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Project/CSharpProject.cs @@ -88,7 +88,7 @@ namespace CSharpBinding public override void StartBuild(ProjectBuildOptions options, IBuildFeedbackSink feedbackSink) { - if (this.MinimumSolutionVersion == 9) { + if (this.MinimumSolutionVersion == Solution.SolutionVersionVS2005) { MSBuildEngine.StartBuild(this, options, feedbackSink, diff --git a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.addin b/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.addin index 8e9cee4b11..b0a388a294 100644 --- a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.addin +++ b/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.addin @@ -5,12 +5,14 @@ <Manifest> <Identity name = "ICSharpCode.FSharpBinding"/> + <Dependency addin = "ICSharpCode.CSharpBinding" requirePreload = "true"/> </Manifest> <Runtime> <Import assembly = "FSharpBinding.dll"/> <Import assembly = ":ICSharpCode.SharpDevelop"/> <Import assembly = ":ICSharpCode.SharpDevelop.Dom"/> + <Import assembly = "$ICSharpCode.CSharpBinding/CSharpBinding.dll"/> </Runtime> <Path name = "/SharpDevelop/Workbench/Ambiences"> @@ -98,7 +100,6 @@ category = "Main" title = "F# Interactive" icon = "F#.ProjectIcon" - shortcut = "Control|Shift|B" class = "FSharpBinding.FSharpInteractive"/> </Path> diff --git a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.fsproj b/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.fsproj index e97aa5d25e..54721898f0 100644 --- a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.fsproj +++ b/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.fsproj @@ -30,6 +30,9 @@ <ErrorReport>prompt</ErrorReport> <WarningLevel>3</WarningLevel> </PropertyGroup> + <PropertyGroup> + <OtherFlags>--standalone</OtherFlags> + </PropertyGroup> <ItemGroup> <Compile Include="Src\project.fs" /> <Compile Include="Src\languagebinding.fs" /> @@ -47,15 +50,119 @@ </None> </ItemGroup> <ItemGroup> + <Reference Include="AvalonDock"> + <HintPath>..\..\..\..\..\Libraries\AvalonDock\AvalonDock.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="log4net"> + <HintPath>..\..\..\..\..\Libraries\log4net\log4net.dll</HintPath> + <Private>False</Private> + </Reference> <Reference Include="Microsoft.Build.Engine, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <Name>Microsoft.Build.Engine</Name> <AssemblyName>Microsoft.Build.Engine.dll</AssemblyName> </Reference> + <Reference Include="Mono.Cecil"> + <HintPath>..\..\..\..\..\Libraries\Mono.Cecil\Mono.Cecil.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="PresentationCFFRasterizer" /> + <Reference Include="PresentationCore"> + <RequiredTargetFramework>3.0</RequiredTargetFramework> + </Reference> + <Reference Include="PresentationFramework"> + <RequiredTargetFramework>3.0</RequiredTargetFramework> + </Reference> + <Reference Include="PresentationUI"> + <RequiredTargetFramework>3.0</RequiredTargetFramework> + </Reference> + <Reference Include="ReachFramework"> + <RequiredTargetFramework>3.0</RequiredTargetFramework> + </Reference> <Reference Include="System" /> <Reference Include="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <Name>System.Configuration</Name> <AssemblyName>System.configuration.dll</AssemblyName> </Reference> + <Reference Include="System.Printing"> + <RequiredTargetFramework>3.0</RequiredTargetFramework> + </Reference> + <Reference Include="System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <Name>System.Security</Name> + <AssemblyName>System.Security.dll</AssemblyName> + </Reference> + <Reference Include="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <Name>System.Web</Name> + <AssemblyName>System.Web.dll</AssemblyName> + </Reference> + <Reference Include="System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <Name>System.EnterpriseServices</Name> + <AssemblyName>System.EnterpriseServices.dll</AssemblyName> + </Reference> + <Reference Include="System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <Name>System.Runtime.Remoting</Name> + <AssemblyName>System.Runtime.Remoting.dll</AssemblyName> + </Reference> + <Reference Include="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <Name>System.DirectoryServices</Name> + <AssemblyName>System.DirectoryServices.dll</AssemblyName> + </Reference> + <Reference Include="System.Runtime.Serialization.Formatters.Soap, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <Name>System.Runtime.Serialization.Formatters.Soap</Name> + <AssemblyName>System.Runtime.Serialization.Formatters.Soap.dll</AssemblyName> + </Reference> + <Reference Include="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <Name>System.Transactions</Name> + <AssemblyName>System.Transactions.dll</AssemblyName> + </Reference> + <Reference Include="System.DirectoryServices.Protocols, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <Name>System.DirectoryServices.Protocols</Name> + <AssemblyName>System.DirectoryServices.Protocols.dll</AssemblyName> + </Reference> + <Reference Include="System.Web.RegularExpressions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <Name>System.Web.RegularExpressions</Name> + <AssemblyName>System.Web.RegularExpressions.dll</AssemblyName> + </Reference> + <Reference Include="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <Name>System.Web.Services</Name> + <AssemblyName>System.Web.Services.dll</AssemblyName> + </Reference> + <Reference Include="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <Name>System.Data</Name> + <AssemblyName>System.Data.dll</AssemblyName> + </Reference> + <Reference Include="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <Name>System.Design</Name> + <AssemblyName>System.Design.dll</AssemblyName> + </Reference> + <Reference Include="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <Name>System.Drawing.Design</Name> + <AssemblyName>System.Drawing.Design.dll</AssemblyName> + </Reference> + <Reference Include="System.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <Name>System.Deployment</Name> + <AssemblyName>System.Deployment.dll</AssemblyName> + </Reference> + <Reference Include="Accessibility, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <Name>Accessibility</Name> + <AssemblyName>Accessibility.dll</AssemblyName> + </Reference> + <Reference Include="System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <Name>System.Data.OracleClient</Name> + <AssemblyName>System.Data.OracleClient.dll</AssemblyName> + </Reference> + <Reference Include="System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <Name>System.ServiceProcess</Name> + <AssemblyName>System.ServiceProcess.dll</AssemblyName> + </Reference> + <Reference Include="System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <Name>System.Configuration.Install</Name> + <AssemblyName>System.Configuration.Install.dll</AssemblyName> + </Reference> + <Reference Include="Microsoft.VisualC, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <Name>Microsoft.VisualC</Name> + <AssemblyName>Microsoft.VisualC.dll</AssemblyName> + </Reference> <Reference Include="System.Core"> <RequiredTargetFramework>3.5</RequiredTargetFramework> </Reference> @@ -71,50 +178,72 @@ <Name>System.Xml</Name> <AssemblyName>System.XML.dll</AssemblyName> </Reference> + <Reference Include="UIAutomationProvider"> + <RequiredTargetFramework>3.0</RequiredTargetFramework> + </Reference> + <Reference Include="UIAutomationTypes"> + <RequiredTargetFramework>3.0</RequiredTargetFramework> + </Reference> + <Reference Include="WindowsBase"> + <RequiredTargetFramework>3.0</RequiredTargetFramework> + </Reference> + <Reference Include="WindowsFormsIntegration" /> + <ProjectReference Include="..\..\..\..\..\Main\ICSharpCode.Core.WinForms\ICSharpCode.Core.WinForms.csproj"> + <Name>ICSharpCode.Core.WinForms</Name> + <Project>{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}</Project> + <Private>False</Private> + </ProjectReference> <ProjectReference Include="..\..\..\..\..\Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj"> <Name>ICSharpCode.TextEditor</Name> <Project>{2d18be89-d210-49eb-a9dd-2246fbb3df6d}</Project> - <Private>True</Private> + <Private>False</Private> </ProjectReference> <ProjectReference Include="..\..\..\..\..\Libraries\NRefactory\Project\NRefactory.csproj"> <Name>NRefactory</Name> <Project>{3a9ae6aa-bc07-4a2f-972c-581e3ae2f195}</Project> - <Private>True</Private> + <Private>False</Private> </ProjectReference> <ProjectReference Include="..\..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj"> <Name>ICSharpCode.SharpDevelop</Name> <Project>{2748ad25-9c63-4e12-877b-4dce96fbed54}</Project> - <Private>True</Private> + <Private>False</Private> </ProjectReference> <ProjectReference Include="..\..\..\..\..\Main\Core\Project\ICSharpCode.Core.csproj"> <Name>ICSharpCode.Core</Name> <Project>{35cef10f-2d4c-45f2-9dd1-161e0fec583c}</Project> - <Private>True</Private> - </ProjectReference> - <ProjectReference Include="..\..\..\..\..\Main\ICSharpCode.SharpDevelop.BuildWorker\ICSharpCode.SharpDevelop.BuildWorker.csproj"> - <Name>ICSharpCode.SharpDevelop.BuildWorker</Name> - <Project>{c3cbc8e3-81d8-4c5b-9941-dccd12d50b1f}</Project> - <Private>True</Private> + <Private>False</Private> </ProjectReference> <ProjectReference Include="..\..\..\..\..\Main\ICSharpCode.SharpDevelop.Dom\Project\ICSharpCode.SharpDevelop.Dom.csproj"> <Name>ICSharpCode.SharpDevelop.Dom</Name> <Project>{924ee450-603d-49c1-a8e5-4afaa31ce6f3}</Project> - <Private>True</Private> + <Private>False</Private> </ProjectReference> <ProjectReference Include="..\..\..\..\..\Main\ICSharpCode.SharpDevelop.Widgets\Project\ICSharpCode.SharpDevelop.Widgets.csproj"> <Name>ICSharpCode.SharpDevelop.Widgets</Name> <Project>{8035765f-d51f-4a0c-a746-2fd100e19419}</Project> - <Private>True</Private> + <Private>False</Private> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\..\..\..\Main\ICSharpCode.Core.Presentation\ICSharpCode.Core.Presentation.csproj"> + <Project>{7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}</Project> + <Name>ICSharpCode.Core.Presentation</Name> + <Private>False</Private> + </ProjectReference> + <ProjectReference Include="..\..\..\..\..\Main\ICSharpCode.SharpDevelop.BuildWorker\ICSharpCode.SharpDevelop.BuildWorker.csproj"> + <Project>{C3CBC8E3-81D8-4C5B-9941-DCCD12D50B1F}</Project> + <Name>ICSharpCode.SharpDevelop.BuildWorker</Name> + <Private>False</Private> </ProjectReference> </ItemGroup> - <Target Name="Clean" Condition="!Exists('$(MSBuildExtensionsPath)\FSharp\1.0\Microsoft.FSharp.Targets')"> - <!-- F# not found? no need to clean anything --> - </Target> - <Target Name="Build" Condition="!Exists('$(MSBuildExtensionsPath)\FSharp\1.0\Microsoft.FSharp.Targets')"> - <Warning Text="Microsoft.FSharp.Targets not found, skipping F# binding"/> - </Target> - <Target Name="Rebuild" Condition="!Exists('$(MSBuildExtensionsPath)\FSharp\1.0\Microsoft.FSharp.Targets')"> - <Warning Text="Microsoft.FSharp.Targets not found, skipping F# binding"/> - </Target> + <Target Name="Clean" Condition="!Exists('$(MSBuildExtensionsPath)\FSharp\1.0\Microsoft.FSharp.Targets')"> + <!-- F# not found? no need to clean anything --> + </Target> + <Target Name="Build" Condition="!Exists('$(MSBuildExtensionsPath)\FSharp\1.0\Microsoft.FSharp.Targets')"> + <Warning Text="Microsoft.FSharp.Targets not found, skipping F# binding" /> + </Target> + <Target Name="Rebuild" Condition="!Exists('$(MSBuildExtensionsPath)\FSharp\1.0\Microsoft.FSharp.Targets')"> + <Warning Text="Microsoft.FSharp.Targets not found, skipping F# binding" /> + </Target> <Import Project="$(MSBuildExtensionsPath)\FSharp\1.0\Microsoft.FSharp.Targets" Condition="Exists('$(MSBuildExtensionsPath)\FSharp\1.0\Microsoft.FSharp.Targets')" /> </Project> \ No newline at end of file diff --git a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/fsi.fs b/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/fsi.fs index 9b252eceb4..147eb55837 100644 --- a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/fsi.fs +++ b/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/fsi.fs @@ -131,8 +131,16 @@ type SentToFSharpInteractive = class match window.ActiveViewContent :> obj with | :? ITextEditorControlProvider as textArea -> let textArea = textArea.TextEditorControl.ActiveTextAreaControl.TextArea - for selection in textArea.SelectionManager.SelectionCollection do - TheControl.fsiProcess.StandardInput.WriteLine(selection.SelectedText) + let pad = WorkbenchSingleton.Workbench.GetPad(typeof<FSharpInteractive>) + pad.BringPadToFront() + if textArea.SelectionManager.HasSomethingSelected then + for selection in textArea.SelectionManager.SelectionCollection do + TheControl.fsiProcess.StandardInput.WriteLine(selection.SelectedText) + else + let line = textArea.Document.GetLineNumberForOffset(textArea.Caret.Offset) + let lineSegment = textArea.Document.GetLineSegment(line) + let lineText = textArea.Document.GetText(lineSegment.Offset, lineSegment.TotalLength) + TheControl.fsiProcess.StandardInput.WriteLine(lineText) TheControl.fsiProcess.StandardInput.WriteLine(";;") | _ -> () -end \ No newline at end of file +end diff --git a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/project.fs b/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/project.fs index bb0017cae2..49bc0e4ee0 100644 --- a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/project.fs +++ b/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/project.fs @@ -10,7 +10,6 @@ namespace FSharpBinding //Global todos //TODO add "compiling" dialog to output the correct directory -//TODO output to correct directory :) //TODO copy all config to the correct locations //TODO add directory structure @@ -221,7 +220,7 @@ type FsOptions() = override x.LoadPanelContents() = let this = (typeof<FsOptions>) let caller = this.Assembly - x.SetupFromXmlStream(caller.GetManifestResourceStream("FSharpBindings.Resources.FsOptions.xfrm")) + x.SetupFromXmlStream(caller.GetManifestResourceStream("FsOptions.xfrm")) x.InitializeHelper() x.helper.BindBoolean(x.Get<CheckBox>("standalone"), "Standalone", false) |> ignore x.helper.BindBoolean(x.Get<CheckBox>("nomllib"), "NoMLLib", false) |> ignore diff --git a/src/AddIns/BackendBindings/Python/PyWalker/MainForm.cs b/src/AddIns/BackendBindings/Python/PyWalker/MainForm.cs index 2cfbdb61ca..756e88b79c 100644 --- a/src/AddIns/BackendBindings/Python/PyWalker/MainForm.cs +++ b/src/AddIns/BackendBindings/Python/PyWalker/MainForm.cs @@ -48,7 +48,7 @@ namespace PyWalker PythonAst ast = parser.ParseFile(false); if (sink.Errors.Count == 0) { ResolveWalker walker = new ResolveWalker(this); - walker.Walk(ast); + ast.Walk(walker); } else { walkerOutputTextBox.Text += "\r\n"; foreach (PythonCompilerError error in sink.Errors) { diff --git a/src/AddIns/BackendBindings/Python/PyWalker/ResolveWalker.cs b/src/AddIns/BackendBindings/Python/PyWalker/ResolveWalker.cs index e127423cf9..1da2736ef9 100644 --- a/src/AddIns/BackendBindings/Python/PyWalker/ResolveWalker.cs +++ b/src/AddIns/BackendBindings/Python/PyWalker/ResolveWalker.cs @@ -31,49 +31,43 @@ namespace PyWalker public override bool Walk(AndExpression node) { writer.WriteLine("And"); - return true; + return base.Walk(node); } public override bool Walk(AssertStatement node) { writer.WriteLine("Assert"); - return true; + return base.Walk(node); } - //public override bool Walk(AugAssignStatement node) - //{ - // writer.WriteLine("AugAssert"); - // return true; - //} - public override bool Walk(Arg node) { writer.WriteLine("Arg: " + node.Name.ToString()); - return true; + return base.Walk(node); } -// public override bool Walk(AssignStatement node) -// { -// writer.WriteLine("Assign"); -// return true; -// } + public override bool Walk(AssignmentStatement node) + { + writer.WriteLine("AssignmentStatement"); + return base.Walk(node); + } public override bool Walk(BackQuoteExpression node) { writer.WriteLine("BackQuote"); - return true; + return base.Walk(node); } public override bool Walk(BinaryExpression node) { writer.WriteLine("Binary"); - return true; + return base.Walk(node); } public override bool Walk(BreakStatement node) { writer.WriteLine("Breaks"); - return true; + return base.Walk(node); } public override bool Walk(ClassDefinition node) @@ -83,121 +77,109 @@ namespace PyWalker } else { writer.WriteLine("Class: " + node.Name.ToString()); } - return true; + return base.Walk(node); } public override bool Walk(ConditionalExpression node) { writer.WriteLine("ConditionalExpression"); - return true; + return base.Walk(node); } public override bool Walk(ConstantExpression node) { writer.WriteLine("ConstantExpression"); - return true; + return base.Walk(node); } public override bool Walk(ContinueStatement node) { writer.WriteLine("Continue"); - return true; + return base.Walk(node); } public override bool Walk(PrintStatement node) { writer.WriteLine("PrintStatement"); - return true; + return base.Walk(node); } public override bool Walk(FunctionDefinition node) { writer.WriteLine("FunctionDefinition"); - return true; + return base.Walk(node); } public override bool Walk(CallExpression node) { writer.WriteLine("Call"); - return true; + return base.Walk(node); } public override bool Walk(DictionaryExpression node) { writer.WriteLine("Dict"); - return true; + return base.Walk(node); } public override bool Walk(DottedName node) { writer.WriteLine("DottedName"); - return true; + return base.Walk(node); } public override bool Walk(ExpressionStatement node) { writer.WriteLine("Expr"); - return true; + return base.Walk(node); } -// public override bool Walk(FieldExpression node) -// { -// writer.WriteLine("Field: " + node.Name.ToString()); -// return true; -// } - public override bool Walk(GlobalStatement node) { writer.WriteLine("Global"); - return true; + return base.Walk(node); } public override bool Walk(NameExpression node) { writer.WriteLine("Name: " + node.Name); - return true; + return base.Walk(node); } public override bool Walk(FromImportStatement node) { writer.WriteLine("FromImport: " + node.Root.MakeString()); - return true; + return base.Walk(node); } public override bool Walk(ImportStatement node) { writer.WriteLine("Import: " + GetImports(node.Names)); - return true; + return base.Walk(node); } public override bool Walk(UnaryExpression node) { writer.WriteLine("Unary"); - return true; + return base.Walk(node); } public override bool Walk(SuiteStatement node) { writer.WriteLine("Suite"); - return true; + return base.Walk(node); } -// public override bool Walk(GlobalSuite node) -// { -// writer.WriteLine("GlobalSuite"); -// return true; -// } - public override bool Walk(ErrorExpression node) { writer.WriteLine("Error"); - return true; + return base.Walk(node); } public override bool Walk(IfStatement node) { writer.WriteLine("If"); - return true; + return base.Walk(node); } string GetImports(IList<DottedName> names) @@ -222,6 +204,5 @@ namespace PyWalker } return s.ToString(); } - } } diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj b/src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj index 8a8c959bbd..fbf8798beb 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj @@ -86,13 +86,15 @@ <Compile Include="Src\PythonConsoleCompletionDataProvider.cs" /> <Compile Include="Src\PythonConsoleHost.cs" /> <Compile Include="Src\PythonConsolePad.cs" /> + <Compile Include="Src\PythonControlFieldExpression.cs" /> <Compile Include="Src\PythonDesignerGenerator.cs" /> <Compile Include="Src\PythonDesignerLoader.cs" /> <Compile Include="Src\PythonDesignerLoaderProvider.cs" /> <Compile Include="Src\PythonExpressionFinder.cs" /> <Compile Include="Src\PythonForm.cs" /> <Compile Include="Src\PythonFormsDesignerDisplayBinding.cs" /> - <Compile Include="Src\PythonFormVisitor.cs" /> + <Compile Include="Src\PythonFormWalker.cs" /> + <Compile Include="Src\PythonFormWalkerException.cs" /> <Compile Include="Src\PythonLanguageBinding.cs" /> <Compile Include="Src\PythonOptionsPanel.cs" /> <Compile Include="Src\PythonOutputStream.cs" /> diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Resources/CompilingOptionsPanel.xfrm b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Resources/CompilingOptionsPanel.xfrm index bfc0a42753..c972ec65db 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Resources/CompilingOptionsPanel.xfrm +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Resources/CompilingOptionsPanel.xfrm @@ -8,17 +8,34 @@ <Location value="3, -2" /> <UseCompatibleTextRendering value="True" /> <Text value="${res:Dialog.ProjectOptions.Build.Output}" /> - <Anchor value="Top, Left, Right" /> <Size value="504, 362" /> + <Anchor value="Top, Left, Right" /> <TabIndex value="2" /> <Controls> + <System.Windows.Forms.ComboBox> + <Name value="targetCpuComboBox" /> + <TabIndex value="14" /> + <Location value="12, 106" /> + <Size value="180, 21" /> + <FormattingEnabled value="True" /> + <DropDownStyle value="DropDownList" /> + </System.Windows.Forms.ComboBox> + <System.Windows.Forms.Label> + <Name value="targetCpuLabel" /> + <Location value="12, 87" /> + <UseCompatibleTextRendering value="True" /> + <Text value="${res:Dialog.ProjectOptions.Build.TargetCPU}" /> + <Size value="180, 16" /> + <TextAlign value="MiddleLeft" /> + <TabIndex value="13" /> + </System.Windows.Forms.Label> <System.Windows.Forms.CheckBox> <Name value="debugInfoCheckBox" /> <CheckAlign value="MiddleRight" /> <Location value="12, 63" /> - <Text value="Debug info:" /> + <Text value="${res:Dialog.ProjectOptions.Build.DebugInfo}" /> <TabIndex value="12" /> - <Size value="147, 21" /> + <Size value="180, 21" /> <UseCompatibleTextRendering value="True" /> </System.Windows.Forms.CheckBox> <System.Windows.Forms.Label> @@ -26,29 +43,29 @@ <Location value="12, 17" /> <UseCompatibleTextRendering value="True" /> <Text value="${res:Dialog.ProjectOptions.Build.OutputPath}" /> - <Anchor value="Top, Left, Right" /> - <TextAlign value="BottomLeft" /> <Size value="492, 16" /> + <TextAlign value="BottomLeft" /> + <Anchor value="Top, Left, Right" /> <TabIndex value="3" /> </System.Windows.Forms.Label> <System.Windows.Forms.TextBox> <Name value="outputPathTextBox" /> <TabIndex value="4" /> - <Size value="448, 20" /> <Location value="12, 37" /> <Anchor value="Top, Left, Right" /> + <Size value="448, 20" /> </System.Windows.Forms.TextBox> <System.Windows.Forms.Button> <Name value="outputPathBrowseButton" /> <Location value="464, 37" /> <UseCompatibleTextRendering value="True" /> <Text value="..." /> - <Anchor value="Top, Right" /> <Size value="40, 21" /> + <Anchor value="Top, Right" /> <TabIndex value="5" /> </System.Windows.Forms.Button> </Controls> </System.Windows.Forms.GroupBox> </Controls> </System.Windows.Forms.UserControl> -</Components> +</Components> \ No newline at end of file diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/CompilingOptionsPanel.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/CompilingOptionsPanel.cs index e5b3739135..3d97e47828 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/CompilingOptionsPanel.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/CompilingOptionsPanel.cs @@ -28,6 +28,9 @@ namespace ICSharpCode.PythonBinding b = BindBoolean("debugInfoCheckBox", "DebugInfo", false); CreateLocationButton(b, "debugInfoCheckBox"); + + b = CreatePlatformTargetComboBox(); + CreateLocationButton(b, "targetCpuComboBox"); AddConfigurationSelector(this); } @@ -82,5 +85,13 @@ namespace ICSharpCode.PythonBinding { helper.AddConfigurationSelector(control); } + + /// <summary> + /// Creates the platform target combo box. + /// </summary> + protected virtual ConfigurationGuiBinding CreatePlatformTargetComboBox() + { + return base.CreatePlatformTarget(); + } } } diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/IComponentCreator.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/IComponentCreator.cs index 88d1b18edd..05455d0c58 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/IComponentCreator.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/IComponentCreator.cs @@ -6,13 +6,19 @@ // </file> using System; +using System.Collections; using System.ComponentModel; namespace ICSharpCode.PythonBinding { /// <summary> - /// Interface that creates an IComponent given a type. Used by the PythonFormVisitor - /// class so it can be wired up to a IDesignerHost + /// Interface that can: + /// + /// 1) Create an IComponent given a type. + /// 2) Create a new object given its type name. + /// + /// Used by the PythonFormVisitor class so it can be wired up to an + /// IDesignerHost and an IDesignerSerializationManager. /// </summary> public interface IComponentCreator { @@ -22,5 +28,23 @@ namespace ICSharpCode.PythonBinding /// <param name="componentClass">The type of the component to be created.</param> /// <param name="name">The component name.</param> IComponent CreateComponent(Type componentClass, string name); + + /// <summary> + /// Adds a component to the component creator. + /// </summary> + void Add(IComponent component, string name); + + /// <summary> + /// Creates a new instance of the object given its type. + /// </summary> + /// <param name="arguments">Arguments passed to the type's constructor.</param> + /// <param name="name">Name of the object.</param> + /// <param name="addToContainer">If set to true then the is added to the design container.</param> + object CreateInstance(Type type, ICollection arguments, string name, bool addToContainer); + + /// <summary> + /// Gets the type given its name. + /// </summary> + Type GetType(string typeName); } } diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonControlFieldExpression.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonControlFieldExpression.cs new file mode 100644 index 0000000000..2a57b161bb --- /dev/null +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonControlFieldExpression.cs @@ -0,0 +1,125 @@ +// <file> +// <copyright see="prj:///doc/copyright.txt"/> +// <license see="prj:///doc/license.txt"/> +// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/> +// <version>$Revision$</version> +// </file> + +using System; +using System.Collections.Generic; +using System.Text; +using IronPython.Compiler.Ast; + +namespace ICSharpCode.PythonBinding +{ + /// <summary> + /// Represents a member field expression in a Control or Form: + /// + /// self._textBox1 + /// self._textBox1.Name + /// </summary> + public class PythonControlFieldExpression + { + string memberName = String.Empty; + string fullMemberName = String.Empty; + + PythonControlFieldExpression(string memberName, string fullMemberName) + { + this.memberName = memberName; + this.fullMemberName = fullMemberName; + } + + public string MemberName { + get { return memberName; } + } + + public string FullMemberName { + get { return fullMemberName; } + } + + /// <summary> + /// Creates a PythonControlField from a member expression: + /// + /// self._textBox1 + /// self._textBox1.Name + /// </summary> + public static PythonControlFieldExpression Create(MemberExpression expression) + { + string memberName = expression.Name.ToString(); + string fullMemberName = PythonControlFieldExpression.GetMemberName(expression); + return new PythonControlFieldExpression(memberName, fullMemberName); + } + + /// <summary> + /// Gets the variable name from an expression of the form: + /// + /// self._textBox1.Name + /// + /// Returns "textBox1" + /// </summary> + public static string GetVariableNameFromSelfReference(string name) + { + int startIndex = name.IndexOf('.'); + if (startIndex > 0) { + name = name.Substring(startIndex + 1); + int endIndex = name.IndexOf('.'); + if (endIndex > 0) { + return GetVariableName(name.Substring(0, endIndex)); + } + return String.Empty; + } + return name; + } + + /// <summary> + /// Gets the variable name of the control being added. + /// </summary> + public static string GetControlNameBeingAdded(CallExpression node) + { + //if (node.Args.Length > 0) { + Arg arg = node.Args[0]; + MemberExpression memberExpression = arg.Expression as MemberExpression; + return GetVariableName(memberExpression.Name.ToString()); + //} + //return null; + } + + /// <summary> + /// Removes the underscore from the variable name. + /// </summary> + public static string GetVariableName(string name) + { + if (!String.IsNullOrEmpty(name)) { + if (name.Length > 1) { + if (name[0] == '_') { + return name.Substring(1); + } + } + } + return name; + } + + /// <summary> + /// Gets the fully qualified name being referenced in the MemberExpression. + /// </summary> + public static string GetMemberName(MemberExpression expression) + { + StringBuilder typeName = new StringBuilder(); + + while (expression != null) { + typeName.Insert(0, expression.Name); + typeName.Insert(0, "."); + + NameExpression nameExpression = expression.Target as NameExpression; + expression = expression.Target as MemberExpression; + if (expression == null) { + if (nameExpression != null) { + typeName.Insert(0, nameExpression.Name); + } + } + } + + return typeName.ToString(); + } + } +} diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonDesignerGenerator.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonDesignerGenerator.cs index d8a4b56e56..4037b2e55b 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonDesignerGenerator.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonDesignerGenerator.cs @@ -9,6 +9,7 @@ using System; using System.CodeDom; using System.CodeDom.Compiler; using System.Collections; +using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Reflection; @@ -17,6 +18,7 @@ using System.Windows.Forms; using ICSharpCode.FormsDesigner; using ICSharpCode.SharpDevelop; +using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor; using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.TextEditor; @@ -39,9 +41,11 @@ namespace ICSharpCode.PythonBinding public class PythonDesignerGenerator : IPythonDesignerGenerator { FormsDesignerViewContent viewContent; + ITextEditorProperties textEditorProperties; - public PythonDesignerGenerator() + public PythonDesignerGenerator(ITextEditorProperties textEditorProperties) { + this.textEditorProperties = textEditorProperties; } /// <summary> @@ -61,9 +65,10 @@ namespace ICSharpCode.PythonBinding this.viewContent = null; } - public OpenedFile DetermineDesignerCodeFile() + public IEnumerable<OpenedFile> GetSourceFiles(out OpenedFile designerCodeFile) { - return this.ViewContent.PrimaryFile; + designerCodeFile = this.ViewContent.PrimaryFile; + return new [] {designerCodeFile}; } public void MergeFormChanges(CodeCompileUnit unit) @@ -76,7 +81,7 @@ namespace ICSharpCode.PythonBinding public void MergeRootComponentChanges(IComponent component) { ParseInformation parseInfo = ParseFile(this.ViewContent.DesignerCodeFile.FileName, this.ViewContent.DesignerCodeFileContent); - Merge(component, ViewContent.DesignerCodeFileDocument, parseInfo.BestCompilationUnit); + Merge(component, ViewContent.DesignerCodeFileDocument, parseInfo.BestCompilationUnit, textEditorProperties); } /// <summary> @@ -85,21 +90,21 @@ namespace ICSharpCode.PythonBinding /// <param name="component">The root component in the designer host.</param> /// <param name="document">The document that the generated code will be merged into.</param> /// <param name="parseInfo">The current compilation unit for the <paramref name="document"/>.</param> - public static void Merge(IComponent component, IDocument document, ICompilationUnit compilationUnit) + public static void Merge(IComponent component, IDocument document, ICompilationUnit compilationUnit, ITextEditorProperties textEditorProperties) { // Get the document's initialize components method. IMethod method = GetInitializeComponents(compilationUnit); // Generate the python source code. - PythonForm pythonForm = new PythonForm("\t"); + PythonForm pythonForm = new PythonForm(NRefactoryToPythonConverter.GetIndentString(textEditorProperties)); int indent = method.Region.BeginColumn; string methodBody = pythonForm.GenerateInitializeComponentMethodBody(component as Form, indent); - Console.WriteLine("GeneratedCode: " + methodBody); // Merge the code. DomRegion methodRegion = GetBodyRegionInDocument(method); - int startOffset = document.PositionToOffset(new TextLocation(methodRegion.BeginColumn - 1, methodRegion.BeginLine - 1)); - int endOffset = document.PositionToOffset(new TextLocation(methodRegion.EndColumn - 1, methodRegion.EndLine - 1)); + int startOffset = GetStartOffset(document, methodRegion); + int endOffset = GetEndOffset(document, methodRegion); + document.Replace(startOffset, endOffset - startOffset, methodBody); } @@ -232,5 +237,26 @@ namespace ICSharpCode.PythonBinding { return unit.Classes[0]; } + + /// <summary> + /// Gets the start offset of the region. + /// </summary> + static int GetStartOffset(IDocument document, DomRegion region) + { + return document.PositionToOffset(new TextLocation(region.BeginColumn - 1, region.BeginLine - 1)); + } + + /// <summary> + /// Gets the end offset of the region. + /// </summary> + static int GetEndOffset(IDocument document, DomRegion region) + { + TextLocation endLocation = new TextLocation(region.EndColumn - 1, region.EndLine - 1); + if (endLocation.Line >= document.TotalNumberOfLines) { + // At end of document. + return document.TextLength; + } + return document.PositionToOffset(endLocation); + } } } diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonDesignerLoader.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonDesignerLoader.cs index 7e22ef860e..b6950e7ade 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonDesignerLoader.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonDesignerLoader.cs @@ -7,6 +7,7 @@ using System; using System.CodeDom; +using System.Collections; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Security.Permissions; @@ -26,7 +27,8 @@ namespace ICSharpCode.PythonBinding public class PythonDesignerLoader : BasicDesignerLoader, IComponentCreator { IPythonDesignerGenerator generator; - + IDesignerSerializationManager serializationManager; + public PythonDesignerLoader(IPythonDesignerGenerator generator) { if (generator == null) { @@ -52,6 +54,30 @@ namespace ICSharpCode.PythonBinding return base.LoaderHost.CreateComponent(componentClass, name); } + /// <summary> + /// Adds a component. + /// </summary> + public void Add(IComponent component, string name) + { + base.LoaderHost.Container.Add(component, name); + } + + /// <summary> + /// Creates a new instance of the specified type. + /// </summary> + public object CreateInstance(Type type, ICollection arguments, string name, bool addToContainer) + { + return serializationManager.CreateInstance(type, arguments, name, addToContainer); + } + + /// <summary> + /// Gets the type given its name. + /// </summary> + public Type GetType(string typeName) + { + return serializationManager.GetType(typeName); + } + /// <summary> /// Passes the designer host's root component to the generator so it can update the /// source code with changes made at design time. @@ -64,8 +90,9 @@ namespace ICSharpCode.PythonBinding protected override void PerformLoad(IDesignerSerializationManager serializationManager) { // Create designer root object. - PythonFormVisitor visitor = new PythonFormVisitor(); - visitor.CreateForm("abc", this); + this.serializationManager = serializationManager; + PythonFormWalker visitor = new PythonFormWalker(this); + visitor.CreateForm(generator.ViewContent.DesignerCodeFileContent); } } } diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonForm.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonForm.cs index 38e493f670..e1fd485171 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonForm.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonForm.cs @@ -65,6 +65,7 @@ namespace ICSharpCode.PythonBinding AppendControl(form); AppendIndentedLine("self.ResumeLayout(False)"); + AppendIndentedLine("self.PerformLayout()"); } void AppendControl(Control control) diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFormVisitor.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFormVisitor.cs deleted file mode 100644 index c13946b355..0000000000 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFormVisitor.cs +++ /dev/null @@ -1,33 +0,0 @@ -// <file> -// <copyright see="prj:///doc/copyright.txt"/> -// <license see="prj:///doc/license.txt"/> -// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/> -// <version>$Revision$</version> -// </file> - -using System; -using System.Drawing; -using System.Windows.Forms; - -namespace ICSharpCode.PythonBinding -{ - /// <summary> - /// Description of PythonFormVisitor. - /// </summary> - public class PythonFormVisitor - { - public PythonFormVisitor() - { - } - - /// <summary> - /// Creates a form from python code. - /// </summary> - public Form CreateForm(string pythonCode, IComponentCreator componentCreator) - { - Form form = (Form)componentCreator.CreateComponent(typeof(Form), "MainForm"); - form.Name = "MainForm"; - return form; - } - } -} diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFormWalker.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFormWalker.cs new file mode 100644 index 0000000000..aa520dfc67 --- /dev/null +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFormWalker.cs @@ -0,0 +1,196 @@ +// <file> +// <copyright see="prj:///doc/copyright.txt"/> +// <license see="prj:///doc/license.txt"/> +// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/> +// <version>$Revision$</version> +// </file> + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Reflection; +using System.Text; +using System.Windows.Forms; + +using IronPython.Compiler.Ast; + +namespace ICSharpCode.PythonBinding +{ + /// <summary> + /// Visits the code's Python AST and creates a Windows Form. + /// </summary> + public class PythonFormWalker : PythonWalker + { + Form form; + PythonControlFieldExpression fieldExpression; + IComponentCreator componentCreator; + bool walkingAssignment; + Dictionary<string, object> createdObjects = new Dictionary<string, object>(); + + public PythonFormWalker(IComponentCreator componentCreator) + { + this.componentCreator = componentCreator; + } + + /// <summary> + /// Creates a form from python code. + /// </summary> + public Form CreateForm(string pythonCode) + { + PythonParser parser = new PythonParser(); + PythonAst ast = parser.CreateAst(@"Form.py", pythonCode); + ast.Walk(this); + + // Did we find the InitializeComponent method? + if (form == null) { + throw new PythonFormWalkerException("Unable to find InitializeComponents method."); + } + + return form; + } + + public override bool Walk(ClassDefinition node) + { + if (node.Body != null) { + node.Body.Walk(this); + } + return false; + } + + public override bool Walk(FunctionDefinition node) + { + if (IsInitializeComponentMethod(node)) { + form = (Form)componentCreator.CreateComponent(typeof(Form), "MainForm"); + node.Body.Walk(this); + } + return false; + } + + public override bool Walk(AssignmentStatement node) + { + if (node.Left.Count > 0) { + MemberExpression memberExpression = node.Left[0] as MemberExpression; + if (memberExpression != null) { + fieldExpression = PythonControlFieldExpression.Create(memberExpression); + + walkingAssignment = true; + node.Right.Walk(this); + walkingAssignment = false; + } + } + return false; + } + + public override bool Walk(ConstantExpression node) + { + Control control = GetCurrentControl(); + SetPropertyValue(control, fieldExpression.MemberName, node.Value); + return false; + } + + Control GetCurrentControl() + { + string variableName = PythonControlFieldExpression.GetVariableNameFromSelfReference(fieldExpression.FullMemberName); + if (variableName.Length > 0) { + return GetControl(variableName); + } + return form; + } + + public override bool Walk(CallExpression node) + { + MemberExpression memberExpression = node.Target as MemberExpression; + if (memberExpression != null) { + string name = PythonControlFieldExpression.GetMemberName(memberExpression); + if (walkingAssignment) { + Type type = GetType(name); + List<object> args = GetArguments(node); + object instance = componentCreator.CreateInstance(type, args, fieldExpression.MemberName, false); + if (!SetPropertyValue(form, fieldExpression.MemberName, instance)) { + AddComponent(fieldExpression.MemberName, instance); + } + } else if (name == "self.Controls.Add") { + string controlName = PythonControlFieldExpression.GetControlNameBeingAdded(node); + form.Controls.Add(GetControl(controlName)); + } + } + return false; + } + + /// <summary> + /// Gets the arguments passed to the call expression. + /// </summary> + static List<object> GetArguments(CallExpression expression) + { + List<object> args = new List<object>(); + foreach (Arg a in expression.Args) { + ConstantExpression constantExpression = a.Expression as ConstantExpression; + if (constantExpression != null) { + args.Add(constantExpression.Value); + } + } + return args; + } + + static bool IsInitializeComponentMethod(FunctionDefinition node) + { + string name = node.Name.ToString().ToLowerInvariant(); + return name == "initializecomponent" || name == "initializecomponents"; + } + + /// <summary> + /// Sets the value of a form's property. + /// </summary> + bool SetPropertyValue(Control control, string name, object @value) + { + PropertyInfo propertyInfo = control.GetType().GetProperty(name); + if (propertyInfo != null) { + propertyInfo.SetValue(control, @value, null); + return true; + } + return false; + } + + Type GetType(string typeName) + { + Type type = componentCreator.GetType(typeName); + if (type == null) { + throw new PythonFormWalkerException(String.Format("Could not find type '{0}'.", typeName)); + } + return type; + } + + /// <summary> + /// Looks for the control with the specified name in the objects that have been + /// created whilst processing the InitializeComponent method. + /// </summary> + Control GetControl(string name) + { + object o = null; + if (createdObjects.TryGetValue(name, out o)) { + return o as Control; + } + return null; + } + + /// <summary> + /// Adds a component to the list of created objects. + /// </summary> + void AddComponent(string name, object component) + { + string variableName = PythonControlFieldExpression.GetVariableName(name); + componentCreator.Add(component as IComponent, variableName); + createdObjects.Add(variableName, component); + } + + static string GetFirstArgumentAsString(CallExpression node) + { + List<object> args = GetArguments(node); + if (args.Count > 0) { + return args[0] as String; + } + return null; + } + } +} diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFormWalkerException.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFormWalkerException.cs new file mode 100644 index 0000000000..cbeee4fa47 --- /dev/null +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFormWalkerException.cs @@ -0,0 +1,21 @@ +// <file> +// <copyright see="prj:///doc/copyright.txt"/> +// <license see="prj:///doc/license.txt"/> +// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/> +// <version>$Revision$</version> +// </file> + +using System; + +namespace ICSharpCode.PythonBinding +{ + /// <summary> + /// Exception thrown by the PythonFormWalker class. + /// </summary> + public class PythonFormWalkerException : Exception + { + public PythonFormWalkerException(string message) : base(message) + { + } + } +} diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFormsDesignerDisplayBinding.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFormsDesignerDisplayBinding.cs index 0c8edb5f75..f2e1c9ef8e 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFormsDesignerDisplayBinding.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFormsDesignerDisplayBinding.cs @@ -7,12 +7,14 @@ using System; using System.IO; + using ICSharpCode.FormsDesigner; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor; using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.TextEditor; +using ICSharpCode.TextEditor.Document; namespace ICSharpCode.PythonBinding { @@ -44,8 +46,13 @@ namespace ICSharpCode.PythonBinding } return false; } - + public IViewContent[] CreateSecondaryViewContent(IViewContent viewContent) + { + return CreateSecondaryViewContent(viewContent, SharpDevelopTextEditorProperties.Instance); + } + + public IViewContent[] CreateSecondaryViewContent(IViewContent viewContent, ITextEditorProperties textEditorProperties) { foreach (IViewContent existingView in viewContent.SecondaryViewContents) { if (existingView.GetType() == typeof(FormsDesignerViewContent)) { @@ -54,7 +61,7 @@ namespace ICSharpCode.PythonBinding } IDesignerLoaderProvider loader = new PythonDesignerLoaderProvider(); - IDesignerGenerator generator = new PythonDesignerGenerator(); + IDesignerGenerator generator = new PythonDesignerGenerator(textEditorProperties); return new IViewContent[] { new FormsDesignerViewContent(viewContent, loader, generator) }; } diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonParser.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonParser.cs index 34e770d0da..4b2b4015ca 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonParser.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonParser.cs @@ -75,30 +75,35 @@ namespace ICSharpCode.PythonBinding return false; } + /// <summary> + /// Parses a python file and creates a PythonAst. + /// </summary> + public PythonAst CreateAst(string fileName, string fileContent) + { + if (scriptEngine == null) { + scriptEngine = IronPython.Hosting.Python.CreateEngine(); + } + + PythonCompilerSink sink = new PythonCompilerSink(); + SourceUnit source = DefaultContext.DefaultPythonContext.CreateFileUnit(fileName, fileContent); + CompilerContext context = new CompilerContext(source, new PythonCompilerOptions(), sink); + using (Parser parser = Parser.CreateParser(context, new PythonOptions())) { + return parser.ParseFile(false); + } + } + /// <summary> /// Parses the python code and returns an ICompilationUnit. /// </summary> public ICompilationUnit Parse(IProjectContent projectContent, string fileName, string fileContent) { if (fileContent != null) { - // try { - if (scriptEngine == null) { - scriptEngine = IronPython.Hosting.Python.CreateEngine(); - } - - PythonCompilerSink sink = new PythonCompilerSink(); - SourceUnit source = DefaultContext.DefaultPythonContext.CreateFileUnit(fileName, fileContent); - CompilerContext context = new CompilerContext(source, new PythonCompilerOptions(), sink); - Parser parser = Parser.CreateParser(context, new PythonOptions()); - PythonAst ast = parser.ParseFile(false); - + PythonAst ast = CreateAst(fileName, fileContent); PythonAstWalker walker = new PythonAstWalker(projectContent, fileName); walker.Walk(ast); return walker.CompilationUnit; - // } catch (PythonSyntaxErrorException) { - // Ignore parsing errors - // } } + DefaultCompilationUnit compilationUnit = new DefaultCompilationUnit(projectContent); compilationUnit.FileName = fileName; return compilationUnit; diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonResolver.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonResolver.cs index 978befe086..fbba20e7cf 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonResolver.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonResolver.cs @@ -281,17 +281,17 @@ namespace ICSharpCode.PythonBinding /// </summary> LocalResolveResult GetLocalVariable(string expression, string fileName, string fileContent) { - PythonVariableResolver resolver = new PythonVariableResolver(); - string typeName = resolver.Resolve(expression, fileName, fileContent); - if (typeName != null) { - IClass resolvedClass = GetClass(typeName); - if (resolvedClass != null) { - DefaultClass dummyClass = new DefaultClass(DefaultCompilationUnit.DummyCompilationUnit, "Global"); - DefaultMethod dummyMethod = new DefaultMethod(dummyClass, String.Empty); - DefaultField.LocalVariableField field = new DefaultField.LocalVariableField(resolvedClass.DefaultReturnType, expression, DomRegion.Empty, dummyClass); - return new LocalResolveResult(dummyMethod, field); - } - } +// PythonVariableResolver resolver = new PythonVariableResolver(); +// string typeName = resolver.Resolve(expression, fileName, fileContent); +// if (typeName != null) { +// IClass resolvedClass = GetClass(typeName); +// if (resolvedClass != null) { +// DefaultClass dummyClass = new DefaultClass(DefaultCompilationUnit.DummyCompilationUnit, "Global"); +// DefaultMethod dummyMethod = new DefaultMethod(dummyClass, String.Empty); +// DefaultField.LocalVariableField field = new DefaultField.LocalVariableField(resolvedClass.DefaultReturnType, expression, DomRegion.Empty, dummyClass); +// return new LocalResolveResult(dummyMethod, field); +// } +// } return null; } } diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/AddInFileTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/AddInFileTestFixture.cs index 0f13dbc4cf..bd972945c9 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/AddInFileTestFixture.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/AddInFileTestFixture.cs @@ -45,6 +45,8 @@ namespace PythonBinding.Tests Runtime formsDesignerRuntime; Codon displayBindingCodon; Codon convertCodeCodon; + Codon pythonFileIconCodon; + Codon pythonProjectIconCodon; [TestFixtureSetUp] public void SetupFixture() @@ -72,6 +74,8 @@ namespace PythonBinding.Tests compilingOptionsCodon = GetCodon("/SharpDevelop/BackendBindings/ProjectOptions/Python", "CompilingOptions"); debugOptionsCodon = GetCodon("/SharpDevelop/BackendBindings/ProjectOptions/Python", "DebugOptions"); convertCodeCodon = GetCodon("/SharpDevelop/Workbench/MainMenu/Tools/ConvertCode", "ConvertToPython"); + pythonFileIconCodon = GetCodon("/Workspace/Icons", "PythonFileIcon"); + pythonProjectIconCodon = GetCodon("/Workspace/Icons", "PythonProjectIcon"); // Get the PythonBinding runtime. foreach (Runtime runtime in addin.Runtimes) { @@ -610,7 +614,43 @@ namespace PythonBinding.Tests Assert.AreEqual(".cs", csharpCondition["activeextension"]); Assert.AreEqual(".vb", vbnetCondition["activeextension"]); } + + [Test] + public void PythonFileIconCodonExists() + { + Assert.IsNotNull(pythonFileIconCodon); + } + + [Test] + public void PythonFileIconCodonExtensions() + { + Assert.AreEqual(".py", pythonFileIconCodon["extensions"]); + } + + [Test] + public void PythonFileIconCodonResource() + { + Assert.AreEqual("Python.ProjectBrowser.File", pythonFileIconCodon["resource"]); + } + + [Test] + public void PythonProjectIconCodonExists() + { + Assert.IsNotNull(pythonProjectIconCodon); + } + [Test] + public void PythonProjectIconCodonLanguage() + { + Assert.AreEqual("Python", pythonProjectIconCodon["language"]); + } + + [Test] + public void PythonProjectIconCodonResource() + { + Assert.AreEqual("Python.ProjectBrowser.Project", pythonProjectIconCodon["resource"]); + } + /// <summary> /// Gets the codon with the specified extension path and name. /// </summary> diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/CompilingOptionsPanelTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/CompilingOptionsPanelTestFixture.cs index 5bd7d382c1..1d10376d14 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/CompilingOptionsPanelTestFixture.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/CompilingOptionsPanelTestFixture.cs @@ -117,6 +117,18 @@ namespace PythonBinding.Tests Assert.IsTrue(compilingOptionsPanel.ConfigurationSelectorAddedToControl); } + [Test] + public void TargetCpuComboxBoxAdded() + { + Assert.IsTrue(compilingOptionsPanel.IsTargetCpuComboBoxCreated); + } + + [Test] + public void TargetCpuComboxBoxLocationButtonCreated() + { + Assert.IsTrue(compilingOptionsPanel.IsLocationButtonCreated("targetCpuComboBox")); + } + BrowseFolderButtonInfo GetOutputPathBrowseFolderInfo() { return compilingOptionsPanel.GetBrowseFolderButtonInfo("outputPathBrowseButton"); diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/GenerateSimpleFormTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/GenerateSimpleFormTestFixture.cs index b544ea6a8b..4ff0d01854 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/GenerateSimpleFormTestFixture.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/GenerateSimpleFormTestFixture.cs @@ -42,7 +42,8 @@ namespace PythonBinding.Tests.Designer " # \r\n" + " self.ClientSize = System.Drawing.Size(284, 264)\r\n" + " self.Name = \"MainForm\"\r\n" + - " self.ResumeLayout(False)\r\n"; + " self.ResumeLayout(False)\r\n" + + " self.PerformLayout()\r\n"; Assert.AreEqual(expectedCode, generatedPythonCode); } diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/GeneratorMergeFindsInitializeComponentsTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/GeneratorMergeFindsInitializeComponentsTestFixture.cs index af626e9a91..b671843905 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/GeneratorMergeFindsInitializeComponentsTestFixture.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/GeneratorMergeFindsInitializeComponentsTestFixture.cs @@ -35,6 +35,7 @@ namespace PythonBinding.Tests.Designer [TestFixtureSetUp] public void SetUpFixture() { + MockTextEditorProperties textEditorProperties = new MockTextEditorProperties(); generator = new DerivedPythonDesignerGenerator(); mockViewContent = new MockTextEditorViewContent(); viewContent = new FormsDesignerViewContent(mockViewContent, new MockOpenedFile("Test.py")); @@ -95,7 +96,9 @@ namespace PythonBinding.Tests.Designer "\t\t# \r\n" + "\t\tself.ClientSize = System.Drawing.Size(499, 309)\r\n" + "\t\tself.Name = \"MainForm\"\r\n" + - "\t\tself.ResumeLayout(False)\r\n"; + "\t\tself.ResumeLayout(False)\r\n" + + "\t\tself.PerformLayout()\r\n"; + Assert.AreEqual(expectedText, viewContent.DesignerCodeFileContent); } @@ -123,7 +126,8 @@ namespace PythonBinding.Tests.Designer "\t\tself.SuspendLayout()\r\n" + "\t\tself.ClientSize = System.Drawing.Size(499, 309)\r\n" + "\t\tself.Name = 'MainForm'\r\n" + - "\t\tself.ResumeLayout(False)\r\n"; + "\t\tself.ResumeLayout(False)\r\n" + + "\t\tself.PerformLayout()\r\n"; } } } diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/LoadFormTestFixtureBase.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/LoadFormTestFixtureBase.cs index a5719073b5..486ae26a02 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/LoadFormTestFixtureBase.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/LoadFormTestFixtureBase.cs @@ -6,9 +6,13 @@ // </file> using System; +using System.Collections; using System.Collections.Generic; using System.ComponentModel; +using System.Drawing; +using System.Reflection; using System.Windows.Forms; + using ICSharpCode.PythonBinding; using PythonBinding.Tests.Utils; @@ -20,6 +24,9 @@ namespace PythonBinding.Tests.Designer public class LoadFormTestFixtureBase : IComponentCreator { List <CreatedComponent> createdComponents = new List<CreatedComponent>(); + List <CreatedInstance> createdInstances = new List<CreatedInstance>(); + List <AddedComponent> addedComponents = new List<AddedComponent>(); + List<string> typeNames = new List<string>(); public LoadFormTestFixtureBase() { @@ -31,12 +38,65 @@ namespace PythonBinding.Tests.Designer createdComponents.Add(c); object instance = componentClass.Assembly.CreateInstance(componentClass.FullName); - Control control = instance as Control; return (IComponent)instance; } + public void Add(IComponent component, string name) + { + AddedComponent addedComponent = new AddedComponent(component, name); + addedComponents.Add(addedComponent); + } + + public object CreateInstance(Type type, ICollection arguments, string name, bool addToContainer) + { + CreatedInstance createdInstance = new CreatedInstance(type, arguments, name, addToContainer); + createdInstances.Add(createdInstance); + + object[] argumentsArray = new object[arguments.Count]; + arguments.CopyTo(argumentsArray, 0); + + object o = type.Assembly.CreateInstance(type.FullName, true, BindingFlags.CreateInstance, null, argumentsArray, null, new object[0]); + createdInstance.Object = o; + return o; + } + + public Type GetType(string typeName) + { + typeNames.Add(typeName); + + // Lookup type in System.Windows.Forms assembly. + Type type = typeof(Form).Assembly.GetType(typeName); + if (type == null) { + // Lookup type System.Drawing assembly. + type = typeof(Size).Assembly.GetType(typeName); + } + return type; + } + protected List<CreatedComponent> CreatedComponents { get { return createdComponents; } } + + protected List<AddedComponent> AddedComponents { + get { return addedComponents; } + } + + protected List<CreatedInstance> CreatedInstances { + get { return createdInstances; } + } + + protected List<string> TypeNames { + get { return typeNames; } + } + + protected CreatedInstance GetCreatedInstance(Type type) + { + foreach (CreatedInstance instance in createdInstances) { + if (instance.InstanceType == type) { + return instance; + } + } + return null; + } } } diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/LoadSimpleFormTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/LoadSimpleFormTestFixture.cs index efb0b867f4..f17222e3f7 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/LoadSimpleFormTestFixture.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/LoadSimpleFormTestFixture.cs @@ -6,9 +6,11 @@ // </file> using System; +using System.Collections.Generic; using System.Drawing; using System.IO; using System.Windows.Forms; + using ICSharpCode.PythonBinding; using NUnit.Framework; using PythonBinding.Tests.Utils; @@ -18,26 +20,35 @@ namespace PythonBinding.Tests.Designer [TestFixture] public class LoadSimpleFormTestFixture : LoadFormTestFixtureBase { - string pythonCode = "def InitializeComponent(self):\r\n" + - " self.SuspendLayout()\r\n" + - " # \r\n" + - " # MainForm\r\n" + - " # \r\n" + - " self.ClientSize = System.Drawing.Size(284, 264)\r\n" + - " self.Name = \"MainForm\"\r\n" + - " self.ResumeLayout(False)\r\n"; + string pythonCode = "class MainForm(System.Windows.Forms.Form):\r\n" + + " def InitializeComponent(self):\r\n" + + " self.SuspendLayout()\r\n" + + " # \r\n" + + " # MainForm\r\n" + + " # \r\n" + + " self.ClientSize = System.Drawing.Size(300, 400)\r\n" + + " self.Name = \"MainForm\"\r\n" + + " self.ResumeLayout(False)\r\n"; Form form; CreatedComponent formComponent; + string typeName; + CreatedInstance instance; [TestFixtureSetUp] public void SetUpFixture() { - PythonFormVisitor visitor = new PythonFormVisitor(); - form = visitor.CreateForm(pythonCode, this); + PythonFormWalker walker = new PythonFormWalker(this); + form = walker.CreateForm(pythonCode); if (CreatedComponents.Count > 0) { formComponent = CreatedComponents[0]; } + if (TypeNames.Count > 0) { + typeName = TypeNames[0]; + } + if (CreatedInstances.Count > 0) { + instance = CreatedInstances[0]; + } } [TestFixtureTearDown] @@ -74,6 +85,42 @@ namespace PythonBinding.Tests.Designer public void ComponentType() { Assert.AreEqual("System.Windows.Forms.Form", formComponent.TypeName); + } + + [Test] + public void FormClientSize() + { + Size size = new Size(300, 400); + Assert.AreEqual(size, form.ClientSize); + } + + /// <summary> + /// The System.Drawing.Size type name should have been looked up by the PythonFormWalker when + /// parsing the InitializeComponent method. + /// </summary> + [Test] + public void TypeNameLookedUp() + { + Assert.AreEqual("System.Drawing.Size", typeName); + } + + [Test] + public void OneObjectCreated() + { + Assert.AreEqual(1, CreatedInstances.Count); + } + + [Test] + public void InstanceType() + { + List<object> args = new List<object>(); + int width = 300; + int height = 400; + args.Add(width); + args.Add(height); + + CreatedInstance expectedInstance = new CreatedInstance(typeof(Size), args, "ClientSize", false); + Assert.AreEqual(expectedInstance, instance); } } } diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/LoadTextBoxTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/LoadTextBoxTestFixture.cs new file mode 100644 index 0000000000..ca960c39b7 --- /dev/null +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/LoadTextBoxTestFixture.cs @@ -0,0 +1,92 @@ +// <file> +// <copyright see="prj:///doc/copyright.txt"/> +// <license see="prj:///doc/license.txt"/> +// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/> +// <version>$Revision$</version> +// </file> + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.IO; +using System.Windows.Forms; + +using ICSharpCode.PythonBinding; +using NUnit.Framework; +using PythonBinding.Tests.Utils; + +namespace PythonBinding.Tests.Designer +{ + [TestFixture] + public class LoadTextBoxTestFixture : LoadFormTestFixtureBase + { + string pythonCode = "class MainForm(System.Windows.Forms.Form):\r\n" + + " def InitializeComponent(self):\r\n" + + " self._textBox1 = System.Windows.Forms.TextBox()\r\n" + + " self.SuspendLayout()\r\n" + + " # \r\n" + + " # textBox1\r\n" + + " # \r\n" + + " self._textBox1.Name = \"textBoxName\"\r\n" + + " # \r\n" + + " # form1\r\n" + + " # \r\n" + + " self.Name = \"form1\"\r\n" + + " self.Controls.Add(self._textBox1)\r\n" + + " self.ResumeLayout(False)\r\n"; + Form form; + TextBox textBox; + + [TestFixtureSetUp] + public void SetUpFixture() + { + PythonFormWalker walker = new PythonFormWalker(this); + form = walker.CreateForm(pythonCode); + if (form.Controls.Count > 0) { + textBox = form.Controls[0] as TextBox; + } + } + + [TestFixtureTearDown] + public void TearDownFixture() + { + form.Dispose(); + } + + [Test] + public void TextBoxInstanceCreated() + { + CreatedInstance instance = new CreatedInstance(typeof(TextBox), new List<object>(), "_textBox1", false); + Assert.Contains(instance, CreatedInstances); + } + + [Test] + public void AddedComponentsContainsTextBox() + { + CreatedInstance instance = GetCreatedInstance(typeof(TextBox)); + + AddedComponent component = new AddedComponent(instance.Object as IComponent, "textBox1"); + Assert.Contains(component, AddedComponents); + } + + [Test] + public void TextBoxAddedToForm() + { + Assert.IsNotNull(textBox); + } + + [Test] + public void TextBoxObjectMatchesObjectAddedToComponentCreator() + { + CreatedInstance instance = GetCreatedInstance(typeof(TextBox)); + Assert.AreSame(textBox, instance.Object as TextBox); + } + + [Test] + public void TextBoxName() + { + Assert.AreEqual("textBoxName", textBox.Name); + } + } +} diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/MergeFormTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/MergeFormTestFixture.cs index 291576a806..01e671a57c 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/MergeFormTestFixture.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/MergeFormTestFixture.cs @@ -7,7 +7,10 @@ using System; using System.CodeDom; +using System.Drawing; using System.IO; +using System.Windows.Forms; + using ICSharpCode.PythonBinding; using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.TextEditor; @@ -22,7 +25,6 @@ namespace PythonBinding.Tests.Designer /// can merge the changes into the text editor. /// </summary> [TestFixture] - [Ignore("Not ported")] public class MergeFormTestFixture { IDocument document; @@ -30,25 +32,26 @@ namespace PythonBinding.Tests.Designer [TestFixtureSetUp] public void SetUpFixture() { -// using (TextEditorControl textEditor = new TextEditorControl()) { -// document = textEditor.Document; -// textEditor.Text = GetTextEditorCode(); -// -// PythonParser parser = new PythonParser(); -// ICompilationUnit textEditorCompileUnit = parser.Parse(new DefaultProjectContent(), @"test.py", document.TextContent); -// -// PythonProvider provider = new PythonProvider(); -// CodeCompileUnit unit = provider.Parse(new StringReader(GetGeneratedCode())); -// GeneratedInitializeComponentMethod initComponentMethod = GeneratedInitializeComponentMethod.GetGeneratedInitializeComponentMethod(unit); -// initComponentMethod.Merge(document, textEditorCompileUnit); -// } + using (TextEditorControl textEditor = new TextEditorControl()) { + document = textEditor.Document; + textEditor.Text = GetTextEditorCode(); + + PythonParser parser = new PythonParser(); + ICompilationUnit compilationUnit = parser.Parse(new DefaultProjectContent(), @"test.py", document.TextContent); + + using (Form form = new Form()) { + form.Name = "MainForm"; + form.ClientSize = new Size(499, 309); + + PythonDesignerGenerator.Merge(form, document, compilationUnit, new MockTextEditorProperties()); + } + } } [Test] public void MergedDocumentText() { string expectedText = GetTextEditorCode().Replace(GetTextEditorInitializeComponentMethod(), GetGeneratedInitializeComponentMethod()); - Assert.AreEqual(expectedText, document.TextContent); } @@ -67,14 +70,13 @@ namespace PythonBinding.Tests.Designer { return "\tdef InitializeComponent(self):\r\n" + "\t\tself.SuspendLayout()\r\n" + - "\t\t#\r\n" + + "\t\t# \r\n" + "\t\t# MainForm\r\n" + - "\t\t#\r\n" + - "\t\tself.AutoScaleDimensions = System.Drawing.SizeF(6, 13)\r\n" + - "\t\tself.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font\r\n" + + "\t\t# \r\n" + "\t\tself.ClientSize = System.Drawing.Size(499, 309)\r\n" + - "\t\tself.Name = 'MainForm'\r\n" + - "\t\tself.ResumeLayout(False)\r\n"; + "\t\tself.Name = \"MainForm\"\r\n" + + "\t\tself.ResumeLayout(False)\r\n" + + "\t\tself.PerformLayout()\r\n"; } string GetTextEditorCode() diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/MissingInitializeComponentMethodTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/MissingInitializeComponentMethodTestFixture.cs new file mode 100644 index 0000000000..9b53443c29 --- /dev/null +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/MissingInitializeComponentMethodTestFixture.cs @@ -0,0 +1,70 @@ +// <file> +// <copyright see="prj:///doc/copyright.txt"/> +// <license see="prj:///doc/license.txt"/> +// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/> +// <version>$Revision$</version> +// </file> + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Windows.Forms; + +using ICSharpCode.PythonBinding; +using IronPython.Compiler.Ast; +using Microsoft.Scripting; +using NUnit.Framework; +using PythonBinding.Tests.Utils; + +namespace PythonBinding.Tests.Designer +{ + /// <summary> + /// Tests that the PythonFormVisitor throws an exception if no InitializeComponent or + /// InitializeComponent method can be found. + /// </summary> + [TestFixture] + public class MissingInitializeComponentMethodTestFixture : LoadFormTestFixtureBase + { + string pythonCode = "from System.Windows.Forms import Form\r\n" + + "\r\n" + + "class MainForm(System.Windows.Forms.Form):\r\n" + + " def __init__(self):\r\n" + + " self.MissingMethod()\r\n" + + "\r\n" + + " def MissingMethod(self):\r\n" + + " pass\r\n"; + [Test] + [ExpectedException(typeof(PythonFormWalkerException))] + public void PythonFormWalkerExceptionThrown() + { + PythonFormWalker walker = new PythonFormWalker(this); + walker.CreateForm(pythonCode); + Assert.Fail("Exception should have been thrown before this."); + } + + /// <summary> + /// Check that the PythonFormWalker does not try to walk the class body if it is null. + /// </summary> + [Test] + public void ClassWithNoBody() + { + ClassDefinition classDef = new ClassDefinition(new SymbolId(10), null, null); + PythonFormWalker walker = new PythonFormWalker(this); + walker.Walk(classDef); + } + + /// <summary> + /// Make sure we do not get an ArgumentOutOfRangeException when walking the + /// AssignmentStatement. + /// </summary> + [Test] + public void NoLeftHandSideExpressionsInAssignment() + { + List<Expression> lhs = new List<Expression>(); + AssignmentStatement assign = new AssignmentStatement(lhs.ToArray(), null); + PythonFormWalker walker = new PythonFormWalker(this); + walker.Walk(assign); + } + } +} diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/NoNewLineAfterInitializeComponentTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/NoNewLineAfterInitializeComponentTestFixture.cs new file mode 100644 index 0000000000..06b3b198e8 --- /dev/null +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/NoNewLineAfterInitializeComponentTestFixture.cs @@ -0,0 +1,87 @@ +// <file> +// <copyright see="prj:///doc/copyright.txt"/> +// <license see="prj:///doc/license.txt"/> +// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/> +// <version>$Revision$</version> +// </file> + +using System; +using System.CodeDom; +using System.Drawing; +using System.IO; +using System.Windows.Forms; + +using ICSharpCode.PythonBinding; +using ICSharpCode.SharpDevelop.Dom; +using ICSharpCode.TextEditor; +using ICSharpCode.TextEditor.Document; +using NUnit.Framework; +using PythonBinding.Tests.Utils; + +namespace PythonBinding.Tests.Designer +{ + /// <summary> + /// Tests the code can be generated if there is no new line after the InitializeComponent method. + /// </summary> + [TestFixture] + public class NoNewLineAfterInitializeComponentMethodTestFixture + { + IDocument document; + + [TestFixtureSetUp] + public void SetUpFixture() + { + using (TextEditorControl textEditor = new TextEditorControl()) { + document = textEditor.Document; + textEditor.Text = GetTextEditorCode(); + + PythonParser parser = new PythonParser(); + ICompilationUnit compilationUnit = parser.Parse(new DefaultProjectContent(), @"test.py", document.TextContent); + + using (Form form = new Form()) { + form.Name = "MainForm"; + form.ClientSize = new Size(499, 309); + + PythonDesignerGenerator.Merge(form, document, compilationUnit, new MockTextEditorProperties()); + } + } + } + + [Test] + public void GeneratedCode() + { + string expectedCode = "from System.Windows.Forms import Form\r\n" + + "\r\n" + + "class MainForm(Form):\r\n" + + "\tdef __init__(self):\r\n" + + "\t\tself.InitializeComponent()\r\n" + + "\t\r\n" + + "\tdef InitializeComponent(self):\r\n" + + "\t\tself.SuspendLayout()\r\n" + + "\t\t# \r\n" + + "\t\t# MainForm\r\n" + + "\t\t# \r\n" + + "\t\tself.ClientSize = System.Drawing.Size(499, 309)\r\n" + + "\t\tself.Name = \"MainForm\"\r\n" + + "\t\tself.ResumeLayout(False)\r\n" + + "\t\tself.PerformLayout()\r\n"; + + Assert.AreEqual(expectedCode, document.TextContent); + } + + /// <summary> + /// No new line after the pass statement for InitializeComponent method. + /// </summary> + string GetTextEditorCode() + { + return "from System.Windows.Forms import Form\r\n" + + "\r\n" + + "class MainForm(Form):\r\n" + + "\tdef __init__(self):\r\n" + + "\t\tself.InitializeComponent()\r\n" + + "\t\r\n" + + "\tdef InitializeComponent(self):\r\n" + + "\t\tpass"; + } + } +} diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/PythonDesignerLoaderProviderTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/PythonDesignerLoaderProviderTestFixture.cs index 11f8e73feb..75f8cad014 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/PythonDesignerLoaderProviderTestFixture.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/PythonDesignerLoaderProviderTestFixture.cs @@ -25,7 +25,7 @@ namespace PythonBinding.Tests.Designer public void SetUpFixture() { provider = new PythonDesignerLoaderProvider(); - generator = new PythonDesignerGenerator(); + generator = new PythonDesignerGenerator(null); } [Test] diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/PythonDesignerLoaderTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/PythonDesignerLoaderTestFixture.cs index 8cef89b3ad..4688afefba 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/PythonDesignerLoaderTestFixture.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/PythonDesignerLoaderTestFixture.cs @@ -132,9 +132,9 @@ namespace PythonBinding.Tests.Designer "\r\n" + "class MainForm(Form):\r\n" + "\tdef __init__(self):\r\n" + - "\t\tself.InitializeComponent()\r\n" + + "\t\tself.InitializeComponents()\r\n" + "\t\r\n" + - "\tdef InitializeComponent(self):\r\n" + + "\tdef InitializeComponents(self):\r\n" + "\t\tself.Name = 'MainForm'\r\n"; } } diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/TextBoxNotAddedToFormTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/TextBoxNotAddedToFormTestFixture.cs new file mode 100644 index 0000000000..3cd170e0db --- /dev/null +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/TextBoxNotAddedToFormTestFixture.cs @@ -0,0 +1,73 @@ +// <file> +// <copyright see="prj:///doc/copyright.txt"/> +// <license see="prj:///doc/license.txt"/> +// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/> +// <version>$Revision$</version> +// </file> + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.IO; +using System.Windows.Forms; + +using ICSharpCode.PythonBinding; +using NUnit.Framework; +using PythonBinding.Tests.Utils; + +namespace PythonBinding.Tests.Designer +{ + /// <summary> + /// When a text box is not added to the form's Control collection in InitializeComponent then: + /// + /// 1) Text box should not be added to the form's Control collection when the form is created. + /// 2) Text box should be registered with the designer via the IComponentCreator.Add method. + /// 3) Text box should be created via the IComponentCreator.CreateInstance method. + /// </summary> + [TestFixture] + public class TextBoxNotAddedToFormTestFixture : LoadFormTestFixtureBase + { + string pythonCode = "class MainForm(System.Windows.Forms.Form):\r\n" + + " def InitializeComponent(self):\r\n" + + " self._textBox1 = System.Windows.Forms.TextBox()\r\n" + + " self.SuspendLayout()\r\n" + + " # \r\n" + + " # textBox1\r\n" + + " # \r\n" + + " self._textBox1.Name = \"textBox1\"\r\n" + + " # \r\n" + + " # form1\r\n" + + " # \r\n" + + " self.ResumeLayout(False)\r\n"; + Form form; + + [TestFixtureSetUp] + public void SetUpFixture() + { + PythonFormWalker walker = new PythonFormWalker(this); + form = walker.CreateForm(pythonCode); + } + + [TestFixtureTearDown] + public void TearDownFixture() + { + form.Dispose(); + } + + [Test] + public void AddedComponentsContainsTextBox() + { + CreatedInstance instance = GetCreatedInstance(typeof(TextBox)); + + AddedComponent c = new AddedComponent(instance.Object as IComponent, "textBox1"); + Assert.Contains(c, AddedComponents); + } + + [Test] + public void TextBoxIsNotAddedToForm() + { + Assert.AreEqual(0, form.Controls.Count); + } + } +} diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/TextEditorIndentPassedToGeneratorTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/TextEditorIndentPassedToGeneratorTestFixture.cs new file mode 100644 index 0000000000..40f94e1605 --- /dev/null +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/TextEditorIndentPassedToGeneratorTestFixture.cs @@ -0,0 +1,86 @@ +// <file> +// <copyright see="prj:///doc/copyright.txt"/> +// <license see="prj:///doc/license.txt"/> +// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/> +// <version>$Revision$</version> +// </file> + +using System; +using System.CodeDom; +using System.Drawing; +using System.IO; +using System.Windows.Forms; + +using ICSharpCode.FormsDesigner; +using ICSharpCode.PythonBinding; +using ICSharpCode.SharpDevelop.Dom; +using ICSharpCode.TextEditor; +using ICSharpCode.TextEditor.Document; +using NUnit.Framework; +using PythonBinding.Tests.Utils; + +namespace PythonBinding.Tests.Designer +{ + /// <summary> + /// Tests that the indent information in the ITextEditorProperties is passed to the generator. + /// </summary> + [TestFixture] + public class TextEditorIndentPassedToGeneratorTestFixture + { + IDocument document; + + [TestFixtureSetUp] + public void SetUpFixture() + { + using (FormsDesignerViewContent viewContent = new FormsDesignerViewContent(null, new MockOpenedFile("Test.py"))) { + viewContent.DesignerCodeFileContent = "class MainForm(Form):\r\n" + + " def __init__(self):\r\n" + + " self.InitializeComponent()\r\n" + + "\r\n" + + " def InitializeComponent(self):\r\n" + + " pass\r\n"; + + document = viewContent.DesignerCodeFileDocument; + + ParseInformation parseInfo = new ParseInformation(); + PythonParser parser = new PythonParser(); + ICompilationUnit compilationUnit = parser.Parse(new DefaultProjectContent(), @"test.py", document.TextContent); + parseInfo.SetCompilationUnit(compilationUnit); + + using (Form form = new Form()) { + form.Name = "MainForm"; + form.ClientSize = new Size(284, 264); + + MockTextEditorProperties textEditorProperties = new MockTextEditorProperties(); + textEditorProperties.ConvertTabsToSpaces = true; + textEditorProperties.IndentationSize = 1; + + DerivedPythonDesignerGenerator generator = new DerivedPythonDesignerGenerator(textEditorProperties); + generator.ParseInfoToReturnFromParseFileMethod = parseInfo; + generator.Attach(viewContent); + generator.MergeRootComponentChanges(form); + } + } + } + + [Test] + public void GeneratedCode() + { + string expectedCode = "class MainForm(Form):\r\n" + + " def __init__(self):\r\n" + + " self.InitializeComponent()\r\n" + + "\r\n" + + " def InitializeComponent(self):\r\n" + + " self.SuspendLayout()\r\n" + + " # \r\n" + + " # MainForm\r\n" + + " # \r\n" + + " self.ClientSize = System.Drawing.Size(284, 264)\r\n" + + " self.Name = \"MainForm\"\r\n" + + " self.ResumeLayout(False)\r\n" + + " self.PerformLayout()\r\n"; + + Assert.AreEqual(expectedCode, document.TextContent); + } + } +} diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/UnknownTypeTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/UnknownTypeTestFixture.cs new file mode 100644 index 0000000000..d5e70dc5a7 --- /dev/null +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/UnknownTypeTestFixture.cs @@ -0,0 +1,46 @@ +// <file> +// <copyright see="prj:///doc/copyright.txt"/> +// <license see="prj:///doc/license.txt"/> +// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/> +// <version>$Revision$</version> +// </file> + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Windows.Forms; + +using ICSharpCode.PythonBinding; +using IronPython.Compiler.Ast; +using Microsoft.Scripting; +using NUnit.Framework; +using PythonBinding.Tests.Utils; + +namespace PythonBinding.Tests.Designer +{ + /// <summary> + /// Tests that the PythonFormWalker throws a PythonFormWalkerException if a unknown type is used in the + /// form. + /// </summary> + [TestFixture] + public class UnknownTypeTestFixture : LoadFormTestFixtureBase + { + string pythonCode = "from System.Windows.Forms import Form\r\n" + + "\r\n" + + "class MainForm(System.Windows.Forms.Form):\r\n" + + " def __init__(self):\r\n" + + " self.InitializeComponent()\r\n" + + "\r\n" + + " def InitializeComponent(self):\r\n" + + " self.ClientSize = Unknown.Type(10)\r\n"; + [Test] + [ExpectedException(typeof(PythonFormWalkerException))] + public void PythonFormWalkerExceptionThrown() + { + PythonFormWalker walker = new PythonFormWalker(this); + walker.CreateForm(pythonCode); + Assert.Fail("Exception should have been thrown before this."); + } + } +} diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/FormsDesignerDisplayBindingTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/FormsDesignerDisplayBindingTestFixture.cs index 20501f47d5..9033102540 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/FormsDesignerDisplayBindingTestFixture.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/FormsDesignerDisplayBindingTestFixture.cs @@ -120,7 +120,7 @@ namespace PythonBinding.Tests public void CreatesPythonFormsDesigner() { MockTextEditorViewContent view = new MockTextEditorViewContent(); - IViewContent[] views = displayBinding.CreateSecondaryViewContent(view); + IViewContent[] views = displayBinding.CreateSecondaryViewContent(view, new MockTextEditorProperties()); Assert.AreEqual(1, views.Length); Assert.IsTrue(views[0] is FormsDesignerViewContent); views[0].Dispose(); @@ -133,7 +133,7 @@ namespace PythonBinding.Tests IViewContent[] views = null; using (FormsDesignerViewContent formsDesigner = new FormsDesignerViewContent(view, new MockOpenedFile("test.py"))) { view.SecondaryViewContents.Add(formsDesigner); - views = displayBinding.CreateSecondaryViewContent(view); + views = displayBinding.CreateSecondaryViewContent(view, new MockTextEditorProperties()); } Assert.AreEqual(0, views.Length); } diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Parsing/IronPythonParserTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Parsing/IronPythonParserTestFixture.cs deleted file mode 100644 index 658732db68..0000000000 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Parsing/IronPythonParserTestFixture.cs +++ /dev/null @@ -1,68 +0,0 @@ -// <file> -// <copyright see="prj:///doc/copyright.txt"/> -// <license see="prj:///doc/license.txt"/> -// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/> -// <version>$Revision$</version> -// </file> - -using Microsoft.Scripting.Runtime; -using System; -using System.CodeDom; -using System.CodeDom.Compiler; -using System.IO; -using IronPython; -using IronPython.Compiler; -using IronPython.Compiler.Ast; -using IronPython.Runtime; -using NUnit.Framework; - -namespace PythonBinding.Tests.Parsing -{ - /// <summary> - /// Tests the IronPython's parser. - /// </summary> - [TestFixture] - public class IronPythonParserTestFixture - { - /// <summary> - /// Cannot create PrintStatement for code com. - /// </summary> -// [Test]s -// public void Test() -// { -// string pythonScript = "print 'Hello'"; -// PythonProvider provider = new PythonProvider(); -// CodeCompileUnit unit = provider.Parse(new StringReader(pythonScript)); -// } - - [Test] - public void Test2() - { -// string pythonScript = "print 'Hello'"; -// CompilerContext context = new CompilerContext(); -// Parser parser = Parser.FromString(null, context, pythonScript); -// Statement statement = parser.ParseFileInput(); - } - - [Test] - public void Test3() - { -// string pythonScript = "Console.WriteLine"; -// CompilerContext context = new CompilerContext(); -// Parser parser = Parser.FromString(null, context, pythonScript); -// Statement statement = parser.ParseFileInput(); -// ResolveVisitor visitor = new ResolveVisitor(); -// statement.Walk(visitor); -// Console.WriteLine(statement.GetType().FullName); - } - } - - public class ResolveVisitor : PythonWalker - { - public override bool Walk(NameExpression node) - { - System.Console.WriteLine("NameExpression: " + node.Name); - return true; - } - } -} diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj b/src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj index b1781c6b22..fba600177a 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj @@ -160,13 +160,19 @@ <Compile Include="Designer\IsFullyQualifiedBaseClassFormDesignableTestFixture.cs" /> <Compile Include="Designer\LoadFormTestFixtureBase.cs" /> <Compile Include="Designer\LoadSimpleFormTestFixture.cs" /> + <Compile Include="Designer\LoadTextBoxTestFixture.cs" /> <Compile Include="Designer\MergeFormTestFixture.cs" /> + <Compile Include="Designer\MissingInitializeComponentMethodTestFixture.cs" /> + <Compile Include="Designer\NoNewLineAfterInitializeComponentTestFixture.cs" /> <Compile Include="Designer\OneCompatibleMethodTestFixture.cs" /> <Compile Include="Designer\PythonGeneratorTestFixture.cs" /> <Compile Include="Designer\IsFormDesignableTestFixture.cs" /> <Compile Include="Designer\NullGeneratorPassedToLoader.cs" /> <Compile Include="Designer\PythonDesignerLoaderProviderTestFixture.cs" /> <Compile Include="Designer\PythonDesignerLoaderTestFixture.cs" /> + <Compile Include="Designer\TextBoxNotAddedToFormTestFixture.cs" /> + <Compile Include="Designer\TextEditorIndentPassedToGeneratorTestFixture.cs" /> + <Compile Include="Designer\UnknownTypeTestFixture.cs" /> <Compile Include="Expressions\FindImportExpressionTestFixture.cs" /> <Compile Include="Expressions\FindSystemConsoleExpressionTestFixture.cs" /> <Compile Include="Expressions\RemoveLastPartTests.cs" /> @@ -177,7 +183,6 @@ <Compile Include="ImportCompletionTestFixture.cs" /> <Compile Include="LanguageBindingTestFixture.cs" /> <Compile Include="Parsing\ClassWithBaseClassTestFixture.cs" /> - <Compile Include="Parsing\IronPythonParserTestFixture.cs" /> <Compile Include="Parsing\MethodWithParametersTestFixture.cs" /> <Compile Include="Parsing\MissingLastParameterFromMethodTestFixture.cs" /> <Compile Include="Parsing\ParseClassWithCtorTestFixture.cs" /> @@ -207,9 +212,11 @@ <Compile Include="Resolver\ResolveUnknownNamespaceTestFixture.cs" /> <Compile Include="RunPythonCommandTestFixture.cs" /> <Compile Include="StopPythonCommandTestFixture.cs" /> + <Compile Include="Utils\AddedComponent.cs" /> <Compile Include="Utils\BrowseButtonInfo.cs" /> <Compile Include="Utils\BrowseFolderButtonInfo.cs" /> <Compile Include="Utils\CreatedComponent.cs" /> + <Compile Include="Utils\CreatedInstance.cs" /> <Compile Include="Utils\DerivedAddInOptions.cs" /> <Compile Include="Utils\DerivedApplicationSettingsPanel.cs" /> <Compile Include="Utils\DerivedCompilingOptionsPanel.cs" /> diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Resolver/ResolveLocalClassInstanceTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Resolver/ResolveLocalClassInstanceTestFixture.cs index f575e14fe6..6dfe09fe2b 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Resolver/ResolveLocalClassInstanceTestFixture.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Resolver/ResolveLocalClassInstanceTestFixture.cs @@ -23,6 +23,7 @@ namespace PythonBinding.Tests.Resolver /// Check that the type of "a" can be obtained by the resolver. /// </summary> [TestFixture] + [Ignore("Disabled local variable resolution for SD 3.0")] public class ResolveLocalClassInstanceTestFixture { PythonResolver resolver; diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/AddedComponent.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/AddedComponent.cs new file mode 100644 index 0000000000..ac24d7ba5d --- /dev/null +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/AddedComponent.cs @@ -0,0 +1,54 @@ +// <file> +// <copyright see="prj:///doc/copyright.txt"/> +// <license see="prj:///doc/license.txt"/> +// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/> +// <version>$Revision$</version> +// </file> + +using System; +using System.ComponentModel; + +namespace PythonBinding.Tests.Utils +{ + /// <summary> + /// Component passed to the IComponentCreator.Add method. + /// </summary> + public class AddedComponent + { + public AddedComponent(IComponent component, string name) + { + Component = component; + Name = name; + } + + public string Name { get; set; } + public IComponent Component { get; set; } + + public override bool Equals(object obj) + { + AddedComponent rhs = obj as AddedComponent; + if (rhs != null) { + return Name == rhs.Name && Component == rhs.Component; + } + return base.Equals(obj); + } + + public override int GetHashCode() + { + return Component.GetHashCode() ^ Name.GetHashCode(); + } + + public override string ToString() + { + return "AddedComponent [Component=" + GetComponentTypeName() + "Name=" + Name + "]"; + } + + string GetComponentTypeName() + { + if (Component != null) { + return Component.GetType().Name; + } + return "<null>"; + } + } +} diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/CreatedInstance.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/CreatedInstance.cs new file mode 100644 index 0000000000..5fefa7dae6 --- /dev/null +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/CreatedInstance.cs @@ -0,0 +1,69 @@ +// <file> +// <copyright see="prj:///doc/copyright.txt"/> +// <license see="prj:///doc/license.txt"/> +// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/> +// <version>$Revision$</version> +// </file> + +using System; +using System.Collections; +using System.Text; + +namespace PythonBinding.Tests.Utils +{ + /// <summary> + /// Helper class that stores the parameters passed when the IComponentCreator.CreateInstance method is called. + /// </summary> + public class CreatedInstance + { + public CreatedInstance(Type type, ICollection arguments, string name, bool addToContainer) + { + InstanceType = type; + Arguments = arguments; + Name = name; + AddToContainer = addToContainer; + } + + public Type InstanceType { get; set; } + public ICollection Arguments { get; set; } + public string Name { get; set; } + public bool AddToContainer { get; set; } + public object Object { get; set; } + + public override bool Equals(object obj) + { + CreatedInstance rhs = obj as CreatedInstance; + if (rhs != null) { + return ToString() == rhs.ToString(); + } + return base.Equals(obj); + } + + public override int GetHashCode() + { + return InstanceType.GetHashCode(); + } + + public override string ToString() + { + return "CreatedInstance [Type=" + InstanceType + ", Name=" + Name + ArgsToString() + "]"; + } + + string ArgsToString() + { + StringBuilder s = new StringBuilder(); + s.Append("[Args="); + + bool firstArg = true; + foreach (object o in Arguments) { + if (!firstArg) { + s.Append(", "); + } + s.Append(o); + firstArg = false; + } + s.Append("]"); + return s.ToString(); + } + } +} diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/DerivedCompilingOptionsPanel.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/DerivedCompilingOptionsPanel.cs index 0473085207..4ba740cc07 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/DerivedCompilingOptionsPanel.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/DerivedCompilingOptionsPanel.cs @@ -28,6 +28,7 @@ namespace PythonBinding.Tests.Utils Dictionary<string, TextBoxEditMode> boundTextEditModes = new Dictionary<string, TextBoxEditMode>(); List<string> locationButtonsCreated = new List<string>(); Dictionary<string, BrowseFolderButtonInfo> browseFolderButtons = new Dictionary<string, BrowseFolderButtonInfo>(); + bool createdTargetCpuComboBox; public DerivedCompilingOptionsPanel() { @@ -45,6 +46,13 @@ namespace PythonBinding.Tests.Utils get { return setupFromManifestResourceName; } } + /// <summary> + /// Returns whether the target cpu combo box was created. + /// </summary> + public bool IsTargetCpuComboBoxCreated { + get { return createdTargetCpuComboBox; } + } + /// <summary> /// Gets the name of the control that was bound to the specified /// property. @@ -142,6 +150,12 @@ namespace PythonBinding.Tests.Utils return base.CreateLocationButton(binding, controlName); } + protected override ConfigurationGuiBinding CreatePlatformTargetComboBox() + { + createdTargetCpuComboBox = true; + return base.CreatePlatformTargetComboBox(); + } + /// <summary> /// Connects the browse folder button control to the target control. /// </summary> diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/DerivedPythonDesignerGenerator.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/DerivedPythonDesignerGenerator.cs index adb395ba97..b848ca37ce 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/DerivedPythonDesignerGenerator.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/DerivedPythonDesignerGenerator.cs @@ -17,6 +17,7 @@ using ICSharpCode.PythonBinding; using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.TextEditor; +using ICSharpCode.TextEditor.Document; namespace PythonBinding.Tests.Utils { @@ -29,8 +30,13 @@ namespace PythonBinding.Tests.Utils string fileNamePassedToParseFile; string textContentPassedToParseFile; ParseInformation parseInfoToReturnFromParseFile; + + public DerivedPythonDesignerGenerator() : this(new MockTextEditorProperties()) + { + } - public DerivedPythonDesignerGenerator() + public DerivedPythonDesignerGenerator(ITextEditorProperties textEditorProperties) + : base(textEditorProperties) { } diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/MockDesignerGenerator.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/MockDesignerGenerator.cs index e8aa7b96d9..5a4d5fd54f 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/MockDesignerGenerator.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/MockDesignerGenerator.cs @@ -48,9 +48,10 @@ namespace PythonBinding.Tests.Utils this.viewContent = null; } - public ICSharpCode.SharpDevelop.OpenedFile DetermineDesignerCodeFile() + public System.Collections.Generic.IEnumerable<ICSharpCode.SharpDevelop.OpenedFile> GetSourceFiles(out ICSharpCode.SharpDevelop.OpenedFile designerCodeFile) { - return this.viewContent.DesignerCodeFile; + designerCodeFile = this.viewContent.DesignerCodeFile; + return new [] {designerCodeFile}; } public void MergeFormChanges(CodeCompileUnit unit) diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/MockProject.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/MockProject.cs index 7faa3e41e9..3c40b25205 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/MockProject.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/MockProject.cs @@ -142,6 +142,10 @@ namespace PythonBinding.Tests.Utils } } + public event EventHandler ActiveConfigurationChanged { add {} remove {} } + + public event EventHandler ActivePlatformChanged { add {} remove {} } + public ICollection<string> ConfigurationNames { get { throw new NotImplementedException(); diff --git a/src/AddIns/BackendBindings/Python/RequiredLibraries/IronPython.Modules.dll b/src/AddIns/BackendBindings/Python/RequiredLibraries/IronPython.Modules.dll new file mode 100755 index 0000000000..7351f206cc Binary files /dev/null and b/src/AddIns/BackendBindings/Python/RequiredLibraries/IronPython.Modules.dll differ diff --git a/src/AddIns/BackendBindings/Python/RequiredLibraries/IronPython.dll b/src/AddIns/BackendBindings/Python/RequiredLibraries/IronPython.dll new file mode 100755 index 0000000000..58a0818ca0 Binary files /dev/null and b/src/AddIns/BackendBindings/Python/RequiredLibraries/IronPython.dll differ diff --git a/src/AddIns/BackendBindings/Python/RequiredLibraries/License.Rtf b/src/AddIns/BackendBindings/Python/RequiredLibraries/License.Rtf new file mode 100644 index 0000000000..9cadaea828 --- /dev/null +++ b/src/AddIns/BackendBindings/Python/RequiredLibraries/License.Rtf @@ -0,0 +1,177 @@ +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f34\fbidi \froman\fcharset1\fprq2{\*\panose 02040503050406030204}Cambria Math;} +{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f39\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\f40\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f42\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f43\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f44\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\f45\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f46\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f47\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;} +{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;} +{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;} +{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}} +{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0; +\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 +\ltrch\fcs0 \fs22\lang1033\langfe1033\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\* +\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe1033\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp1033 +\snext11 \ssemihidden \sunhideused \sqformat Normal Table;}}{\*\rsidtbl \rsid11612883}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\author dinov}{\operator dinov} +{\creatim\yr2007\mo10\dy30\hr14\min43}{\revtim\yr2007\mo10\dy30\hr14\min43}{\version2}{\edmins1}{\nofpages2}{\nofwords404}{\nofchars2212}{\*\company Microsoft}{\nofcharsws2611}{\vern32893}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/200 +3/wordml}}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect +\widowctrl\ftnbj\aenddoc\trackmoves1\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120\dghorigin1701 +\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\rsidroot11612883 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2 +\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6 +\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang +{\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\sb100\sa100\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 +\fs22\lang1033\langfe1033\loch\af31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af0\afs28 \ltrch\fcs0 \b\f0\fs28\insrsid11612883 \hich\af0\dbch\af31505\loch\f0 Microsoft }{\rtlch\fcs1 \ab\af0\afs28 \ltrch\fcs0 +\b\f0\fs28\insrsid11612883 \hich\af0\dbch\af31505\loch\f0 Public }{\rtlch\fcs1 \ab\af0\afs28 \ltrch\fcs0 \b\f0\fs28\insrsid11612883 \hich\af0\dbch\af31505\loch\f0 License (Ms-PL) +\par }{\rtlch\fcs1 \ab\af0\afs24 \ltrch\fcs0 \b\f0\fs24\insrsid11612883 \hich\af0\dbch\af31505\loch\f0 +This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.}{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid11612883 +\par }{\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\insrsid11612883 \hich\af0\dbch\af31505\loch\f0 1. Definitions +\par }{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid11612883 \hich\af0\dbch\af31505\loch\f0 \hich\f0 The terms \'93\loch\f0 \hich\f0 reproduce,\'94\loch\f0 \hich\f0 \'93\loch\f0 \hich\f0 reproduction,\'94\loch\f0 \hich\f0 \'93 +\hich\af0\dbch\af31505\loch\f0 \hich\f0 derivative works,\'94\loch\f0 \hich\f0 and \'93\loch\f0 \hich\f0 distribution\'94\loch\f0 have the same meaning here as under U.S. copyright law. +\par \hich\af0\dbch\af31505\loch\f0 \hich\f0 A \'93\loch\f0 \hich\f0 contribution\'94\loch\f0 is the original software, or any additions or changes to the software. +\par \hich\af0\dbch\af31505\loch\f0 \hich\f0 A \'93\loch\f0 \hich\f0 contributor\'94\loch\f0 is any person that distributes its contribution under this\hich\af0\dbch\af31505\loch\f0 license. +\par \loch\af0\dbch\af31505\hich\f0 \'93\loch\f0 \hich\f0 Licensed patents\'94\loch\f0 are a contributor\hich\f0 \rquote \loch\f0 s patent claims that read directly on its contribution. +\par }{\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\insrsid11612883 \hich\af0\dbch\af31505\loch\f0 2. Grant of Rights +\par }{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid11612883 \hich\af0\dbch\af31505\loch\f0 (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contrib +\hich\af0\dbch\af31505\loch\f0 utor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. + +\par \hich\af0\dbch\af31505\loch\f0 (B) Patent Grant- Subject to th\hich\af0\dbch\af31505\loch\f0 +e terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or o +\hich\af0\dbch\af31505\loch\f0 t\hich\af0\dbch\af31505\loch\f0 herwise dispose of its contribution in the software or derivative works of the contribution in the software. +\par }{\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\insrsid11612883 \hich\af0\dbch\af31505\loch\f0 3. Conditions and Limitations +\par }{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid11612883 \hich\af0\dbch\af31505\loch\f0 (A) No Trademark License- This license does not grant you rights to use any contributors\hich\f0 \rquote \loch\f0 name, logo, or trademarks. +\par \hich\af0\dbch\af31505\loch\f0 (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. +\par \hich\af0\dbch\af31505\loch\f0 (C) If you distribute any portion of the software, you must ret\hich\af0\dbch\af31505\loch\f0 ain all copyright, patent, trademark, and attribution notices that are present in the software. +\par \hich\af0\dbch\af31505\loch\f0 (D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with y\hich\af0\dbch\af31505\loch\f0 +our distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. +\par \hich\af0\dbch\af31505\loch\f0 \hich\f0 (E) The software is licensed \'93\loch\f0 \hich\f0 as-is.\'94\loch\f0 You bear the risk of using it. The contributors give \hich\af0\dbch\af31505\loch\f0 +no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantabil +\hich\af0\dbch\af31505\loch\f0 i\hich\af0\dbch\af31505\loch\f0 ty, fitness for a particular purpose and non-infringement. +\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid11612883 +\par }{\*\themedata 504b030414000600080000002100828abc13fa0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb6ac3301045f785fe83d0b6d8 +72ba28a5d8cea249777d2cd20f18e4b12d6a8f843409c9df77ecb850ba082d74231062ce997b55ae8fe3a00e1893f354e9555e6885647de3a8abf4fbee29bbd7 +2a3150038327acf409935ed7d757e5ee14302999a654e99e393c18936c8f23a4dc072479697d1c81e51a3b13c07e4087e6b628ee8cf5c4489cf1c4d075f92a0b +44d7a07a83c82f308ac7b0a0f0fbf90c2480980b58abc733615aa2d210c2e02cb04430076a7ee833dfb6ce62e3ed7e14693e8317d8cd0433bf5c60f53fea2fe7 +065bd80facb647e9e25c7fc421fd2ddb526b2e9373fed4bb902e182e97b7b461e6bfad3f010000ffff0300504b030414000600080000002100a5d6a7e7c00000 +00360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4fc7060abb08 +84a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b63095120f88d94fbc +52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462a1a82fe353 +bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f7468656d652f7468 +656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b4b0d592c9c +070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b4757e8d3f7 +29e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f7468656d65 +312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87615b8116d8 +a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad79482a9c04 +98f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b5d8a314d3c +94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab999fb7b471 +7509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9699640f671 +9e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd5868b37a088d1 +e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d60cf03ac1a5 +193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f9e7ef3f2d1 +17d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be15c308d3f2 +8acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a99793849c26ae6 +6252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d32a423279a +668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2af074481847 +bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86e877f0034e +16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb44f95d843b +5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a6409fb44d0 +8741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c3d9058edf2 +c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db02565e85f3b966 +0d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276b9f7dec44b +7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8c33585b5fb +9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e51440ca2e0 +088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95b21be5ceaf +8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff6dce591a26 +ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec69ffb9e65d0 +28d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239b75a5bb1e6 +345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a44959d366ad93 +b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e82db8df9f30 +254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d652f74 +68656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d363f24 +51eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e3198 +720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d9850528 +a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100828abc13fa0000001c0200001300000000000000000000000000 +000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b000000000000000000000000 +002b0100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c00000000000000000000000000140200007468 +656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b000016000000000000000000 +00000000d10200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b010000270000000000 +00000000000000009b0900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000960a00000000} +{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d +617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169 +6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363 +656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e} +{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4; +\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9; +\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7; +\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000 +4d73786d6c322e534158584d4c5265616465722e352e3000000000000000000000060000 +d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffffec69d9888b8b3d4c859eaf6cd158be0f0000000000000000000000009055 +58f93d1bc801feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file diff --git a/src/AddIns/BackendBindings/Python/RequiredLibraries/Microsoft.Scripting.Core.dll b/src/AddIns/BackendBindings/Python/RequiredLibraries/Microsoft.Scripting.Core.dll new file mode 100755 index 0000000000..ee80ba679e Binary files /dev/null and b/src/AddIns/BackendBindings/Python/RequiredLibraries/Microsoft.Scripting.Core.dll differ diff --git a/src/AddIns/BackendBindings/Python/RequiredLibraries/Microsoft.Scripting.ExtensionAttribute.dll b/src/AddIns/BackendBindings/Python/RequiredLibraries/Microsoft.Scripting.ExtensionAttribute.dll new file mode 100644 index 0000000000..08b48baa88 Binary files /dev/null and b/src/AddIns/BackendBindings/Python/RequiredLibraries/Microsoft.Scripting.ExtensionAttribute.dll differ diff --git a/src/AddIns/BackendBindings/Python/RequiredLibraries/Microsoft.Scripting.dll b/src/AddIns/BackendBindings/Python/RequiredLibraries/Microsoft.Scripting.dll new file mode 100755 index 0000000000..c17f191e10 Binary files /dev/null and b/src/AddIns/BackendBindings/Python/RequiredLibraries/Microsoft.Scripting.dll differ diff --git a/src/AddIns/BackendBindings/Python/RequiredLibraries/ipy.exe b/src/AddIns/BackendBindings/Python/RequiredLibraries/ipy.exe new file mode 100755 index 0000000000..a84ceccbf2 Binary files /dev/null and b/src/AddIns/BackendBindings/Python/RequiredLibraries/ipy.exe differ diff --git a/src/AddIns/BackendBindings/VBNetBinding/Project/Src/Project/VBNetProject.cs b/src/AddIns/BackendBindings/VBNetBinding/Project/Src/Project/VBNetProject.cs index 67510354bb..c21bb6db35 100644 --- a/src/AddIns/BackendBindings/VBNetBinding/Project/Src/Project/VBNetProject.cs +++ b/src/AddIns/BackendBindings/VBNetBinding/Project/Src/Project/VBNetProject.cs @@ -109,7 +109,7 @@ namespace VBNetBinding public override void StartBuild(ProjectBuildOptions options, IBuildFeedbackSink feedbackSink) { - if (this.MinimumSolutionVersion == 9) { + if (this.MinimumSolutionVersion == Solution.SolutionVersionVS2005) { MSBuildEngine.StartBuild(this, options, feedbackSink, diff --git a/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesigner.cs b/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesigner.cs index 51c6899e28..2ef55f8227 100644 --- a/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesigner.cs +++ b/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesigner.cs @@ -7,7 +7,6 @@ using System; using System.Collections.ObjectModel; -using System.Diagnostics; using System.IO; using System.Xml; @@ -18,7 +17,6 @@ using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor; using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Project; using ICSharpCode.TextEditor; -using ICSharpCode.TextEditor.Document; namespace ICSharpCode.WixBinding { @@ -61,28 +59,6 @@ namespace ICSharpCode.WixBinding return null; } - // The FormsDesignerViewContent normally operates independently of any - // text editor. The following overrides connect the forms designer - // directly to the underlying XML text editor so that the caret positioning - // and text selection operations done by the WiX designer actually - // become visible in the text editor. - - public override IDocument PrimaryFileDocument { - get { return ((ITextEditorControlProvider)this.PrimaryViewContent).TextEditorControl.Document; } - } - - public override IDocument DesignerCodeFileDocument { - get { return this.PrimaryFileDocument; } - } - - public override System.Text.Encoding PrimaryFileEncoding { - get { return ((ITextEditorControlProvider)this.PrimaryViewContent).TextEditorControl.Encoding; } - } - - public override System.Text.Encoding DesignerCodeFileEncoding { - get { return this.PrimaryFileEncoding; } - } - /// <summary> /// Attempts to open the Wix dialog from the document currently /// associated with this designer. @@ -106,6 +82,16 @@ namespace ICSharpCode.WixBinding protected override void LoadInternal(OpenedFile file, Stream stream) { if (file == this.PrimaryFile) { + // The FormsDesignerViewContent normally operates independently of any + // text editor. The following statements connect the forms designer + // directly to the underlying XML text editor so that the caret positioning + // and text selection operations done by the WiX designer actually + // become visible in the text editor. + if (!this.SourceCodeStorage.ContainsFile(file)) { + TextEditorControl editor = ((ITextEditorControlProvider)this.PrimaryViewContent).TextEditorControl; + this.SourceCodeStorage.AddFile(file, editor.Document, editor.Encoding ?? ParserService.DefaultFileEncoding, true); + } + try { if (!ignoreDialogIdSelectedInTextEditor) { string dialogId = GetDialogIdSelectedInTextEditor(); diff --git a/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesignerGenerator.cs b/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesignerGenerator.cs index dae743f544..6ed4ebb03e 100644 --- a/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesignerGenerator.cs +++ b/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesignerGenerator.cs @@ -9,6 +9,7 @@ using System; using System.CodeDom; using System.CodeDom.Compiler; using System.Collections; +using System.Collections.Generic; using System.ComponentModel; using System.IO; using System.Reflection; @@ -58,9 +59,10 @@ namespace ICSharpCode.WixBinding get { return this.view; } } - public OpenedFile DetermineDesignerCodeFile() + public IEnumerable<OpenedFile> GetSourceFiles(out OpenedFile designerCodeFile) { - return this.view.PrimaryFile; + designerCodeFile = this.view.PrimaryFile; + return new [] {designerCodeFile}; } public void Attach(FormsDesignerViewContent viewContent) diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj b/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj index f9bb94cff9..793e2d364e 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj @@ -22,6 +22,10 @@ <BaseAddress>108003328</BaseAddress> <FileAlignment>4096</FileAlignment> <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <SignAssembly>True</SignAssembly> + <AssemblyOriginatorKeyFile>..\..\..\..\Main\ICSharpCode.SharpDevelop.snk</AssemblyOriginatorKeyFile> + <DelaySign>False</DelaySign> + <AssemblyOriginatorKeyMode>File</AssemblyOriginatorKeyMode> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)' == 'Release' "> <Optimize>True</Optimize> @@ -60,6 +64,7 @@ <Compile Include="Src\DesignerLoader\AbstractCodeDomDesignerLoader.cs" /> <Compile Include="Src\DesignerLoader\NRefactoryDesignerLoader.cs" /> <Compile Include="Src\DesignerLoader\XmlDesignerLoader.cs" /> + <Compile Include="Src\DesignerSourceCodeStorage.cs" /> <Compile Include="Src\Gui\ImageResourceEditorDialog.cs" /> <Compile Include="Src\Gui\ImageResourceEditorDialog.Designer.cs"> <DependentUpon>ImageResourceEditorDialog.cs</DependentUpon> @@ -165,4 +170,4 @@ </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> <Import Project="PostBuildEvent.proj" /> -</Project> \ No newline at end of file +</Project> diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/AbstractDesignerGenerator.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/AbstractDesignerGenerator.cs index 073753fa25..3f5786cc0f 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/AbstractDesignerGenerator.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/AbstractDesignerGenerator.cs @@ -12,6 +12,7 @@ using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.IO; +using System.Linq; using System.Reflection; using ICSharpCode.Core; @@ -70,7 +71,7 @@ namespace ICSharpCode.FormsDesigner this.viewContent = null; } - public OpenedFile DetermineDesignerCodeFile() + public IEnumerable<OpenedFile> GetSourceFiles(out OpenedFile designerCodeFile) { // get new initialize components ParseInformation info = ParserService.ParseFile(this.viewContent.PrimaryFileName, this.viewContent.PrimaryFileContent, false); @@ -80,9 +81,20 @@ namespace ICSharpCode.FormsDesigner this.currentClassPart = c; this.initializeComponents = FormsDesignerSecondaryDisplayBinding.GetInitializeComponents(c); if (this.initializeComponents != null) { - string designerFile = this.initializeComponents.DeclaringType.CompilationUnit.FileName; - if (designerFile != null) { - return FileService.GetOrCreateOpenedFile(designerFile); + string designerFileName = this.initializeComponents.DeclaringType.CompilationUnit.FileName; + if (designerFileName != null) { + + designerCodeFile = FileService.GetOrCreateOpenedFile(designerFileName); + + CompoundClass compound = c.GetCompoundClass() as CompoundClass; + if (compound == null) { + return new [] {designerCodeFile}; + } else { + return compound.Parts + .Select(cl => FileService.GetOrCreateOpenedFile(cl.CompilationUnit.FileName)) + .Distinct(); + } + } } } @@ -99,14 +111,20 @@ namespace ICSharpCode.FormsDesigner try { LoggingService.Info("Remove field declaration: "+fieldName); Reparse(); - IField field = GetField(formClass, fieldName); + + IField field = GetField(completeClass, fieldName); if (field != null) { - int startOffset = this.ViewContent.DesignerCodeFileDocument.PositionToOffset(new TextLocation(0, field.Region.BeginLine - 1)); - int endOffset = this.ViewContent.DesignerCodeFileDocument.PositionToOffset(new TextLocation(0, field.Region.EndLine)); - this.ViewContent.DesignerCodeFileDocument.Remove(startOffset, endOffset - startOffset); - } else if ((field = GetField(completeClass, fieldName)) != null) { - // TODO: Remove the field in the part where it is declared - LoggingService.Warn("Removing field declaration in non-designer part currently not supported"); + string fileName = field.DeclaringType.CompilationUnit.FileName; + LoggingService.Debug("-> Field is declared in file '" + fileName + "', Region: " + field.Region.ToString()); + OpenedFile file = FileService.GetOpenedFile(fileName); + if (file == null) throw new InvalidOperationException("The file where the field is declared is not open, although it belongs to the class."); + IDocument doc = this.ViewContent.GetDocumentForFile(file); + if (doc == null) throw new InvalidOperationException("Could not get document for file '" + file.FileName + "'."); + + this.RemoveFieldDeclaration(doc, field); + file.MakeDirty(); + } else { + LoggingService.Warn("-> Field '" + fieldName + "' not found in class"); } } catch (Exception ex) { MessageService.ShowError(ex); @@ -136,19 +154,19 @@ namespace ICSharpCode.FormsDesigner { try { Reparse(); - IField oldField = GetField(formClass, newField.Name); + IField oldField = GetField(completeClass, newField.Name); if (oldField != null) { - int startOffset = this.ViewContent.DesignerCodeFileDocument.PositionToOffset(new TextLocation(0, oldField.Region.BeginLine - 1)); - int endOffset = this.ViewContent.DesignerCodeFileDocument.PositionToOffset(new TextLocation(0, oldField.Region.EndLine)); - this.ViewContent.DesignerCodeFileDocument.Replace(startOffset, endOffset - startOffset, tabs + GenerateFieldDeclaration(domGenerator, newField) + Environment.NewLine); + string fileName = oldField.DeclaringType.CompilationUnit.FileName; + LoggingService.Debug("-> Old field is declared in file '" + fileName + "', Region: " + oldField.Region.ToString()); + OpenedFile file = FileService.GetOpenedFile(fileName); + if (file == null) throw new InvalidOperationException("The file where the field is declared is not open, although it belongs to the class."); + IDocument doc = this.ViewContent.GetDocumentForFile(file); + if (doc == null) throw new InvalidOperationException("Could not get document for file '" + file.FileName + "'."); + this.ReplaceFieldDeclaration(doc, oldField, GenerateFieldDeclaration(domGenerator, newField)); + file.MakeDirty(); } else { - if ((oldField = GetField(completeClass, newField.Name)) != null) { - // TODO: Replace the field in the part where it is declared - LoggingService.Warn("Field declaration replacement in non-designer part currently not supported"); - } else { - int endOffset = this.ViewContent.DesignerCodeFileDocument.PositionToOffset(new TextLocation(0, initializeComponents.BodyRegion.EndLine)); - this.ViewContent.DesignerCodeFileDocument.Insert(endOffset, tabs + GenerateFieldDeclaration(domGenerator, newField) + Environment.NewLine); - } + int endOffset = this.ViewContent.DesignerCodeFileDocument.PositionToOffset(new TextLocation(0, initializeComponents.BodyRegion.EndLine)); + this.ViewContent.DesignerCodeFileDocument.Insert(endOffset, tabs + GenerateFieldDeclaration(domGenerator, newField) + Environment.NewLine); } } catch (Exception ex) { MessageService.ShowError(ex); @@ -159,6 +177,36 @@ namespace ICSharpCode.FormsDesigner protected abstract DomRegion GetReplaceRegion(ICSharpCode.TextEditor.Document.IDocument document, IMethod method); + /// <summary> + /// Removes a field declaration from the source code document. + /// </summary> + /// <remarks> + /// The default implementation assumes that the field region starts at the very beginning + /// of the line of the field declaration and ends at the end of that line. + /// Override this method if that is not the case in a specific language. + /// </remarks> + protected virtual void RemoveFieldDeclaration(IDocument document, IField field) + { + int startOffset = document.PositionToOffset(new TextLocation(0, field.Region.BeginLine - 1)); + int endOffset = document.PositionToOffset(new TextLocation(0, field.Region.EndLine)); + document.Remove(startOffset, endOffset - startOffset); + } + + /// <summary> + /// Replaces a field declaration in the source code document. + /// </summary> + /// <remarks> + /// The default implementation assumes that the field region starts at the very beginning + /// of the line of the field declaration and ends at the end of that line. + /// Override this method if that is not the case in a specific language. + /// </remarks> + protected virtual void ReplaceFieldDeclaration(IDocument document, IField oldField, string newFieldDeclaration) + { + int startOffset = document.PositionToOffset(new TextLocation(0, oldField.Region.BeginLine - 1)); + int endOffset = document.PositionToOffset(new TextLocation(0, oldField.Region.EndLine)); + document.Replace(startOffset, endOffset - startOffset, tabs + newFieldDeclaration + Environment.NewLine); + } + protected virtual void FixGeneratedCode(IClass formClass, CodeMemberMethod code) { } @@ -289,9 +337,49 @@ namespace ICSharpCode.FormsDesigner protected void Reparse() { - // get new initialize components - ParseInformation info = ParserService.ParseFile(this.ViewContent.DesignerCodeFile.FileName, this.ViewContent.DesignerCodeFileContent, false); - ICompilationUnit cu = info.BestCompilationUnit; + Dictionary<OpenedFile, ParseInformation> parsings = new Dictionary<OpenedFile, ParseInformation>(); + ParseInformation info; + ICompilationUnit cu; + + // Reparse all source files for the designed form + foreach (KeyValuePair<OpenedFile, IDocument> entry in this.ViewContent.SourceFiles) { + parsings.Add(entry.Key, ParserService.ParseFile(entry.Key.FileName, entry.Value.TextContent, false)); + } + + // Update currentClassPart from PrimaryFile + this.currentClassPart = null; + if (this.ViewContent.PrimaryFile != null && parsings.TryGetValue(this.ViewContent.PrimaryFile, out info)) { + cu = info.BestCompilationUnit; + foreach (IClass c in cu.Classes) { + if (FormsDesignerSecondaryDisplayBinding.BaseClassIsFormOrControl(c)) { + if (FormsDesignerSecondaryDisplayBinding.GetInitializeComponents(c) != null) { + this.currentClassPart = c; + break; + } + } + } + if (this.currentClassPart == null) { + LoggingService.Warn("AbstractDesignerGenerator.Reparse: Could not find designed class in primary file '" + this.ViewContent.PrimaryFile.FileName + "'"); + } + } else { + LoggingService.Debug("AbstractDesignerGenerator.Reparse: Primary file is unavailable"); + } + + // Update initializeComponents, completeClass and formClass + // from designer code file + this.completeClass = null; + this.formClass = null; + this.initializeComponents = null; + if (this.ViewContent.DesignerCodeFile == null || + !parsings.TryGetValue(this.ViewContent.DesignerCodeFile, out info)) { + LoggingService.Warn("AbstractDesignerGenerator.Reparse: Designer source code file is unavailable"); + if (this.currentClassPart != null) { + this.completeClass = this.currentClassPart.GetCompoundClass(); + } + return; + } + + cu = info.BestCompilationUnit; foreach (IClass c in cu.Classes) { if (FormsDesignerSecondaryDisplayBinding.BaseClassIsFormOrControl(c)) { this.initializeComponents = FormsDesignerSecondaryDisplayBinding.GetInitializeComponents(c); @@ -309,6 +397,10 @@ namespace ICSharpCode.FormsDesigner } } } + + if (this.completeClass == null || this.formClass == null) { + LoggingService.Warn("AbstractDesignerGenerator.Reparse: Could not find InitializeComponents in designer source code file '" + this.ViewContent.DesignerCodeFile.FileName + "'"); + } } protected static string GetIndentation(string line) @@ -338,13 +430,15 @@ namespace ICSharpCode.FormsDesigner { Reparse(); + LoggingService.Debug("Forms designer: AbstractDesignerGenerator.InsertComponentEvent: eventMethodName=" + eventMethodName); + foreach (IMethod method in completeClass.Methods) { if (method.Name == eventMethodName) { file = method.DeclaringType.CompilationUnit.FileName; - if (FileUtility.IsEqualFileName(file, this.ViewContent.PrimaryFileName)) { - position = GetCursorLine(this.ViewContent.PrimaryFileDocument, method); - } else if (FileUtility.IsEqualFileName(file, this.ViewContent.DesignerCodeFile.FileName)) { - position = GetCursorLine(this.ViewContent.DesignerCodeFileDocument, method); + OpenedFile openedFile = FileService.GetOpenedFile(file); + IDocument doc; + if (openedFile != null && (doc = this.ViewContent.GetDocumentForFile(openedFile)) != null) { + position = GetCursorLine(doc, method); } else { try { position = GetCursorLine(FindReferencesAndRenameHelper.GetDocumentInformation(file).CreateDocument(), method); @@ -362,6 +456,7 @@ namespace ICSharpCode.FormsDesigner file = currentClassPart.CompilationUnit.FileName; int line = GetEventHandlerInsertionLine(currentClassPart); + LoggingService.Debug("-> Inserting new event handler at line " + line.ToString(System.Globalization.CultureInfo.InvariantCulture)); int offset = this.viewContent.PrimaryFileDocument.GetLineSegment(line - 1).Offset; diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/IDesignerGenerator.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/IDesignerGenerator.cs index 9dbc0bf73a..b539c0c56a 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/IDesignerGenerator.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/IDesignerGenerator.cs @@ -9,6 +9,7 @@ using System; using System.CodeDom; using System.CodeDom.Compiler; using System.Collections; +using System.Collections.Generic; using System.ComponentModel; using System.Reflection; @@ -25,10 +26,13 @@ namespace ICSharpCode.FormsDesigner void Detach(); FormsDesignerViewContent ViewContent { get; } /// <summary> - /// Gets the OpenedFile for the file which contains the code to be modified by the forms designer. - /// This method must never return null. If it cannot find that file, it must throw an exception. + /// Gets the collection of OpenedFiles that contain code which belongs + /// to the designed form, not including resource files. /// </summary> - OpenedFile DetermineDesignerCodeFile(); + /// <param name="designerCodeFile">Receives the file which contains the code to be modified by the forms designer.</param> + /// <returns>A collection of OpenedFiles that contain code which belongs to the designed form.</returns> + /// <remarks>The returned collection must include the <paramref name="designerCodeFile"/>.</remarks> + IEnumerable<OpenedFile> GetSourceFiles(out OpenedFile designerCodeFile); void MergeFormChanges(CodeCompileUnit unit); bool InsertComponentEvent(IComponent component, EventDescriptor edesc, string eventMethodName, string body, out string file, out int position); ICollection GetCompatibleMethods(EventDescriptor edesc); diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/VBNetDesignerGenerator.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/VBNetDesignerGenerator.cs index 94b7add6ee..ae3c50b162 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/VBNetDesignerGenerator.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/VBNetDesignerGenerator.cs @@ -12,6 +12,7 @@ using System.Text; using ICSharpCode.Core; using ICSharpCode.SharpDevelop.Dom; +using ICSharpCode.TextEditor; using ICSharpCode.NRefactory.Ast; using ICSharpCode.NRefactory.PrettyPrinter; @@ -30,6 +31,24 @@ namespace ICSharpCode.FormsDesigner return new DomRegion(r.BeginLine + 1, 1, r.EndLine, 1); } + protected override void RemoveFieldDeclaration(ICSharpCode.TextEditor.Document.IDocument document, IField field) + { + // In VB, the field region begins at the start of the declaration + // and ends on the first column of the line following the declaration. + int startOffset = document.PositionToOffset(new TextLocation(0, field.Region.BeginLine - 1)); + int endOffset = document.PositionToOffset(new TextLocation(0, field.Region.EndLine - 1)); + document.Remove(startOffset, endOffset - startOffset); + } + + protected override void ReplaceFieldDeclaration(ICSharpCode.TextEditor.Document.IDocument document, IField oldField, string newFieldDeclaration) + { + // In VB, the field region begins at the start of the declaration + // and ends on the first column of the line following the declaration. + int startOffset = document.PositionToOffset(new TextLocation(0, oldField.Region.BeginLine - 1)); + int endOffset = document.PositionToOffset(new TextLocation(0, oldField.Region.EndLine - 1)); + document.Replace(startOffset, endOffset - startOffset, tabs + newFieldDeclaration + Environment.NewLine); + } + protected override string CreateEventHandler(Type eventType, string eventMethodName, string body, string indentation) { string param = GenerateParams(eventType); diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/XmlDesignerGenerator.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/XmlDesignerGenerator.cs index 69de7b86c6..f5f0d5b577 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/XmlDesignerGenerator.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/XmlDesignerGenerator.cs @@ -9,6 +9,7 @@ using System; using System.CodeDom; using System.CodeDom.Compiler; using System.Collections; +using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.Design; using System.Drawing; @@ -45,9 +46,10 @@ namespace ICSharpCode.FormsDesigner this.viewContent = null; } - public OpenedFile DetermineDesignerCodeFile() + public IEnumerable<OpenedFile> GetSourceFiles(out OpenedFile designerCodeFile) { - return this.viewContent.PrimaryFile; + designerCodeFile = this.viewContent.PrimaryFile; + return new [] {designerCodeFile}; } public void MergeFormChanges(CodeCompileUnit unit) diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerSourceCodeStorage.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerSourceCodeStorage.cs new file mode 100644 index 0000000000..f1b163db9f --- /dev/null +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerSourceCodeStorage.cs @@ -0,0 +1,217 @@ +// <file> +// <copyright see="prj:///doc/copyright.txt"/> +// <license see="prj:///doc/license.txt"/> +// <owner name="Christian Hornung" email="chhornung@googlemail.com"/> +// <version>$Revision$</version> +// </file> + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +using ICSharpCode.Core; +using ICSharpCode.SharpDevelop; +using ICSharpCode.TextEditor.Document; +using ICSharpCode.TextEditor.Util; + +namespace ICSharpCode.FormsDesigner +{ + /// <summary> + /// Manages the source code files and their content associated with + /// an open forms designer view. + /// </summary> + public sealed class DesignerSourceCodeStorage : IEnumerable<KeyValuePair<OpenedFile, IDocument>> + { + readonly Dictionary<OpenedFile, FileContent> fileContents = new Dictionary<OpenedFile, FileContent>(); + OpenedFile designerCodeFile; + + public DesignerSourceCodeStorage() + { + } + + public OpenedFile DesignerCodeFile { + get { return this.designerCodeFile; } + set { + if (value != null && !this.fileContents.ContainsKey(value)) { + throw new InvalidOperationException("The specified DesignerCodeFile '" + value.FileName + "' is not registered with this DesignerSourceCodeStorage instance."); + } + this.designerCodeFile = value; + } + } + + /// <summary> + /// Gets the <see cref="IDocument"/> associated with the specified file or + /// <c>null</c> if the file is not registered with the current instance. + /// </summary> + public IDocument this[OpenedFile file] { + get { + FileContent c; + if (this.fileContents.TryGetValue(file, out c)) { + return c.Document; + } else { + return null; + } + } + } + + public IEnumerator<KeyValuePair<OpenedFile, IDocument>> GetEnumerator() + { + foreach (KeyValuePair<OpenedFile, FileContent> entry in this.fileContents) { + yield return new KeyValuePair<OpenedFile, IDocument>(entry.Key, entry.Value.Document); + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return this.GetEnumerator(); + } + + public void LoadFile(OpenedFile file, Stream stream) + { + if (stream == null) + throw new ArgumentNullException("stream"); + if (file == null) + throw new ArgumentNullException("file"); + + FileContent c; + if (!this.fileContents.TryGetValue(file, out c)) { + c = new FileContent(); + this.fileContents.Add(file, c); + } + c.LoadFrom(stream); + } + + public void SaveFile(OpenedFile file, Stream stream) + { + if (stream == null) + throw new ArgumentNullException("stream"); + if (file == null) + throw new ArgumentNullException("file"); + + FileContent c; + if (!this.fileContents.TryGetValue(file, out c)) { + throw new InvalidOperationException("Cannot save file '" + file.FileName + "' because this file is not registered with this DesignerSourceCodeStorage instance."); + } + c.SaveTo(stream); + } + + /// <summary> + /// Adds a file with an empty document. + /// </summary> + public void AddFile(OpenedFile file) + { + this.fileContents.Add(file, new FileContent()); + } + + /// <summary> + /// Adds a file with an empty document and the specified encoding. + /// </summary> + public void AddFile(OpenedFile file, Encoding encoding) + { + this.fileContents.Add(file, new FileContent(encoding)); + } + + /// <summary> + /// Adds a file with the specified document and the specified encoding. + /// </summary> + public void AddFile(OpenedFile file, IDocument document, Encoding encoding) + { + this.fileContents.Add(file, new FileContent(document, encoding)); + } + + /// <summary> + /// Adds a file with the specified document and the specified encoding. + /// </summary> + /// <param name="doNotLoad">When true, the SourceCodeStorage will not load the stream content into the document when the view is loaded. Use this when the document content is already managed elsewhere.</param> + public void AddFile(OpenedFile file, IDocument document, Encoding encoding, bool doNotLoad) + { + this.fileContents.Add(file, new FileContent(document, encoding, doNotLoad)); + } + + public bool ContainsFile(OpenedFile file) + { + return this.fileContents.ContainsKey(file); + } + + public bool RemoveFile(OpenedFile file) + { + return this.fileContents.Remove(file); + } + + public Encoding GetFileEncoding(OpenedFile file) + { + if (file == null) + throw new ArgumentNullException("file"); + + FileContent c; + if (!this.fileContents.TryGetValue(file, out c)) { + throw new InvalidOperationException("Cannot get Encoding for file '" + file.FileName + "' because this file is not registered with this DesignerSourceCodeStorage instance."); + } + return c.Encoding; + } + + + /// <summary> + /// Stores the content of a file in an <see cref="IDocument"/> + /// along with its encoding. + /// </summary> + sealed class FileContent + { + static readonly DocumentFactory documentFactory = new DocumentFactory(); + + Encoding encoding; + readonly IDocument document; + readonly bool doNotLoad; + + public FileContent() + : this(ParserService.DefaultFileEncoding) + { + } + + public FileContent(Encoding encoding) + : this(documentFactory.CreateDocument(), encoding) + { + } + + public FileContent(IDocument document, Encoding encoding) + : this(document, encoding, false) + { + } + + public FileContent(IDocument document, Encoding encoding, bool doNotLoad) + { + if (document == null) + throw new ArgumentNullException("document"); + if (encoding == null) + throw new ArgumentNullException("encoding"); + this.document = document; + this.encoding = encoding; + this.doNotLoad = doNotLoad; + } + + public IDocument Document { + get { return this.document; } + } + + public Encoding Encoding { + get { return this.encoding; } + } + + public void LoadFrom(Stream stream) + { + if (this.doNotLoad) + return; + this.encoding = ParserService.DefaultFileEncoding; + this.Document.TextContent = FileReader.ReadFileContent(stream, ref this.encoding); + } + + public void SaveTo(Stream stream) + { + using(StreamWriter writer = new StreamWriter(stream, this.encoding)) { + writer.Write(this.Document.TextContent); + } + } + } + } +} diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs index 77d29c5e87..fd06448bbb 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs @@ -13,6 +13,7 @@ using System.ComponentModel.Design; using System.ComponentModel.Design.Serialization; using System.Drawing; using System.IO; +using System.Linq; using System.Text; using System.Windows.Forms; @@ -23,7 +24,6 @@ using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor; using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.TextEditor.Document; -using ICSharpCode.TextEditor.Util; namespace ICSharpCode.FormsDesigner { @@ -41,11 +41,7 @@ namespace ICSharpCode.FormsDesigner FormsDesignerUndoEngine undoEngine; TypeResolutionService typeResolutionService; - Encoding primaryFileEncoding; - readonly IDocument primaryFileDocument = new DocumentFactory().CreateDocument(); - Encoding designerCodeFileEncoding; - OpenedFile designerCodeFile; - IDocument designerCodeFileDocument; + readonly DesignerSourceCodeStorage sourceCodeStorage; readonly Dictionary<Type, TypeDescriptionProvider> addedTypeDescriptionProviders = new Dictionary<Type, TypeDescriptionProvider>(); @@ -64,11 +60,11 @@ namespace ICSharpCode.FormsDesigner } public OpenedFile DesignerCodeFile { - get { return this.designerCodeFile; } + get { return this.sourceCodeStorage.DesignerCodeFile; } } - public virtual IDocument PrimaryFileDocument { - get { return this.primaryFileDocument; } + public IDocument PrimaryFileDocument { + get { return this.sourceCodeStorage[this.PrimaryFile]; } } public string PrimaryFileContent { @@ -76,12 +72,14 @@ namespace ICSharpCode.FormsDesigner set { this.PrimaryFileDocument.TextContent = value; } } - public virtual Encoding PrimaryFileEncoding { - get { return this.primaryFileEncoding; } + public IDocument DesignerCodeFileDocument { + get { + if (this.sourceCodeStorage.DesignerCodeFile == null) { + return null; + } else { + return this.sourceCodeStorage[this.sourceCodeStorage.DesignerCodeFile]; + } } - - public virtual IDocument DesignerCodeFileDocument { - get { return this.designerCodeFileDocument; } } public string DesignerCodeFileContent { @@ -89,19 +87,17 @@ namespace ICSharpCode.FormsDesigner set { this.DesignerCodeFileDocument.TextContent = value; } } - public virtual Encoding DesignerCodeFileEncoding { - get { return this.designerCodeFileEncoding; } - } - public IDocument GetDocumentForFile(OpenedFile file) { - if (file == this.DesignerCodeFile) { - return this.DesignerCodeFileDocument; - } else if (file == this.PrimaryFile) { - return this.PrimaryFileDocument; - } else { - return null; + return this.sourceCodeStorage[file]; } + + public IEnumerable<KeyValuePair<OpenedFile, IDocument>> SourceFiles { + get { return this.sourceCodeStorage; } + } + + protected DesignerSourceCodeStorage SourceCodeStorage { + get { return this.sourceCodeStorage; } } public IViewContent PrimaryViewContent { @@ -125,12 +121,16 @@ namespace ICSharpCode.FormsDesigner this.UserContent = this.pleaseWaitLabel; + this.sourceCodeStorage = new DesignerSourceCodeStorage(); this.resourceStore = new ResourceStore(this); // null check is required to support running in unit test mode if (WorkbenchSingleton.Workbench != null) { this.IsActiveViewContentChanged += this.IsActiveViewContentChangedHandler; } + + FileService.FileRemoving += this.FileServiceFileRemoving; + ICSharpCode.SharpDevelop.Debugging.DebuggerService.DebugStarting += this.DebugStarting; } public FormsDesignerViewContent(IViewContent primaryViewContent, IDesignerLoaderProvider loaderProvider, IDesignerGenerator generator) @@ -154,59 +154,73 @@ namespace ICSharpCode.FormsDesigner public FormsDesignerViewContent(IViewContent primaryViewContent, OpenedFile mockFile) : this(primaryViewContent) { - this.primaryFileDocument = new DocumentFactory().CreateDocument(); - this.designerCodeFileDocument = this.primaryFileDocument; - this.designerCodeFileEncoding = System.Text.Encoding.UTF8; - this.designerCodeFile = mockFile; + this.sourceCodeStorage.AddFile(mockFile, Encoding.UTF8); + this.sourceCodeStorage.DesignerCodeFile = mockFile; } + bool inMasterLoadOperation; + protected override void LoadInternal(OpenedFile file, System.IO.Stream stream) { - LoggingService.Debug("Forms designer: Load " + file.FileName); + LoggingService.Debug("Forms designer: Load " + file.FileName + "; inMasterLoadOperation=" + this.inMasterLoadOperation); - if (file == this.PrimaryFile) { + if (inMasterLoadOperation) { - this.primaryFileEncoding = ParserService.DefaultFileEncoding; - this.primaryFileDocument.TextContent = FileReader.ReadFileContent(stream, ref this.primaryFileEncoding); + if (this.sourceCodeStorage.ContainsFile(file)) { + LoggingService.Debug("Forms designer: Loading " + file.FileName + " in source code storage"); + this.sourceCodeStorage.LoadFile(file, stream); + } else { + LoggingService.Debug("Forms designer: Loading " + file.FileName + " in resource store"); + this.resourceStore.Load(file, stream); + } - LoggingService.Debug("Forms designer: Determining designer code file for " + file.FileName); - OpenedFile newDesignerCodeFile = this.generator.DetermineDesignerCodeFile(); - if (newDesignerCodeFile == null) { - throw new InvalidOperationException("The designer code file could not be determined."); + } else if (file == this.PrimaryFile || this.sourceCodeStorage.ContainsFile(file)) { + + if (this.loader != null && this.loader.Loading) { + throw new InvalidOperationException("Designer loading a source code file while DesignerLoader is loading and the view is not in a master load operation. This must not happen."); } - if (this.designerCodeFile != null && newDesignerCodeFile != this.designerCodeFile) { - this.Files.Remove(this.designerCodeFile); + if (this.designSurface != null) { + this.UnloadDesigner(); } - this.designerCodeFile = newDesignerCodeFile; - if (this.designerCodeFile == this.PrimaryFile) { + this.inMasterLoadOperation = true; - LoggingService.Debug("Forms designer: Designer code file is equal to primary file. Reloading designer."); + try { - this.UnloadDesigner(); - this.designerCodeFileEncoding = this.PrimaryFileEncoding; - this.designerCodeFileDocument = this.PrimaryFileDocument; - this.LoadAndDisplayDesigner(); + this.sourceCodeStorage.LoadFile(file, stream); - } else if (!this.Files.Contains(this.designerCodeFile)) { - LoggingService.Debug("Forms designer: Adding designer code file " + this.designerCodeFile.FileName); - this.Files.Insert(1, this.designerCodeFile); - } else if (this.HasLoadError || this.designSurface == null || !this.designSurface.IsLoaded) { - LoggingService.Debug("Forms designer: Having a load error. Reloading designer."); - this.ReloadDesignerFromMemory(); + LoggingService.Debug("Forms designer: Determining designer source files for " + file.FileName); + OpenedFile newDesignerCodeFile; + IEnumerable<OpenedFile> sourceFiles = this.generator.GetSourceFiles(out newDesignerCodeFile); + if (sourceFiles == null || newDesignerCodeFile == null) { + throw new FormsDesignerLoadException("The designer source files could not be determined."); } - } else if (file == this.DesignerCodeFile) { + // Unload all source files from the view which are no longer in the returned collection + foreach (OpenedFile f in this.Files.Except(sourceFiles).ToArray()) { + // Ensure that we only unload source files, but not resource files. + if (this.sourceCodeStorage.ContainsFile(f)) { + LoggingService.Debug("Forms designer: Unloading file '" + f.FileName + "' because it no longer belongs to the designed form"); + this.Files.Remove(f); + this.sourceCodeStorage.RemoveFile(f); + } + } - LoggingService.Debug("Forms designer: Reloading designer because of LoadInternal on DesignerCodeFile"); + // Load all files which are new in the returned collection + foreach (OpenedFile f in sourceFiles.Except(this.Files).ToArray()) { + this.sourceCodeStorage.AddFile(f); + this.Files.Add(f); + } - this.UnloadDesigner(); - this.designerCodeFileEncoding = ParserService.DefaultFileEncoding; - this.designerCodeFileDocument = new DocumentFactory().CreateDocument(); - this.designerCodeFileDocument.TextContent = FileReader.ReadFileContent(stream, ref this.designerCodeFileEncoding); + this.sourceCodeStorage.DesignerCodeFile = newDesignerCodeFile; + this.LoadAndDisplayDesigner(); + } finally { + this.inMasterLoadOperation = false; + } + } else { // Loading a resource file @@ -216,14 +230,20 @@ namespace ICSharpCode.FormsDesigner LoggingService.Debug("Forms designer: Reloading designer because of LoadInternal on resource file"); this.UnloadDesigner(); mustReload = true; + this.inMasterLoadOperation = true; } else { mustReload = false; } + + try { LoggingService.Debug("Forms designer: Loading " + file.FileName + " in resource store"); this.resourceStore.Load(file, stream); if (mustReload) { this.LoadAndDisplayDesigner(); } + } finally { + this.inMasterLoadOperation = false; + } } } @@ -234,14 +254,8 @@ namespace ICSharpCode.FormsDesigner if (hasUnmergedChanges) { this.MergeFormChanges(); } - if (file == this.DesignerCodeFile) { - using(StreamWriter writer = new StreamWriter(stream, this.DesignerCodeFileEncoding)) { - writer.Write(this.DesignerCodeFileContent); - } - } else if (file == this.PrimaryFile) { - using(StreamWriter writer = new StreamWriter(stream, this.PrimaryFileEncoding)) { - writer.Write(this.PrimaryFileContent); - } + if (this.sourceCodeStorage.ContainsFile(file)) { + this.sourceCodeStorage.SaveFile(file, stream); } else { this.resourceStore.Save(file, stream); } @@ -302,7 +316,7 @@ namespace ICSharpCode.FormsDesigner serviceContainer.AddService(typeof(UndoEngine), undoEngine); IComponentChangeService componentChangeService = (IComponentChangeService)designSurface.GetService(typeof(IComponentChangeService)); - componentChangeService.ComponentChanged += MakeDirty; + componentChangeService.ComponentChanged += ComponentChanged; componentChangeService.ComponentAdded += ComponentListChanged; componentChangeService.ComponentRemoved += ComponentListChanged; componentChangeService.ComponentRename += ComponentListChanged; @@ -325,7 +339,7 @@ namespace ICSharpCode.FormsDesigner bool hasUnmergedChanges; - void MakeDirty(object sender, ComponentChangedEventArgs args) + void MakeDirty() { hasUnmergedChanges = true; this.DesignerCodeFile.MakeDirty(); @@ -344,10 +358,22 @@ namespace ICSharpCode.FormsDesigner } } + void ComponentChanged(object sender, ComponentChangedEventArgs e) + { + bool loading = this.loader != null && this.loader.Loading; + LoggingService.Debug("Forms designer: ComponentChanged: " + (e.Component == null ? "<null>" : e.Component.ToString()) + ", Member=" + (e.Member == null ? "<null>" : e.Member.Name) + ", OldValue=" + (e.OldValue == null ? "<null>" : e.OldValue.ToString()) + ", NewValue=" + (e.NewValue == null ? "<null>" : e.NewValue.ToString()) + "; Loading=" + loading + "; Unloading=" + this.unloading); + if (!loading && !unloading) { + this.MakeDirty(); + } + } + void ComponentListChanged(object sender, EventArgs e) { - if (this.loader == null || !this.loader.Loading) { + bool loading = this.loader != null && this.loader.Loading; + LoggingService.Debug("Forms designer: Component added/removed/renamed, Loading=" + loading + ", Unloading=" + this.unloading); + if (!loading && !unloading) { shouldUpdateSelectableObjects = true; + this.MakeDirty(); } } @@ -376,7 +402,7 @@ namespace ICSharpCode.FormsDesigner IComponentChangeService componentChangeService = designSurface.GetService(typeof(IComponentChangeService)) as IComponentChangeService; if (componentChangeService != null) { - componentChangeService.ComponentChanged -= MakeDirty; + componentChangeService.ComponentChanged -= ComponentChanged; componentChangeService.ComponentAdded -= ComponentListChanged; componentChangeService.ComponentRemoved -= ComponentListChanged; componentChangeService.ComponentRename -= ComponentListChanged; @@ -459,6 +485,8 @@ namespace ICSharpCode.FormsDesigner void DesignerLoading(object sender, EventArgs e) { LoggingService.Debug("Forms designer: DesignerLoader loading..."); + this.reloadPending = false; + this.unloading = false; this.UserContent = this.pleaseWaitLabel; Application.DoEvents(); } @@ -466,16 +494,22 @@ namespace ICSharpCode.FormsDesigner void DesingerUnloading(object sender, EventArgs e) { LoggingService.Debug("Forms designer: DesignerLoader unloading..."); + this.unloading = true; if (!this.disposing) { this.UserContent = this.pleaseWaitLabel; Application.DoEvents(); } } + bool reloadPending; + bool unloading; + void DesignerLoaded(object sender, LoadedEventArgs e) { // This method is called when the designer has loaded. LoggingService.Debug("Forms designer: DesignerLoader loaded, HasSucceeded=" + e.HasSucceeded.ToString()); + this.reloadPending = false; + this.unloading = false; if (e.HasSucceeded) { // Display the designer on the view content @@ -509,6 +543,7 @@ namespace ICSharpCode.FormsDesigner void DesignerFlushed(object sender, EventArgs e) { this.resourceStore.CommitAllResourceChanges(); + this.hasUnmergedChanges = false; } static string FormatLoadErrors(DesignSurface designSurface) @@ -523,8 +558,11 @@ namespace ICSharpCode.FormsDesigner public virtual void MergeFormChanges() { - if (this.HasLoadError) { + if (this.HasLoadError || this.designSurface == null) { + LoggingService.Debug("Forms designer: Cannot merge form changes because the designer is not loaded successfully or not loaded at all"); return; + } else if (this.DesignerCodeFile == null) { + throw new InvalidOperationException("Cannot merge form changes without a designer code file."); } bool isDirty = this.DesignerCodeFile.IsDirty; LoggingService.Info("Merging form changes..."); @@ -583,7 +621,9 @@ namespace ICSharpCode.FormsDesigner if (loaderService != null) { if (!this.Host.Loading) { LoggingService.Info("Forms designer reloading due to change in referenced assembly"); + this.reloadPending = true; if (!loaderService.Reload()) { + this.reloadPending = false; MessageService.ShowMessage("The designer has detected that a referenced assembly has been changed, but the designer loader did not accept the reload command. Please reload the designer manually by closing and reopening this file."); } } else { @@ -610,6 +650,9 @@ namespace ICSharpCode.FormsDesigner base.Dispose(); } finally { + ICSharpCode.SharpDevelop.Debugging.DebuggerService.DebugStarting -= this.DebugStarting; + FileService.FileRemoving -= this.FileServiceFileRemoving; + this.UnloadDesigner(); // null check is required to support running in unit test mode @@ -807,7 +850,7 @@ namespace ICSharpCode.FormsDesigner protected void ReloadDesignerFromMemory() { - using(MemoryStream ms = new MemoryStream(this.DesignerCodeFileEncoding.GetBytes(this.DesignerCodeFileContent), false)) { + using(MemoryStream ms = new MemoryStream(this.sourceCodeStorage.GetFileEncoding(this.DesignerCodeFile).GetBytes(this.DesignerCodeFileContent), false)) { this.Load(this.DesignerCodeFile, ms); } @@ -818,6 +861,48 @@ namespace ICSharpCode.FormsDesigner get { return ToolboxProvider.FormsDesignerSideBar; } } + void FileServiceFileRemoving(object sender, FileCancelEventArgs e) + { + if (!e.Cancel) { + if (WorkbenchSingleton.InvokeRequired) { + WorkbenchSingleton.SafeThreadAsyncCall(this.CheckForDesignerCodeFileDeletion, e); + } else { + this.CheckForDesignerCodeFileDeletion(e); + } + } + } + + void CheckForDesignerCodeFileDeletion(FileCancelEventArgs e) + { + OpenedFile file; + + if (e.IsDirectory) { + file = this.Files.SingleOrDefault( + f => FileUtility.IsBaseDirectory(e.FileName, f.FileName) + ); + } else { + file = this.Files.SingleOrDefault( + f => FileUtility.IsEqualFileName(f.FileName, e.FileName) + ); + } + + if (file == null || file == this.PrimaryFile) + return; + + LoggingService.Info("Forms designer: Handling deletion of open designer code file '" + file.FileName + "'"); + + if (file == this.sourceCodeStorage.DesignerCodeFile) { + this.UnloadDesigner(); + this.sourceCodeStorage.DesignerCodeFile = null; + } + + // When any of our designer code files is deleted, + // remove the file from the file list so that + // the primary view is not closed because of this event. + this.Files.Remove(file); + this.sourceCodeStorage.RemoveFile(file); + } + #region Design surface manager (static) static readonly DesignSurfaceManager designSurfaceManager = new DesignSurfaceManager(); @@ -828,5 +913,34 @@ namespace ICSharpCode.FormsDesigner } #endregion + + #region Debugger event handling (to prevent designer reload while debugger is starting) + + void DebugStarting(object sender, EventArgs e) + { + if (designSurfaceManager.ActiveDesignSurface != this.DesignSurface || + !this.reloadPending) + return; + + // The designer loader does not reload immediately, + // but only when the Application.Idle event is raised. + // When the IsActiveViewContentChangedHandler has been called because of the + // layout change prior to starting the debugger, and it has + // initiated a reload because of a changed referenced assembly, + // the reload can interrupt the starting of the debugger. + // To prevent this, we explicitly raise the Idle event here. + LoggingService.Debug("Forms designer: DebugStarting raises the Idle event to force pending reload now"); + Application.DoEvents(); + Cursor oldCursor = Cursor.Current; + Cursor.Current = Cursors.WaitCursor; + try { + Application.RaiseIdle(EventArgs.Empty); + Application.DoEvents(); + } finally { + Cursor.Current = oldCursor; + } + } + + #endregion } } diff --git a/src/AddIns/Misc/CodeAnalysis/Src/FxCopRule.cs b/src/AddIns/Misc/CodeAnalysis/Src/FxCopRule.cs index 02b1734cb9..be7f21704b 100644 --- a/src/AddIns/Misc/CodeAnalysis/Src/FxCopRule.cs +++ b/src/AddIns/Misc/CodeAnalysis/Src/FxCopRule.cs @@ -10,6 +10,7 @@ using System.Collections.Generic; namespace ICSharpCode.CodeAnalysis { + [Serializable] public class FxCopRule : IComparable { readonly string checkId; @@ -73,6 +74,7 @@ namespace ICSharpCode.CodeAnalysis } } + [Serializable] public class FxCopCategory { readonly string name; diff --git a/src/AddIns/Misc/CodeAnalysis/Src/FxCopWrapper.cs b/src/AddIns/Misc/CodeAnalysis/Src/FxCopWrapper.cs index b2b63447f1..8a7bb76e35 100644 --- a/src/AddIns/Misc/CodeAnalysis/Src/FxCopWrapper.cs +++ b/src/AddIns/Misc/CodeAnalysis/Src/FxCopWrapper.cs @@ -16,7 +16,7 @@ using Microsoft.Win32; namespace ICSharpCode.CodeAnalysis { - public static class FxCopWrapper + public class FxCopWrapper : MarshalByRefObject { static Dictionary<string[], List<FxCopCategory>> ruleDict = new Dictionary<string[], List<FxCopCategory>>(new ArrayHashCodeProvider()); @@ -178,20 +178,24 @@ namespace ICSharpCode.CodeAnalysis setup.ApplicationBase = fxCopPath; AppDomain domain = AppDomain.CreateDomain("FxCop Rule Loading Domain", AppDomain.CurrentDomain.Evidence, setup); - string[][] ruleTextList; + ResolveEventHandler onResolve = delegate(object sender, ResolveEventArgs args) { + if (args.Name == typeof(FxCopWrapper).Assembly.FullName) { + return typeof(FxCopWrapper).Assembly; + } else { + return null; + } + }; + FxCopRule[] ruleList; try { - ruleTextList = (string[][])AppDomainLaunchHelper.LaunchInAppDomain(domain, typeof(FxCopWrapper), "GetRuleListInCurrentAppDomain", fxCopPath, ruleAssemblies); + AppDomain.CurrentDomain.AssemblyResolve += onResolve; + FxCopWrapper wrapper = (FxCopWrapper)domain.CreateInstanceFromAndUnwrap(typeof(FxCopWrapper).Assembly.Location, typeof(FxCopWrapper).FullName); + + ruleList = wrapper.GetRuleListInstanceMethod(fxCopPath, ruleAssemblies); } finally { + AppDomain.CurrentDomain.AssemblyResolve -= onResolve; AppDomain.Unload(domain); } - FxCopRule[] ruleList = new FxCopRule[ruleTextList.Length]; - for (int i = 0; i < ruleTextList.Length; i++) { - ruleList[i] = new FxCopRule(ruleTextList[i][0], ruleTextList[i][1], - ruleTextList[i][2], ruleTextList[i][3], - ruleTextList[i][4]); - } - Array.Sort(ruleList); List<FxCopCategory> rules = new List<FxCopCategory>(); lock (ruleDict) { @@ -236,7 +240,7 @@ namespace ICSharpCode.CodeAnalysis return v.ToString(); } - public static string[][] GetRuleListInCurrentAppDomain(string fxCopPath, string[] ruleAssemblies) + FxCopRule[] GetRuleListInstanceMethod(string fxCopPath, string[] ruleAssemblies) { Assembly asm = Assembly.LoadFrom(Path.Combine(fxCopPath, "FxCopCommon.dll")); @@ -253,20 +257,21 @@ namespace ICSharpCode.CodeAnalysis object exceptionList = CallMethod(project, "Initialize"); foreach (Exception ex in ((IEnumerable)exceptionList)) { - LoggingService.Warn(ex); + Console.WriteLine(ex.ToString()); } IEnumerable ruleList = (IEnumerable)GetProp(GetProp(project, "AllRules"), "Values"); - List<string[]> rules = new List<string[]>(); + + List<FxCopRule> rules = new List<FxCopRule>(); foreach (object ruleContainer in ruleList) { object rule = GetProp(ruleContainer, "IRule"); - rules.Add(new string[] { - GetSProp(rule, "CheckId"), - GetSProp(rule, "Name"), - GetSProp(rule, "Category"), - GetSProp(rule, "Description"), - GetSProp(rule, "Url") - }); + rules.Add(new FxCopRule( + GetSProp(rule, "CheckId"), + GetSProp(rule, "Name"), + GetSProp(rule, "Category"), + GetSProp(rule, "Description"), + GetSProp(rule, "Url") + )); } return rules.ToArray(); diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/WatchPad.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/WatchPad.cs index 90680b84d9..ba1c525465 100644 --- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/WatchPad.cs +++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/WatchPad.cs @@ -45,6 +45,14 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads } } + public class ErrorInfoNode : ICorDebug.InfoNode + { + public ErrorInfoNode(string name, string text) : base(name, text) + { + Image = IconService.GetBitmap("Icons.16x16.Error"); + } + } + public sealed class WatchItemName: NodeTextBox { public WatchItemName() { @@ -240,7 +248,9 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads nodes.Add(new TreeViewVarNode(debuggedProcess, watchList, valNode)); } catch (GetValueException) { - MessageService.ShowError(string.Format(StringParser.Parse("${res:MainWindow.Windows.Debug.Watch.InvalidExpression}"), nod.Content.Name)); + string error = String.Format(StringParser.Parse("${res:MainWindow.Windows.Debug.Watch.InvalidExpression}"), nod.Content.Name); + ErrorInfoNode infoNode = new ErrorInfoNode(nod.Content.Name, error); + nodes.Add(new TreeViewVarNode(debuggedProcess, watchList, infoNode)); } } diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/TreeModel/ValueNode.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/TreeModel/ValueNode.cs index af43744872..a66ef87d53 100644 --- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/TreeModel/ValueNode.cs +++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/TreeModel/ValueNode.cs @@ -88,6 +88,8 @@ namespace Debugger.AddIn.TreeModel this.Text = val.AsString; } + this.Text = (this.Text.Length > 256) ? this.Text.Substring(0, 256) + "..." : this.Text; + if (val.Type != null) { this.Type = val.Type.Name; } else { diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Wrappers/Util.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Wrappers/Util.cs index d14d0d382b..2faa745c7a 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Wrappers/Util.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Wrappers/Util.cs @@ -12,7 +12,7 @@ using System.Runtime.InteropServices; namespace Debugger.Wrappers { - public delegate void UnmanagedStringGetter(uint pStringLenght, out uint stringLenght, System.IntPtr pString); + public delegate void UnmanagedStringGetter(uint pStringLength, out uint stringLength, System.IntPtr pString); public static class Util { @@ -21,25 +21,32 @@ namespace Debugger.Wrappers return GetString(getter, 64, true); } - public static string GetString(UnmanagedStringGetter getter, uint defaultLenght, bool trim) + public static string GetString(UnmanagedStringGetter getter, uint defaultLength, bool trim) { + const uint MAX_LENGTH = 1024 * 1024; string managedString; IntPtr unmanagedString; - uint exactLenght; + uint exactLength; // First attempt - unmanagedString = Marshal.AllocHGlobal((int)defaultLenght * 2 + 2); // + 2 for terminating zero - getter(defaultLenght, out exactLenght, defaultLenght > 0 ? unmanagedString : IntPtr.Zero); + unmanagedString = Marshal.AllocHGlobal((int)defaultLength * 2 + 2); // + 2 for terminating zero + getter(defaultLength, out exactLength, defaultLength > 0 ? unmanagedString : IntPtr.Zero); - if(exactLenght > defaultLenght) { + exactLength = (exactLength > MAX_LENGTH) ? MAX_LENGTH : exactLength; + + if(exactLength > defaultLength) { // Second attempt Marshal.FreeHGlobal(unmanagedString); - unmanagedString = Marshal.AllocHGlobal((int)exactLenght * 2 + 2); // + 2 for terminating zero - getter(exactLenght, out exactLenght, unmanagedString); + // TODO: Consider removing "+ 2" for the zero + unmanagedString = Marshal.AllocHGlobal((int)exactLength * 2 + 2); // + 2 for terminating zero + uint unused; + getter(exactLength, out unused, unmanagedString); } + // TODO: Check how the trimming and the last 0 charater works + // Return managed string and free unmanaged memory - managedString = Marshal.PtrToStringUni(unmanagedString, (int)exactLenght); + managedString = Marshal.PtrToStringUni(unmanagedString, (int)exactLength); //Console.WriteLine("Marshaled string from COM: \"" + managedString + "\" lenght=" + managedString.Length + " arrayLenght=" + exactLenght); // The API might or might not include terminating null at the end if (trim) { diff --git a/src/AddIns/Misc/HtmlHelp2/Project/src/Commands/ShowErrorHelpCommand.cs b/src/AddIns/Misc/HtmlHelp2/Project/src/Commands/ShowErrorHelpCommand.cs index 80d6e86d4b..553d909ad8 100644 --- a/src/AddIns/Misc/HtmlHelp2/Project/src/Commands/ShowErrorHelpCommand.cs +++ b/src/AddIns/Misc/HtmlHelp2/Project/src/Commands/ShowErrorHelpCommand.cs @@ -4,6 +4,7 @@ // <owner name="Siegfried Pammer" email="sie_pam@gmx.at"/> // <version>$Revision: 3555 $</version> // </file> + using MSHelpServices; using System; using System.Collections.Generic; @@ -15,7 +16,7 @@ using ICSharpCode.SharpDevelop.Gui; namespace HtmlHelp2.Commands { /// <summary> - /// Description of ShowErrorHelpCommand + /// Shows help information for an error in the Errors window. /// </summary> public class ShowErrorHelpCommand : AbstractMenuCommand { @@ -27,8 +28,7 @@ namespace HtmlHelp2.Commands ICSharpCode.SharpDevelop.Gui.TaskView view = (ICSharpCode.SharpDevelop.Gui.TaskView)Owner; // Search all selected tasks - foreach (Task t in new List<Task>(view.SelectedTasks)) - { + foreach (Task t in new List<Task>(view.SelectedTasks)) { string code = t.BuildError.ErrorCode; if (string.IsNullOrEmpty(code)) @@ -38,8 +38,7 @@ namespace HtmlHelp2.Commands MSHelpServices.IHxTopic topic; // If HtmlHelp2 AddIn is initialised correctly we can start! - if (HtmlHelp2.Environment.HtmlHelp2Environment.SessionIsInitialized) - { + if (HtmlHelp2.Environment.HtmlHelp2Environment.SessionIsInitialized) { // Get the topic IHxIndex index = HtmlHelp2.Environment.HtmlHelp2Environment.GetIndex(""); if (index == null) { @@ -47,6 +46,10 @@ namespace HtmlHelp2.Commands return; } int indexSlot = index.GetSlotFromString(code); + if (indexSlot <= 0) { + MessageService.ShowErrorFormatted("No help available for {0}!", code); + return; + } IHxTopicList list = index.GetTopicsFromSlot(indexSlot); if (list == null) { MessageService.ShowErrorFormatted("No help available for {0}!", code); @@ -62,9 +65,7 @@ namespace HtmlHelp2.Commands MessageService.ShowErrorFormatted("No help available for {0}!", code); return; } - } - else // Otherwise we have to show an Error message ... - { + } else { // Otherwise we have to show an Error message ... LoggingService.Error("Couldn't initialize help database"); return; } diff --git a/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/RequiredLibraries/Reflector.IpcServer.AddIn.dll b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/RequiredLibraries/Reflector.IpcServer.AddIn.dll new file mode 100755 index 0000000000..97bb651b68 Binary files /dev/null and b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/RequiredLibraries/Reflector.IpcServer.AddIn.dll differ diff --git a/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/RequiredLibraries/Reflector.IpcServer.dll b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/RequiredLibraries/Reflector.IpcServer.dll new file mode 100755 index 0000000000..b4e046198e Binary files /dev/null and b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/RequiredLibraries/Reflector.IpcServer.dll differ diff --git a/src/AddIns/Misc/ResourceToolkit/Project/Src/Gui/UnusedResourceKeysViewContent.cs b/src/AddIns/Misc/ResourceToolkit/Project/Src/Gui/UnusedResourceKeysViewContent.cs index 19fddc7744..e8b18310c1 100644 --- a/src/AddIns/Misc/ResourceToolkit/Project/Src/Gui/UnusedResourceKeysViewContent.cs +++ b/src/AddIns/Misc/ResourceToolkit/Project/Src/Gui/UnusedResourceKeysViewContent.cs @@ -389,23 +389,32 @@ namespace Hornung.ResourceToolkit.Gui /// <param name="key">The key to be deleted.</param> protected static void DeleteResourceKey(string fileName, string key) { - IResourceFileContent content = ResourceFileContentRegistry.GetResourceFileContent(fileName); - if (content != null) { - if (content.ContainsKey(key)) { - LoggingService.Debug("ResourceToolkit: Remove key '"+key+"' from resource file '"+fileName+"'"); - content.RemoveKey(key); + try { + IResourceFileContent content = ResourceFileContentRegistry.GetResourceFileContent(fileName); + if (content != null) { + if (content.ContainsKey(key)) { + LoggingService.Debug("ResourceToolkit: Remove key '"+key+"' from resource file '"+fileName+"'"); + content.RemoveKey(key); + } else { + MessageService.ShowWarningFormatted("${res:Hornung.ResourceToolkit.KeyNotFoundWarning}", key, fileName); + } } else { - MessageService.ShowWarningFormatted("${res:Hornung.ResourceToolkit.KeyNotFoundWarning}", key, fileName); + MessageService.ShowWarning("ResoureToolkit: Could not get ResourceFileContent for '"+fileName+"' key +'"+key+"'."); } - } else { - MessageService.ShowWarning("ResoureToolkit: Could not get ResourceFileContent for '"+fileName+"' key +'"+key+"'."); + } catch (Exception ex) { + MessageService.ShowWarningFormatted("${res:Hornung.ResourceToolkit.ErrorProcessingResourceFile}" + Environment.NewLine + ex.Message, fileName); + return; } foreach (KeyValuePair<string, IResourceFileContent> entry in ResourceFileContentRegistry.GetLocalizedContents(fileName)) { LoggingService.Debug("ResourceToolkit: Looking in localized resource file: '"+entry.Value.FileName+"'"); - if (entry.Value.ContainsKey(key)) { - LoggingService.Debug("ResourceToolkit: -> Key found, removing."); - entry.Value.RemoveKey(key); + try { + if (entry.Value.ContainsKey(key)) { + LoggingService.Debug("ResourceToolkit: -> Key found, removing."); + entry.Value.RemoveKey(key); + } + } catch (Exception ex) { + MessageService.ShowWarningFormatted("${res:Hornung.ResourceToolkit.ErrorProcessingResourceFile}" + Environment.NewLine + ex.Message, entry.Value.FileName); } } } diff --git a/src/AddIns/Misc/ResourceToolkit/Project/Src/Refactoring/ResourceRefactoringService.cs b/src/AddIns/Misc/ResourceToolkit/Project/Src/Refactoring/ResourceRefactoringService.cs index 477823ce28..03f67198f1 100644 --- a/src/AddIns/Misc/ResourceToolkit/Project/Src/Refactoring/ResourceRefactoringService.cs +++ b/src/AddIns/Misc/ResourceToolkit/Project/Src/Refactoring/ResourceRefactoringService.cs @@ -308,23 +308,38 @@ namespace Hornung.ResourceToolkit.Refactoring monitor.BeginTask(null, 0, false); } - // rename references - // FIXME: RenameReferences does not enforce escaping rules. May be a problem if someone uses double-quotes in the new resource key name. - FindReferencesAndRenameHelper.RenameReferences(references, newKey); - - // rename definition (if present) - if (rrr.ResourceFileContent.ContainsKey(rrr.Key)) { - rrr.ResourceFileContent.RenameKey(rrr.Key, newKey); - } else { + try { + // rename definition (if present) + if (rrr.ResourceFileContent.ContainsKey(rrr.Key)) { + rrr.ResourceFileContent.RenameKey(rrr.Key, newKey); + } else { + if (monitor != null) monitor.ShowingDialog = true; + MessageService.ShowWarning("${res:Hornung.ResourceToolkit.RenameKeyDefinitionNotFoundWarning}"); + if (monitor != null) monitor.ShowingDialog = false; + } + } catch (Exception ex) { if (monitor != null) monitor.ShowingDialog = true; - MessageService.ShowWarning("${res:Hornung.ResourceToolkit.RenameKeyDefinitionNotFoundWarning}"); + MessageService.ShowWarningFormatted("${res:Hornung.ResourceToolkit.ErrorProcessingResourceFile}" + Environment.NewLine + ex.Message, rrr.ResourceFileContent.FileName); if (monitor != null) monitor.ShowingDialog = false; + if (monitor != null) monitor.Done(); + // Do not rename the references when renaming the definition failed. + return; } + // rename references + // FIXME: RenameReferences does not enforce escaping rules. May be a problem if someone uses double-quotes in the new resource key name. + FindReferencesAndRenameHelper.RenameReferences(references, newKey); + // rename definitions in localized resource files foreach (KeyValuePair<string, IResourceFileContent> entry in ResourceFileContentRegistry.GetLocalizedContents(rrr.FileName)) { - if (entry.Value.ContainsKey(rrr.Key)) { - entry.Value.RenameKey(rrr.Key, newKey); + try { + if (entry.Value.ContainsKey(rrr.Key)) { + entry.Value.RenameKey(rrr.Key, newKey); + } + } catch (Exception ex) { + if (monitor != null) monitor.ShowingDialog = true; + MessageService.ShowWarningFormatted("${res:Hornung.ResourceToolkit.ErrorProcessingResourceFile}" + Environment.NewLine + ex.Message, entry.Value.FileName); + if (monitor != null) monitor.ShowingDialog = false; } } diff --git a/src/AddIns/Misc/SearchAndReplace/Project/Commands/SearchToolbarCommands.cs b/src/AddIns/Misc/SearchAndReplace/Project/Commands/SearchToolbarCommands.cs index e5a9e11b1c..738bef2e9b 100644 --- a/src/AddIns/Misc/SearchAndReplace/Project/Commands/SearchToolbarCommands.cs +++ b/src/AddIns/Misc/SearchAndReplace/Project/Commands/SearchToolbarCommands.cs @@ -61,7 +61,7 @@ namespace SearchAndReplace protected override void OnOwnerChanged(EventArgs e) { base.OnOwnerChanged(e); - comboBox = (ComboBox)Owner; + comboBox = (ComboBox)base.ComboBox; comboBox.IsEditable = true; comboBox.KeyDown += OnKeyPress; comboBox.Width = 130; diff --git a/src/AddIns/Misc/SharpRefactoring/Src/CSharpMethodExtractor.cs b/src/AddIns/Misc/SharpRefactoring/Src/CSharpMethodExtractor.cs index 1eeba16840..bfde221c2d 100644 --- a/src/AddIns/Misc/SharpRefactoring/Src/CSharpMethodExtractor.cs +++ b/src/AddIns/Misc/SharpRefactoring/Src/CSharpMethodExtractor.cs @@ -4,17 +4,16 @@ // <owner name="Siegfried Pammer" email="sie_pam@gmx.at"/> // <version>$Revision: 3287 $</version> // </file> -using ICSharpCode.SharpDevelop; using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; + using ICSharpCode.Core; using ICSharpCode.NRefactory; using ICSharpCode.NRefactory.Ast; -using ICSharpCode.NRefactory.AstBuilder; using ICSharpCode.NRefactory.PrettyPrinter; using ICSharpCode.NRefactory.Visitors; +using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Dom.NRefactoryResolver; using ICSharpCode.SharpDevelop.Project; using ICSharpCode.TextEditor.Document; @@ -27,7 +26,7 @@ namespace SharpRefactoring public class CSharpMethodExtractor : MethodExtractorBase { public CSharpMethodExtractor(ICSharpCode.TextEditor.TextEditorControl textEditor, ISelection selection) - : base(textEditor, selection, new CSharpOutputVisitor()) + : base(textEditor, selection) { } @@ -49,7 +48,7 @@ namespace SharpRefactoring parser.Parse(); if (parser.Errors.Count > 0) { - MessageService.ShowError("Errors occured during parsing! Cannot extract a new method!"); + MessageService.ShowError("${res:AddIns.SharpRefactoring.ExtractMethod.ParseErrors}"); return false; } @@ -72,7 +71,7 @@ namespace SharpRefactoring this.parentNode = GetParentMember(this.currentSelection.StartPosition.Line, this.currentSelection.StartPosition.Column, this.currentSelection.EndPosition.Line, this.currentSelection.EndPosition.Column); if (parentNode == null) { - MessageService.ShowError("Invalid selection! Please select a valid range."); + MessageService.ShowError("${res:AddIns.SharpRefactoring.ExtractMethod.InvalidSelection}"); return false; } @@ -116,16 +115,25 @@ namespace SharpRefactoring Location end = new Location(this.currentSelection.EndPosition.Column + 1, this.currentSelection.EndPosition.Line + 1); foreach (KeyValuePair<string, List<LocalLookupVariable>> pair in ltv.Variables) { - foreach (LocalLookupVariable variable in pair.Value) { + foreach (LocalLookupVariable v in pair.Value) { + Variable variable = new Variable(v); if (variable.StartPos > end || variable.EndPos < start) continue; + variable.IsReferenceType = true; // TODO : implement check for reference type + + if (variable.Type.Type == "var") { + Dom.ParseInformation info = ParserService.GetParseInformation(this.textEditor.FileName); + Dom.ExpressionResult res = new Dom.ExpressionResult(variable.Name, Dom.DomRegion.FromLocation(variable.StartPos, variable.EndPos), Dom.ExpressionContext.Default, null); + Dom.ResolveResult result = this.GetResolver().Resolve(res, info, this.textEditor.Document.TextContent); + variable.Type = Dom.Refactoring.CodeGenerator.ConvertType(result.ResolvedType, new Dom.ClassFinder(result.CallingMember)); + } + if (IsInSel(variable.StartPos, this.currentSelection) && HasOccurrencesAfter(true, this.parentNode, new Location(this.currentSelection.EndPosition.Column + 1, this.currentSelection.EndPosition.Line + 1), variable.Name, variable.StartPos, variable.EndPos)) { - possibleReturnValues.Add(new VariableDeclaration(variable.Name, variable.Initializer, variable.TypeRef)); - otherReturnValues.Add(new VariableDeclaration(variable.Name, variable.Initializer, variable.TypeRef)); + possibleReturnValues.Add(new VariableDeclaration(variable.Name, variable.Initializer, variable.Type)); + otherReturnValues.Add(new VariableDeclaration(variable.Name, variable.Initializer, variable.Type)); } - FindReferenceVisitor frv = new FindReferenceVisitor(true, variable.Name, start, end); parentNode.AcceptVisitor(frv, null); @@ -137,18 +145,18 @@ namespace SharpRefactoring bool getsAssigned = pair.Value.Count > 0; if (hasOccurrencesAfter && isInitialized) - newMethod.Parameters.Add(new ParameterDeclarationExpression(variable.TypeRef, variable.Name, ParameterModifiers.Ref)); + newMethod.Parameters.Add(new ParameterDeclarationExpression(variable.Type, variable.Name, ParameterModifiers.Ref)); else { if (hasOccurrencesAfter && hasAssignment) - newMethod.Parameters.Add(new ParameterDeclarationExpression(variable.TypeRef, variable.Name, ParameterModifiers.Out)); + newMethod.Parameters.Add(new ParameterDeclarationExpression(variable.Type, variable.Name, ParameterModifiers.Out)); else { if (!hasOccurrencesAfter && getsAssigned) - newMethod.Parameters.Add(new ParameterDeclarationExpression(variable.TypeRef, variable.Name, ParameterModifiers.None)); + newMethod.Parameters.Add(new ParameterDeclarationExpression(variable.Type, variable.Name, ParameterModifiers.None)); else { if (!hasOccurrencesAfter && !isInitialized) - newMethod.Body.Children.Insert(0, new LocalVariableDeclaration(new VariableDeclaration(variable.Name, variable.Initializer, variable.TypeRef))); + newMethod.Body.Children.Insert(0, new LocalVariableDeclaration(new VariableDeclaration(variable.Name, variable.Initializer, variable.Type))); else - newMethod.Parameters.Add(new ParameterDeclarationExpression(variable.TypeRef, variable.Name, ParameterModifiers.In)); + newMethod.Parameters.Add(new ParameterDeclarationExpression(variable.Type, variable.Name, ParameterModifiers.In)); } } } @@ -177,9 +185,21 @@ namespace SharpRefactoring CreateReturnStatement(newMethod, possibleReturnValues); + newMethod.Name = "NewMethod"; + this.extractedMethod = newMethod; return true; } + + public override IOutputAstVisitor GetOutputVisitor() + { + return new CSharpOutputVisitor(); + } + + public override Dom.IResolver GetResolver() + { + return new NRefactoryResolver(Dom.LanguageProperties.CSharp); + } } } diff --git a/src/AddIns/Misc/SharpRefactoring/Src/ExtractMethodCommand.cs b/src/AddIns/Misc/SharpRefactoring/Src/ExtractMethodCommand.cs index e640723683..e7aec5fe42 100644 --- a/src/AddIns/Misc/SharpRefactoring/Src/ExtractMethodCommand.cs +++ b/src/AddIns/Misc/SharpRefactoring/Src/ExtractMethodCommand.cs @@ -5,7 +5,6 @@ // <version>$Revision$</version> // </file> -using ICSharpCode.TextEditor; using System; using System.Collections.Generic; using System.IO; @@ -20,6 +19,7 @@ using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Refactoring; +using ICSharpCode.TextEditor; using ICSharpCode.TextEditor.Document; using SharpRefactoring.Forms; using SharpRefactoring.Transformers; @@ -36,7 +36,7 @@ namespace SharpRefactoring MethodExtractorBase extractor = GetCurrentExtractor(textEditor); if (extractor != null) { if (extractor.Extract()) { - ExtractMethodForm form = new ExtractMethodForm("NewMethod", extractor.CreatePreview()); + ExtractMethodForm form = new ExtractMethodForm(extractor.ExtractedMethod, new Func<IOutputAstVisitor>(extractor.GetOutputVisitor)); if (form.ShowDialog() == DialogResult.OK) { extractor.ExtractedMethod.Name = form.Text; @@ -54,11 +54,11 @@ namespace SharpRefactoring MethodExtractorBase GetCurrentExtractor(TextEditorControl editor) { - switch (ProjectService.CurrentProject.Language) { + switch (LanguageBindingService.GetCodonPerCodeFileName(editor.FileName).Language) { case "C#": return new CSharpMethodExtractor(editor, editor.ActiveTextAreaControl.SelectionManager.SelectionCollection[0]); default: - MessageService.ShowError(string.Format(StringParser.Parse("${res:AddIns.SharpRefactoring.ExtractMethodNotSupported}"), ProjectService.CurrentProject.Language)); + MessageService.ShowError(string.Format(StringParser.Parse("${res:AddIns.SharpRefactoring.ExtractMethodNotSupported}"), LanguageBindingService.GetCodonPerCodeFileName(editor.FileName).Language)); return null; } } diff --git a/src/AddIns/Misc/SharpRefactoring/Src/Forms/ExtractMethodForm.Designer.cs b/src/AddIns/Misc/SharpRefactoring/Src/Forms/ExtractMethodForm.Designer.cs index 5431897823..7fdfd906e2 100644 --- a/src/AddIns/Misc/SharpRefactoring/Src/Forms/ExtractMethodForm.Designer.cs +++ b/src/AddIns/Misc/SharpRefactoring/Src/Forms/ExtractMethodForm.Designer.cs @@ -1,11 +1,9 @@ -/* - * Erstellt mit SharpDevelop. - * Benutzer: HP - * Datum: 12.11.2007 - * Zeit: 18:46 - * - * Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern. - */ +// <file> +// <copyright see="prj:///doc/copyright.txt"/> +// <license see="prj:///doc/license.txt"/> +// <owner name="Siegfried Pammer" email="sie_pam@gmx.at"/> +// <version>$Revision$</version> +// </file> namespace SharpRefactoring.Forms { partial class ExtractMethodForm @@ -36,109 +34,109 @@ namespace SharpRefactoring.Forms /// </summary> private void InitializeComponent() { - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.txtName = new System.Windows.Forms.TextBox(); - this.txtPreview = new System.Windows.Forms.TextBox(); - this.btnCancel = new System.Windows.Forms.Button(); - this.btnOK = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // label1 - // - this.label1.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.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 9); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(167, 13); - this.label1.TabIndex = 0; - this.label1.Text = "Enter a name for the new method:"; - // - // label2 - // - this.label2.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.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(12, 48); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(48, 13); - this.label2.TabIndex = 1; - this.label2.Text = "Preview:"; - // - // txtName - // - this.txtName.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.txtName.Location = new System.Drawing.Point(12, 25); - this.txtName.Name = "txtName"; - this.txtName.Size = new System.Drawing.Size(467, 20); - this.txtName.TabIndex = 2; - this.txtName.TextChanged += new System.EventHandler(this.txtName_TextChanged); - // - // txtPreview - // - this.txtPreview.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.txtPreview.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtPreview.Location = new System.Drawing.Point(12, 64); - this.txtPreview.Multiline = true; - this.txtPreview.Name = "txtPreview"; - this.txtPreview.ReadOnly = true; - this.txtPreview.Size = new System.Drawing.Size(467, 151); - this.txtPreview.TabIndex = 3; - // - // btnCancel - // - this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Location = new System.Drawing.Point(404, 221); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(75, 23); - this.btnCancel.TabIndex = 4; - this.btnCancel.Text = "Cancel"; - this.btnCancel.UseVisualStyleBackColor = true; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // btnOK - // - this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnOK.Location = new System.Drawing.Point(323, 221); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(75, 23); - this.btnOK.TabIndex = 5; - this.btnOK.Text = "OK"; - this.btnOK.UseVisualStyleBackColor = true; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // ExtractMethodForm - // - this.AcceptButton = this.btnOK; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.btnCancel; - this.ClientSize = new System.Drawing.Size(491, 252); - this.Controls.Add(this.btnOK); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.txtPreview); - this.Controls.Add(this.txtName); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "ExtractMethodForm"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Extract Method"; - this.ResumeLayout(false); - this.PerformLayout(); - + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.txtName = new System.Windows.Forms.TextBox(); + this.txtPreview = new System.Windows.Forms.TextBox(); + this.btnCancel = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // label1 + // + this.label1.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.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(167, 13); + this.label1.TabIndex = 0; + this.label1.Text = "${res:AddIns.SharpRefactoring.ExtractMethod.EnterName}:"; + // + // label2 + // + this.label2.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.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(12, 48); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(48, 13); + this.label2.TabIndex = 1; + this.label2.Text = "${res:AddIns.SharpRefactoring.ExtractMethod.Preview}:"; + // + // txtName + // + this.txtName.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.txtName.Location = new System.Drawing.Point(12, 25); + this.txtName.Name = "txtName"; + this.txtName.Size = new System.Drawing.Size(467, 20); + this.txtName.TabIndex = 2; + this.txtName.TextChanged += new System.EventHandler(this.txtNameTextChanged); + // + // txtPreview + // + this.txtPreview.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.txtPreview.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtPreview.Location = new System.Drawing.Point(12, 64); + this.txtPreview.Multiline = true; + this.txtPreview.Name = "txtPreview"; + this.txtPreview.ReadOnly = true; + this.txtPreview.Size = new System.Drawing.Size(467, 151); + this.txtPreview.TabIndex = 3; + // + // btnCancel + // + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(404, 221); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 23); + this.btnCancel.TabIndex = 4; + this.btnCancel.Text = "${res:Global.CancelButtonText}"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancelClick); + // + // btnOK + // + this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnOK.Location = new System.Drawing.Point(323, 221); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(75, 23); + this.btnOK.TabIndex = 5; + this.btnOK.Text = "${res:Global.OKButtonText}"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler(this.btnOKClick); + // + // ExtractMethodForm + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(491, 252); + this.Controls.Add(this.btnOK); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.txtPreview); + this.Controls.Add(this.txtName); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ExtractMethodForm"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "${res:AddIns.SharpRefactoring.ExtractMethod}"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ExtractMethodFormFormClosing); + this.ResumeLayout(false); + this.PerformLayout(); } private System.Windows.Forms.Label label1; diff --git a/src/AddIns/Misc/SharpRefactoring/Src/Forms/ExtractMethodForm.cs b/src/AddIns/Misc/SharpRefactoring/Src/Forms/ExtractMethodForm.cs index f89013bcbf..2ac5fd05ed 100644 --- a/src/AddIns/Misc/SharpRefactoring/Src/Forms/ExtractMethodForm.cs +++ b/src/AddIns/Misc/SharpRefactoring/Src/Forms/ExtractMethodForm.cs @@ -1,16 +1,18 @@ -/* - * Erstellt mit SharpDevelop. - * Benutzer: HP - * Datum: 12.11.2007 - * Zeit: 18:46 - * - * Sie k�nnen diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader �ndern. - */ - +// <file> +// <copyright see="prj:///doc/copyright.txt"/> +// <license see="prj:///doc/license.txt"/> +// <owner name="Siegfried Pammer" email="sie_pam@gmx.at"/> +// <version>$Revision$</version> +// </file> +using ICSharpCode.Core; using System; -using System.Drawing; +using System.Collections.Generic; +using System.Linq; using System.Windows.Forms; -using ICSharpCode.Core; +using ICSharpCode.NRefactory; +using ICSharpCode.NRefactory.Ast; +using ICSharpCode.NRefactory.PrettyPrinter; +using ICSharpCode.SharpDevelop.Refactoring; namespace SharpRefactoring.Forms { @@ -19,44 +21,68 @@ namespace SharpRefactoring.Forms /// </summary> public partial class ExtractMethodForm : Form { - public ExtractMethodForm(string name, string preview) + Func<IOutputAstVisitor> generator; + MethodDeclaration declaration; + BlockStatement body; + bool cancelUnload = false; + + public ExtractMethodForm(MethodDeclaration declaration, Func<IOutputAstVisitor> generator) { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); - - this.txtName.Text = name; - this.txtPreview.Text = preview; - txtName_TextChanged(null, EventArgs.Empty); - - this.txtName.SelectAll(); + SetTranslation(this); + + this.declaration = declaration; + this.generator = generator; + IOutputAstVisitor visitor = this.generator.Invoke(); + body = declaration.Body; + declaration.Body = new BlockStatement(); + + declaration.AcceptVisitor(visitor, null); + + this.txtName.Text = this.declaration.Name; + this.txtPreview.Text = visitor.Text; + + this.txtName.SelectAll(); + } + + void SetTranslation(Control c) + { + c.Text = StringParser.Parse(c.Text); + foreach (Control ctrl in c.Controls) + SetTranslation(ctrl); } - private void btnOK_Click(object sender, EventArgs e) - { - this.Text = this.txtName.Text; - this.DialogResult = DialogResult.OK; - } - - private void btnCancel_Click(object sender, EventArgs e) - { - this.DialogResult = DialogResult.Cancel; - } - - private void txtName_TextChanged(object sender, EventArgs e) - { - string text = this.txtPreview.Text; - - if (string.IsNullOrEmpty(text)) - return; + void btnOKClick(object sender, EventArgs e) + { + if (FindReferencesAndRenameHelper.CheckName(this.txtName.Text, string.Empty)) { + this.Text = this.txtName.Text; + this.DialogResult = DialogResult.OK; + this.declaration.Body = body; + cancelUnload = false; + } else + cancelUnload = true; + } - string afterName = text.Substring(text.IndexOf('(')); - - string type = text.Split(' ')[0]; + void btnCancelClick(object sender, EventArgs e) + { + this.DialogResult = DialogResult.Cancel; + } - this.txtPreview.Text = type + " " + this.txtName.Text + afterName; - } + void txtNameTextChanged(object sender, EventArgs e) + { + declaration.Name = this.txtName.Text; + IOutputAstVisitor visitor = this.generator.Invoke(); + declaration.AcceptVisitor(visitor, null); + this.txtPreview.Text = visitor.Text; + } + + void ExtractMethodFormFormClosing(object sender, FormClosingEventArgs e) + { + e.Cancel = cancelUnload; + } } } diff --git a/src/AddIns/Misc/SharpRefactoring/Src/MethodExtractorBase.cs b/src/AddIns/Misc/SharpRefactoring/Src/MethodExtractorBase.cs index 910961b0f8..87dfe44c4b 100644 --- a/src/AddIns/Misc/SharpRefactoring/Src/MethodExtractorBase.cs +++ b/src/AddIns/Misc/SharpRefactoring/Src/MethodExtractorBase.cs @@ -9,13 +9,13 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Text; - using ICSharpCode.Core; using ICSharpCode.NRefactory; using ICSharpCode.NRefactory.Ast; using ICSharpCode.NRefactory.PrettyPrinter; using ICSharpCode.NRefactory.Visitors; using ICSharpCode.SharpDevelop; +using ICSharpCode.SharpDevelop.Dom.NRefactoryResolver; using ICSharpCode.SharpDevelop.Project; using ICSharpCode.TextEditor; using ICSharpCode.TextEditor.Document; @@ -27,7 +27,7 @@ namespace SharpRefactoring /// <summary> /// Description of MethodExtractorBase. /// </summary> - public class MethodExtractorBase + public abstract class MethodExtractorBase { protected ICSharpCode.TextEditor.TextEditorControl textEditor; protected ISelection currentSelection; @@ -36,7 +36,6 @@ namespace SharpRefactoring protected ParametrizedNode parentNode; protected Statement caller; protected List<LocalVariableDeclaration> beforeCallDeclarations; - protected IOutputAstVisitor output; protected VariableDeclaration returnedVariable; protected List<ISpecial> specialsList; @@ -51,12 +50,11 @@ namespace SharpRefactoring get { return extractedMethod; } } - public MethodExtractorBase(ICSharpCode.TextEditor.TextEditorControl textEditor, ISelection selection, IOutputAstVisitor output) + public MethodExtractorBase(ICSharpCode.TextEditor.TextEditorControl textEditor, ISelection selection) { this.currentDocument = textEditor.Document; this.textEditor = textEditor; this.currentSelection = selection; - this.output = output; } protected static Statement CreateCaller(ParametrizedNode parent, MethodDeclaration method, VariableDeclaration returnVariable) @@ -64,7 +62,7 @@ namespace SharpRefactoring Statement caller; InvocationExpression expr = new InvocationExpression(new IdentifierExpression(method.Name), CreateArgumentExpressions(method.Parameters)); - if (method.TypeReference.Type != "void") { + if (method.TypeReference.Type != "System.Void") { if (parent is MethodDeclaration) { if (method.TypeReference == (parent as MethodDeclaration).TypeReference) caller = new ReturnStatement(expr); @@ -100,24 +98,12 @@ namespace SharpRefactoring newMethod.Body.Children.Add(new ReturnStatement(new IdentifierExpression(possibleReturnValues[possibleReturnValues.Count - 1].Name))); this.returnedVariable = possibleReturnValues[possibleReturnValues.Count - 1]; } else { - newMethod.TypeReference = new TypeReference("void"); + newMethod.TypeReference = new TypeReference("System.Void", true); this.returnedVariable = null; } } } - public string CreatePreview() - { - BlockStatement body = this.extractedMethod.Body; - this.extractedMethod.Body = new BlockStatement(); - - this.extractedMethod.AcceptVisitor(output, null); - - this.extractedMethod.Body = body; - - return output.Text; - } - public void InsertCall() { string call = GenerateCode(CreateCaller(this.parentNode, this.extractedMethod, this.returnedVariable), false); @@ -132,7 +118,9 @@ namespace SharpRefactoring public void InsertAfterCurrentMethod() { - using (SpecialNodesInserter.Install(this.specialsList, this.output)) { + IOutputAstVisitor outputVisitor = this.GetOutputVisitor(); + + using (SpecialNodesInserter.Install(this.specialsList, outputVisitor)) { string code = "\r\n\r\n" + GenerateCode(this.extractedMethod, true); code = code.TrimEnd('\r', '\n', ' ', '\t'); @@ -171,7 +159,7 @@ namespace SharpRefactoring parser.Parse(); if (parser.Errors.Count > 0) { - MessageService.ShowError("Invalid selection! Please select a valid range!"); + MessageService.ShowError("${res:AddIns.SharpRefactoring.ExtractMethod.InvalidSelection}"); } MethodDeclaration method = (MethodDeclaration)(parser.CompilationUnit.Children[0].Children[0]); @@ -272,7 +260,7 @@ namespace SharpRefactoring return false; } - protected bool IsInitializedVariable(bool caseSensitive, ParametrizedNode member, LocalLookupVariable variable) + protected bool IsInitializedVariable(bool caseSensitive, ParametrizedNode member, Variable variable) { if (!(variable.Initializer.IsNull)) { return true; @@ -291,21 +279,37 @@ namespace SharpRefactoring return false; } - protected static bool HasAssignment(MethodDeclaration method, LocalLookupVariable variable) + protected static bool HasAssignment(MethodDeclaration method, Variable variable) { - HasAssignmentsVisitor hav = new HasAssignmentsVisitor(variable.Name, variable.TypeRef, variable.StartPos, variable.EndPos); + HasAssignmentsVisitor hav = new HasAssignmentsVisitor(variable.Name, variable.Type, variable.StartPos, variable.EndPos); method.AcceptVisitor(hav, null); return hav.HasAssignment; } - - public virtual bool Extract() + public abstract IOutputAstVisitor GetOutputVisitor(); + + public abstract bool Extract(); + + public abstract Dom.IResolver GetResolver(); + } + + public class Variable { + public TypeReference Type { get; set; } + public string Name { get; set; } + public Location StartPos { get; set; } + public Location EndPos { get; set; } + public Expression Initializer { get; set; } + public bool IsReferenceType { get; set; } + + public Variable(LocalLookupVariable v) { - throw new InvalidOperationException("Cannot use plain MethodExtractor, please use a language specific implementation!"); + this.Type = v.TypeRef; + this.Name = v.Name; + this.StartPos = v.StartPos; + this.EndPos = v.EndPos; + this.Initializer = v.Initializer; } } - - } diff --git a/src/AddIns/Misc/SourceAnalysis/Src/AnalysisIdeOptionsPanel.cs b/src/AddIns/Misc/SourceAnalysis/Src/AnalysisIdeOptionsPanel.cs index ec343cdfec..420ac75cb6 100644 --- a/src/AddIns/Misc/SourceAnalysis/Src/AnalysisIdeOptionsPanel.cs +++ b/src/AddIns/Misc/SourceAnalysis/Src/AnalysisIdeOptionsPanel.cs @@ -62,7 +62,7 @@ namespace MattEverson.SourceAnalysis void ModifyStyleCopSettingsClick(object sender, EventArgs e) { var executable = Path.Combine(StyleCopWrapper.FindStyleCopPath(), "StyleCopSettingsEditor.exe"); - var parameters = StyleCopWrapper.GetMasterSettingsFile(); + var parameters = "\"" + StyleCopWrapper.GetMasterSettingsFile() + "\""; if (!File.Exists(executable)) { LoggingService.Debug("StyleCopSettingsEditor.exe: " + executable); diff --git a/src/Automated.proj b/src/Automated.proj index 2ce642a201..5f233d7960 100644 --- a/src/Automated.proj +++ b/src/Automated.proj @@ -106,6 +106,10 @@ <Move SourceFiles="$(SharpDevelopSrc)\setup\bin\SharpDevelop.msi" DestinationFiles="$(ArtefactsOutputDir)\$(ArtefactPrefix)$(BuildNumber).msi"/> + + <RemoveDir + Directories="$(SharpDevelopSrc)\setup\bin" /> + </Target> <Target Name="zipsource"> diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Xshd/V1Loader.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Xshd/V1Loader.cs index 793282cff5..88e3561e83 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Xshd/V1Loader.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Xshd/V1Loader.cs @@ -93,9 +93,9 @@ namespace ICSharpCode.AvalonEdit.Highlighting.Xshd return null; XshdColor color = new XshdColor(); if (element.HasAttribute("bold")) - color.FontWeight = bool.Parse(element.GetAttribute("bold")) ? FontWeights.Bold : FontWeights.Normal; + color.FontWeight = XmlConvert.ToBoolean(element.GetAttribute("bold")) ? FontWeights.Bold : FontWeights.Normal; if (element.HasAttribute("italic")) - color.FontStyle = bool.Parse(element.GetAttribute("italic")) ? FontStyles.Italic : FontStyles.Normal; + color.FontStyle = XmlConvert.ToBoolean(element.GetAttribute("italic")) ? FontStyles.Italic : FontStyles.Normal; if (element.HasAttribute("color")) color.Foreground = ParseColor(element.GetAttribute("color")); return color; diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Xshd/V2Loader.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Xshd/V2Loader.cs index 5312bc0e27..abe409ea73 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Xshd/V2Loader.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Xshd/V2Loader.cs @@ -94,7 +94,7 @@ namespace ICSharpCode.AvalonEdit.Highlighting.Xshd XshdRuleSet ruleSet = new XshdRuleSet(); SetPosition(ruleSet, reader); ruleSet.Name = reader.GetAttribute("name"); - ruleSet.IgnoreCase = GetBoolAttribute(reader, "ignoreCase"); + ruleSet.IgnoreCase = reader.GetBoolAttribute("ignoreCase"); CheckElementName(reader, ruleSet.Name); ParseElements(ruleSet.Elements, reader); @@ -139,21 +139,13 @@ namespace ICSharpCode.AvalonEdit.Highlighting.Xshd return import; } - static bool? GetBoolAttribute(XmlReader reader, string attributeName) - { - if (reader.GetAttribute(attributeName) == null) - return null; - else - return string.Equals(reader.GetAttribute(attributeName), "true", StringComparison.OrdinalIgnoreCase); - } - static XshdSpan ParseSpan(XmlReader reader) { XshdSpan span = new XshdSpan(); SetPosition(span, reader); span.BeginRegex = reader.GetAttribute("begin"); span.EndRegex = reader.GetAttribute("end"); - span.Multiline = GetBoolAttribute(reader, "multiline") ?? false; + span.Multiline = reader.GetBoolAttribute("multiline") ?? false; span.SpanColorReference = ParseColorReference(reader); span.RuleSetReference = ParseRuleSetReference(reader); if (!reader.IsEmptyElement) { @@ -275,9 +267,9 @@ namespace ICSharpCode.AvalonEdit.Highlighting.Xshd return color; } - internal static ColorConverter ColorConverter = new ColorConverter(); - internal static FontWeightConverter FontWeightConverter = new FontWeightConverter(); - internal static FontStyleConverter FontStyleConverter = new FontStyleConverter(); + internal readonly static ColorConverter ColorConverter = new ColorConverter(); + internal readonly static FontWeightConverter FontWeightConverter = new FontWeightConverter(); + internal readonly static FontStyleConverter FontStyleConverter = new FontStyleConverter(); static HighlightingBrush ParseForeground(IXmlLineInfo lineInfo, string foreground) { diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/ExtensionMethods.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/ExtensionMethods.cs index a3bf7310bb..bb1d97deea 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/ExtensionMethods.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/ExtensionMethods.cs @@ -103,7 +103,19 @@ namespace ICSharpCode.AvalonEdit.Utils public static bool? GetBoolAttribute(this XmlElement element, string attributeName) { XmlAttribute attr = element.GetAttributeNode(attributeName); - return attr != null ? (bool?)bool.Parse(attr.Value) : null; + return attr != null ? (bool?)XmlConvert.ToBoolean(attr.Value) : null; + } + + /// <summary> + /// Gets the value of the attribute as boolean, or null if the attribute does not exist. + /// </summary> + public static bool? GetBoolAttribute(this XmlReader reader, string attributeName) + { + string attributeValue = reader.GetAttribute(attributeName); + if (attributeValue == null) + return null; + else + return XmlConvert.ToBoolean(attributeValue); } /// <summary> diff --git a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/ICompletionData.cs b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/ICompletionData.cs index 8a174345bd..ba1c1143d2 100644 --- a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/ICompletionData.cs +++ b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/ICompletionData.cs @@ -66,7 +66,7 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow } } - public string Description { + public virtual string Description { get { return description; } @@ -89,6 +89,12 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow return false; } + public DefaultCompletionData(string text, int imageIndex) + { + this.text = text; + this.imageIndex = imageIndex; + } + public DefaultCompletionData(string text, string description, int imageIndex) { this.text = text; diff --git a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextAreaMouseHandler.cs b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextAreaMouseHandler.cs index 442495606d..e246924dd3 100644 --- a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextAreaMouseHandler.cs +++ b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextAreaMouseHandler.cs @@ -362,7 +362,11 @@ namespace ICSharpCode.TextEditor clickedOnSelectedText = true; } - textArea.SelectionManager.SetSelection(new DefaultSelection(textArea.TextView.Document, new TextLocation(marker.StartColumn, marker.StartLine), new TextLocation(marker.EndColumn, marker.EndLine))); + TextLocation startLocation = new TextLocation(marker.StartColumn, marker.StartLine); + TextLocation endLocation = new TextLocation(marker.EndColumn, marker.EndLine); + textArea.SelectionManager.SetSelection(new DefaultSelection(textArea.TextView.Document, startLocation, endLocation)); + textArea.Caret.Position = startLocation; + textArea.SetDesiredColumn(); textArea.Focus(); return; } @@ -450,6 +454,8 @@ namespace ICSharpCode.TextEditor int FindWordEnd(IDocument document, int offset) { LineSegment line = document.GetLineSegmentForOffset(offset); + if (line.Length == 0) + return offset; int endPos = line.Offset + line.Length; offset = Math.Min(offset, endPos - 1); diff --git a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextView.cs b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextView.cs index 5bdfb82fe3..d3c2407cc8 100644 --- a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextView.cs +++ b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextView.cs @@ -774,26 +774,35 @@ namespace ICSharpCode.TextEditor int result; using (Graphics g = textArea.CreateGraphics()) { - do { + // call GetLogicalColumnInternal to skip over text, + // then skip over fold markers + // and repeat as necessary. + // The loop terminates once the correct logical column is reached in + // GetLogicalColumnInternal or inside a fold marker. + while (true) { + LineSegment line = Document.GetLineSegment(lineNumber); FoldMarker nextFolding = FindNextFoldedFoldingOnLineAfterColumn(lineNumber, start-1); int end = nextFolding != null ? nextFolding.StartColumn : int.MaxValue; result = GetLogicalColumnInternal(g, line, start, end, ref posX, visualPosX); - if (result < 0) { - // reached fold marker - lineNumber = nextFolding.EndLine; - start = nextFolding.EndColumn; - int newPosX = posX + 1 + MeasureStringWidth(g, nextFolding.FoldText, TextEditorProperties.FontContainer.RegularFont); - if (newPosX >= visualPosX) { - inFoldMarker = nextFolding; - if (IsNearerToAThanB(visualPosX, posX, newPosX)) - return new TextLocation(nextFolding.StartColumn, nextFolding.StartLine); - else - return new TextLocation(nextFolding.EndColumn, nextFolding.EndLine); - } - posX = newPosX; + + // break when GetLogicalColumnInternal found the result column + if (result < end) + break; + + // reached fold marker + lineNumber = nextFolding.EndLine; + start = nextFolding.EndColumn; + int newPosX = posX + 1 + MeasureStringWidth(g, nextFolding.FoldText, TextEditorProperties.FontContainer.RegularFont); + if (newPosX >= visualPosX) { + inFoldMarker = nextFolding; + if (IsNearerToAThanB(visualPosX, posX, newPosX)) + return new TextLocation(nextFolding.StartColumn, nextFolding.StartLine); + else + return new TextLocation(nextFolding.EndColumn, nextFolding.EndLine); } - } while (result < 0); + posX = newPosX; + } } return new TextLocation(result, lineNumber); } @@ -801,7 +810,7 @@ namespace ICSharpCode.TextEditor int GetLogicalColumnInternal(Graphics g, LineSegment line, int start, int end, ref int drawingPos, int targetVisualPosX) { if (start == end) - return -1; + return end; Debug.Assert(start < end); Debug.Assert(drawingPos < targetVisualPosX); @@ -824,7 +833,7 @@ namespace ICSharpCode.TextEditor for (int i = 0; i < words.Count; i++) { TextWord word = words[i]; if (wordOffset >= end) { - return -1; + return wordOffset; } if (wordOffset + word.Length >= start) { int newDrawingPos; diff --git a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Util/TipPainter.cs b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Util/TipPainter.cs index acfd1afdea..cb2bb2f144 100644 --- a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Util/TipPainter.cs +++ b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Util/TipPainter.cs @@ -15,7 +15,6 @@ namespace ICSharpCode.TextEditor.Util { const float HorizontalBorder = 2; const float VerticalBorder = 1; - static RectangleF workingArea = RectangleF.Empty; //static StringFormat centerTipFormat = CreateTipStringFormat(); @@ -24,19 +23,22 @@ namespace ICSharpCode.TextEditor.Util return GetTipSize(control, graphics, new TipText (graphics, font, description)); } + static Rectangle GetWorkingArea(Control control) + { + Form ownerForm = control.FindForm(); + if (ownerForm.Owner != null) { + ownerForm = ownerForm.Owner; + } + + return Screen.GetWorkingArea(ownerForm); + } + public static Size GetTipSize(Control control, Graphics graphics, TipSection tipData) { Size tipSize = Size.Empty; SizeF tipSizeF = SizeF.Empty; - if (workingArea == RectangleF.Empty) { - Form ownerForm = control.FindForm(); - if (ownerForm.Owner != null) { - ownerForm = ownerForm.Owner; - } - - workingArea = Screen.GetWorkingArea(ownerForm); - } + RectangleF workingArea = GetWorkingArea(control); PointF screenLocation = control.PointToScreen(Point.Empty); @@ -68,14 +70,7 @@ namespace ICSharpCode.TextEditor.Util Size tipSize = Size.Empty; SizeF tipSizeF = SizeF.Empty; - if (workingArea == RectangleF.Empty) { - Form ownerForm = control.FindForm(); - if (ownerForm.Owner != null) { - ownerForm = ownerForm.Owner; - } - - workingArea = Screen.GetWorkingArea(ownerForm); - } + RectangleF workingArea = GetWorkingArea(control); PointF screenLocation = p; @@ -110,14 +105,7 @@ namespace ICSharpCode.TextEditor.Util PointF screenLocation = control.PointToScreen(Point.Empty); - if (workingArea == RectangleF.Empty) { - Form ownerForm = control.FindForm(); - if (ownerForm.Owner != null) { - ownerForm = ownerForm.Owner; - } - - workingArea = Screen.GetWorkingArea(ownerForm); - } + RectangleF workingArea = GetWorkingArea(control); SizeF maxLayoutSize = new SizeF(workingArea.Right - screenLocation.X - HorizontalBorder * 2, workingArea.Bottom - screenLocation.Y - VerticalBorder * 2); @@ -163,14 +151,7 @@ namespace ICSharpCode.TextEditor.Util PointF screenLocation = control.PointToScreen(new Point(control.Width, 0)); - if (workingArea == RectangleF.Empty) { - Form ownerForm = control.FindForm(); - if (ownerForm.Owner != null) { - ownerForm = ownerForm.Owner; - } - - workingArea = Screen.GetWorkingArea(ownerForm); - } + RectangleF workingArea = GetWorkingArea(control); SizeF maxLayoutSize = new SizeF(screenLocation.X - HorizontalBorder * 2, workingArea.Bottom - screenLocation.Y - VerticalBorder * 2); diff --git a/src/Libraries/Mono.Cecil/Mono.Cecil.dll b/src/Libraries/Mono.Cecil/Mono.Cecil.dll new file mode 100755 index 0000000000..e1efb58bd1 Binary files /dev/null and b/src/Libraries/Mono.Cecil/Mono.Cecil.dll differ diff --git a/src/Libraries/Mono.Cecil/readme.txt b/src/Libraries/Mono.Cecil/readme.txt new file mode 100644 index 0000000000..26defd6e05 --- /dev/null +++ b/src/Libraries/Mono.Cecil/readme.txt @@ -0,0 +1,24 @@ +See http://www.mono-project.com/Cecil + +* License + + Copyright (C) 2005 Jb Evain + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/Libraries/NRefactory/Project/Src/Ast/TypeReference.cs b/src/Libraries/NRefactory/Project/Src/Ast/TypeReference.cs index 2039b992f8..467bbae7c1 100644 --- a/src/Libraries/NRefactory/Project/Src/Ast/TypeReference.cs +++ b/src/Libraries/NRefactory/Project/Src/Ast/TypeReference.cs @@ -266,7 +266,7 @@ namespace ICSharpCode.NRefactory.Ast this.Type = type; } - [Obsolete("Type and SystemType are no longer distinguised - use the (string type, bool isKeyword) constructor instead!")] + [Obsolete("Type and SystemType are no longer distinguished - use the (string type, bool isKeyword) constructor instead!")] public TypeReference(string type, string systemType) { this.Type = systemType; diff --git a/src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs b/src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs index 29dd214f20..4551eda142 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs +++ b/src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs @@ -580,7 +580,7 @@ newType.Templates); out typeRef); #line 443 "VBNET.ATG" - newType.BaseTypes.Add(typeRef); + SafeAdd(newType, newType.BaseTypes, typeRef); } while (la.kind == 123) { TypeImplementsClause( @@ -695,7 +695,7 @@ newType); out typeRef, false); #line 497 "VBNET.ATG" - newType.BaseTypes.Add(typeRef); + SafeAdd(newType, newType.BaseTypes, typeRef); } EndOfStmt(); @@ -975,7 +975,7 @@ out List<TypeReference> baseInterfaces) { out type); #line 1570 "VBNET.ATG" - baseInterfaces.Add(type); + if (type != null) baseInterfaces.Add(type); while (la.kind == 12) { lexer.NextToken(); @@ -984,7 +984,7 @@ out type); out type); #line 1574 "VBNET.ATG" - baseInterfaces.Add(type); + if (type != null) baseInterfaces.Add(type); } EndOfStmt(); } @@ -1223,7 +1223,7 @@ out List<TypeReference> bases) { out type); #line 1554 "VBNET.ATG" - bases.Add(type); + if (type != null) bases.Add(type); while (la.kind == 12) { lexer.NextToken(); TypeName( @@ -1231,7 +1231,7 @@ out type); out type); #line 1557 "VBNET.ATG" - bases.Add(type); + if (type != null) bases.Add(type); } EndOfStmt(); } @@ -2512,7 +2512,7 @@ out List<string> handlesClause) { out name); #line 1543 "VBNET.ATG" - handlesClause.Add(name); + if (name != null) handlesClause.Add(name); while (la.kind == 12) { lexer.NextToken(); EventMemberSpecifier( @@ -2520,7 +2520,7 @@ out name); out name); #line 1544 "VBNET.ATG" - handlesClause.Add(name); + if (name != null) handlesClause.Add(name); } } diff --git a/src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG b/src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG index 16f6c08f75..1392e53695 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG +++ b/src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG @@ -440,7 +440,7 @@ NonModuleDeclaration<ModifierList m, List<AttributeSection> attributes> TypeParameterList<newType.Templates> EndOfStmt (. newType.BodyStartLocation = t.Location; .) - [ ClassBaseType<out typeRef> (. newType.BaseTypes.Add(typeRef); .) ] + [ ClassBaseType<out typeRef> (. SafeAdd(newType, newType.BaseTypes, typeRef); .) ] { TypeImplementsClause<out baseInterfaces> (. newType.BaseTypes.AddRange(baseInterfaces); .) } ClassBody<newType> "End" "Class" (. newType.EndLocation = t.EndLocation; .) @@ -494,7 +494,7 @@ NonModuleDeclaration<ModifierList m, List<AttributeSection> attributes> newType.Type = ClassType.Enum; .) Identifier (. newType.Name = t.val; .) - [ "As" NonArrayTypeName<out typeRef, false> (. newType.BaseTypes.Add(typeRef); .) ] + [ "As" NonArrayTypeName<out typeRef, false> (. SafeAdd(newType, newType.BaseTypes, typeRef); .) ] EndOfStmt (. newType.BodyStartLocation = t.Location; .) EnumBody<newType> @@ -1540,8 +1540,8 @@ HandlesClause<out List<string> handlesClause> handlesClause = new List<string>(); string name; .) = - "Handles" EventMemberSpecifier<out name> (. handlesClause.Add(name); .) - { "," EventMemberSpecifier<out name> (. handlesClause.Add(name); .) } + "Handles" EventMemberSpecifier<out name> (. if (name != null) handlesClause.Add(name); .) + { "," EventMemberSpecifier<out name> (. if (name != null) handlesClause.Add(name); .) } . /* 7.8. */ @@ -1551,10 +1551,10 @@ InterfaceBase <out List<TypeReference> bases> bases = new List<TypeReference>(); .) = "Inherits" - TypeName<out type> (. bases.Add(type); .) + TypeName<out type> (. if (type != null) bases.Add(type); .) { "," - TypeName<out type> (. bases.Add(type); .) + TypeName<out type> (. if (type != null) bases.Add(type); .) } EndOfStmt . @@ -1567,11 +1567,11 @@ TypeImplementsClause<out List<TypeReference> baseInterfaces> .) = "Implements" TypeName<out type> (. - baseInterfaces.Add(type); + if (type != null) baseInterfaces.Add(type); .) { "," TypeName<out type> - (. baseInterfaces.Add(type); .) + (. if (type != null) baseInterfaces.Add(type); .) } EndOfStmt . diff --git a/src/Libraries/NRefactory/Test/Output/CSharp/CSharpOutputTest.cs b/src/Libraries/NRefactory/Test/Output/CSharp/CSharpOutputTest.cs index 3589e940b8..57de764725 100644 --- a/src/Libraries/NRefactory/Test/Output/CSharp/CSharpOutputTest.cs +++ b/src/Libraries/NRefactory/Test/Output/CSharp/CSharpOutputTest.cs @@ -89,6 +89,12 @@ namespace ICSharpCode.NRefactory.Tests.PrettyPrinter TestTypeMember("void Method() { }"); } + [Test] + public void StaticMethod() + { + TestTypeMember("static void Method() { }"); + } + [Test] public void PartialModifier() { @@ -101,6 +107,12 @@ namespace ICSharpCode.NRefactory.Tests.PrettyPrinter TestProgram("public class Foo<T> where T : IDisposable, ICloneable { }"); } + [Test] + public void InterfaceWithOutParameters() + { + TestProgram("public interface ITest { void Method(out int a, ref double b); }"); + } + [Test] public void GenericClassDefinitionWithBaseType() { diff --git a/src/Libraries/NRefactory/Test/Parser/GlobalScope/TypeDeclarationTests.cs b/src/Libraries/NRefactory/Test/Parser/GlobalScope/TypeDeclarationTests.cs index 9106d94914..d97a2e633a 100644 --- a/src/Libraries/NRefactory/Test/Parser/GlobalScope/TypeDeclarationTests.cs +++ b/src/Libraries/NRefactory/Test/Parser/GlobalScope/TypeDeclarationTests.cs @@ -196,6 +196,14 @@ public abstract class MyClass : MyBase, Interface1, My.Test.Interface2 Assert.AreEqual(2, td.EndLocation.Line, "end line"); } + [Test] + public void VBNetMissingBaseClassTest() + { + // SD2-1499: test that this invalid code doesn't crash + TypeDeclaration td = ParseUtilVBNet.ParseGlobal<TypeDeclaration>("public class test inherits", true); + Assert.AreEqual(0, td.BaseTypes.Count); + } + [Test] public void VBNetEnumWithBaseClassDeclarationTest() { diff --git a/src/Libraries/log4net/LICENSE.txt b/src/Libraries/log4net/LICENSE.txt new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/src/Libraries/log4net/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/src/Libraries/log4net/log4net.dll b/src/Libraries/log4net/log4net.dll new file mode 100755 index 0000000000..ffc57e1125 Binary files /dev/null and b/src/Libraries/log4net/log4net.dll differ diff --git a/src/Main/Base/Project/Configuration/AssemblyInfo.cs b/src/Main/Base/Project/Configuration/AssemblyInfo.cs index 9c07f58a75..b197949a6f 100644 --- a/src/Main/Base/Project/Configuration/AssemblyInfo.cs +++ b/src/Main/Base/Project/Configuration/AssemblyInfo.cs @@ -20,6 +20,7 @@ using System.Runtime.CompilerServices; [assembly: Dependency("ICSharpCode.NRefactory", LoadHint.Always)] [assembly: Dependency("ICSharpCode.SharpDevelop.Dom", LoadHint.Always)] [assembly: Dependency("ICSharpCode.SharpDevelop.Widgets", LoadHint.Always)] +[assembly: Dependency("System.Core", LoadHint.Always)] [assembly: Dependency("System.Drawing", LoadHint.Always)] [assembly: Dependency("System.Xml", LoadHint.Always)] [assembly: Dependency("System.Windows.Forms", LoadHint.Always)] diff --git a/src/Main/Base/Project/Resources/CommonAboutDialog.xfrm b/src/Main/Base/Project/Resources/CommonAboutDialog.xfrm index 7d12f05618..122b2882a4 100644 --- a/src/Main/Base/Project/Resources/CommonAboutDialog.xfrm +++ b/src/Main/Base/Project/Resources/CommonAboutDialog.xfrm @@ -26,7 +26,7 @@ <!-- The copyright label --> <System.Windows.Forms.Label> - <Text value = "(c) 2000-2008 by icsharpcode.net"/> + <Text value = "(c) 2000-2009 by icsharpcode.net"/> <Width value = "400"/> <Height value = "20"/> <Location value = "{X=8, Y=234}"/> diff --git a/src/Main/Base/Project/Resources/ProjectAndSolutionOptionsPanel.xfrm b/src/Main/Base/Project/Resources/ProjectAndSolutionOptionsPanel.xfrm index 6628af410d..659f5e20d7 100644 --- a/src/Main/Base/Project/Resources/ProjectAndSolutionOptionsPanel.xfrm +++ b/src/Main/Base/Project/Resources/ProjectAndSolutionOptionsPanel.xfrm @@ -75,7 +75,7 @@ <TabIndex value="13" /> <Minimum value="1" /> <Location value="227, 66" /> - <Maximum value="8" /> + <Maximum value="16" /> <Size value="49, 20" /> </System.Windows.Forms.NumericUpDown> <System.Windows.Forms.Label> diff --git a/src/Main/Base/Project/Src/Commands/ChooseLayoutCommand.cs b/src/Main/Base/Project/Src/Commands/ChooseLayoutCommand.cs index 61633d8b3b..6067166d99 100644 --- a/src/Main/Base/Project/Src/Commands/ChooseLayoutCommand.cs +++ b/src/Main/Base/Project/Src/Commands/ChooseLayoutCommand.cs @@ -41,7 +41,7 @@ namespace ICSharpCode.SharpDevelop.Commands if (editingLayout) return; LoggingService.Debug("ChooseLayoutCommand.Run()"); - var comboBox = (System.Windows.Controls.ComboBox)Owner; + var comboBox = (System.Windows.Controls.ComboBox)base.ComboBox; string dataPath = Path.Combine(PropertyService.DataDirectory, "resources" + Path.DirectorySeparatorChar + "layouts"); string configPath = Path.Combine(PropertyService.ConfigDirectory, "layouts"); if (!Directory.Exists(configPath)) { @@ -115,6 +115,7 @@ namespace ICSharpCode.SharpDevelop.Commands frm.MinimizeBox = false; frm.ClientSize = new System.Drawing.Size(400, 300); frm.StartPosition = FormStartPosition.CenterParent; + frm.ShowInTaskbar = false; if (frm.ShowDialog(WorkbenchSingleton.MainWin32Window) == DialogResult.OK) { IList<string> oldNames = new List<string>(CustomLayoutNames); @@ -156,7 +157,7 @@ namespace ICSharpCode.SharpDevelop.Commands { if (editingLayout) return; LoggingService.Debug("ChooseLayoutCommand.LayoutChanged(object,EventArgs)"); - var comboBox = (System.Windows.Controls.ComboBox)Owner; + var comboBox = (System.Windows.Controls.ComboBox)base.ComboBox; for (int i = 0; i < comboBox.Items.Count; ++i) { if (((LayoutConfiguration)comboBox.Items[i]).Name == LayoutConfiguration.CurrentLayoutName) { comboBox.SelectedIndex = i; @@ -170,7 +171,7 @@ namespace ICSharpCode.SharpDevelop.Commands editingLayout = true; try { - var comboBox = (System.Windows.Controls.ComboBox)Owner; + var comboBox = (System.Windows.Controls.ComboBox)base.ComboBox; comboBox.Items.Clear(); int index = 0; foreach (LayoutConfiguration config in LayoutConfiguration.Layouts) { diff --git a/src/Main/Base/Project/Src/Commands/FileCommands.cs b/src/Main/Base/Project/Src/Commands/FileCommands.cs index 5ef9f2bc30..5f07111e90 100644 --- a/src/Main/Base/Project/Src/Commands/FileCommands.cs +++ b/src/Main/Base/Project/Src/Commands/FileCommands.cs @@ -73,7 +73,7 @@ namespace ICSharpCode.SharpDevelop.Commands internal static void Save(IViewContent content) { - if (content != null) { + if (content != null && content.IsDirty) { if (content is ICustomizedCommands) { if (((ICustomizedCommands)content).SaveCommand()) { return; @@ -84,7 +84,8 @@ namespace ICSharpCode.SharpDevelop.Commands } foreach (OpenedFile file in content.Files.ToArray()) { - Save(file); + if (file.IsDirty) + Save(file); } } } @@ -144,12 +145,15 @@ namespace ICSharpCode.SharpDevelop.Commands internal static void Save(IViewContent content) { - if (content != null && !content.IsViewOnly) { + if (content != null) { if (content is ICustomizedCommands) { if (((ICustomizedCommands)content).SaveAsCommand()) { return; } } + if (content.IsViewOnly) { + return; + } // save the primary file only if (content.PrimaryFile != null) { Save(content.PrimaryFile); diff --git a/src/Main/Base/Project/Src/Commands/SideBarCommands.cs b/src/Main/Base/Project/Src/Commands/SideBarCommands.cs index 22c0c43ac5..d0afef8d42 100644 --- a/src/Main/Base/Project/Src/Commands/SideBarCommands.cs +++ b/src/Main/Base/Project/Src/Commands/SideBarCommands.cs @@ -13,7 +13,6 @@ using ICSharpCode.SharpDevelop.Widgets.SideBar; namespace ICSharpCode.SharpDevelop.Commands { - /* public class SideBarRenameTabItem : AbstractMenuCommand { public override void Run() @@ -167,5 +166,4 @@ namespace ICSharpCode.SharpDevelop.Commands } } } - */ } diff --git a/src/Main/Base/Project/Src/Gui/BrowserDisplayBinding/BrowserCommands.cs b/src/Main/Base/Project/Src/Gui/BrowserDisplayBinding/BrowserCommands.cs index fa8e036540..bf98c9e6a5 100644 --- a/src/Main/Base/Project/Src/Gui/BrowserDisplayBinding/BrowserCommands.cs +++ b/src/Main/Base/Project/Src/Gui/BrowserDisplayBinding/BrowserCommands.cs @@ -69,7 +69,7 @@ namespace ICSharpCode.SharpDevelop.BrowserDisplayBinding protected override void OnOwnerChanged(EventArgs e) { base.OnOwnerChanged(e); - ToolBarComboBox toolbarItem = (ToolBarComboBox)Owner; + ToolBarComboBox toolbarItem = (ToolBarComboBox)base.ComboBox; toolbarItem.ComboBox.Width *= 3; ((HtmlViewPane)toolbarItem.Caller).SetUrlComboBox(toolbarItem.ComboBox); } diff --git a/src/Main/Base/Project/Src/Gui/Components/SideBar/SharpDevelopSideBar.cs b/src/Main/Base/Project/Src/Gui/Components/SideBar/SharpDevelopSideBar.cs index 8a55f111b0..4275e435aa 100644 --- a/src/Main/Base/Project/Src/Gui/Components/SideBar/SharpDevelopSideBar.cs +++ b/src/Main/Base/Project/Src/Gui/Components/SideBar/SharpDevelopSideBar.cs @@ -200,5 +200,14 @@ namespace ICSharpCode.SharpDevelop.Gui } public event SideTabEventHandler SideTabDeleted; + + + public Point SideBarMousePosition { get; private set; } + + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + this.SideBarMousePosition = new Point(e.X, e.Y); + } } } diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/ExtractInterfaceDialog.cs b/src/Main/Base/Project/Src/Gui/Dialogs/ExtractInterfaceDialog.cs index 9bfc8913f9..048b491579 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/ExtractInterfaceDialog.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/ExtractInterfaceDialog.cs @@ -33,7 +33,6 @@ namespace ICSharpCode.SharpDevelop.Gui // InitializeComponent(); - this.TopMost = true; this.possibleInterfaceMembers = new List<IMember>(); this.hasSetFilenameExplicitly = false; @@ -146,6 +145,10 @@ namespace ICSharpCode.SharpDevelop.Gui foreach (int i in selectMembersListBox.CheckedIndices) { this.options.ChosenMembers.Add(this.possibleInterfaceMembers[i]); } + if (this.options.ChosenMembers.Count == 0) { + MessageService.ShowError("Please select at least one member from the list!"); + return; + } this.options.IncludeComments = cbIncludeComments.CheckState == CheckState.Checked; this.options.AddInterfaceToClass = cbAddToClass.CheckState == CheckState.Checked; this.DialogResult = DialogResult.OK; diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/IDEOptions/SelectCulturePanel.cs b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/IDEOptions/SelectCulturePanel.cs index 6053be60c9..14ef9ff001 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/IDEOptions/SelectCulturePanel.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/IDEOptions/SelectCulturePanel.cs @@ -75,6 +75,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels listView.Activation = ItemActivation.OneClick; listView.Anchor = (System.Windows.Forms.AnchorStyles.Top | (System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)); + listView.MultiSelect = false; foreach (Language language in LanguageService.Languages) { listView.Items.Add(new ListViewItem(new string[] {language.Name, language.Code}, language.ImageIndex)); diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs index 5d5d1b3272..c62eb1890b 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs @@ -197,6 +197,13 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels b.DefaultLocation = PropertyStorageLocations.PlatformSpecific; b.RegisterLocationButton(advancedLocationButton); + b = CreatePlatformTarget(); + b.RegisterLocationButton(advancedLocationButton); + } + + protected ConfigurationGuiBinding CreatePlatformTarget() + { + ConfigurationGuiBinding b; b = helper.BindStringEnum("targetCpuComboBox", "PlatformTarget", "AnyCPU", new StringPair("AnyCPU", "${res:Dialog.ProjectOptions.Build.TargetCPU.Any}"), @@ -204,9 +211,9 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels new StringPair("x64", "${res:Dialog.ProjectOptions.Build.TargetCPU.x64}"), new StringPair("Itanium", "${res:Dialog.ProjectOptions.Build.TargetCPU.Itanium}")); b.DefaultLocation = PropertyStorageLocations.PlatformSpecific; - b.RegisterLocationButton(advancedLocationButton); + return b; } - + void DebugSymbolsLoaded(object sender, EventArgs e) { PropertyStorageLocations location; @@ -236,7 +243,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels ComboBox targetFrameworkComboBox = (ComboBox)ControlDictionary["targetFrameworkComboBox"]; if (convertProjectToMSBuild35Button != null) { - if (project.MinimumSolutionVersion == Solution.SolutionVersionVS05) { + if (project.MinimumSolutionVersion == Solution.SolutionVersionVS2005) { // VS05 project targetFrameworkComboBox.Enabled = false; convertProjectToMSBuild35Button.Click += OnConvertProjectToMSBuild35ButtonClick; @@ -277,7 +284,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels } else { project.ConvertToMSBuild35(dlg.ChangeTargetFramework); } - if (project.MinimumSolutionVersion == Solution.SolutionVersionVS05) + if (project.MinimumSolutionVersion == Solution.SolutionVersionVS2005) throw new InvalidOperationException("Project did not convert to MSBuild 3.5"); ProjectService.SaveSolution(); InitTargetFramework(); diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/Signing.cs b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/Signing.cs index 491f84414c..845d4d1896 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/Signing.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/Signing.cs @@ -35,7 +35,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels keyFile = Get<ComboBox>("keyFile"); - b = helper.BindString(keyFile, "AssemblyOriginatorKeyFile", TextBoxEditMode.EditEvaluatedProperty); + b = helper.BindString(keyFile, "AssemblyOriginatorKeyFile", TextBoxEditMode.EditRawProperty); b.RegisterLocationButton(locationButton); FindKeys(baseDirectory); if (keyFile.Text.Length > 0) { @@ -74,13 +74,13 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels while (true) { try { foreach (string fileName in Directory.GetFiles(directory, "*.snk")) { - keyFile.Items.Add(FileUtility.GetRelativePath(baseDirectory, fileName)); + keyFile.Items.Add(MSBuildInternals.Escape(FileUtility.GetRelativePath(baseDirectory, fileName))); } foreach (string fileName in Directory.GetFiles(directory, "*.pfx")) { - keyFile.Items.Add(FileUtility.GetRelativePath(baseDirectory, fileName)); + keyFile.Items.Add(MSBuildInternals.Escape(FileUtility.GetRelativePath(baseDirectory, fileName))); } foreach (string fileName in Directory.GetFiles(directory, "*.key")) { - keyFile.Items.Add(FileUtility.GetRelativePath(baseDirectory, fileName)); + keyFile.Items.Add(MSBuildInternals.Escape(FileUtility.GetRelativePath(baseDirectory, fileName))); } } catch { // can happen for networked drives / network locations @@ -96,7 +96,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels void BrowseKeyFile() { keyFile.SelectedIndex = -1; - BrowseForFile(ControlDictionary["keyFileComboBox"], "${res:SharpDevelop.FileFilter.KeyFiles} (" + KeyFileExtensions + ")|" + KeyFileExtensions + "|${res:SharpDevelop.FileFilter.AllFiles}|*.*", TextBoxEditMode.EditEvaluatedProperty); + BrowseForFile(ControlDictionary["keyFileComboBox"], "${res:SharpDevelop.FileFilter.KeyFiles} (" + KeyFileExtensions + ")|" + KeyFileExtensions + "|${res:SharpDevelop.FileFilter.AllFiles}|*.*", TextBoxEditMode.EditRawProperty); } void CreateKeyFile() @@ -105,7 +105,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels using (CreateKeyForm createKey = new CreateKeyForm(baseDirectory)) { createKey.KeyFile = project.Name; if (createKey.ShowDialog(WorkbenchSingleton.MainWin32Window) == DialogResult.OK) { - keyFile.Text = createKey.KeyFile; + keyFile.Text = MSBuildInternals.Escape(createKey.KeyFile); return; } } diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/EditAvailableConfigurationsDialog.Designer.cs b/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/EditAvailableConfigurationsDialog.Designer.cs index 840b4afe24..0246c04637 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/EditAvailableConfigurationsDialog.Designer.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/EditAvailableConfigurationsDialog.Designer.cs @@ -36,7 +36,7 @@ namespace ICSharpCode.SharpDevelop.Gui private void InitializeComponent() { this.listBox = new System.Windows.Forms.ListBox(); - this.okButton = new System.Windows.Forms.Button(); + this.closeButton = new System.Windows.Forms.Button(); this.removeButton = new System.Windows.Forms.Button(); this.renameButton = new System.Windows.Forms.Button(); this.addButton = new System.Windows.Forms.Button(); @@ -56,14 +56,14 @@ namespace ICSharpCode.SharpDevelop.Gui // // okButton // - this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.okButton.Location = new System.Drawing.Point(222, 111); - this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(75, 23); - this.okButton.TabIndex = 1; - this.okButton.Text = "${res:Global.OKButtonText}"; - this.okButton.UseVisualStyleBackColor = true; + this.closeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.closeButton.DialogResult = System.Windows.Forms.DialogResult.OK; + this.closeButton.Location = new System.Drawing.Point(222, 111); + this.closeButton.Name = "closeButton"; + this.closeButton.Size = new System.Drawing.Size(75, 23); + this.closeButton.TabIndex = 1; + this.closeButton.Text = "${res:Global.CloseButtonText}"; + this.closeButton.UseVisualStyleBackColor = true; // // removeButton // @@ -106,7 +106,7 @@ namespace ICSharpCode.SharpDevelop.Gui this.Controls.Add(this.addButton); this.Controls.Add(this.renameButton); this.Controls.Add(this.removeButton); - this.Controls.Add(this.okButton); + this.Controls.Add(this.closeButton); this.Controls.Add(this.listBox); this.MinimumSize = new System.Drawing.Size(230, 165); this.Name = "EditAvailableConfigurationsDialog"; @@ -119,6 +119,6 @@ namespace ICSharpCode.SharpDevelop.Gui private System.Windows.Forms.Button renameButton; private System.Windows.Forms.Button removeButton; private System.Windows.Forms.ListBox listBox; - private System.Windows.Forms.Button okButton; + private System.Windows.Forms.Button closeButton; } } diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/SolutionConfigurationEditor.Designer.cs b/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/SolutionConfigurationEditor.Designer.cs index b9384a6f1b..9ca567c793 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/SolutionConfigurationEditor.Designer.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/SolutionConfigurationEditor.Designer.cs @@ -45,7 +45,7 @@ namespace ICSharpCode.SharpDevelop.Gui this.configurationColumn = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.platformColumn = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.panel2 = new System.Windows.Forms.Panel(); - this.okButton = new System.Windows.Forms.Button(); + this.closeButton = new System.Windows.Forms.Button(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.grid)).BeginInit(); this.panel2.SuspendLayout(); @@ -118,8 +118,8 @@ namespace ICSharpCode.SharpDevelop.Gui this.grid.Size = new System.Drawing.Size(504, 192); this.grid.TabIndex = 1; this.grid.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.GridCellValueChanged); - this.grid.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.GridDataError); this.grid.EditingControlShowing += new System.Windows.Forms.DataGridViewEditingControlShowingEventHandler(this.GridEditingControlShowing); + this.grid.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.GridDataError); // // projectNameColumn // @@ -140,27 +140,27 @@ namespace ICSharpCode.SharpDevelop.Gui // // panel2 // - this.panel2.Controls.Add(this.okButton); + this.panel2.Controls.Add(this.closeButton); this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom; this.panel2.Location = new System.Drawing.Point(0, 229); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(504, 30); this.panel2.TabIndex = 2; // - // okButton + // closeButton // - this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.okButton.Location = new System.Drawing.Point(417, 3); - this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(75, 23); - this.okButton.TabIndex = 0; - this.okButton.Text = "${res:Global.OKButtonText}"; - this.okButton.UseVisualStyleBackColor = true; + this.closeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.closeButton.DialogResult = System.Windows.Forms.DialogResult.OK; + this.closeButton.Location = new System.Drawing.Point(417, 3); + this.closeButton.Name = "closeButton"; + this.closeButton.Size = new System.Drawing.Size(75, 23); + this.closeButton.TabIndex = 0; + this.closeButton.Text = "${res:Global.CloseButtonText}"; + this.closeButton.UseVisualStyleBackColor = true; // // SolutionConfigurationEditor // - this.AcceptButton = this.okButton; + this.AcceptButton = this.closeButton; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(504, 259); @@ -176,10 +176,10 @@ namespace ICSharpCode.SharpDevelop.Gui this.panel2.ResumeLayout(false); this.ResumeLayout(false); } + private System.Windows.Forms.Button closeButton; private System.Windows.Forms.DataGridView grid; private System.Windows.Forms.ComboBox configurationComboBox; private System.Windows.Forms.ComboBox platformComboBox; - private System.Windows.Forms.Button okButton; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.DataGridViewComboBoxColumn platformColumn; private System.Windows.Forms.DataGridViewComboBoxColumn configurationColumn; diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/SolutionConfigurationEditor.cs b/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/SolutionConfigurationEditor.cs index 681323361e..3c7b526de6 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/SolutionConfigurationEditor.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/SolutionConfigurationEditor.cs @@ -37,7 +37,7 @@ namespace ICSharpCode.SharpDevelop.Gui this.Text = StringParser.Parse(this.Text); label1.Text = StringParser.Parse(label1.Text); label2.Text = StringParser.Parse(label2.Text); - okButton.Text = StringParser.Parse(okButton.Text); + closeButton.Text = StringParser.Parse(closeButton.Text); projectNameColumn.HeaderText = StringParser.Parse(projectNameColumn.HeaderText); configurationColumn.HeaderText = StringParser.Parse(configurationColumn.HeaderText); platformColumn.HeaderText = StringParser.Parse(platformColumn.HeaderText); diff --git a/src/Main/Base/Project/Src/Gui/IViewContent.cs b/src/Main/Base/Project/Src/Gui/IViewContent.cs index 975cdff241..66ddef38ff 100644 --- a/src/Main/Base/Project/Src/Gui/IViewContent.cs +++ b/src/Main/Base/Project/Src/Gui/IViewContent.cs @@ -100,7 +100,7 @@ namespace ICSharpCode.SharpDevelop.Gui /// <summary> /// Gets the list of files that are being edited using this view content. - /// The returned collection normally is readonly. + /// The returned collection usually is read-only. /// </summary> IList<OpenedFile> Files { get; } diff --git a/src/Main/Base/Project/Src/Gui/Pads/ClassBrowser/ClassBrowserToolbarCommands.cs b/src/Main/Base/Project/Src/Gui/Pads/ClassBrowser/ClassBrowserToolbarCommands.cs index 3c23b850b8..bb1582f38a 100644 --- a/src/Main/Base/Project/Src/Gui/Pads/ClassBrowser/ClassBrowserToolbarCommands.cs +++ b/src/Main/Base/Project/Src/Gui/Pads/ClassBrowser/ClassBrowserToolbarCommands.cs @@ -163,7 +163,7 @@ namespace ICSharpCode.SharpDevelop.Gui.ClassBrowser protected override void OnOwnerChanged(EventArgs e) { base.OnOwnerChanged(e); - ToolBarComboBox toolbarItem = (ToolBarComboBox)Owner; + ToolBarComboBox toolbarItem = (ToolBarComboBox)base.ComboBox; comboBox = toolbarItem.ComboBox; comboBox.DropDownStyle = ComboBoxStyle.DropDown; comboBox.TextChanged += ComboBoxTextChanged; diff --git a/src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageViewToolbarCommands.cs b/src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageViewToolbarCommands.cs index 3c48dd383a..e4f64c7257 100644 --- a/src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageViewToolbarCommands.cs +++ b/src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageViewToolbarCommands.cs @@ -19,7 +19,7 @@ namespace ICSharpCode.SharpDevelop.Gui protected override void OnOwnerChanged(EventArgs e) { base.OnOwnerChanged(e); - ToolBarComboBox toolbarItem = (ToolBarComboBox)Owner; + ToolBarComboBox toolbarItem = (ToolBarComboBox)base.ComboBox; comboBox = toolbarItem.ComboBox; SetItems(); CompilerMessageView.Instance.MessageCategoryAdded += new EventHandler(CompilerMessageViewMessageCategoryAdded); diff --git a/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/FileNode.cs b/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/FileNode.cs index a2b9a44610..fdf4697497 100644 --- a/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/FileNode.cs +++ b/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/FileNode.cs @@ -6,6 +6,7 @@ // </file> using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Windows.Forms; @@ -328,16 +329,9 @@ namespace ICSharpCode.SharpDevelop.Project /// </summary> void DeleteChildNodes() { - if (Nodes.Count == 0) return; - - foreach (TreeNode node in Nodes) { - FileNode fileNode = node as FileNode; - if (fileNode != null) { - fileNode.DeleteChildNodes(); // delete recursively - FileService.RemoveFile(fileNode.FileName, false); - } else { - LoggingService.Warn("FileNode.DeleteChildren. Child is not a FileNode."); - } + foreach (FileNode fileNode in Nodes.OfType<FileNode>().ToList()) { + fileNode.DeleteChildNodes(); // delete recursively + FileService.RemoveFile(fileNode.FileName, false); } } } diff --git a/src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPadCommands.cs b/src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPadCommands.cs index 4785102c9a..61b358bf0f 100644 --- a/src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPadCommands.cs +++ b/src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPadCommands.cs @@ -23,7 +23,7 @@ namespace ICSharpCode.SharpDevelop.Gui protected override void OnOwnerChanged(EventArgs e) { base.OnOwnerChanged(e); - ToolBarComboBox toolbarItem = (ToolBarComboBox)Owner; + ToolBarComboBox toolbarItem = (ToolBarComboBox)base.ComboBox; comboBox = toolbarItem.ComboBox; SetItems(); comboBox.SelectedIndex = 0; diff --git a/src/Main/Base/Project/Src/Gui/Workbench/SingleInstanceHelper.cs b/src/Main/Base/Project/Src/Gui/Workbench/SingleInstanceHelper.cs index 410e89a708..8ca1fa72e8 100644 --- a/src/Main/Base/Project/Src/Gui/Workbench/SingleInstanceHelper.cs +++ b/src/Main/Base/Project/Src/Gui/Workbench/SingleInstanceHelper.cs @@ -25,7 +25,7 @@ namespace ICSharpCode.SharpDevelop.Gui public static bool OpenFilesInPreviousInstance(string[] fileList) { - LoggingService.Debug("Trying to pass arguments to previous instance..."); + LoggingService.Info("Trying to pass arguments to previous instance..."); int currentProcessId = Process.GetCurrentProcess().Id; string currentFile = Assembly.GetEntryAssembly().Location; int number = new Random().Next(); @@ -65,7 +65,7 @@ namespace ICSharpCode.SharpDevelop.Gui return false; long fileNumber = m.WParam.ToInt64(); long openEvenIfProjectIsOpened = m.LParam.ToInt64(); - LoggingService.Debug("Receiving custom message..."); + LoggingService.Info("Receiving custom message..."); if (openEvenIfProjectIsOpened == 0 && ProjectService.OpenSolution != null) { m.Result = new IntPtr(RESULT_PROJECT_IS_OPEN); } else { diff --git a/src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs b/src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs index f43f96974d..00474d5cea 100644 --- a/src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs +++ b/src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs @@ -305,6 +305,7 @@ namespace ICSharpCode.SharpDevelop.Gui t.Interval = delayMilliseconds; t.Tick += delegate { t.Stop(); + t.Dispose(); method(); }; t.Start(); diff --git a/src/Main/Base/Project/Src/Project/AbstractProject.cs b/src/Main/Base/Project/Src/Project/AbstractProject.cs index cf65ce3235..836919d2a1 100644 --- a/src/Main/Base/Project/Src/Project/AbstractProject.cs +++ b/src/Main/Base/Project/Src/Project/AbstractProject.cs @@ -455,7 +455,7 @@ namespace ICSharpCode.SharpDevelop.Project [Browsable(false)] public virtual int MinimumSolutionVersion { - get { return Solution.SolutionVersionVS05; } + get { return Solution.SolutionVersionVS2005; } } public virtual void ResolveAssemblyReferences() @@ -471,19 +471,21 @@ namespace ICSharpCode.SharpDevelop.Project public virtual ICollection<IBuildable> GetBuildDependencies(ProjectBuildOptions buildOptions) { - List<IBuildable> result = new List<IBuildable>(); - foreach (ProjectSection section in this.ProjectSections) { - if (section.Name == "ProjectDependencies") { - foreach (SolutionItem item in section.Items) { - foreach (IProject p in ParentSolution.Projects) { - if (p.IdGuid == item.Name) { - result.Add(p); + lock (SyncRoot) { + List<IBuildable> result = new List<IBuildable>(); + foreach (ProjectSection section in this.ProjectSections) { + if (section.Name == "ProjectDependencies") { + foreach (SolutionItem item in section.Items) { + foreach (IProject p in ParentSolution.Projects) { + if (p.IdGuid == item.Name) { + result.Add(p); + } } } } } + return result; } - return result; } } } diff --git a/src/Main/Base/Project/Src/Project/BuildEngine.cs b/src/Main/Base/Project/Src/Project/BuildEngine.cs index 215e7a6db8..0021399f9d 100644 --- a/src/Main/Base/Project/Src/Project/BuildEngine.cs +++ b/src/Main/Base/Project/Src/Project/BuildEngine.cs @@ -107,7 +107,7 @@ namespace ICSharpCode.SharpDevelop.Project EventHandler eh = null; lock (lockObject) { if (isCancelAllowed && !isCancelled) { - ICSharpCode.Core.LoggingService.Debug("Cancel build"); + ICSharpCode.Core.LoggingService.Info("Cancel build"); isCancelled = true; eh = Cancelled; } @@ -261,6 +261,11 @@ namespace ICSharpCode.SharpDevelop.Project this.project = project; } + public void DoStartBuild(object state) + { + project.StartBuild(options, this); + } + public void ReportError(BuildError error) { engine.ReportError(this, error); @@ -416,7 +421,7 @@ namespace ICSharpCode.SharpDevelop.Project hasDependencyErrors |= n.hasErrors; } - ICSharpCode.Core.LoggingService.Debug("Start building " + node.project.Name); + ICSharpCode.Core.LoggingService.Info("Start building " + node.project.Name); runningWorkers++; projectsCurrentlyBuilding.Add(node); if (hasDependencyErrors) { @@ -424,7 +429,8 @@ namespace ICSharpCode.SharpDevelop.Project node.hasErrors = true; node.Done(false); } else { - node.project.StartBuild(node.options, node); + // do not run "DoStartBuild" inside lock - run it async on the thread pool + System.Threading.ThreadPool.QueueUserWorkItem(node.DoStartBuild); } } } @@ -458,7 +464,7 @@ namespace ICSharpCode.SharpDevelop.Project void OnBuildFinished(BuildNode node, bool success) { - ICSharpCode.Core.LoggingService.Debug("Finished building " + node.project.Name); + ICSharpCode.Core.LoggingService.Info("Finished building " + node.project.Name); lock (this) { if (node.buildFinished) { throw new InvalidOperationException("This node already finished building, do not call IBuildFeedbackSink.Done() multiple times!"); diff --git a/src/Main/Base/Project/Src/Project/BuildOptions.cs b/src/Main/Base/Project/Src/Project/BuildOptions.cs index 5f5587ce5b..28b4d19a64 100644 --- a/src/Main/Base/Project/Src/Project/BuildOptions.cs +++ b/src/Main/Base/Project/Src/Project/BuildOptions.cs @@ -61,7 +61,7 @@ namespace ICSharpCode.SharpDevelop.Project public static int DefaultParallelProjectCount { get { - return PropertyService.Get("SharpDevelop.BuildParallelProjectCount", Environment.ProcessorCount >= 2 ? 2: 1); + return PropertyService.Get("SharpDevelop.BuildParallelProjectCount", Math.Min(4, Environment.ProcessorCount)); } set { PropertyService.Set("SharpDevelop.BuildParallelProjectCount", value); diff --git a/src/Main/Base/Project/Src/Project/CompilableProject.cs b/src/Main/Base/Project/Src/Project/CompilableProject.cs index 8f4b16901c..f79ce3251e 100644 --- a/src/Main/Base/Project/Src/Project/CompilableProject.cs +++ b/src/Main/Base/Project/Src/Project/CompilableProject.cs @@ -359,11 +359,13 @@ namespace ICSharpCode.SharpDevelop.Project protected override void OnPropertyChanged(ProjectPropertyChangedEventArgs e) { base.OnPropertyChanged(e); - if (reparseReferencesSensitiveProperties.Contains(e.PropertyName)) { - ParserService.Reparse(this, true, false); - } - if (reparseCodeSensitiveProperties.Contains(e.PropertyName)) { - ParserService.Reparse(this, false, true); + if (!isLoading) { + if (reparseReferencesSensitiveProperties.Contains(e.PropertyName)) { + ParserService.Reparse(this, true, false); + } + if (reparseCodeSensitiveProperties.Contains(e.PropertyName)) { + ParserService.Reparse(this, false, true); + } } } diff --git a/src/Main/Base/Project/Src/Project/ConfigurationGuiHelper.cs b/src/Main/Base/Project/Src/Project/ConfigurationGuiHelper.cs index a0ad16f10f..9eec03ba3f 100644 --- a/src/Main/Base/Project/Src/Project/ConfigurationGuiHelper.cs +++ b/src/Main/Base/Project/Src/Project/ConfigurationGuiHelper.cs @@ -671,6 +671,7 @@ namespace ICSharpCode.SharpDevelop.Project ResetIndex(); return; } + helper.Project.Save(); } helper.Configuration = (string)configurationComboBox.SelectedItem; helper.Platform = (string)platformComboBox.SelectedItem; diff --git a/src/Main/Base/Project/Src/Project/IBuildFeedbackSink.cs b/src/Main/Base/Project/Src/Project/IBuildFeedbackSink.cs index 647d412305..d4667e7b06 100644 --- a/src/Main/Base/Project/Src/Project/IBuildFeedbackSink.cs +++ b/src/Main/Base/Project/Src/Project/IBuildFeedbackSink.cs @@ -28,7 +28,7 @@ namespace ICSharpCode.SharpDevelop.Project /// <summary> /// Notifies the build engine that the build of a project has finished. - /// You sould not call any methods after the Done() call. + /// You should not call any methods after the Done() call. /// This member is thread-safe. /// </summary> void Done(bool success); diff --git a/src/Main/Base/Project/Src/Project/IProject.cs b/src/Main/Base/Project/Src/Project/IProject.cs index 570190a090..91c11632bd 100644 --- a/src/Main/Base/Project/Src/Project/IProject.cs +++ b/src/Main/Base/Project/Src/Project/IProject.cs @@ -165,7 +165,7 @@ namespace ICSharpCode.SharpDevelop.Project #region Configuration / Platform management /// <summary> - /// Gets/Sets the active configuration. MSBuild properties + /// Gets/Sets the active configuration. /// </summary> string ActiveConfiguration { get; @@ -188,6 +188,16 @@ namespace ICSharpCode.SharpDevelop.Project /// Gets the list of available platform names. /// </summary> ICollection<string> PlatformNames { get; } + + /// <summary> + /// Is raised after the ActiveConfiguration property has changed. + /// </summary> + event EventHandler ActiveConfigurationChanged; + + /// <summary> + /// Is raised after the ActivePlatform property has changed. + /// </summary> + event EventHandler ActivePlatformChanged; #endregion /// <summary> diff --git a/src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs b/src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs index 1f5c04850a..a36273f229 100644 --- a/src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs +++ b/src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs @@ -9,19 +9,23 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; -using System.Linq; using System.IO; +using System.Linq; using ICSharpCode.Core; using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Internal.Templates; using MSBuild = Microsoft.Build.BuildEngine; -using StringPair = ICSharpCode.SharpDevelop.Pair<System.String, System.String>; +using StringPair = ICSharpCode.SharpDevelop.Pair<string, string>; namespace ICSharpCode.SharpDevelop.Project { /// <summary> /// A project that is based on an MSBuild project file. + /// + /// Thread-safety: most members are thread-safe, but direct accesses on the underlying MSBuildProject + /// require locking on the SyncRoot. Methods that return underlying MSBuild objects require that + /// the caller locks on the SyncRoot. /// </summary> public class MSBuildBasedProject : AbstractProject, IProjectItemListProvider, IProjectAllowChangeConfigurations { @@ -30,6 +34,11 @@ namespace ICSharpCode.SharpDevelop.Project /// </summary> MSBuild.Project project; + /// <summary> + /// The '.user' part of the project. + /// </summary> + MSBuild.Project userProject; + /// <summary> /// A list of project properties that are saved after the normal properties. /// Use this for properties that could reference other properties, e.g. @@ -45,6 +54,7 @@ namespace ICSharpCode.SharpDevelop.Project if (engine == null) throw new ArgumentNullException("engine"); this.project = engine.CreateNewProject(); + this.userProject = engine.CreateNewProject(); } /// <summary> @@ -60,6 +70,9 @@ namespace ICSharpCode.SharpDevelop.Project base.Dispose(); // unload evaluatingTempProject if necessary: MSBuildInternals.EnsureCorrectTempProject(project, null, null, ref evaluatingTempProject); + // unload project + userProject: + project.ParentEngine.UnloadProject(project); + userProject.ParentEngine.UnloadProject(userProject); } public override int MinimumSolutionVersion { @@ -68,9 +81,9 @@ namespace ICSharpCode.SharpDevelop.Project if (string.IsNullOrEmpty(project.DefaultToolsVersion) || project.DefaultToolsVersion == "2.0") { - return Solution.SolutionVersionVS05; + return Solution.SolutionVersionVS2005; } else { - return Solution.SolutionVersionVS08; + return Solution.SolutionVersionVS2008; } } } @@ -195,8 +208,10 @@ namespace ICSharpCode.SharpDevelop.Project /// </summary> protected void AddImport(string projectFile, string condition) { - project.AddNewImport(projectFile, condition); - CreateItemsListFromMSBuild(); + lock (SyncRoot) { + project.AddNewImport(projectFile, condition); + CreateItemsListFromMSBuild(); + } } #endregion @@ -317,14 +332,19 @@ namespace ICSharpCode.SharpDevelop.Project protected bool EvaluateMSBuildCondition(string configuration, string platform, string condition) { - return MSBuildInternals.EvaluateCondition(project, configuration, platform, condition, - ref evaluatingTempProject); + lock (SyncRoot) { + return MSBuildInternals.EvaluateCondition(project, configuration, platform, condition, + ref evaluatingTempProject); + } } /// <summary> /// Finds the <c>BuildProperty</c> object used to store <paramref name="propertyName"/> /// in the specified configuration/platform. /// </summary> + /// + /// Warning: you need to lock(project.SyncRoot) around calls to GetAllProperties + /// until you no longer need to access the BuildProperty objects! /// <param name="configuration">The configuration to use.</param> /// <param name="platform">The platform to use.</param> /// <param name="propertyName">The property to look for.</param> @@ -339,6 +359,31 @@ namespace ICSharpCode.SharpDevelop.Project if (string.IsNullOrEmpty(configuration)) configuration = ActiveConfiguration; if (string.IsNullOrEmpty(platform)) platform = ActivePlatform; + // First try main project file + MSBuild.BuildProperty p = FindPropertyObjectInternal(project, configuration, platform, propertyName, out group); + if (p != null) { + location = MSBuildInternals.GetLocationFromCondition(group.Condition); + return p; + } else { + // try user project file + p = FindPropertyObjectInternal(userProject, configuration, platform, propertyName, out group); + if (p != null) { + location = PropertyStorageLocations.UserFile + | MSBuildInternals.GetLocationFromCondition(group.Condition); + return p; + } else { + location = PropertyStorageLocations.Unknown; + group = null; + return null; + } + } + } + + MSBuild.BuildProperty FindPropertyObjectInternal(MSBuild.Project project, + string configuration, string platform, + string propertyName, + out MSBuild.BuildPropertyGroup group) + { // We need to use ToList because EvaluateMSBuildCondition invalidates the list // of property groups. foreach (MSBuild.BuildPropertyGroup g @@ -351,13 +396,10 @@ namespace ICSharpCode.SharpDevelop.Project if (property == null) continue; if (EvaluateMSBuildCondition(configuration, platform, g.Condition)) { - location = MSBuildInternals.GetLocationFromCondition(g.Condition); group = g; return property; } } - - location = PropertyStorageLocations.Unknown; group = null; return null; } @@ -370,8 +412,16 @@ namespace ICSharpCode.SharpDevelop.Project /// <param name="platform">Platform filter. Only use properties from this platform. /// Use <c>null</c> to allow properties from all platforms.</param> /// <param name="propertyName">The name of the property</param> - string GetAnyUnevaluatedPropertyValue(string configuration, string platform, - string propertyName) + string GetAnyUnevaluatedPropertyValue(string configuration, string platform, string propertyName) + { + // first try main project file, then try user project file + MSBuild.BuildProperty p = GetAnyUnevaluatedProperty(project, configuration, platform, propertyName); + if (p == null) + p = GetAnyUnevaluatedProperty(userProject, configuration, platform, propertyName); + return p != null ? p.Value : null; + } + + static MSBuild.BuildProperty GetAnyUnevaluatedProperty(MSBuild.Project project, string configuration, string platform, string propertyName) { foreach (MSBuild.BuildPropertyGroup g in project.PropertyGroups) { if (g.IsImported) { @@ -387,7 +437,7 @@ namespace ICSharpCode.SharpDevelop.Project if ((configuration == null || configuration == gConfiguration || gConfiguration == null) && (platform == null || platform == gPlatform || gPlatform == null)) { - return property.Value; + return property; } } return null; @@ -395,6 +445,9 @@ namespace ICSharpCode.SharpDevelop.Project /// <summary> /// Get all instances of the specified property. + /// + /// Warning: you need to lock(project.SyncRoot) around calls to GetAllProperties + /// until you no longer need to access the BuildProperty objects! /// </summary> public IList<MSBuild.BuildProperty> GetAllProperties(string propertyName) { @@ -406,6 +459,13 @@ namespace ICSharpCode.SharpDevelop.Project l.Add(property); } } + foreach (MSBuild.BuildPropertyGroup g in userProject.PropertyGroups) { + if (g.IsImported) continue; + MSBuild.BuildProperty property = MSBuildInternals.GetProperty(g, propertyName); + if (property != null) { + l.Add(property); + } + } return l; } #endregion @@ -432,6 +492,13 @@ namespace ICSharpCode.SharpDevelop.Project return MSBuildInternals.GetLocationFromCondition(g.Condition); } } + foreach (MSBuild.BuildPropertyGroup g in userProject.PropertyGroups) { + if (g.IsImported) continue; + if (MSBuildInternals.GetProperty(g, propertyName) != null) { + return PropertyStorageLocations.UserFile | + MSBuildInternals.GetLocationFromCondition(g.Condition); + } + } return PropertyStorageLocations.Unknown; } @@ -513,12 +580,19 @@ namespace ICSharpCode.SharpDevelop.Project if (location == PropertyStorageLocations.Unchanged) { location = oldLocation; } + // determine the insertion position for the property MSBuild.PropertyPosition propertyInsertionPosition; if (saveAfterImportsProperties.Contains(propertyName)) { propertyInsertionPosition = MSBuild.PropertyPosition.UseExistingOrCreateAfterLastImport; } else { propertyInsertionPosition = MSBuild.PropertyPosition.UseExistingOrCreateAfterLastPropertyGroup; } + // get the project file where the property should be stored + MSBuild.Project targetProject; + if ((location & PropertyStorageLocations.UserFile) == PropertyStorageLocations.UserFile) + targetProject = userProject; + else + targetProject = project; if (oldLocation != location) { // move existing properties to new location, then use the normal property @@ -542,10 +616,10 @@ namespace ICSharpCode.SharpDevelop.Project // Recreate the property using the saved value foreach (KeyValuePair<string, string> pair in oldValuesConf) { if (pair.Value != null) { - project.SetProperty(propertyName, pair.Value, - CreateCondition(pair.Key, null, location), - propertyInsertionPosition, - false); + MSBuildSetProperty(targetProject, propertyName, pair.Value, + CreateCondition(pair.Key, null, location), + propertyInsertionPosition, + false); } } break; @@ -562,10 +636,10 @@ namespace ICSharpCode.SharpDevelop.Project // Recreate the property using the saved value foreach (KeyValuePair<string, string> pair in oldValuesPlat) { if (pair.Value != null) { - project.SetProperty(propertyName, pair.Value, - CreateCondition(null, pair.Key, location), - propertyInsertionPosition, - false); + MSBuildSetProperty(targetProject, propertyName, pair.Value, + CreateCondition(null, pair.Key, location), + propertyInsertionPosition, + false); } } break; @@ -584,10 +658,10 @@ namespace ICSharpCode.SharpDevelop.Project // Recreate the property using the saved value foreach (KeyValuePair<StringPair, string> pair in oldValues) { if (pair.Value != null) { - project.SetProperty(propertyName, pair.Value, - CreateCondition(pair.Key.First, pair.Key.Second, location), - propertyInsertionPosition, - false); + MSBuildSetProperty(targetProject, propertyName, pair.Value, + CreateCondition(pair.Key.First, pair.Key.Second, location), + propertyInsertionPosition, + false); } } break; @@ -596,11 +670,12 @@ namespace ICSharpCode.SharpDevelop.Project } // update existingProperty and existingPropertyGroup after the move operation + PropertyStorageLocations tmpLocation; existingProperty = FindPropertyObject(configuration, platform, propertyName, out existingPropertyGroup, - out oldLocation); + out tmpLocation); } ProjectPropertyChangedEventArgs args; args = new ProjectPropertyChangedEventArgs(propertyName); @@ -612,34 +687,54 @@ namespace ICSharpCode.SharpDevelop.Project args.NewValue = treatPropertyValueAsLiteral ? MSBuildInternals.Escape(newValue) : newValue; } - if (newValue == null) { - if (existingPropertyGroup != null && existingProperty != null) { - args.OldValue = existingProperty.Value; - + if (existingPropertyGroup != null && existingProperty != null) { + // update or delete existing property + args.OldValue = existingProperty.Value; + MSBuildSetProperty(targetProject, propertyName, newValue ?? "", + existingPropertyGroup.Condition, + propertyInsertionPosition, + treatPropertyValueAsLiteral); + if (newValue == null) { + // delete existing property existingPropertyGroup.RemoveProperty(existingProperty); + if (existingPropertyGroup.Count == 0) { - project.RemovePropertyGroup(existingPropertyGroup); + targetProject.RemovePropertyGroup(existingPropertyGroup); } } - } else if (existingPropertyGroup != null && existingProperty != null) { - args.OldValue = existingProperty.Value; - project.SetProperty(propertyName, newValue, - existingPropertyGroup.Condition, - propertyInsertionPosition, - treatPropertyValueAsLiteral); - } else { - project.SetProperty(propertyName, newValue, - CreateCondition(configuration, platform, location), - propertyInsertionPosition, - treatPropertyValueAsLiteral); + } else if (newValue != null) { + // create new property + MSBuildSetProperty(targetProject, propertyName, newValue, + CreateCondition(configuration, platform, location), + propertyInsertionPosition, + treatPropertyValueAsLiteral); } return args; } + void MSBuildSetProperty(MSBuild.Project targetProject, string propertyName, string newValue, + string groupCondition, MSBuild.PropertyPosition position, + bool treatPropertyValueAsLiteral) + { + if (targetProject == project) { + project.SetProperty(propertyName, newValue, groupCondition, position, treatPropertyValueAsLiteral); + } else if (targetProject == userProject) { + project.SetImportedProperty(propertyName, newValue, groupCondition, userProject, position, treatPropertyValueAsLiteral); + } else { + throw new ArgumentException(); + } + } + /// <summary> /// Removes the property from all configurations and platforms. /// </summary> void RemovePropertyCompletely(string propertyName) + { + RemovePropertyCompletely(project, propertyName); + RemovePropertyCompletely(userProject, propertyName); + } + + static void RemovePropertyCompletely(MSBuild.Project project, string propertyName) { List<MSBuild.BuildPropertyGroup> emptiedGroups = new List<MSBuild.BuildPropertyGroup>(); foreach (MSBuild.BuildPropertyGroup g in project.PropertyGroups) { @@ -752,8 +847,9 @@ namespace ICSharpCode.SharpDevelop.Project items.Add(CreateProjectItem(item)); } + + ClearFindFileCache(); } - ClearFindFileCache(); } void IProjectItemListProvider.AddProjectItem(ProjectItem item) @@ -890,59 +986,76 @@ namespace ICSharpCode.SharpDevelop.Project protected virtual void LoadProject(string fileName) { - isLoading = true; - try { - this.FileName = fileName; - - InitializeMSBuildProject(project); - + lock (SyncRoot) { + isLoading = true; try { - project.Load(fileName); - } catch (MSBuild.InvalidProjectFileException ex) { - LoggingService.Warn(ex); - LoggingService.Warn("ErrorCode = " + ex.ErrorCode); - bool isVS2003ProjectWithInvalidEncoding = false; - if (ex.ErrorCode == "MSB4025") { - // Invalid XML. - // This MIGHT be a VS2003 project in default encoding, so we have to use this - // ugly trick to detect old-style projects - using (StreamReader r = File.OpenText(fileName)) { - if (r.ReadLine() == "<VisualStudioProject>") { - isVS2003ProjectWithInvalidEncoding = true; - } + LoadProjectInternal(fileName); + } finally { + isLoading = false; + } + } + } + + void LoadProjectInternal(string fileName) + { + this.FileName = fileName; + + InitializeMSBuildProject(project); + + try { + project.Load(fileName); + } catch (MSBuild.InvalidProjectFileException ex) { + LoggingService.Warn(ex); + LoggingService.Warn("ErrorCode = " + ex.ErrorCode); + bool isVS2003ProjectWithInvalidEncoding = false; + if (ex.ErrorCode == "MSB4025") { + // Invalid XML. + // This MIGHT be a VS2003 project in default encoding, so we have to use this + // ugly trick to detect old-style projects + using (StreamReader r = File.OpenText(fileName)) { + if (r.ReadLine() == "<VisualStudioProject>") { + isVS2003ProjectWithInvalidEncoding = true; } } - if (ex.ErrorCode == "MSB4075" || isVS2003ProjectWithInvalidEncoding) { - // MSB4075 is: - // "The project file must be opened in VS IDE and converted to latest version - // before it can be build by MSBuild." - try { - Converter.PrjxToSolutionProject.ConvertVSNetProject(fileName); - project.Load(fileName); - } catch (System.Xml.XmlException ex2) { - throw new ProjectLoadException(ex2.Message, ex2); - } catch (MSBuild.InvalidProjectFileException ex2) { - throw new ProjectLoadException(ex2.Message, ex2); - } - } else { - throw new ProjectLoadException(ex.Message, ex); + } + if (ex.ErrorCode == "MSB4075" || isVS2003ProjectWithInvalidEncoding) { + // MSB4075 is: + // "The project file must be opened in VS IDE and converted to latest version + // before it can be build by MSBuild." + try { + Converter.PrjxToSolutionProject.ConvertVSNetProject(fileName); + project.Load(fileName); + } catch (System.Xml.XmlException ex2) { + throw new ProjectLoadException(ex2.Message, ex2); + } catch (MSBuild.InvalidProjectFileException ex2) { + throw new ProjectLoadException(ex2.Message, ex2); } + } else { + throw new ProjectLoadException(ex.Message, ex); } - this.ActiveConfiguration = GetEvaluatedProperty("Configuration") ?? this.ActiveConfiguration; - this.ActivePlatform = GetEvaluatedProperty("Platform") ?? this.ActivePlatform; - - // Some projects do not specify default configuration/platform, so we have to set - // Configuration and Platform in the global properties to be sure these properties exist - project.GlobalProperties.SetProperty("Configuration", this.ActiveConfiguration, true); - project.GlobalProperties.SetProperty("Platform", this.ActivePlatform, true); - - CreateItemsListFromMSBuild(); - LoadConfigurationPlatformNamesFromMSBuild(); - - base.IdGuid = GetEvaluatedProperty(ProjectGuidPropertyName); - } finally { - isLoading = false; } + + string userFileName = fileName + ".user"; + if (File.Exists(userFileName)) { + try { + userProject.Load(userFileName); + } catch (MSBuild.InvalidProjectFileException ex) { + throw new ProjectLoadException("Error loading user part " + userFileName + ":\n" + ex.Message); + } + } + + this.ActiveConfiguration = GetEvaluatedProperty("Configuration") ?? this.ActiveConfiguration; + this.ActivePlatform = GetEvaluatedProperty("Platform") ?? this.ActivePlatform; + + // Some projects do not specify default configuration/platform, so we have to set + // Configuration and Platform in the global properties to be sure these properties exist + project.GlobalProperties.SetProperty("Configuration", this.ActiveConfiguration, true); + project.GlobalProperties.SetProperty("Platform", this.ActivePlatform, true); + + CreateItemsListFromMSBuild(); + LoadConfigurationPlatformNamesFromMSBuild(); + + base.IdGuid = GetEvaluatedProperty(ProjectGuidPropertyName); } [Browsable(false)] @@ -952,10 +1065,6 @@ namespace ICSharpCode.SharpDevelop.Project if (base.IdGuid == null) { // Save the GUID in the project if the project does not yet have a GUID. SetPropertyInternal(null, null, ProjectGuidPropertyName, value, PropertyStorageLocations.Base, true); - try { - // save fixed project - project.Save(this.FileName); - } catch {} } base.IdGuid = value; } @@ -967,6 +1076,11 @@ namespace ICSharpCode.SharpDevelop.Project { lock (SyncRoot) { project.Save(fileName); + bool userProjectDirty = userProject.IsDirty; + string userFile = fileName + ".user"; + if (File.Exists(userFile) || userProject.PropertyGroups.Count > 0) { + userProject.Save(userFile); + } } } #endregion @@ -1000,19 +1114,23 @@ namespace ICSharpCode.SharpDevelop.Project public override ICollection<string> ConfigurationNames { get { - if (configurationNames == null) { - LoadConfigurationPlatformNamesFromMSBuild(); + lock (SyncRoot) { + if (configurationNames == null) { + LoadConfigurationPlatformNamesFromMSBuild(); + } + return configurationNames; } - return configurationNames; } } public override ICollection<string> PlatformNames { get { - if (platformNames == null) { - LoadConfigurationPlatformNamesFromMSBuild(); + lock (SyncRoot) { + if (platformNames == null) { + LoadConfigurationPlatformNamesFromMSBuild(); + } + return platformNames; } - return platformNames; } } @@ -1025,6 +1143,25 @@ namespace ICSharpCode.SharpDevelop.Project Set<string> configurationNames = new Set<string>(); Set<string> platformNames = new Set<string>(); + LoadConfigurationPlatformNamesFromMSBuildInternal(project, configurationNames, platformNames); + LoadConfigurationPlatformNamesFromMSBuildInternal(userProject, configurationNames, platformNames); + + if (configurationNames.Count == 0) { + configurationNames.Add("Debug"); + configurationNames.Add("Release"); + } + if (platformNames.Count == 0) { + platformNames.Add("AnyCPU"); + } + + this.configurationNames = configurationNames.AsReadOnly(); + this.platformNames = platformNames.AsReadOnly(); + } + + static void LoadConfigurationPlatformNamesFromMSBuildInternal( + MSBuild.Project project, + Set<string> configurationNames, Set<string> platformNames) + { foreach (MSBuild.BuildPropertyGroup g in project.PropertyGroups) { if (g.IsImported) { continue; @@ -1037,11 +1174,9 @@ namespace ICSharpCode.SharpDevelop.Project if (prop != null && !string.IsNullOrEmpty(prop.FinalValue)) { platformNames.Add(prop.FinalValue); } - + string gConfiguration, gPlatform; - MSBuildInternals.GetConfigurationAndPlatformFromCondition(g.Condition, - out gConfiguration, - out gPlatform); + MSBuildInternals.GetConfigurationAndPlatformFromCondition(g.Condition, out gConfiguration, out gPlatform); if (gConfiguration != null) { configurationNames.Add(gConfiguration); } @@ -1049,17 +1184,6 @@ namespace ICSharpCode.SharpDevelop.Project platformNames.Add(gPlatform); } } - - if (configurationNames.Count == 0) { - configurationNames.Add("Debug"); - configurationNames.Add("Release"); - } - if (platformNames.Count == 0) { - platformNames.Add("AnyCPU"); - } - - this.configurationNames = configurationNames.AsReadOnly(); - this.platformNames = platformNames.AsReadOnly(); } #endregion diff --git a/src/Main/Base/Project/Src/Project/MSBuildEngine.cs b/src/Main/Base/Project/Src/Project/MSBuildEngine.cs index 76965b4ff5..af851baab3 100644 --- a/src/Main/Base/Project/Src/Project/MSBuildEngine.cs +++ b/src/Main/Base/Project/Src/Project/MSBuildEngine.cs @@ -224,6 +224,7 @@ namespace ICSharpCode.SharpDevelop.Project if (buildInProcess) { settings.BuildDoneCallback = delegate(bool success) { + LoggingService.Debug("BuildInProcess: Received BuildDoneCallback"); if (Interlocked.Exchange(ref isBuildingInProcess, 0) != 1) { MessageService.ShowError("isBuildingInProcess should have been 1!"); } @@ -233,15 +234,18 @@ namespace ICSharpCode.SharpDevelop.Project Thread thread = new Thread(new ThreadStart( delegate { + LoggingService.Debug("Acquiring InProcessMSBuildLock"); lock (MSBuildInternals.InProcessMSBuildLock) { WorkerManager.RunBuildInProcess(job, settings); + LoggingService.Debug("Leaving InProcessMSBuildLock"); } })); - thread.Name = "InProcess build thread"; + thread.Name = "InProcess build thread " + thread.ManagedThreadId; thread.SetApartmentState(ApartmentState.STA); thread.Start(); } else { settings.BuildDoneCallback = delegate(bool success) { + LoggingService.Debug("BuildOutOfProcess: Received BuildDoneCallback"); logger.FlushCurrentError(); feedbackSink.Done(success); }; diff --git a/src/Main/Base/Project/Src/Project/MSBuildInternals.cs b/src/Main/Base/Project/Src/Project/MSBuildInternals.cs index 4b3a79a8b8..0f3860da8c 100644 --- a/src/Main/Base/Project/Src/Project/MSBuildInternals.cs +++ b/src/Main/Base/Project/Src/Project/MSBuildInternals.cs @@ -308,6 +308,11 @@ namespace ICSharpCode.SharpDevelop.Project } static void EndXmlManipulation(MSBuild.Project project) + { + MarkProjectAsDirtyForReprocessXml(project); + } + + internal static void MarkProjectAsDirtyForReprocessXml(MSBuild.Project project) { typeof(MSBuild.Project).InvokeMember( "MarkProjectAsDirtyForReprocessXml", @@ -318,14 +323,14 @@ namespace ICSharpCode.SharpDevelop.Project internal static void ResolveAssemblyReferences(MSBuildBasedProject baseProject, ReferenceProjectItem[] referenceReplacements) { - MSBuild.Engine engine; + MSBuild.Engine tempEngine; MSBuild.Project tempProject; IEnumerable<ReferenceProjectItem> references; lock (baseProject.SyncRoot) { // create a copy of the project - engine = CreateEngine(); - tempProject = engine.CreateNewProject(); + tempEngine = CreateEngine(); + tempProject = tempEngine.CreateNewProject(); // tell MSBuild the path so that projects containing <Import Project="relativePath" /> // can be loaded tempProject.FullFileName = baseProject.MSBuildProject.FullFileName; @@ -402,6 +407,8 @@ namespace ICSharpCode.SharpDevelop.Project LoggingService.Warn("Unknown item " + originalInclude); } } + + tempEngine.UnloadAllProjects(); // unload temp project } } } diff --git a/src/Main/Base/Project/Src/Project/Solution/Solution.cs b/src/Main/Base/Project/Src/Project/Solution/Solution.cs index 01110f718e..a92d5d2dcc 100644 --- a/src/Main/Base/Project/Src/Project/Solution/Solution.cs +++ b/src/Main/Base/Project/Src/Project/Solution/Solution.cs @@ -28,7 +28,12 @@ namespace ICSharpCode.SharpDevelop.Project public class Solution : SolutionFolder, IDisposable, IMSBuildEngineProvider, IBuildable { + public const int SolutionVersionVS2005 = 9; + public const int SolutionVersionVS2008 = 10; + + [Obsolete("Use SolutionVersionVS2005 instead")] public const int SolutionVersionVS05 = 9; + [Obsolete("Use SolutionVersionVS2008 instead")] public const int SolutionVersionVS08 = 10; /// <summary>contains <GUID, (IProject/ISolutionFolder)> pairs.</summary> @@ -351,16 +356,16 @@ namespace ICSharpCode.SharpDevelop.Project // we need to specify UTF8 because MSBuild needs the BOM using (StreamWriter sw = new StreamWriter(fileName, false, Encoding.UTF8)) { sw.WriteLine(); - int versionNumber = SolutionVersionVS05; + int versionNumber = SolutionVersionVS2005; foreach (IProject p in this.Projects) { if (p.MinimumSolutionVersion > versionNumber) versionNumber = p.MinimumSolutionVersion; } sw.WriteLine("Microsoft Visual Studio Solution File, Format Version " + versionNumber + ".00"); - if (versionNumber == SolutionVersionVS05) { + if (versionNumber == SolutionVersionVS2005) { sw.WriteLine("# Visual Studio 2005"); - } else if (versionNumber == SolutionVersionVS08) { + } else if (versionNumber == SolutionVersionVS2008) { sw.WriteLine("# Visual Studio 2008"); } sw.WriteLine("# SharpDevelop " + RevisionClass.FullVersion); diff --git a/src/Main/Base/Project/Src/Services/AmbienceService/AmbienceService.cs b/src/Main/Base/Project/Src/Services/AmbienceService/AmbienceService.cs index f3362bb3f7..554fd13d86 100644 --- a/src/Main/Base/Project/Src/Services/AmbienceService/AmbienceService.cs +++ b/src/Main/Base/Project/Src/Services/AmbienceService/AmbienceService.cs @@ -79,7 +79,7 @@ namespace ICSharpCode.SharpDevelop /// <summary> /// Gets the current ambience. - /// Might return a new ambience object, or use an existing. Not thread-safe. + /// Might return a new ambience object, or use an existing. Use this method only on the main thread. /// </summary> public static IAmbience GetCurrentAmbience() { diff --git a/src/Main/Base/Project/Src/Services/AmbienceService/NetAmbience.cs b/src/Main/Base/Project/Src/Services/AmbienceService/NetAmbience.cs index 8a7689dadd..acb1270dc1 100644 --- a/src/Main/Base/Project/Src/Services/AmbienceService/NetAmbience.cs +++ b/src/Main/Base/Project/Src/Services/AmbienceService/NetAmbience.cs @@ -240,14 +240,17 @@ namespace ICSharpCode.SharpDevelop if (returnType == null) { return String.Empty; } + StringBuilder builder = new StringBuilder(); string name = returnType.DotNetName; if (UseFullyQualifiedTypeNames) { builder.Append(name); } else { - int pos = returnType.Namespace.Length; - builder.Append(name, pos, name.Length - pos); + string rtNamespace = returnType.Namespace; + if (name.StartsWith(rtNamespace, StringComparison.Ordinal)) { + builder.Append(name, rtNamespace.Length, name.Length - rtNamespace.Length); + } } return builder.ToString(); diff --git a/src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs b/src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs index ef33be57b6..b00f742831 100644 --- a/src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs +++ b/src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs @@ -442,11 +442,9 @@ namespace ICSharpCode.SharpDevelop.Debugging if (currentValue != null) { debuggerCanShowValue = true; b.Append(" = "); - if (currentValue.Length > 256) { - b.Append(currentValue.Substring(0, 256)); - b.Append("..."); - } else - b.Append(currentValue); + if (currentValue.Length > 256) + currentValue = currentValue.Substring(0, 256) + "..."; + b.Append(currentValue); } } return b.ToString(); @@ -510,7 +508,7 @@ namespace ICSharpCode.SharpDevelop.Debugging string documentation = member.Documentation; if (documentation != null && documentation.Length > 0) { text.Append('\n'); - text.Append(ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.CodeCompletionData.GetDocumentation(documentation)); + text.Append(ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.CodeCompletionData.ConvertDocumentation(documentation)); } return text.ToString(); } diff --git a/src/Main/Base/Project/Src/Services/LanguageBinding/LanguageBindingDescriptor.cs b/src/Main/Base/Project/Src/Services/LanguageBinding/LanguageBindingDescriptor.cs index 9fffa18bf7..bdb58f6efa 100644 --- a/src/Main/Base/Project/Src/Services/LanguageBinding/LanguageBindingDescriptor.cs +++ b/src/Main/Base/Project/Src/Services/LanguageBinding/LanguageBindingDescriptor.cs @@ -40,6 +40,7 @@ namespace ICSharpCode.SharpDevelop } } + public string Guid { get { return codon.Properties["guid"]; diff --git a/src/Main/Base/Project/Src/Services/RefactoringService/FindReferencesAndRenameHelper.cs b/src/Main/Base/Project/Src/Services/RefactoringService/FindReferencesAndRenameHelper.cs index d9cead43a1..4235d30ed7 100644 --- a/src/Main/Base/Project/Src/Services/RefactoringService/FindReferencesAndRenameHelper.cs +++ b/src/Main/Base/Project/Src/Services/RefactoringService/FindReferencesAndRenameHelper.cs @@ -5,11 +5,11 @@ // <version>$Revision$</version> // </file> +using ICSharpCode.NRefactory.Ast; using System; using System.Collections.Generic; using System.IO; using System.Text; - using ICSharpCode.Core; using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor; using ICSharpCode.SharpDevelop.Dom; @@ -54,7 +54,7 @@ namespace ICSharpCode.SharpDevelop.Refactoring 1, "${res:Global.ReplaceButtonText}", "${res:Global.AbortButtonText}"); - if (confirmReplace == 1) { + if (confirmReplace != 0) { return; } } @@ -62,16 +62,12 @@ namespace ICSharpCode.SharpDevelop.Refactoring LanguageProperties language = c.ProjectContent.Language; string classFileName = c.CompilationUnit.FileName; string existingClassCode = ParserService.GetParseableFileContent(classFileName); - + // build the new interface... - string newInterfaceCode = - language.RefactoringProvider.GenerateInterfaceForClass(extractInterface.NewInterfaceName, - extractInterface.ChosenMembers, - extractInterface.IncludeComments, - c.Namespace, - c.Name, - existingClassCode - ); + string newInterfaceCode = language.RefactoringProvider.GenerateInterfaceForClass(extractInterface.NewInterfaceName, + existingClassCode, + extractInterface.ChosenMembers, + c, extractInterface.IncludeComments); if (newInterfaceCode == null) return; @@ -83,7 +79,6 @@ namespace ICSharpCode.SharpDevelop.Refactoring // simply update it editable.Text = newInterfaceCode; viewContent.PrimaryFile.SaveToDisk(); - } else { // create it viewContent = FileService.NewFile(newInterfaceFileName, newInterfaceCode); @@ -101,9 +96,12 @@ namespace ICSharpCode.SharpDevelop.Refactoring } } + ICompilationUnit newCompilationUnit = ParserService.ParseFile(newInterfaceFileName).MostRecentCompilationUnit; + IClass newInterfaceDef = newCompilationUnit.Classes[0]; + // finally, add the interface to the base types of the class that we're extracting from if (extractInterface.AddInterfaceToClass) { - string modifiedClassCode = language.RefactoringProvider.AddBaseTypeToClass(existingClassCode, extractInterface.NewInterfaceName); + string modifiedClassCode = language.RefactoringProvider.AddBaseTypeToClass(existingClassCode, c, newInterfaceDef); if (modifiedClassCode == null) { return; } diff --git a/src/Main/Base/Project/Src/TextEditor/ClipboardHandling.cs b/src/Main/Base/Project/Src/TextEditor/ClipboardHandling.cs index f81d26dae8..07635994d1 100644 --- a/src/Main/Base/Project/Src/TextEditor/ClipboardHandling.cs +++ b/src/Main/Base/Project/Src/TextEditor/ClipboardHandling.cs @@ -47,7 +47,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor return clipboardContainsText; } - static Thread updateThread; + static volatile Thread updateThread; static void UpdateClipboardContainsText() { @@ -56,6 +56,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor Thread t = new Thread(new ThreadStart(DoUpdate)); t.SetApartmentState(ApartmentState.STA); t.IsBackground = true; + t.Name = "clipboard access"; updateThread = t; t.Start(); t.Join(50); // wait a few ms in case the clipboard can be accessed without problems diff --git a/src/Main/Base/Project/Src/TextEditor/Commands/CodeGenerators/ToStringCodeGenerator.cs b/src/Main/Base/Project/Src/TextEditor/Commands/CodeGenerators/ToStringCodeGenerator.cs index 45bee96d63..a4231dfb95 100644 --- a/src/Main/Base/Project/Src/TextEditor/Commands/CodeGenerators/ToStringCodeGenerator.cs +++ b/src/Main/Base/Project/Src/TextEditor/Commands/CodeGenerators/ToStringCodeGenerator.cs @@ -18,7 +18,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands { public override void GenerateCode(List<AbstractNode> nodes, IList items) { - TypeReference stringReference = new TypeReference("System.String"); + TypeReference stringReference = new TypeReference("System.String", true); MethodDeclaration method = new MethodDeclaration { Name = "ToString", Modifier = Modifiers.Public | Modifiers.Override, diff --git a/src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionData.cs b/src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionData.cs index badaa1b11b..3de5e63aa0 100644 --- a/src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionData.cs +++ b/src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionData.cs @@ -20,15 +20,12 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor { public class CodeCompletionData : ICompletionData { - IAmbience ambience; + IEntity entity; int imageIndex; int overloads; string text; - string description; - string documentation; - IClass c; - IMember member; - bool convertedDocumentation = false; + string description; + string documentation; double priority; /// <summary> @@ -37,7 +34,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor /// </summary> public IClass Class { get { - return c; + return entity as IClass; } } @@ -47,7 +44,16 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor /// </summary> public IMember Member { get { - return member; + return entity as IMember; + } + } + + /// <summary> + /// Gets the class or member this CodeCompletionData object was created for. + /// </summary> + public IEntity Entity { + get { + return entity; } } @@ -93,9 +99,11 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor if (description.Length == 0 && (documentation == null || documentation.Length == 0)) { return ""; } - if (!convertedDocumentation && documentation != null) { - convertedDocumentation = true; - documentation = GetDocumentation(documentation); + if (documentation == null) { + if (entity != null) + documentation = ConvertDocumentation(entity.Documentation); + else + documentation = ""; } return description + (overloads > 0 ? " " + StringParser.Parse("${res:ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.CodeCompletionData.OverloadsCounter}", new string[,] {{"NumOverloads", overloads.ToString()}}) : String.Empty) + "\n" + documentation; @@ -107,7 +115,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor string dotnetName; - void GetPriority(string dotnetName) + void InitializePriority(string dotnetName) { this.dotnetName = dotnetName; priority = CodeCompletionDataUsageCache.GetPriority(dotnetName, true); @@ -115,77 +123,51 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor public CodeCompletionData(string s, int imageIndex) { - ambience = AmbienceService.GetCurrentAmbience(); description = documentation = String.Empty; text = s; this.imageIndex = imageIndex; - GetPriority(s); + InitializePriority(s); } public CodeCompletionData(IClass c) { - ambience = AmbienceService.GetCurrentAmbience(); + IAmbience ambience = AmbienceService.GetCurrentAmbience(); // save class (for the delegate description shortcut) - this.c = c; + this.entity = c; imageIndex = ClassBrowserIconService.GetIcon(c); ambience.ConversionFlags = ConversionFlags.ShowTypeParameterList; text = ambience.Convert(c); ambience.ConversionFlags = ConversionFlags.StandardConversionFlags | ConversionFlags.UseFullyQualifiedMemberNames; description = ambience.Convert(c); - documentation = c.Documentation; - GetPriority(c.DotNetName); + InitializePriority(c.DotNetName); } - public CodeCompletionData(IMethod method) + public CodeCompletionData(IMember member) { - member = method; - imageIndex = ClassBrowserIconService.GetIcon(method); - ambience = AmbienceService.GetCurrentAmbience(); + this.entity = member; + imageIndex = ClassBrowserIconService.GetIcon(member); + IAmbience ambience = AmbienceService.GetCurrentAmbience(); ambience.ConversionFlags = ConversionFlags.None; - text = ambience.Convert(method); + text = ambience.Convert(member); ambience.ConversionFlags = ConversionFlags.StandardConversionFlags; - description = ambience.Convert(method); - documentation = method.Documentation; - GetPriority(method.DotNetName); + description = ambience.Convert(member); + InitializePriority(member.DotNetName); } - public CodeCompletionData(IField field) + public CodeCompletionData(IMethod method) : this((IMember)method) { - member = field; - ambience = AmbienceService.GetCurrentAmbience(); - imageIndex = ClassBrowserIconService.GetIcon(field); - ambience.ConversionFlags = ConversionFlags.None; - text = ambience.Convert(field); - ambience.ConversionFlags = ConversionFlags.StandardConversionFlags; - description = ambience.Convert(field); - documentation = field.Documentation; - GetPriority(field.DotNetName); } - public CodeCompletionData(IProperty property) + public CodeCompletionData(IField field) : this((IMember)field) { - member = property; - ambience = AmbienceService.GetCurrentAmbience(); - imageIndex = ClassBrowserIconService.GetIcon(property); - ambience.ConversionFlags = ConversionFlags.None; - text = ambience.Convert(property); - ambience.ConversionFlags = ConversionFlags.StandardConversionFlags; - description = ambience.Convert(property); - documentation = property.Documentation; - GetPriority(property.DotNetName); } - public CodeCompletionData(IEvent e) + public CodeCompletionData(IProperty property) : this((IMember)property) + { + } + + public CodeCompletionData(IEvent e) : this((IMember)e) { - member = e; - ambience = AmbienceService.GetCurrentAmbience(); - imageIndex = ClassBrowserIconService.GetIcon(e); - ambience.ConversionFlags = ConversionFlags.None; - text = ambience.Convert(e); - ambience.ConversionFlags = ConversionFlags.StandardConversionFlags; - description = ambience.Convert(e); - documentation = e.Documentation; - GetPriority(e.DotNetName); } public bool InsertAction(TextArea textArea, char ch) @@ -193,6 +175,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor if (dotnetName != null) { CodeCompletionDataUsageCache.IncrementUsage(dotnetName); } + IClass c = this.Class; if (c != null && text.Length > c.Name.Length) { textArea.InsertString(text.Substring(0, c.Name.Length + 1)); TextLocation start = textArea.Caret.Position; @@ -218,13 +201,22 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor return false; } - internal static Regex whitespace = new Regex(@"\s+"); + [Obsolete("Use 'ConvertDocumentation' instead.")] + public static string GetDocumentation(string doc) + { + return ConvertDocumentation(doc); + } + + static readonly Regex whitespace = new Regex(@"\s+"); /// <summary> /// Converts the xml documentation string into a plain text string. /// </summary> - public static string GetDocumentation(string doc) + public static string ConvertDocumentation(string doc) { + if (string.IsNullOrEmpty(doc)) + return string.Empty; + System.IO.StringReader reader = new System.IO.StringReader("<docroot>" + doc + "</docroot>"); XmlTextReader xml = new XmlTextReader(reader); StringBuilder ret = new StringBuilder(); diff --git a/src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/OverrideCompletionDataProvider.cs b/src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/OverrideCompletionDataProvider.cs index b38bec335f..d1d9f25b80 100644 --- a/src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/OverrideCompletionDataProvider.cs +++ b/src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/OverrideCompletionDataProvider.cs @@ -75,31 +75,36 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor { IMember member; - static string GetName(IMethod method, ConversionFlags flags) + static string GetName(IMember member, ConversionFlags flags) { IAmbience ambience = AmbienceService.GetCurrentAmbience(); - ambience.ConversionFlags = flags | ConversionFlags.ShowParameterNames; - return ambience.Convert(method); + ambience.ConversionFlags = flags | ConversionFlags.ShowParameterNames | ConversionFlags.ShowTypeParameterList; + return ambience.Convert(member); } public OverrideCompletionData(IMethod method) : base(GetName(method, ConversionFlags.ShowParameterList), - "override " + GetName(method, ConversionFlags.ShowReturnType - | ConversionFlags.ShowParameterList - | ConversionFlags.ShowAccessibility) - + "\n\n" + CodeCompletionData.GetDocumentation(method.Documentation), ClassBrowserIconService.GetIcon(method)) { this.member = method; } public OverrideCompletionData(IProperty property) - : base(property.Name, "override " + property.Name + "\n\n" + CodeCompletionData.GetDocumentation(property.Documentation), + : base(property.Name, "override " + property.Name + "\n\n" + CodeCompletionData.ConvertDocumentation(property.Documentation), ClassBrowserIconService.GetIcon(property)) { this.member = property; } + public override string Description { + get { + return "override " + GetName(member, ConversionFlags.ShowReturnType + | ConversionFlags.ShowParameterList + | ConversionFlags.ShowAccessibility) + + "\n\n" + CodeCompletionData.ConvertDocumentation(member.Documentation); + } + } + public override bool InsertAction(TextArea textArea, char ch) { ClassFinder context = new ClassFinder(ParserService.GetParseInformation(textArea.MotherTextEditorControl.FileName), diff --git a/src/Main/Base/Project/Src/TextEditor/Gui/Editor/InsightWindow/MethodInsightDataProvider.cs b/src/Main/Base/Project/Src/TextEditor/Gui/Editor/InsightWindow/MethodInsightDataProvider.cs index 08c629978b..45798339a5 100644 --- a/src/Main/Base/Project/Src/TextEditor/Gui/Editor/InsightWindow/MethodInsightDataProvider.cs +++ b/src/Main/Base/Project/Src/TextEditor/Gui/Editor/InsightWindow/MethodInsightDataProvider.cs @@ -55,7 +55,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor conv.ConversionFlags = ConversionFlags.StandardConversionFlags| ConversionFlags.UseFullyQualifiedMemberNames; string documentation = method.Documentation; string text = conv.Convert(method); - return text + "\n" + CodeCompletionData.GetDocumentation(documentation); + return text + "\n" + CodeCompletionData.ConvertDocumentation(documentation); } int lookupOffset; diff --git a/src/Main/Base/Project/Src/Util/ExtensionMethods.cs b/src/Main/Base/Project/Src/Util/ExtensionMethods.cs index 4a72fa2ae7..b57a10daba 100644 --- a/src/Main/Base/Project/Src/Util/ExtensionMethods.cs +++ b/src/Main/Base/Project/Src/Util/ExtensionMethods.cs @@ -36,6 +36,12 @@ namespace ICSharpCode.SharpDevelop } } + [Obsolete("Use ForEach instead.")] + public static void Foreach<T>(this IEnumerable<T> input, Action<T> action) + { + ForEach(input, action); + } + /// <summary> /// Adds all <paramref name="elements"/> to <paramref name="list"/>. /// </summary> diff --git a/src/Main/Base/Test/NRefactoryResolverTests.cs b/src/Main/Base/Test/NRefactoryResolverTests.cs index 3b13dce152..487649da4a 100644 --- a/src/Main/Base/Test/NRefactoryResolverTests.cs +++ b/src/Main/Base/Test/NRefactoryResolverTests.cs @@ -2748,5 +2748,19 @@ class C : B { Assert.IsTrue(MemberExists(arr, "Y")); Assert.IsFalse(MemberExists(arr, "Z")); } + + [Test] + public void NullableValue() + { + string program = @"using System; +class Test { + public static void M(int? a) { + + } +}"; + MemberResolveResult rr = Resolve<MemberResolveResult>(program, "a.Value", 4); + Assert.AreEqual("System.Nullable.Value", rr.ResolvedMember.FullyQualifiedName); + Assert.AreEqual("System.Int32", rr.ResolvedMember.ReturnType.FullyQualifiedName); + } } } diff --git a/src/Main/Base/Test/StringTagProvider/MockProjectForTagProvider.cs b/src/Main/Base/Test/StringTagProvider/MockProjectForTagProvider.cs index 4ef540d09b..450a17d713 100644 --- a/src/Main/Base/Test/StringTagProvider/MockProjectForTagProvider.cs +++ b/src/Main/Base/Test/StringTagProvider/MockProjectForTagProvider.cs @@ -119,6 +119,10 @@ namespace ICSharpCode.SharpDevelop.Tests.StringTagProvider } } + public event EventHandler ActiveConfigurationChanged { add {} remove {} } + + public event EventHandler ActivePlatformChanged { add {} remove {} } + public ICollection<string> ConfigurationNames { get { throw new NotImplementedException(); diff --git a/src/Main/Core/Project/Configuration/AssemblyInfo.cs b/src/Main/Core/Project/Configuration/AssemblyInfo.cs index 2583bb9518..e626e94bf0 100644 --- a/src/Main/Core/Project/Configuration/AssemblyInfo.cs +++ b/src/Main/Core/Project/Configuration/AssemblyInfo.cs @@ -12,6 +12,8 @@ using System.Runtime.CompilerServices; [assembly: CLSCompliant(true)] [assembly: StringFreezing()] +[assembly: Dependency("System.Xml", LoadHint.Always)] + [assembly: AssemblyTitle("ICSharpCode.Core")] [assembly: AssemblyDescription("The ICSharpCode Core containing the AddInTree and service Subsystem")] [assembly: AssemblyConfiguration("")] diff --git a/src/Main/Core/Project/Src/AddInTree/AddIn/Condition.cs b/src/Main/Core/Project/Src/AddInTree/AddIn/Condition.cs index 7a0ea9c975..7cc6b403f6 100644 --- a/src/Main/Core/Project/Src/AddInTree/AddIn/Condition.cs +++ b/src/Main/Core/Project/Src/AddInTree/AddIn/Condition.cs @@ -53,14 +53,13 @@ namespace ICSharpCode.Core action = properties.Get("action", ConditionFailedAction.Exclude); } - public bool IsValid(object caller) + public bool IsValid(object owner) { try { - return AddInTree.ConditionEvaluators[name].IsValid(caller, this); + return AddInTree.ConditionEvaluators[name].IsValid(owner, this); } catch (KeyNotFoundException) { throw new CoreException("Condition evaluator " + name + " not found!"); } - } public static ICondition Read(XmlReader reader) diff --git a/src/Main/Core/Project/Src/AddInTree/AddIn/DefaultConditionEvaluators/OwnerStateConditionEvaluator.cs b/src/Main/Core/Project/Src/AddInTree/AddIn/DefaultConditionEvaluators/OwnerStateConditionEvaluator.cs index 1d717b08f9..02b460282e 100644 --- a/src/Main/Core/Project/Src/AddInTree/AddIn/DefaultConditionEvaluators/OwnerStateConditionEvaluator.cs +++ b/src/Main/Core/Project/Src/AddInTree/AddIn/DefaultConditionEvaluators/OwnerStateConditionEvaluator.cs @@ -32,8 +32,8 @@ namespace ICSharpCode.Core int conditionInt = Int32.Parse(conditionEnum.ToString("D")); return (stateInt & conditionInt) > 0; - } catch (Exception) { - throw new ApplicationException("can't parse '" + condition.Properties["state"] + "'. Not a valid value."); + } catch (Exception ex) { + throw new CoreException("can't parse '" + condition.Properties["state"] + "'. Not a valid value.", ex); } } return false; diff --git a/src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/ToolBarItem/AbstractComboBoxCommand.cs b/src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/ToolBarItem/AbstractComboBoxCommand.cs index ce538a5b8c..cc015504ee 100644 --- a/src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/ToolBarItem/AbstractComboBoxCommand.cs +++ b/src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/ToolBarItem/AbstractComboBoxCommand.cs @@ -12,6 +12,7 @@ namespace ICSharpCode.Core public abstract class AbstractComboBoxCommand : AbstractCommand, IComboBoxCommand { bool isEnabled = true; + object comboBox; public virtual bool IsEnabled { get { @@ -22,10 +23,21 @@ namespace ICSharpCode.Core } } + public virtual object ComboBox { + get { return comboBox; } + set { + comboBox = value; + OnComboBoxChanged(); + } + } + + protected virtual void OnComboBoxChanged() + { + } + public override void Run() { } - } } diff --git a/src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/ToolBarItem/IComboBoxCommand.cs b/src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/ToolBarItem/IComboBoxCommand.cs index 62fc6985ce..337288e9c0 100644 --- a/src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/ToolBarItem/IComboBoxCommand.cs +++ b/src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/ToolBarItem/IComboBoxCommand.cs @@ -15,5 +15,10 @@ namespace ICSharpCode.Core get; set; } + + object ComboBox { + get; + set; + } } } diff --git a/src/Main/Core/Project/Src/AddInTree/AddIn/ICondition.cs b/src/Main/Core/Project/Src/AddInTree/AddIn/ICondition.cs index 5d1b32f690..57d7888192 100644 --- a/src/Main/Core/Project/Src/AddInTree/AddIn/ICondition.cs +++ b/src/Main/Core/Project/Src/AddInTree/AddIn/ICondition.cs @@ -37,6 +37,6 @@ namespace ICSharpCode.Core /// <summary> /// Returns true, when the condition is valid otherwise false. /// </summary> - bool IsValid(object caller); + bool IsValid(object owner); } } diff --git a/src/Main/Core/Project/Src/AddInTree/AddIn/IConditionEvaluator.cs b/src/Main/Core/Project/Src/AddInTree/AddIn/IConditionEvaluator.cs index b77e1728fe..cd4dba0454 100644 --- a/src/Main/Core/Project/Src/AddInTree/AddIn/IConditionEvaluator.cs +++ b/src/Main/Core/Project/Src/AddInTree/AddIn/IConditionEvaluator.cs @@ -14,6 +14,6 @@ namespace ICSharpCode.Core /// </summary> public interface IConditionEvaluator { - bool IsValid(object caller, Condition condition); + bool IsValid(object owner, Condition condition); } } diff --git a/src/Main/Core/Project/Src/AddInTree/AddIn/Manifest.cs b/src/Main/Core/Project/Src/AddInTree/AddIn/Manifest.cs index 7d58c01790..93e588c8c1 100644 --- a/src/Main/Core/Project/Src/AddInTree/AddIn/Manifest.cs +++ b/src/Main/Core/Project/Src/AddInTree/AddIn/Manifest.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Xml; namespace ICSharpCode.Core @@ -40,15 +41,15 @@ namespace ICSharpCode.Core } } - public List<AddInReference> Dependencies { + public ReadOnlyCollection<AddInReference> Dependencies { get { - return dependencies; + return dependencies.AsReadOnly(); } } - public List<AddInReference> Conflicts { + public ReadOnlyCollection<AddInReference> Conflicts { get { - return conflicts; + return conflicts.AsReadOnly(); } } diff --git a/src/Main/Core/Project/Src/AddInTree/AddIn/Runtime.cs b/src/Main/Core/Project/Src/AddInTree/AddIn/Runtime.cs index c88f21b3bb..0f4c5ddff6 100644 --- a/src/Main/Core/Project/Src/AddInTree/AddIn/Runtime.cs +++ b/src/Main/Core/Project/Src/AddInTree/AddIn/Runtime.cs @@ -63,7 +63,7 @@ namespace ICSharpCode.Core } else if (assembly[0] == '$') { int pos = assembly.IndexOf('/'); if (pos < 0) - throw new ApplicationException("Expected '/' in path beginning with '$'!"); + throw new CoreException("Expected '/' in path beginning with '$'!"); string referencedAddIn = assembly.Substring(1, pos - 1); foreach (AddIn addIn in AddInTree.AddIns) { if (addIn.Enabled && addIn.Manifest.Identities.ContainsKey(referencedAddIn)) { diff --git a/src/Main/Core/Project/Src/Services/MessageService/IMessageService.cs b/src/Main/Core/Project/Src/Services/MessageService/IMessageService.cs index bd9fd54973..711362f8ac 100644 --- a/src/Main/Core/Project/Src/Services/MessageService/IMessageService.cs +++ b/src/Main/Core/Project/Src/Services/MessageService/IMessageService.cs @@ -48,7 +48,7 @@ namespace ICSharpCode.Core.Services /// Use -1 if you don't want to have a cancel button. /// </param> /// <param name="buttontexts">The captions of the buttons.</param> - /// <returns>The number of the button that was clicked.</returns> + /// <returns>The number of the button that was clicked, or -1 if the dialog was closed without clicking a button.</returns> int ShowCustomDialog(string caption, string dialogText, int acceptButtonIndex, int cancelButtonIndex, params string[] buttontexts); string ShowInputBox(string caption, string dialogText, string defaultValue); void ShowMessage(string message, string caption); diff --git a/src/Main/Core/Project/Src/Services/MessageService/MessageService.cs b/src/Main/Core/Project/Src/Services/MessageService/MessageService.cs index 0c07648b72..083b166266 100644 --- a/src/Main/Core/Project/Src/Services/MessageService/MessageService.cs +++ b/src/Main/Core/Project/Src/Services/MessageService/MessageService.cs @@ -142,7 +142,7 @@ namespace ICSharpCode.Core /// Use -1 if you don't want to have a cancel button. /// </param> /// <param name="buttontexts">The captions of the buttons.</param> - /// <returns>The number of the button that was clicked.</returns> + /// <returns>The number of the button that was clicked, or -1 if the dialog was closed without clicking a button.</returns> public static int ShowCustomDialog(string caption, string dialogText, int acceptButtonIndex, int cancelButtonIndex, params string[] buttontexts) { return ServiceManager.MessageService.ShowCustomDialog(caption, dialogText, acceptButtonIndex, cancelButtonIndex, buttontexts); diff --git a/src/Main/Core/Project/Src/Services/PropertyService/Properties.cs b/src/Main/Core/Project/Src/Services/PropertyService/Properties.cs index a0ac92bf41..9a217841f3 100644 --- a/src/Main/Core/Project/Src/Services/PropertyService/Properties.cs +++ b/src/Main/Core/Project/Src/Services/PropertyService/Properties.cs @@ -9,6 +9,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; +using System.Globalization; using System.IO; using System.Text; using System.Xml; @@ -64,7 +65,7 @@ namespace ICSharpCode.Core public string this[string property] { get { - return Convert.ToString(Get(property)); + return Convert.ToString(Get(property), CultureInfo.InvariantCulture); } set { Set(property, value); diff --git a/src/Main/Core/Project/Src/Services/StringParser/StringParser.cs b/src/Main/Core/Project/Src/Services/StringParser/StringParser.cs index a3fbab25dd..2c0b0590ac 100644 --- a/src/Main/Core/Project/Src/Services/StringParser/StringParser.cs +++ b/src/Main/Core/Project/Src/Services/StringParser/StringParser.cs @@ -100,7 +100,7 @@ namespace ICSharpCode.Core StringBuilder output = null; // don't use StringBuilder if input is a single property do { int oldPos = pos; - pos = input.IndexOf("${", pos); + pos = input.IndexOf("${", pos, StringComparison.Ordinal); if (pos < 0) { if (output == null) { return input; @@ -149,7 +149,7 @@ namespace ICSharpCode.Core // most properties start with res: in lowercase, // so we can save 2 string allocations here, in addition to all the jumps // All other prefixed properties {prefix:Key} shoulg get handled in the switch below. - if (propertyName.StartsWith("res:")) { + if (propertyName.StartsWith("res:", StringComparison.OrdinalIgnoreCase)) { try { return Parse(ResourceService.GetString(propertyName.Substring(4)), customTags); } catch (ResourceNotFoundException) { @@ -235,7 +235,7 @@ namespace ICSharpCode.Core static string GetProperty(string propertyName) { string defaultValue = ""; - int pos = propertyName.LastIndexOf("??"); + int pos = propertyName.LastIndexOf("??", StringComparison.Ordinal); if (pos >= 0) { defaultValue = propertyName.Substring(pos + 2); propertyName = propertyName.Substring(0, pos); diff --git a/src/Main/Core/Project/Src/Util/AppDomainLaunchHelper.cs b/src/Main/Core/Project/Src/Util/AppDomainLaunchHelper.cs index 3d926592cb..6f42ec9ef6 100644 --- a/src/Main/Core/Project/Src/Util/AppDomainLaunchHelper.cs +++ b/src/Main/Core/Project/Src/Util/AppDomainLaunchHelper.cs @@ -35,10 +35,11 @@ namespace ICSharpCode.Core /// [Serializable] class Request { ... } // must be serializable !!! /// [Serializable] class ResultClass { ... } // must be serializable !!! /// </code></example> + [Obsolete("This class is broken, serialization does not work and addin dependencies are not loaded in the AppDomain")] public class AppDomainLaunchHelper : MarshalByRefObject { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public object LaunchMethod(string assemblyFile, string typeName, string methodName, object[] arguments) + object LaunchMethod(string assemblyFile, string typeName, string methodName, object[] arguments) { Type t = Assembly.LoadFrom(assemblyFile).GetType(typeName); return t.InvokeMember(methodName, (BindingFlags.Public | BindingFlags.Static | BindingFlags.InvokeMethod), null, null, arguments, CultureInfo.InvariantCulture); diff --git a/src/Main/GlobalAssemblyInfo.template b/src/Main/GlobalAssemblyInfo.template index 4763bc73ae..a8412f89cf 100644 --- a/src/Main/GlobalAssemblyInfo.template +++ b/src/Main/GlobalAssemblyInfo.template @@ -20,7 +20,7 @@ using System.Reflection; [assembly: System.Runtime.InteropServices.ComVisible(false)] [assembly: AssemblyCompany("ic#code")] [assembly: AssemblyProduct("SharpDevelop")] -[assembly: AssemblyCopyright("2000-2008 AlphaSierraPapa")] +[assembly: AssemblyCopyright("2000-2009 AlphaSierraPapa")] [assembly: AssemblyVersion(RevisionClass.FullVersion)] [assembly: NeutralResourcesLanguage("en-US")] diff --git a/src/Main/ICSharpCode.Core.Presentation/GetBitmapExtension.cs b/src/Main/ICSharpCode.Core.Presentation/GetBitmapExtension.cs index 4067b05450..985949cea5 100644 --- a/src/Main/ICSharpCode.Core.Presentation/GetBitmapExtension.cs +++ b/src/Main/ICSharpCode.Core.Presentation/GetBitmapExtension.cs @@ -22,7 +22,7 @@ namespace ICSharpCode.Core.Presentation protected string key; - public override object ProvideValue(IServiceProvider sp) + public override object ProvideValue(IServiceProvider serviceProvider) { return PresentationResourceService.GetBitmapSource(key); } diff --git a/src/Main/ICSharpCode.Core.Presentation/ICSharpCode.Core.Presentation.csproj b/src/Main/ICSharpCode.Core.Presentation/ICSharpCode.Core.Presentation.csproj index ac73ff092d..facbf43dbf 100644 --- a/src/Main/ICSharpCode.Core.Presentation/ICSharpCode.Core.Presentation.csproj +++ b/src/Main/ICSharpCode.Core.Presentation/ICSharpCode.Core.Presentation.csproj @@ -18,6 +18,8 @@ <AssemblyOriginatorKeyFile>..\ICSharpCode.SharpDevelop.snk</AssemblyOriginatorKeyFile> <DelaySign>False</DelaySign> <AssemblyOriginatorKeyMode>File</AssemblyOriginatorKeyMode> + <RunCodeAnalysis>False</RunCodeAnalysis> + <CodeAnalysisRules>-Microsoft.Performance#CA1810</CodeAnalysisRules> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <DebugSymbols>true</DebugSymbols> @@ -67,6 +69,7 @@ <Compile Include="Menu\MenuCommand.cs" /> <Compile Include="Menu\MenuService.cs" /> <Compile Include="Menu\CoreMenuItem.cs" /> + <Compile Include="NativeMethods.cs" /> <Compile Include="PixelSnapper.cs" /> <Compile Include="PresentationResourceService.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> diff --git a/src/Main/ICSharpCode.Core.Presentation/LocalizeExtension.cs b/src/Main/ICSharpCode.Core.Presentation/LocalizeExtension.cs index 9ae3dd12d6..28187281c6 100644 --- a/src/Main/ICSharpCode.Core.Presentation/LocalizeExtension.cs +++ b/src/Main/ICSharpCode.Core.Presentation/LocalizeExtension.cs @@ -22,7 +22,7 @@ namespace ICSharpCode.Core.Presentation protected string key; - public override object ProvideValue(IServiceProvider sp) + public override object ProvideValue(IServiceProvider serviceProvider) { return ResourceService.GetString(key); } diff --git a/src/Main/ICSharpCode.Core.Presentation/Menu/IMenuItemBuilder.cs b/src/Main/ICSharpCode.Core.Presentation/Menu/IMenuItemBuilder.cs index 09bf26cbb1..a59e865eaf 100644 --- a/src/Main/ICSharpCode.Core.Presentation/Menu/IMenuItemBuilder.cs +++ b/src/Main/ICSharpCode.Core.Presentation/Menu/IMenuItemBuilder.cs @@ -11,7 +11,7 @@ using System.Collections; namespace ICSharpCode.Core.Presentation { /// <summary> - /// Description of IMenuItemBuilder. + /// Used to include a dynamically built list of menu items. /// </summary> public interface IMenuItemBuilder { diff --git a/src/Main/ICSharpCode.Core.Presentation/Menu/MenuCommand.cs b/src/Main/ICSharpCode.Core.Presentation/Menu/MenuCommand.cs index 0e40195cad..c5b3a132be 100644 --- a/src/Main/ICSharpCode.Core.Presentation/Menu/MenuCommand.cs +++ b/src/Main/ICSharpCode.Core.Presentation/Menu/MenuCommand.cs @@ -40,6 +40,7 @@ namespace ICSharpCode.Core.Presentation commandCreated = true; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification="We're displaying the message to the user.")] void CreateCommand() { commandCreated = true; diff --git a/src/Main/ICSharpCode.Core.Presentation/Menu/MenuService.cs b/src/Main/ICSharpCode.Core.Presentation/Menu/MenuService.cs index d2ba3c5aed..b2f1d3151f 100644 --- a/src/Main/ICSharpCode.Core.Presentation/Menu/MenuService.cs +++ b/src/Main/ICSharpCode.Core.Presentation/Menu/MenuService.cs @@ -32,7 +32,9 @@ namespace ICSharpCode.Core.Presentation public static ContextMenu CreateContextMenu(object owner, string addInTreePath) { - return null; + ContextMenu menu = new ContextMenu(); + menu.ItemsSource = CreateMenuItems(menu, owner, addInTreePath); + return menu; } internal static ContextMenu CreateContextMenu(IList subItems) diff --git a/src/Main/ICSharpCode.Core.Presentation/NativeMethods.cs b/src/Main/ICSharpCode.Core.Presentation/NativeMethods.cs new file mode 100644 index 0000000000..0a2c85f4d9 --- /dev/null +++ b/src/Main/ICSharpCode.Core.Presentation/NativeMethods.cs @@ -0,0 +1,24 @@ +// <file> +// <copyright see="prj:///doc/copyright.txt"/> +// <license see="prj:///doc/license.txt"/> +// <author name="Daniel Grunwald"/> +// <version>$Revision$</version> +// </file> + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Runtime.InteropServices; +using System.Windows; +using System.Windows.Interop; +using System.Windows.Media.Imaging; + +namespace ICSharpCode.Core.Presentation +{ + static class NativeMethods + { + [DllImport("gdi32.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool DeleteObject(IntPtr hObject); + } +} diff --git a/src/Main/ICSharpCode.Core.Presentation/PixelSnapper.cs b/src/Main/ICSharpCode.Core.Presentation/PixelSnapper.cs index b5dbe1ae29..cb50b670f2 100644 --- a/src/Main/ICSharpCode.Core.Presentation/PixelSnapper.cs +++ b/src/Main/ICSharpCode.Core.Presentation/PixelSnapper.cs @@ -98,7 +98,7 @@ namespace ICSharpCode.Core.Presentation // Gets the matrix that will convert a point from "above" the // coordinate space of a visual into the the coordinate space // "below" the visual. - private Matrix GetVisualTransform(Visual v) + static Matrix GetVisualTransform(Visual v) { if (v != null) { Matrix m = Matrix.Identity; @@ -117,7 +117,7 @@ namespace ICSharpCode.Core.Presentation return Matrix.Identity; } - private Point ApplyVisualTransform(Point point, Visual v, bool inverse) + static Point ApplyVisualTransform(Point point, Visual v, bool inverse) { if (v != null) { Matrix visualTransform = GetVisualTransform(v); @@ -154,12 +154,12 @@ namespace ICSharpCode.Core.Presentation return pixelOffset; } - private bool AreClose(Point point1, Point point2) + static bool AreClose(Point point1, Point point2) { return AreClose(point1.X, point2.X) && AreClose(point1.Y, point2.Y); } - private bool AreClose(double value1, double value2) + static bool AreClose(double value1, double value2) { if (value1 == value2) { diff --git a/src/Main/ICSharpCode.Core.Presentation/PresentationResourceService.cs b/src/Main/ICSharpCode.Core.Presentation/PresentationResourceService.cs index 298a80f148..5881acb044 100644 --- a/src/Main/ICSharpCode.Core.Presentation/PresentationResourceService.cs +++ b/src/Main/ICSharpCode.Core.Presentation/PresentationResourceService.cs @@ -93,13 +93,10 @@ namespace ICSharpCode.Core.Presentation bs.Freeze(); bitmapCache[name] = bs; } finally { - DeleteObject(hBitmap); + NativeMethods.DeleteObject(hBitmap); } return bs; } } - - [DllImport("gdi32.dll")] - static extern bool DeleteObject(IntPtr hObject); } } diff --git a/src/Main/ICSharpCode.Core.Presentation/SplitButton.cs b/src/Main/ICSharpCode.Core.Presentation/SplitButton.cs index 148236687a..042696d98e 100644 --- a/src/Main/ICSharpCode.Core.Presentation/SplitButton.cs +++ b/src/Main/ICSharpCode.Core.Presentation/SplitButton.cs @@ -24,6 +24,7 @@ namespace ICSharpCode.Core.Presentation = DependencyProperty.Register("DropDownMenu", typeof(ContextMenu), typeof(SplitButton), new FrameworkPropertyMetadata(null)); + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] protected static readonly DependencyPropertyKey IsDropDownMenuOpenPropertyKey = DependencyProperty.RegisterReadOnly("IsDropDownMenuOpen", typeof(bool), typeof(SplitButton), new FrameworkPropertyMetadata(false)); diff --git a/src/Main/ICSharpCode.Core.Presentation/ToolBar/ToolBarComboBox.cs b/src/Main/ICSharpCode.Core.Presentation/ToolBar/ToolBarComboBox.cs index cf176cd69b..cb005e73b4 100644 --- a/src/Main/ICSharpCode.Core.Presentation/ToolBar/ToolBarComboBox.cs +++ b/src/Main/ICSharpCode.Core.Presentation/ToolBar/ToolBarComboBox.cs @@ -13,8 +13,6 @@ namespace ICSharpCode.Core.Presentation { sealed class ToolBarComboBox : ComboBox { -// readonly Codon codon; -// readonly object caller; IComboBoxCommand menuCommand; public ToolBarComboBox(Codon codon, object caller) @@ -23,7 +21,8 @@ namespace ICSharpCode.Core.Presentation throw new ArgumentNullException("codon"); this.IsEditable = false; menuCommand = (IComboBoxCommand)codon.AddIn.CreateObject(codon.Properties["class"]); - menuCommand.Owner = this; + menuCommand.ComboBox = this; + menuCommand.Owner = caller; SetResourceReference(FrameworkElement.StyleProperty, ToolBar.ComboBoxStyleKey); } diff --git a/src/Main/ICSharpCode.Core.WinForms/Menu/MenuCommand.cs b/src/Main/ICSharpCode.Core.WinForms/Menu/MenuCommand.cs index 7ac040dc5c..4148bcf36c 100644 --- a/src/Main/ICSharpCode.Core.WinForms/Menu/MenuCommand.cs +++ b/src/Main/ICSharpCode.Core.WinForms/Menu/MenuCommand.cs @@ -115,7 +115,7 @@ namespace ICSharpCode.Core.WinForms if (GetVisible() && Enabled) { ICommand cmd = Command; if (cmd != null) { - LoggingService.Debug("Run command " + cmd.GetType().FullName); + LoggingService.Info("Run command " + cmd.GetType().FullName); cmd.Run(); } } diff --git a/src/Main/ICSharpCode.Core.WinForms/MessageService/CustomDialog.cs b/src/Main/ICSharpCode.Core.WinForms/MessageService/CustomDialog.cs index 3ea2b2100e..ea215df7b2 100644 --- a/src/Main/ICSharpCode.Core.WinForms/MessageService/CustomDialog.cs +++ b/src/Main/ICSharpCode.Core.WinForms/MessageService/CustomDialog.cs @@ -137,6 +137,7 @@ namespace ICSharpCode.Core.WinForms this.DockPadding.Right = 4; this.DockPadding.Top = 4; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.ShowInTaskbar = false; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "CustomDialog"; diff --git a/src/Main/ICSharpCode.Core.WinForms/Properties/AssemblyInfo.cs b/src/Main/ICSharpCode.Core.WinForms/Properties/AssemblyInfo.cs index a06970cd94..cf20b15cca 100644 --- a/src/Main/ICSharpCode.Core.WinForms/Properties/AssemblyInfo.cs +++ b/src/Main/ICSharpCode.Core.WinForms/Properties/AssemblyInfo.cs @@ -12,8 +12,13 @@ using System.Runtime.CompilerServices; [assembly: CLSCompliant(true)] [assembly: StringFreezing()] +[assembly: Dependency("ICSharpCode.Core", LoadHint.Always)] +[assembly: Dependency("System.Xml", LoadHint.Always)] +[assembly: Dependency("System.Drawing", LoadHint.Always)] +[assembly: Dependency("System.Windows.Forms", LoadHint.Always)] + [assembly: AssemblyTitle("ICSharpCode.Core.WinForms")] -[assembly: AssemblyDescription("ICSharpCode.Core, Windows.Forms implementation")] +[assembly: AssemblyDescription("Windows Forms binding for ICSharpCode.Core")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/src/Main/ICSharpCode.Core.WinForms/ToolBar/ToolBarComboBox.cs b/src/Main/ICSharpCode.Core.WinForms/ToolBar/ToolBarComboBox.cs index 7c525d4572..c36776a8c6 100644 --- a/src/Main/ICSharpCode.Core.WinForms/ToolBar/ToolBarComboBox.cs +++ b/src/Main/ICSharpCode.Core.WinForms/ToolBar/ToolBarComboBox.cs @@ -49,7 +49,8 @@ namespace ICSharpCode.Core.WinForms this.codon = codon; menuCommand = (IComboBoxCommand)codon.AddIn.CreateObject(codon.Properties["class"]); - menuCommand.Owner = this; + menuCommand.ComboBox = this; + menuCommand.Owner = caller; if (menuCommand == null) { throw new NullReferenceException("Can't create combobox menu command"); } diff --git a/src/Main/ICSharpCode.Core.WinForms/ToolBar/ToolBarCommand.cs b/src/Main/ICSharpCode.Core.WinForms/ToolBar/ToolBarCommand.cs index 2bb2b669c1..5a24815823 100644 --- a/src/Main/ICSharpCode.Core.WinForms/ToolBar/ToolBarCommand.cs +++ b/src/Main/ICSharpCode.Core.WinForms/ToolBar/ToolBarCommand.cs @@ -10,7 +10,7 @@ using System.Windows.Forms; namespace ICSharpCode.Core.WinForms { - public class ToolBarCommand : ToolStripMenuItem, IStatusUpdate + public class ToolBarCommand : ToolStripButton, IStatusUpdate { object caller; Codon codon; @@ -45,7 +45,7 @@ namespace ICSharpCode.Core.WinForms } if (menuCommand != null) { menuCommand.Owner = caller; - LoggingService.Debug("Run command " + menuCommand.GetType().FullName); + LoggingService.Info("Run command " + menuCommand.GetType().FullName); menuCommand.Run(); } } diff --git a/src/Main/ICSharpCode.SharpDevelop.BuildWorker/BuildJob.cs b/src/Main/ICSharpCode.SharpDevelop.BuildWorker/BuildJob.cs index 428ac2d20b..3002226b46 100644 --- a/src/Main/ICSharpCode.SharpDevelop.BuildWorker/BuildJob.cs +++ b/src/Main/ICSharpCode.SharpDevelop.BuildWorker/BuildJob.cs @@ -50,7 +50,7 @@ namespace ICSharpCode.SharpDevelop.BuildWorker get { return additionalImports; } } - HashSet<string> interestingTaskNames = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase); + HashSet<string> interestingTaskNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase); public ICollection<string> InterestingTaskNames { get { return interestingTaskNames; } diff --git a/src/Main/ICSharpCode.SharpDevelop.BuildWorker/Interprocess/HostProcess.cs b/src/Main/ICSharpCode.SharpDevelop.BuildWorker/Interprocess/HostProcess.cs index a972fcae8d..af42f27f76 100644 --- a/src/Main/ICSharpCode.SharpDevelop.BuildWorker/Interprocess/HostProcess.cs +++ b/src/Main/ICSharpCode.SharpDevelop.BuildWorker/Interprocess/HostProcess.cs @@ -98,10 +98,10 @@ namespace ICSharpCode.SharpDevelop.BuildWorker.Interprocess mc.CallOn(workerObject); } catch (TargetInvocationException ex) { Program.Log(ex.ToString()); - CallMethodOnHost("ReportException", ex.InnerException); + CallMethodOnHost("ReportException", ex.InnerException.ToString()); } catch (Exception ex) { Program.Log(ex.ToString()); - CallMethodOnHost("ReportException", ex); + CallMethodOnHost("ReportException", ex.ToString()); } } } diff --git a/src/Main/ICSharpCode.SharpDevelop.BuildWorker/Interprocess/IHostObject.cs b/src/Main/ICSharpCode.SharpDevelop.BuildWorker/Interprocess/IHostObject.cs index 74a82b13f5..df1e484c6c 100644 --- a/src/Main/ICSharpCode.SharpDevelop.BuildWorker/Interprocess/IHostObject.cs +++ b/src/Main/ICSharpCode.SharpDevelop.BuildWorker/Interprocess/IHostObject.cs @@ -11,6 +11,6 @@ namespace ICSharpCode.SharpDevelop.BuildWorker.Interprocess { public interface IHostObject { - void ReportException(Exception ex); + void ReportException(string exceptionText); } } diff --git a/src/Main/ICSharpCode.SharpDevelop.BuildWorker/Program.cs b/src/Main/ICSharpCode.SharpDevelop.BuildWorker/Program.cs index 9075d1a850..3452051b61 100644 --- a/src/Main/ICSharpCode.SharpDevelop.BuildWorker/Program.cs +++ b/src/Main/ICSharpCode.SharpDevelop.BuildWorker/Program.cs @@ -10,12 +10,14 @@ using System; using System.Collections.Generic; -using System.IO; using System.Diagnostics; +using System.IO; +using System.Runtime.Serialization; using System.Threading; + using ICSharpCode.SharpDevelop.BuildWorker.Interprocess; -using Microsoft.Build.Framework; using Microsoft.Build.BuildEngine; +using Microsoft.Build.Framework; namespace ICSharpCode.SharpDevelop.BuildWorker { @@ -107,7 +109,8 @@ namespace ICSharpCode.SharpDevelop.BuildWorker } // Called with CallMethodOnWorker - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + //[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + // TODO: make use of CancelBuild public void CancelBuild() { lock (this) { @@ -128,7 +131,7 @@ namespace ICSharpCode.SharpDevelop.BuildWorker } success = DoBuild(); } catch (Exception ex) { - host.CallMethodOnHost("ReportException", ex); + host.CallMethodOnHost("ReportException", ex.ToString()); } finally { Program.Log("BuildDone"); @@ -151,7 +154,7 @@ namespace ICSharpCode.SharpDevelop.BuildWorker | ToolsetDefinitionLocations.ConfigurationFile); engine.RegisterLogger(new ForwardingLogger(this)); - engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Diagnostic)); + //engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Diagnostic)); return engine; } @@ -209,13 +212,16 @@ namespace ICSharpCode.SharpDevelop.BuildWorker engine.GlobalProperties.SetProperty(pair.Key, pair.Value); } + Log("Loading " + currentJob.ProjectFileName); Project project = LoadProject(engine, currentJob.ProjectFileName); if (project == null) return false; if (string.IsNullOrEmpty(currentJob.Target)) { + Log("Building default target in " + currentJob.ProjectFileName); return engine.BuildProject(project); } else { + Log("Building target '" + currentJob.Target + "' in " + currentJob.ProjectFileName); return engine.BuildProject(project, currentJob.Target.Split(';')); } } @@ -439,6 +445,14 @@ namespace ICSharpCode.SharpDevelop.BuildWorker [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1064:ExceptionsShouldBePublic")] sealed class BuildCancelException : Exception { + public BuildCancelException() + { + } + + BuildCancelException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } } } } diff --git a/src/Main/ICSharpCode.SharpDevelop.BuildWorker/WorkerManager.cs b/src/Main/ICSharpCode.SharpDevelop.BuildWorker/WorkerManager.cs index b152aac617..b28bd949f7 100644 --- a/src/Main/ICSharpCode.SharpDevelop.BuildWorker/WorkerManager.cs +++ b/src/Main/ICSharpCode.SharpDevelop.BuildWorker/WorkerManager.cs @@ -189,6 +189,7 @@ namespace ICSharpCode.SharpDevelop.BuildWorker void OnWorkerLost(object sender, EventArgs e) { + BuildRun buildRun; lock (lockObject) { workerProcessCount--; freeWorkerProcesses.Remove(this); @@ -204,8 +205,8 @@ namespace ICSharpCode.SharpDevelop.BuildWorker Monitor.Enter(lockObject); } } + buildRun = Interlocked.Exchange(ref currentBuildRun, null); } - BuildRun buildRun = Interlocked.Exchange(ref currentBuildRun, null); if (buildRun != null) { buildRun.RaiseError("Worker process lost during build"); buildRun.Done(false); @@ -231,7 +232,10 @@ namespace ICSharpCode.SharpDevelop.BuildWorker [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] public void BuildDone(bool success) { - BuildRun buildRun = Interlocked.Exchange(ref currentBuildRun, null); + BuildRun buildRun; + lock (lockObject) { + buildRun = Interlocked.Exchange(ref currentBuildRun, null); + } if (buildRun != null) { // OnReady must be called before buildRun.Done - the callback // might trigger another build, and if this worker process @@ -243,7 +247,7 @@ namespace ICSharpCode.SharpDevelop.BuildWorker } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] - public void ReportException(Exception ex) + public void ReportException(string exceptionText) { // shutdown worker if it produced an exception try { @@ -251,9 +255,9 @@ namespace ICSharpCode.SharpDevelop.BuildWorker } catch {} if (ShowError != null) - ShowError(ex); + ShowError(new Exception(exceptionText)); else - Program.ShowMessageBox(ex.ToString()); + Program.ShowMessageBox(exceptionText); } } } diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Configuration/AssemblyInfo.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Configuration/AssemblyInfo.cs index c0c433a20b..c6a53d6d6b 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Configuration/AssemblyInfo.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Configuration/AssemblyInfo.cs @@ -13,6 +13,8 @@ using System.Security.Permissions; [assembly: CLSCompliant(true)] [assembly: StringFreezing()] +[assembly: Dependency("System.Core", LoadHint.Always)] + [assembly: AssemblyTitle("ICSharpCode.SharpDevelop.Dom")] [assembly: AssemblyDescription("Code-completion library")] [assembly: AssemblyConfiguration("")] diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Ambience.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Ambience.cs index 0421567780..cc88f227cc 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Ambience.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Ambience.cs @@ -116,7 +116,7 @@ namespace ICSharpCode.SharpDevelop.Dom { #if DEBUG if (ownerThread != System.Threading.Thread.CurrentThread.ManagedThreadId) - throw new Exception("Ambience may only be used by the thread that created it"); + throw new InvalidOperationException("Ambience may only be used by the thread that created it"); #endif } diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CSharp/CSharpAmbience.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CSharp/CSharpAmbience.cs index a75d7ef70a..8215adb923 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CSharp/CSharpAmbience.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CSharp/CSharpAmbience.cs @@ -473,6 +473,9 @@ namespace ICSharpCode.SharpDevelop.Dom.CSharp if (returnType == null) { return String.Empty; } + + returnType = returnType.GetDirectReturnType(); + StringBuilder builder = new StringBuilder(); string fullName = returnType.FullyQualifiedName; diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CecilReader.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CecilReader.cs index 461566feb4..4977256f0f 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CecilReader.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CecilReader.cs @@ -174,12 +174,15 @@ namespace ICSharpCode.SharpDevelop.Dom || type.BaseType.FullName == "System.MulticastDelegate"; } + protected override bool KeepInheritanceTree { + get { return true; } + } + public CecilClass(ICompilationUnit compilationUnit, IClass declaringType, TypeDefinition td, string fullName) : base(compilationUnit, declaringType) { this.FullyQualifiedName = fullName; - this.KeepInheritanceTree = true; AddAttributes(compilationUnit.ProjectContent, this.Attributes, td.CustomAttributes); diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ExpressionContext.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ExpressionContext.cs index 250771de81..1bb7dad999 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ExpressionContext.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ExpressionContext.cs @@ -62,104 +62,104 @@ namespace ICSharpCode.SharpDevelop.Dom #region C# specific contexts (public static fields) * MOVE TO ANOTHER CLASS * /// <summary>The context expects a new identifier</summary> /// <example>class *expr* {}; string *expr*;</example> - public static ExpressionContext IdentifierExpected = new DefaultExpressionContext("IdentifierExpected"); + public readonly static ExpressionContext IdentifierExpected = new DefaultExpressionContext("IdentifierExpected"); /// <summary>The context is outside of any type declaration, expecting a global-level keyword.</summary> - public static ExpressionContext Global = new DefaultExpressionContext("Global"); + public readonly static ExpressionContext Global = new DefaultExpressionContext("Global"); /// <summary>The context is the body of a property declaration.</summary> /// <example>string Name { *expr* }</example> - public static ExpressionContext PropertyDeclaration = new DefaultExpressionContext("PropertyDeclaration"); + public readonly static ExpressionContext PropertyDeclaration = new DefaultExpressionContext("PropertyDeclaration"); /// <summary>The context is the body of a property declaration inside an interface.</summary> /// <example>string Name { *expr* }</example> - public static ExpressionContext InterfacePropertyDeclaration = new DefaultExpressionContext("InterfacePropertyDeclaration"); + public readonly static ExpressionContext InterfacePropertyDeclaration = new DefaultExpressionContext("InterfacePropertyDeclaration"); /// <summary>The context is the body of a event declaration.</summary> /// <example>event EventHandler NameChanged { *expr* }</example> - public static ExpressionContext EventDeclaration = new DefaultExpressionContext("EventDeclaration"); + public readonly static ExpressionContext EventDeclaration = new DefaultExpressionContext("EventDeclaration"); /// <summary>The context is the body of a method.</summary> /// <example>void Main () { *expr* }</example> - public static ExpressionContext MethodBody = new DefaultExpressionContext("MethodBody"); + public readonly static ExpressionContext MethodBody = new DefaultExpressionContext("MethodBody"); /// <summary>The context is after the type parameters of a type/method declaration. /// The only valid keyword is "where"</summary> /// <example>class <T> *expr*</example> - public static ExpressionContext ConstraintsStart = new DefaultExpressionContext("ConstraintsStart"); + public readonly static ExpressionContext ConstraintsStart = new DefaultExpressionContext("ConstraintsStart"); /// <summary>The context is after the 'where' of a constraints list.</summary> /// <example>class <T> where *expr*</example> - public static ExpressionContext Constraints = new NonStaticTypeExpressionContext("Constraints", false); + public readonly static ExpressionContext Constraints = new NonStaticTypeExpressionContext("Constraints", false); /// <summary>The context is the body of a type declaration.</summary> - public static ExpressionContext TypeDeclaration = new NonStaticTypeExpressionContext("TypeDeclaration", true); + public readonly static ExpressionContext TypeDeclaration = new NonStaticTypeExpressionContext("TypeDeclaration", true); /// <summary>The context is the body of an interface declaration.</summary> - public static ExpressionContext InterfaceDeclaration = new NonStaticTypeExpressionContext("InterfaceDeclaration", true); + public readonly static ExpressionContext InterfaceDeclaration = new NonStaticTypeExpressionContext("InterfaceDeclaration", true); /// <summary>Context expects "base" or "this".</summary> /// <example>public ClassName() : *expr*</example> - public static ExpressionContext BaseConstructorCall = new DefaultExpressionContext("BaseConstructorCall"); + public readonly static ExpressionContext BaseConstructorCall = new DefaultExpressionContext("BaseConstructorCall"); /// <summary>The first parameter</summary> /// <example>void MethodName(*expr*)</example> - public static ExpressionContext FirstParameterType = new NonStaticTypeExpressionContext("FirstParameterType", false); + public readonly static ExpressionContext FirstParameterType = new NonStaticTypeExpressionContext("FirstParameterType", false); /// <summary>Another parameter</summary> /// <example>void MethodName(..., *expr*)</example> - public static ExpressionContext ParameterType = new NonStaticTypeExpressionContext("ParameterType", false); + public readonly static ExpressionContext ParameterType = new NonStaticTypeExpressionContext("ParameterType", false); /// <summary>Context expects a fully qualified type name.</summary> /// <example>using Alias = *expr*;</example> - public static ExpressionContext FullyQualifiedType = new DefaultExpressionContext("FullyQualifiedType"); + public readonly static ExpressionContext FullyQualifiedType = new DefaultExpressionContext("FullyQualifiedType"); /// <summary>Context expects is a property name in an object initializer.</summary> /// <example>new *type* [(args)] { *expr* = ... }</example> - public static ExpressionContext ObjectInitializer = new DefaultExpressionContext("ObjectInitializer"); + public readonly static ExpressionContext ObjectInitializer = new DefaultExpressionContext("ObjectInitializer"); #endregion #region Default contexts (public static fields) /// <summary>Default/unknown context</summary> - public static ExpressionContext Default = new DefaultExpressionContext("Default"); + public readonly static ExpressionContext Default = new DefaultExpressionContext("Default"); /// <summary>The context expects the base type of an enum.</summary> /// <example>enum Name : *expr* {}</example> - public static ExpressionContext EnumBaseType = new EnumBaseTypeExpressionContext(); + public readonly static ExpressionContext EnumBaseType = new EnumBaseTypeExpressionContext(); /// <summary>Context expects a non-sealed type or interface</summary> /// <example>class C : *expr* {}</example> - public static ExpressionContext InheritableType = new InheritableTypeExpressionContext(); + public readonly static ExpressionContext InheritableType = new InheritableTypeExpressionContext(); /// <summary>Context expects a namespace name</summary> /// <example>using *expr*;</example> - public static ExpressionContext Namespace = new ImportableExpressionContext(false); + public readonly static ExpressionContext Namespace = new ImportableExpressionContext(false); /// <summary>Context expects an importable type (namespace or class with public static members)</summary> /// <example>Imports *expr*;</example> - public static ExpressionContext Importable = new ImportableExpressionContext(true); + public readonly static ExpressionContext Importable = new ImportableExpressionContext(true); /// <summary>Context expects a type name</summary> /// <example>typeof(*expr*)</example> - public static ExpressionContext Type = new TypeExpressionContext(null, false, true); + public readonly static ExpressionContext Type = new TypeExpressionContext(null, false, true); /// <summary>Context expects the name of a non-static, non-void type</summary> /// <example>is *expr*, *expr* variableName</example> - public static ExpressionContext NonStaticNonVoidType = new NonStaticTypeExpressionContext("NonStaticType", false); + public readonly static ExpressionContext NonStaticNonVoidType = new NonStaticTypeExpressionContext("NonStaticType", false); /// <summary>Context expects a non-abstract type that has accessible constructors</summary> /// <example>new *expr*();</example> /// <remarks>When using this context, a resolver should treat the expression as object creation, /// even when the keyword "new" is not part of the expression.</remarks> - public static ExpressionContext ObjectCreation = new TypeExpressionContext(null, true, true); + public readonly static ExpressionContext ObjectCreation = new TypeExpressionContext(null, true, true); /// <summary>Context expects a type deriving from System.Attribute.</summary> /// <example>[*expr*()]</example> /// <remarks>When using this context, a resolver should try resolving typenames with an /// appended "Attribute" suffix and treat "invocations" of the attribute type as /// object creation.</remarks> - public static ExpressionContext Attribute = new AttributeExpressionContext(); + public readonly static ExpressionContext Attribute = new AttributeExpressionContext(); /// <summary>Context expects a type name which has special base type</summary> /// <param name="baseClass">The class the expression must derive from.</param> @@ -173,11 +173,11 @@ namespace ICSharpCode.SharpDevelop.Dom /// <summary>Context expects an interface</summary> /// <example>interface C : *expr* {}</example> /// <example>Implements *expr*</example> - public static ExpressionContext Interface = new ClassTypeExpressionContext(ClassType.Interface); + public readonly static ExpressionContext Interface = new ClassTypeExpressionContext(ClassType.Interface); /// <summary>Context expects a delegate</summary> /// <example>public event *expr*</example> - public static ExpressionContext DelegateType = new ClassTypeExpressionContext(ClassType.Delegate); + public readonly static ExpressionContext DelegateType = new ClassTypeExpressionContext(ClassType.Delegate); #endregion diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ExtensionMethods.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ExtensionMethods.cs index 05743586b8..c7dec601fa 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ExtensionMethods.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ExtensionMethods.cs @@ -29,6 +29,12 @@ namespace ICSharpCode.SharpDevelop.Dom list.Add(o); } + /// <summary> + /// Converts a recursive data structure into a flat list. + /// </summary> + /// <param name="input">The root elements of the recursive data structure.</param> + /// <param name="recursive">The function that gets the children of an element.</param> + /// <returns>Iterator that enumerates the tree structure in preorder.</returns> public static IEnumerable<T> Flatten<T>(this IEnumerable<T> input, Func<T, IEnumerable<T>> recursion) { Stack<IEnumerator<T>> stack = new Stack<IEnumerator<T>>(); @@ -43,7 +49,7 @@ namespace ICSharpCode.SharpDevelop.Dom stack.Push(children.GetEnumerator()); } } - stack.Pop(); + stack.Pop().Dispose(); } } finally { while (stack.Count > 0) { diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultClass.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultClass.cs index 20b8f45561..47c0a76308 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultClass.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultClass.cs @@ -6,8 +6,9 @@ // </file> using System; -using System.Linq; using System.Collections.Generic; +using System.Linq; +using System.Threading; namespace ICSharpCode.SharpDevelop.Dom { @@ -373,59 +374,86 @@ namespace ICSharpCode.SharpDevelop.Dom return CompareTo((IClass)o); } - volatile List<IClass> inheritanceTreeCache; + volatile IClass[] inheritanceTreeCache; public IEnumerable<IClass> ClassInheritanceTree { get { - List<IClass> visitedList = inheritanceTreeCache; - if (visitedList != null) - return visitedList; - visitedList = new List<IClass>(); - Queue<IReturnType> typesToVisit = new Queue<IReturnType>(); - bool enqueuedLastBaseType = false; - bool hasErrors = false; - IClass currentClass = this; - IReturnType nextType; - do { - if (currentClass != null) { - if (!visitedList.Contains(currentClass)) { - visitedList.Add(currentClass); - foreach (IReturnType type in currentClass.BaseTypes) { - typesToVisit.Enqueue(type); - } - } - } - if (typesToVisit.Count > 0) { - nextType = typesToVisit.Dequeue(); - } else { - nextType = enqueuedLastBaseType ? null : GetBaseTypeByClassType(this); - enqueuedLastBaseType = true; - } - if (nextType != null) { - currentClass = nextType.GetUnderlyingClass(); - if (currentClass == null) - hasErrors = true; - } - } while (nextType != null); + // Notes: + // the ClassInheritanceTree must work even if the following things happen: + // - cyclic inheritance + // - multithreaded calls + + // Recursive calls are possible if the SearchType request done by GetUnderlyingClass() + // uses ClassInheritanceTree. + // Such recursive calls are tricky, they have caused incorrect behavior (SD2-1474) + // or performance problems (SD2-1510) in the past. + // As of revision 3769, NRefactoryAstConvertVisitor sets up the SearchClassReturnType + // used for base types so that it does not look up inner classes in the class itself, + // so the ClassInheritanceTree is not used created in those cases. + // However, other language bindings might not set up base types correctly, so it's + // still possible that ClassInheritanceTree is called recursivly. + // In that case, we'll return an invalid inheritance tree because of + // ProxyReturnType's automatic stack overflow prevention. + // We do not use locks to protect against multithreaded calls because + // resolving one class's base types can cause getting the inheritance tree + // of another class -> beware of deadlocks - // A SearchType request causes the inheritance tree to be generated, but if it was - // this classes' base type that caused the SearchType request, the GetUnderlyingClass() - // will fail and we will produce an incomplete inheritance tree. - // So we don't cache incomplete inheritance trees for parsed classes (fixes SD2-1474). - if (!hasErrors || KeepInheritanceTree) { - inheritanceTreeCache = visitedList; - if (!KeepInheritanceTree) - DomCache.RegisterForClear(delegate { inheritanceTreeCache = null; }); + IClass[] inheritanceTree = this.inheritanceTreeCache; + if (inheritanceTree != null) { + return inheritanceTree; } - return visitedList; + + inheritanceTree = CalculateClassInheritanceTree(); + + this.inheritanceTreeCache = inheritanceTree; + if (!KeepInheritanceTree) + DomCache.RegisterForClear(ClearCachedInheritanceTree); + + return inheritanceTree; } } + void ClearCachedInheritanceTree() + { + inheritanceTreeCache = null; + } + + IClass[] CalculateClassInheritanceTree() + { + List<IClass> visitedList = new List<IClass>(); + Queue<IReturnType> typesToVisit = new Queue<IReturnType>(); + bool enqueuedLastBaseType = false; + IClass currentClass = this; + IReturnType nextType; + do { + if (currentClass != null) { + if (!visitedList.Contains(currentClass)) { + visitedList.Add(currentClass); + foreach (IReturnType type in currentClass.BaseTypes) { + typesToVisit.Enqueue(type); + } + } + } + if (typesToVisit.Count > 0) { + nextType = typesToVisit.Dequeue(); + } else { + nextType = enqueuedLastBaseType ? null : GetBaseTypeByClassType(this); + enqueuedLastBaseType = true; + } + if (nextType != null) { + currentClass = nextType.GetUnderlyingClass(); + } + } while (nextType != null); + return visitedList.ToArray(); + } + /// <summary> /// Specifies whether to keep the inheritance tree when the DomCache is cleared. /// </summary> - protected bool KeepInheritanceTree = false; + protected virtual bool KeepInheritanceTree { + get { return false; } + } public IReturnType GetBaseType(int index) { diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultMethod.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultMethod.cs index bab90c8a7e..95e4486a5b 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultMethod.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultMethod.cs @@ -195,13 +195,9 @@ namespace ICSharpCode.SharpDevelop.Dom public virtual int CompareTo(IMethod value) { - int cmp; - - if (FullyQualifiedName != null) { - cmp = FullyQualifiedName.CompareTo(value.FullyQualifiedName); - if (cmp != 0) { - return cmp; - } + int cmp = string.CompareOrdinal(this.FullyQualifiedName, value.FullyQualifiedName); + if (cmp != 0) { + return cmp; } cmp = this.TypeParameters.Count - value.TypeParameters.Count; diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultProperty.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultProperty.cs index c2cae7e092..d2f9719816 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultProperty.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultProperty.cs @@ -94,25 +94,25 @@ namespace ICSharpCode.SharpDevelop.Dom { public DomRegion GetterRegion { get { return getterRegion; } - set { + set { CheckBeforeMutation(); - getterRegion = value; + getterRegion = value; } } public DomRegion SetterRegion { get { return setterRegion; } - set { + set { CheckBeforeMutation(); - setterRegion = value; + setterRegion = value; } } public ModifierEnum GetterModifiers { get { return getterModifiers; } - set { + set { CheckBeforeMutation(); - getterModifiers = value; + getterModifiers = value; } } @@ -120,7 +120,7 @@ namespace ICSharpCode.SharpDevelop.Dom { get { return setterModifiers; } set { CheckBeforeMutation(); - setterModifiers = value; + setterModifiers = value; } } @@ -138,13 +138,9 @@ namespace ICSharpCode.SharpDevelop.Dom { public virtual int CompareTo(IProperty value) { - int cmp; - - if (FullyQualifiedName != null) { - cmp = FullyQualifiedName.CompareTo(value.FullyQualifiedName); - if (cmp != 0) { - return cmp; - } + int cmp = string.CompareOrdinal(this.FullyQualifiedName, value.FullyQualifiedName); + if (cmp != 0) { + return cmp; } return DiffUtility.Compare(Parameters, value.Parameters); diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/SearchClassReturnType.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/SearchClassReturnType.cs index 99e590b037..1fdbc70afd 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/SearchClassReturnType.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/SearchClassReturnType.cs @@ -24,6 +24,7 @@ namespace ICSharpCode.SharpDevelop.Dom string name; string shortName; int typeParameterCount; + bool lookForInnerClassesInDeclaringClass = true; public SearchClassReturnType(IProjectContent projectContent, IClass declaringClass, int caretLine, int caretColumn, string name, int typeParameterCount) { @@ -42,6 +43,19 @@ namespace ICSharpCode.SharpDevelop.Dom shortName = name.Substring(pos + 1); } + /// <summary> + /// Gets/Sets whether to look for inner classes in the declaring class. + /// The default is true. + /// Set this property to false for return types that are used as base type references. + /// </summary> + public bool LookForInnerClassesInDeclaringClass { + get { return lookForInnerClassesInDeclaringClass; } + set { + lookForInnerClassesInDeclaringClass = value; + ClearCachedBaseType(); + } + } + volatile IReturnType cachedBaseType; int isSearching; // 0=false, 1=true @@ -58,7 +72,12 @@ namespace ICSharpCode.SharpDevelop.Dom if (Interlocked.CompareExchange(ref isSearching, 1, 0) != 0) return null; try { - type = pc.SearchType(new SearchTypeRequest(name, typeParameterCount, declaringClass, caretLine, caretColumn)).Result; + SearchTypeRequest request = new SearchTypeRequest(name, typeParameterCount, declaringClass, caretLine, caretColumn); + if (!lookForInnerClassesInDeclaringClass) { + // skip looking for inner classes by adjusting the CurrentType for the lookup + request.CurrentType = declaringClass.DeclaringType; + } + type = pc.SearchType(request).Result; cachedBaseType = type; if (type != null) DomCache.RegisterForClear(ClearCachedBaseType); diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/SystemTypes.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/SystemTypes.cs index f972323738..d6fb933640 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/SystemTypes.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/SystemTypes.cs @@ -15,6 +15,7 @@ namespace ICSharpCode.SharpDevelop.Dom public readonly IReturnType Void; public readonly IReturnType Object; public readonly IReturnType Delegate; + public readonly IReturnType MulticastDelegate; public readonly IReturnType ValueType; public readonly IReturnType Enum; @@ -39,6 +40,7 @@ namespace ICSharpCode.SharpDevelop.Dom Void = new VoidReturnType(pc); Object = CreateFromName("System.Object"); Delegate = CreateFromName("System.Delegate"); + MulticastDelegate = CreateFromName("System.MulticastDelegate"); ValueType = CreateFromName("System.ValueType"); Enum = CreateFromName("System.Enum"); @@ -53,7 +55,7 @@ namespace ICSharpCode.SharpDevelop.Dom Exception = CreateFromName("System.Exception"); AsyncCallback = CreateFromName("System.AsyncCallback"); IAsyncResult = CreateFromName("System.IAsyncResult"); - IAsyncResult = CreateFromName("System.IDisposable"); + IDisposable = CreateFromName("System.IDisposable"); } IReturnType CreateFromName(string name) diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/LanguageProperties.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/LanguageProperties.cs index d6a4e98192..20705e0f70 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/LanguageProperties.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/LanguageProperties.cs @@ -18,7 +18,7 @@ namespace ICSharpCode.SharpDevelop.Dom /// A case-sensitive dummy language that returns false for all Supports.. properties, /// uses a dummy code generator and refactoring provider and returns null for CodeDomProvider. /// </summary> - public readonly static LanguageProperties None = new LanguageProperties(StringComparer.InvariantCulture); + public readonly static LanguageProperties None = new LanguageProperties(StringComparer.Ordinal); /// <summary> /// C# 3.0 language properties. @@ -248,7 +248,7 @@ namespace ICSharpCode.SharpDevelop.Dom #region CSharpProperties internal sealed class CSharpProperties : LanguageProperties { - public CSharpProperties() : base(StringComparer.InvariantCulture) {} + public CSharpProperties() : base(StringComparer.Ordinal) {} public override RefactoringProvider RefactoringProvider { get { @@ -315,7 +315,7 @@ namespace ICSharpCode.SharpDevelop.Dom #region VBNetProperties internal sealed class VBNetProperties : LanguageProperties { - public VBNetProperties() : base(StringComparer.InvariantCultureIgnoreCase) {} + public VBNetProperties() : base(StringComparer.OrdinalIgnoreCase) {} public override bool ShowMember(IMember member, bool showStatic) { diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/NRefactoryASTConvertVisitor.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/NRefactoryASTConvertVisitor.cs index fc6d30b1e7..527fa94f6c 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/NRefactoryASTConvertVisitor.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/NRefactoryASTConvertVisitor.cs @@ -388,7 +388,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver if (c.ClassType != ClassType.Enum && typeDeclaration.BaseTypes != null) { foreach (AST.TypeReference type in typeDeclaration.BaseTypes) { - IReturnType rt = CreateReturnType(type); + IReturnType rt = CreateReturnType(type, null, TypeVisitor.ReturnTypeOptions.BaseTypeReference); if (rt != null) { c.BaseTypes.Add(rt); } @@ -472,7 +472,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver void CreateDelegate(DefaultClass c, string name, AST.TypeReference returnType, IList<AST.TemplateDefinition> templates, IList<AST.ParameterDeclarationExpression> parameters) { - c.BaseTypes.Add(c.ProjectContent.SystemTypes.Delegate); + c.BaseTypes.Add(c.ProjectContent.SystemTypes.MulticastDelegate); if (currentClass.Count > 0) { DefaultClass cur = GetCurrentClass(); cur.InnerClasses.Add(c); @@ -508,7 +508,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver internal static IParameter CreateParameter(AST.ParameterDeclarationExpression par, IMethod method, IClass currentClass, ICompilationUnit cu) { - IReturnType parType = CreateReturnType(par.TypeReference, method, currentClass, cu); + IReturnType parType = CreateReturnType(par.TypeReference, method, currentClass, cu, TypeVisitor.ReturnTypeOptions.None); DefaultParameter p = new DefaultParameter(par.ParameterName, parType, GetRegion(par.StartLocation, par.EndLocation)); p.Modifiers = (ParameterModifiers)par.ParamModifier; return p; @@ -524,7 +524,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver method.IsExtensionMethod = methodDeclaration.IsExtensionMethod; method.Documentation = GetDocumentation(region.BeginLine, methodDeclaration.Attributes); ConvertTemplates(methodDeclaration.Templates, method); - method.ReturnType = CreateReturnType(methodDeclaration.TypeReference, method); + method.ReturnType = CreateReturnType(methodDeclaration.TypeReference, method, TypeVisitor.ReturnTypeOptions.None); ConvertAttributes(methodDeclaration, method); if (methodDeclaration.Parameters.Count > 0) { foreach (AST.ParameterDeclarationExpression par in methodDeclaration.Parameters) { @@ -559,7 +559,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver method.Documentation = GetDocumentation(region.BeginLine, declareDeclaration.Attributes); method.Modifiers |= ModifierEnum.Extern | ModifierEnum.Static; - method.ReturnType = CreateReturnType(declareDeclaration.TypeReference, method); + method.ReturnType = CreateReturnType(declareDeclaration.TypeReference, method, TypeVisitor.ReturnTypeOptions.None); ConvertAttributes(declareDeclaration, method); foreach (AST.ParameterDeclarationExpression par in declareDeclaration.Parameters) { @@ -724,7 +724,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver region, c); del.Modifiers |= ModifierEnum.Synthetic; CreateDelegate(del, eventDeclaration.Name + "EventHandler", - new AST.TypeReference("System.Void"), + new AST.TypeReference("System.Void", true), new AST.TemplateDefinition[0], eventDeclaration.Parameters); type = del.DefaultReturnType; @@ -753,23 +753,23 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver return null; } - IReturnType CreateReturnType(AST.TypeReference reference, IMethod method) + IReturnType CreateReturnType(AST.TypeReference reference, IMethod method, TypeVisitor.ReturnTypeOptions options) { - return CreateReturnType(reference, method, GetCurrentClass(), cu); + return CreateReturnType(reference, method, GetCurrentClass(), cu, options); } - static IReturnType CreateReturnType(AST.TypeReference reference, IMethod method, IClass currentClass, ICompilationUnit cu) + static IReturnType CreateReturnType(AST.TypeReference reference, IMethod method, IClass currentClass, ICompilationUnit cu, TypeVisitor.ReturnTypeOptions options) { if (currentClass == null) { - return TypeVisitor.CreateReturnType(reference, new DefaultClass(cu, "___DummyClass"), method, 1, 1, cu.ProjectContent, true); + return TypeVisitor.CreateReturnType(reference, new DefaultClass(cu, "___DummyClass"), method, 1, 1, cu.ProjectContent, options | TypeVisitor.ReturnTypeOptions.Lazy); } else { - return TypeVisitor.CreateReturnType(reference, currentClass, method, currentClass.Region.BeginLine + 1, 1, cu.ProjectContent, true); + return TypeVisitor.CreateReturnType(reference, currentClass, method, currentClass.Region.BeginLine + 1, 1, cu.ProjectContent, options | TypeVisitor.ReturnTypeOptions.Lazy); } } IReturnType CreateReturnType(AST.TypeReference reference) { - return CreateReturnType(reference, null); + return CreateReturnType(reference, null, TypeVisitor.ReturnTypeOptions.None); } } } diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/TypeVisitor.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/TypeVisitor.cs index aefb823405..4e2ac8cdcf 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/TypeVisitor.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/TypeVisitor.cs @@ -20,24 +20,47 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver // TODO: Rename this class, the visitor functionality was moved to ResolveVisitor public static class TypeVisitor { + [Flags] + public enum ReturnTypeOptions + { + None = 0, + Lazy = 1, + BaseTypeReference = 2 + } + public static IReturnType CreateReturnType(TypeReference reference, NRefactoryResolver resolver) { return CreateReturnType(reference, resolver.CallingClass, resolver.CallingMember, resolver.CaretLine, resolver.CaretColumn, - resolver.ProjectContent, false); + resolver.ProjectContent, ReturnTypeOptions.None); } + [Obsolete("Use the overload with ReturnTypeOptions instead")] public static IReturnType CreateReturnType(TypeReference reference, IClass callingClass, IMember callingMember, int caretLine, int caretColumn, IProjectContent projectContent, bool useLazyReturnType) + { + return CreateReturnType(reference, callingClass, callingMember, caretLine, caretColumn, + projectContent, + useLazyReturnType ? ReturnTypeOptions.Lazy : ReturnTypeOptions.None); + } + + public static IReturnType CreateReturnType(TypeReference reference, IClass callingClass, + IMember callingMember, int caretLine, int caretColumn, + IProjectContent projectContent, + ReturnTypeOptions options) { if (reference == null) return null; if (reference.IsNull) return null; if (reference is InnerClassTypeReference) { reference = ((InnerClassTypeReference)reference).CombineToNormalTypeReference(); } + + bool useLazyReturnType = (options & ReturnTypeOptions.Lazy) == ReturnTypeOptions.Lazy; + bool isBaseTypeReference = (options & ReturnTypeOptions.BaseTypeReference) == ReturnTypeOptions.BaseTypeReference; + LanguageProperties languageProperties = projectContent.Language; IReturnType t = null; if (callingClass != null && !reference.IsGlobal) { @@ -47,8 +70,9 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver break; } } - if (t == null && callingMember is IMethod && (callingMember as IMethod).TypeParameters != null) { - foreach (ITypeParameter tp in (callingMember as IMethod).TypeParameters) { + IMethod callingMethod = callingMember as IMethod; + if (t == null && callingMethod != null) { + foreach (ITypeParameter tp in callingMethod.TypeParameters) { if (languageProperties.NameComparer.Equals(tp.Name, reference.Type)) { t = new GenericReturnType(tp); break; @@ -57,23 +81,27 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver } } if (t == null) { - if (reference.Type != reference.Type) { + int typeParameterCount = reference.GenericTypes.Count; + if (reference.IsKeyword) { // keyword-type like void, int, string etc. - IClass c = projectContent.GetClass(reference.Type, 0); + IClass c = projectContent.GetClass(reference.Type, typeParameterCount); if (c != null) t = c.DefaultReturnType; else - t = new GetClassReturnType(projectContent, reference.Type, 0); + t = new GetClassReturnType(projectContent, reference.Type, typeParameterCount); } else { - int typeParameterCount = reference.GenericTypes.Count; - if (useLazyReturnType) { - if (reference.IsGlobal || reference.IsKeyword) + if (useLazyReturnType || isBaseTypeReference) { + if (reference.IsGlobal) { t = new GetClassReturnType(projectContent, reference.Type, typeParameterCount); - else if (callingClass != null) - t = new SearchClassReturnType(projectContent, callingClass, caretLine, caretColumn, reference.Type, typeParameterCount); + } else if (callingClass != null) { + SearchClassReturnType scrt = new SearchClassReturnType(projectContent, callingClass, caretLine, caretColumn, reference.Type, typeParameterCount); + if (isBaseTypeReference) + scrt.LookForInnerClassesInDeclaringClass = false; + t = scrt; + } } else { IClass c; - if (reference.IsGlobal || reference.IsKeyword) { + if (reference.IsGlobal) { c = projectContent.GetClass(reference.Type, typeParameterCount); t = (c != null) ? c.DefaultReturnType : null; } else if (callingClass != null) { @@ -86,9 +114,9 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver } } if (reference.GenericTypes.Count > 0) { - List<IReturnType> para = new List<IReturnType>(reference.GenericTypes.Count); + IReturnType[] para = new IReturnType[reference.GenericTypes.Count]; for (int i = 0; i < reference.GenericTypes.Count; ++i) { - para.Add(CreateReturnType(reference.GenericTypes[i], callingClass, callingMember, caretLine, caretColumn, projectContent, useLazyReturnType)); + para[i] = CreateReturnType(reference.GenericTypes[i], callingClass, callingMember, caretLine, caretColumn, projectContent, options); } t = new ConstructedReturnType(t, para); } diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ProjectContent/IProjectContent.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ProjectContent/IProjectContent.cs index c1eb3c4ac3..d18efae547 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ProjectContent/IProjectContent.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ProjectContent/IProjectContent.cs @@ -138,15 +138,34 @@ namespace ICSharpCode.SharpDevelop.Dom Default = LookInReferences | LookForInnerClass } - public struct SearchTypeRequest + public sealed class SearchTypeRequest { - public readonly string Name; - public readonly int TypeParameterCount; - public readonly ICompilationUnit CurrentCompilationUnit; - public readonly IClass CurrentType; - public readonly int CaretLine; - public readonly int CaretColumn; - public readonly IUsingScope CurrentUsingScope; + IUsingScope currentUsingScope; + ICompilationUnit currentCompilationUnit; + + public string Name { get; set; } + public int TypeParameterCount { get; set; } + public IClass CurrentType { get; set; } + public int CaretLine { get; set; } + public int CaretColumn { get; set; } + + public ICompilationUnit CurrentCompilationUnit { + get { return currentCompilationUnit; } + set { + if (value == null) + throw new ArgumentNullException("CurrentCompilationUnit"); + currentCompilationUnit = value; + } + } + + public IUsingScope CurrentUsingScope { + get { return currentUsingScope; } + set { + if (value == null) + throw new ArgumentNullException("CurrentUsingScope"); + currentUsingScope = value; + } + } public SearchTypeRequest(string name, int typeParameterCount, IClass currentType, int caretLine, int caretColumn) { diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/CodeGenerator.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/CodeGenerator.cs index 084198fc29..958b8863ab 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/CodeGenerator.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/CodeGenerator.cs @@ -413,7 +413,7 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring MethodDeclaration method = new MethodDeclaration { Name = "On" + e.Name, Modifier = ConvertModifier(modifier, context), - TypeReference = new TypeReference("System.Void"), + TypeReference = new TypeReference("System.Void", true), Parameters = parameters }; diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/NRefactoryRefactoringProvider.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/NRefactoryRefactoringProvider.cs index 434af99cac..f898c06108 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/NRefactoryRefactoringProvider.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/NRefactoryRefactoringProvider.cs @@ -93,195 +93,47 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring } } - private class ExtractInterfaceVisitor : NR.Visitors.AbstractAstVisitor + public override string GenerateInterfaceForClass(string newInterfaceName, string existingCode, IList<IMember> membersToKeep, IClass sourceClass, bool preserveComments) { - string newInterfaceName; - string sourceClassName; - string sourceNamespace; - Dictionary<string, IMember> membersToInclude; - - public ExtractInterfaceVisitor(string newInterfaceName, - string sourceNamespace, - string sourceClassName, - IList<IMember> chosenMembers) { - this.newInterfaceName = newInterfaceName; - this.sourceNamespace = sourceNamespace; - this.sourceClassName = sourceClassName; - - // store the chosen members in a dictionary for easy lookup - membersToInclude = new Dictionary<string, IMember>(); - foreach(IMember m in chosenMembers) { - membersToInclude.Add(m.Name, m); - } - } - - public override object VisitCompilationUnit(CompilationUnit compilationUnit, object data) - { - // strip out any usings & extract our TypeReference from the NameSpace - // we walk backwards so that deletions don't affect the iteration - NamespaceDeclaration ns; - TypeDeclaration td; - object child; - object nsChild; - for(int i = compilationUnit.Children.Count-1; i>=0; i--) { - child = compilationUnit.Children[i]; - if (child is UsingDeclaration) { - // we don't want our usings here... - compilationUnit.Children.RemoveAt(i); - } - else if (child is NamespaceDeclaration) { - ns = (NamespaceDeclaration)child; - if (ns.Name != this.sourceNamespace) { - // we're not interested in this namespace... - compilationUnit.Children.RemoveAt(i); - } else { - - // this NamespaceDeclaration presumably contains our source class - // walk its children backwards to that removing them won't break the iteration - for(int j = ns.Children.Count-1; j>=0; j--) { - nsChild = ns.Children[j]; - if (nsChild is TypeDeclaration) { - td = (TypeDeclaration)nsChild; - - if (td.Name == this.sourceClassName) { - // keep it, and substitute it for the current NamespaceDeclaration - compilationUnit.Children[i] = td; - } else { - // it's not the class we're extracting from - ns.Children.RemoveAt(j); - } - } else { - // it's not even a class... (e.g. using, etc) - ns.Children.RemoveAt(j); - } - } - } - } else { - // we don't actually want to throw an exception here just because we havn't forseen the node type... - //throw new NotSupportedException("trimming "+compilationUnit.Children[i].ToString()+" is not supported."); + Modifiers modifiers = CodeGenerator.ConvertModifier(sourceClass.Modifiers, new ClassFinder(membersToKeep[0])); + // keep only visibility modifiers and 'unsafe' modifier + // -> remove abstract,sealed,static + modifiers &= Modifiers.Visibility | Modifiers.Unsafe; + + TypeDeclaration interfaceDef = new TypeDeclaration(modifiers, new List<AttributeSection>()); + interfaceDef.Name = newInterfaceName; + interfaceDef.Type = NR.Ast.ClassType.Interface; + interfaceDef.Templates = CodeGenerator.ConvertTemplates(sourceClass.TypeParameters, new ClassFinder(membersToKeep[0])); + + foreach (IMember member in membersToKeep) { + AttributedNode an = CodeGenerator.ConvertMember(member, new ClassFinder(member)); + INode node = null; + if (an is MethodDeclaration) { + MethodDeclaration m = an as MethodDeclaration; + m.Body = BlockStatement.Null; + m.Modifier = Modifiers.None; + node = m; + } else { + if (an is PropertyDeclaration) { + PropertyDeclaration p = an as PropertyDeclaration; + p.GetRegion.Block = BlockStatement.Null; + p.SetRegion.Block= BlockStatement.Null; + p.Modifier = Modifiers.None; + node = p; } } - return base.VisitCompilationUnit(compilationUnit, data); - } - - public override object VisitTypeDeclaration(TypeDeclaration typeDeclaration, object data) - { - // rewrite the type declaration to an interface - typeDeclaration.Attributes.Clear(); - typeDeclaration.BaseTypes.Clear(); - typeDeclaration.Type = NR.Ast.ClassType.Interface; - typeDeclaration.Name = newInterfaceName; + if (node == null) + throw new NotSupportedException(); - // remove those children who are not explicitly listed in our 'membersToInclude' dictionary - // we walk backwards so that deletions don't affect the iteration - bool keepIt; - MethodDeclaration method; - PropertyDeclaration property; - object child; - for (int i = typeDeclaration.Children.Count-1; i >= 0; i--) { - keepIt = false; - child = typeDeclaration.Children[i]; - if (child is MethodDeclaration) { - method = (MethodDeclaration)child; - if (membersToInclude.ContainsKey(method.Name) - && ((method.Modifier & Modifiers.Static) == Modifiers.None)) { - keepIt = true; - } - } else if (child is PropertyDeclaration) { - property = (PropertyDeclaration)child; - if (membersToInclude.ContainsKey(property.Name) - && ((property.Modifier & Modifiers.Static) == Modifiers.None)) { - keepIt = true; - } - } - - if (!keepIt) { - typeDeclaration.Children.RemoveAt(i); - } - } - - // must call the base method to ensure that this type's children get visited - return base.VisitTypeDeclaration(typeDeclaration, data); + interfaceDef.AddChild(node); } - public override object VisitMethodDeclaration(MethodDeclaration methodDeclaration, object data) - { - // strip out the public modifier... - methodDeclaration.Modifier = NR.Ast.Modifiers.None; - - // ...and the method body - methodDeclaration.Body = BlockStatement.Null; - - return null; - } + IOutputAstVisitor printer = this.GetOutputVisitor(); - public override object VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration, object data) - { - // strip out the public modifiers... - propertyDeclaration.Modifier = NR.Ast.Modifiers.None; - - // ... and the body of any get block... - if (propertyDeclaration.HasGetRegion) { - propertyDeclaration.GetRegion.Block = BlockStatement.Null; - } - - // ... and the body of any set block... - if (propertyDeclaration.HasSetRegion) { - propertyDeclaration.SetRegion.Block = BlockStatement.Null; - } - - return null; - } - } - - public override string GenerateInterfaceForClass(string newInterfaceName, - IList<IMember> membersToKeep, - bool preserveComments, - string sourceNamespace, - string sourceClassName, - string existingCode - ) - { - string codeForNewInterface = "<insert code for '"+newInterfaceName+"' here>"; - NR.IParser parser = ParseFile(null, existingCode); - if (parser == null) { - return null; - } - // use a custom IAstVisitor to strip our class out of this file, - // rewrite it as our desired interface, and strip out every - // member except those we want to keep in our new interface. - ExtractInterfaceVisitor extractInterfaceVisitor = new ExtractInterfaceVisitor(newInterfaceName, - sourceNamespace, - sourceClassName, - membersToKeep); - parser.CompilationUnit.AcceptVisitor(extractInterfaceVisitor, null); - - // now use an output visitor for the appropriate language (based on - // extension of the existing code file) to format the new interface. - IOutputAstVisitor output = GetOutputVisitor(); - if (preserveComments) { - // run the output visitor with the specials inserter to insert comments - // NOTE: *all* comments will be preserved, even for code that has been - // removed to create the interface... - // TODO: is it worth enhancing the SpecialsNodeInserter to attach comments directly to code so they can be filtered based on what is preserved after a transformation? - using (SpecialNodesInserter.Install(parser.Lexer.SpecialTracker.RetrieveSpecials(), output)) { - parser.CompilationUnit.AcceptVisitor(output, null); - } - } else { - // run the output visitor without the specials inserter - parser.CompilationUnit.AcceptVisitor(output, null); - } - parser.Dispose(); + interfaceDef.AcceptVisitor(printer, null); - if (output.Errors.Count == 0) { - // get the output - codeForNewInterface = output.Text; - } else { - // dump errors into the new interface file... - codeForNewInterface = String.Format("{0} {1}", - this.CommentToken, output.Errors.ErrorOutput); - } + string codeForNewInterface = printer.Text; // wrap the new code in the same comments/usings/namespace as the the original class file. string newFileContent = CreateNewFileLikeExisting(existingCode, codeForNewInterface); @@ -289,13 +141,14 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring return newFileContent; } - private class AddTypeToBaseTypesVisitor : NR.Visitors.AbstractAstVisitor + class AddTypeToBaseTypesVisitor : NR.Visitors.AbstractAstVisitor { - private TypeReference typeReference; + IClass target, newBaseType; - public AddTypeToBaseTypesVisitor(string newTypeName) + public AddTypeToBaseTypesVisitor(IClass target, IClass newBaseType) { - this.typeReference = new TypeReference(newTypeName); + this.target = target; + this.newBaseType = newBaseType; } public override object VisitTypeDeclaration(TypeDeclaration typeDeclaration, object data) @@ -303,29 +156,32 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring // test the Type string property explicitly (rather than .BaseTypes.Contains()) // to ensure that a matching type name is enough to prevent adding a second // reference. + + if (typeDeclaration.Name != target.Name) + return base.VisitTypeDeclaration(typeDeclaration, data); + bool exists = false; foreach(TypeReference type in typeDeclaration.BaseTypes) { - if (type.Type == this.typeReference.Type) { + if (type.Type == this.newBaseType.Name) { exists = true; break; } } if (!exists) { - typeDeclaration.BaseTypes.Add(this.typeReference); + typeDeclaration.BaseTypes.Add(new TypeReference(newBaseType.Name, newBaseType.TypeParameters.Select(p => new TypeReference(p.Name)).ToList())); } return base.VisitTypeDeclaration(typeDeclaration, data); } } - public override string AddBaseTypeToClass(string existingCode, string newInterfaceName) + public override string AddBaseTypeToClass(string existingCode, IClass targetClass, IClass newBaseType) { - string newCode = existingCode; NR.IParser parser = ParseFile(null, existingCode); if (parser == null) { return null; } - AddTypeToBaseTypesVisitor addTypeToBaseTypesVisitor = new AddTypeToBaseTypesVisitor(newInterfaceName); + AddTypeToBaseTypesVisitor addTypeToBaseTypesVisitor = new AddTypeToBaseTypesVisitor(targetClass, newBaseType); parser.CompilationUnit.AcceptVisitor(addTypeToBaseTypesVisitor, null); @@ -752,12 +608,14 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring static bool IsEndDirective(string trimLine) { - return trimLine.StartsWith("#endregion") || trimLine.StartsWith("#endif"); + return trimLine.StartsWith("#endregion", StringComparison.Ordinal) + || trimLine.StartsWith("#endif", StringComparison.Ordinal); } static bool IsStartDirective(string trimLine) { - return trimLine.StartsWith("#region") || trimLine.StartsWith("#if"); + return trimLine.StartsWith("#region", StringComparison.Ordinal) + || trimLine.StartsWith("#if", StringComparison.Ordinal); } #endregion } diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/RefactoringProvider.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/RefactoringProvider.cs index 6ecde72062..7896f666ab 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/RefactoringProvider.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/RefactoringProvider.cs @@ -5,6 +5,7 @@ // <version>$Revision$</version> // </file> +using ICSharpCode.NRefactory.Ast; using System; using System.Collections.Generic; @@ -35,19 +36,15 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring return false; } } - public virtual string GenerateInterfaceForClass(string newInterfaceName, - IList<IMember> membersToExtract, - bool preserveComments, - string sourceNamespace, - string sourceClassName, - string existingCode - ) + public virtual string GenerateInterfaceForClass(string newInterfaceName, string existingCode, IList<IMember> membersToKeep, IClass sourceClass, bool preserveComments) + { throw new NotSupportedException(); } - public virtual string AddBaseTypeToClass(string existingCode, string newInterfaceName) { - throw new NotSupportedException(); + public virtual string AddBaseTypeToClass(string existingCode, IClass targetClass, IClass newBaseType) + { + throw new NotImplementedException(); } #endregion diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ReflectionLayer/ReflectionClass.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ReflectionLayer/ReflectionClass.cs index 6d24ab937c..3d444a44e4 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ReflectionLayer/ReflectionClass.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ReflectionLayer/ReflectionClass.cs @@ -105,8 +105,6 @@ namespace ICSharpCode.SharpDevelop.Dom.ReflectionLayer FullyQualifiedName = fullName; } - this.KeepInheritanceTree = true; - try { AddAttributes(compilationUnit.ProjectContent, this.Attributes, CustomAttributeData.GetCustomAttributes(type)); } catch (Exception ex) { @@ -184,6 +182,9 @@ namespace ICSharpCode.SharpDevelop.Dom.ReflectionLayer } } } + + protected override bool KeepInheritanceTree { + get { return true; } + } } - } diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/VBNet/VBNetAmbience.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/VBNet/VBNetAmbience.cs index ffa6375df2..581af40452 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/VBNet/VBNetAmbience.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/VBNet/VBNetAmbience.cs @@ -484,6 +484,9 @@ namespace ICSharpCode.SharpDevelop.Dom.VBNet if (returnType == null) { return String.Empty; } + + returnType = returnType.GetDirectReturnType(); + StringBuilder builder = new StringBuilder(); string fullName = returnType.FullyQualifiedName; diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/XmlDoc.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/XmlDoc.cs index bfe61f1381..81909554b8 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/XmlDoc.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/XmlDoc.cs @@ -202,9 +202,11 @@ namespace ICSharpCode.SharpDevelop.Dom fs.Position = index[m].FileLocation; string keyInFile = loader.ReadString(); if (keyInFile == key) { + //LoggingService.Debug("Got XML documentation for " + key); resultDocu = loader.ReadString(); break; } else { + // this is a harmless hash collision, just continue reading LoggingService.Warn("Found " + keyInFile + " instead of " + key); } } diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Tests/ICSharpCode.SharpDevelop.Dom.Tests/NRefactoryRefactoringProviderTests.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Tests/ICSharpCode.SharpDevelop.Dom.Tests/NRefactoryRefactoringProviderTests.cs index b13ea87e45..ae5596c466 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Tests/ICSharpCode.SharpDevelop.Dom.Tests/NRefactoryRefactoringProviderTests.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Tests/ICSharpCode.SharpDevelop.Dom.Tests/NRefactoryRefactoringProviderTests.cs @@ -52,7 +52,7 @@ namespace ExtractInterface.Tests { string Configure {set;} IList<int> GetRange(string subject); - int MultiplyBy5(int x, + int MultiplyBy5(int x, out bool success); event EventHandler<UnhandledExceptionEventArgs> ConfigurationChanged; @@ -60,17 +60,17 @@ namespace ExtractInterface.Tests { } "; } - + private class TestClass { public const string FileName = "TestCase.cs"; - + // TODO: write TestClass.FileContent to refactor the string literal code blocks // from the following tests. public const string FileContent = @""; } #region Sanity Test - + [Test] /// <summary> /// ensures that the custom assertions in this test fixture are working properly @@ -151,12 +151,8 @@ namespace ExtractInterfaceImplicitPropertyTest { string sourceClassName = c.Name; string sourceNamespace = c.Namespace; - string interfaceCode = csharpRefactoringProvider.GenerateInterfaceForClass(interfaceName, - membersToExtract, - false, - sourceNamespace, - sourceClassName, - fileContent); + string interfaceCode = csharpRefactoringProvider.GenerateInterfaceForClass( + interfaceName, fileContent, membersToExtract, c, false); ICompilationUnit icu = helper.Parse(TestClass.FileName, interfaceCode); IClass i = icu.Classes[0]; @@ -206,12 +202,8 @@ namespace ExtractInterfaceImplicitPropertyTest { string sourceClassName = c.Name; string sourceNamespace = c.Namespace; - string interfaceCode = csharpRefactoringProvider.GenerateInterfaceForClass(interfaceName, - membersToExtract, - false, - sourceNamespace, - sourceClassName, - fileContent); + string interfaceCode = csharpRefactoringProvider.GenerateInterfaceForClass( + interfaceName, fileContent, membersToExtract, c, false); ICompilationUnit icu = helper.Parse(TestClass.FileName, interfaceCode); IClass i = icu.Classes[0]; @@ -265,12 +257,8 @@ namespace ExtractInterfaceImplicitPropertyTest { string sourceClassName = c.Name; string sourceNamespace = c.Namespace; - string interfaceCode = csharpRefactoringProvider.GenerateInterfaceForClass(interfaceName, - membersToExtract, - false, - sourceNamespace, - sourceClassName, - fileContent); + string interfaceCode = csharpRefactoringProvider.GenerateInterfaceForClass( + interfaceName, fileContent, membersToExtract, c, false); ICompilationUnit icu = helper.Parse(ITestClass.FileName, interfaceCode); IClass i = icu.Classes[0]; @@ -331,12 +319,8 @@ namespace ExtractInterfaceImplicitPropertyTest { string sourceClassName = c.Name; string sourceNamespace = c.Namespace; - string interfaceCode = csharpRefactoringProvider.GenerateInterfaceForClass(interfaceName, - membersToExtract, - false, - sourceNamespace, - sourceClassName, - fileContent); + string interfaceCode = csharpRefactoringProvider.GenerateInterfaceForClass( + interfaceName, fileContent, membersToExtract, c, false); ICompilationUnit icu = helper.Parse(ITestClass.FileName, interfaceCode); IClass i = icu.Classes[0]; @@ -354,6 +338,8 @@ namespace ExtractInterfaceImplicitPropertyTest { } [Test] + [Ignore("This test is not necessary: we shouldn't require that GenerateInterfaceForClass ignores static methods, " + + "they cannot be selected as memberToExtract in the UI anyways.")] public void GenerateInterfaceWithStaticMethodsTest() { string fileContent = @" using System; @@ -390,12 +376,8 @@ namespace ExtractInterfaceImplicitPropertyTest { string sourceClassName = c.Name; string sourceNamespace = c.Namespace; - string interfaceCode = csharpRefactoringProvider.GenerateInterfaceForClass(interfaceName, - membersToExtract, - false, - sourceNamespace, - sourceClassName, - fileContent); + string interfaceCode = csharpRefactoringProvider.GenerateInterfaceForClass( + interfaceName, fileContent, membersToExtract, c, false); ICompilationUnit icu = helper.Parse(ITestClass.FileName, interfaceCode); IClass i = icu.Classes[0]; diff --git a/src/Main/ICSharpCode.SharpDevelop.Sda/Src/ExceptionBox.cs b/src/Main/ICSharpCode.SharpDevelop.Sda/Src/ExceptionBox.cs index de5b3b202f..666d4b1567 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Sda/Src/ExceptionBox.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Sda/Src/ExceptionBox.cs @@ -163,11 +163,12 @@ namespace ICSharpCode.SharpDevelop.Sda void CopyInfoToClipboard() { if (copyErrorCheckBox.Checked) { + string exceptionText = exceptionTextBox.Text; if (Application.OleRequired() == ApartmentState.STA) { - ClipboardWrapper.SetText(getClipboardString()); + ClipboardWrapper.SetText(exceptionText); } else { Thread th = new Thread((ThreadStart)delegate { - ClipboardWrapper.SetText(getClipboardString()); + ClipboardWrapper.SetText(exceptionText); }); th.Name = "CopyInfoToClipboard"; th.SetApartmentState(ApartmentState.STA); diff --git a/src/Main/StartUp/Project/Resources/StringResources.resources b/src/Main/StartUp/Project/Resources/StringResources.resources index 63d5f37ac7..5c6b9dcb94 100644 Binary files a/src/Main/StartUp/Project/Resources/StringResources.resources and b/src/Main/StartUp/Project/Resources/StringResources.resources differ diff --git a/src/Main/StartUp/Project/app.template.config b/src/Main/StartUp/Project/app.template.config index f95d69d026..0a7a8b7c62 100644 --- a/src/Main/StartUp/Project/app.template.config +++ b/src/Main/StartUp/Project/app.template.config @@ -49,6 +49,10 @@ <assemblyIdentity name="ICSharpCode.NRefactory" publicKeyToken="efe927acf176eea2" culture="neutral"/> <bindingRedirect oldVersion="4.0.0.0-$INSERTVERSION$" newVersion="$INSERTVERSION$"/> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="FormsDesigner" publicKeyToken="f829da5c02be14ee" culture="neutral"/> + <bindingRedirect oldVersion="3.0.0.0-$INSERTVERSION$" newVersion="$INSERTVERSION$"/> + </dependentAssembly> <!-- redirect MSBuild.Framework requests to make old task assemblies work with MSBuild 3.5 --> <dependentAssembly> @@ -78,6 +82,7 @@ <!-- <add key="domPersistencePath" value="none" /> --> </appSettings> <log4net> + <!-- Writes to the console. The console is only visible in debug builds of SharpDevelop. --> <appender name="ColoredConsoleAppender" type="log4net.Appender.ColoredConsoleAppender"> <mapping> <level value="FATAL" /> @@ -104,6 +109,14 @@ </layout> </appender> + <!-- Writes to OutputDebugString - use a tool like Sysinternals DebugView to view the log --> + <appender name="DebugAppender" type="log4net.Appender.OutputDebugStringAppender"> + <layout type="log4net.Layout.PatternLayout"> + <conversionPattern value="[%thread] %-5level- %message%newline" /> + </layout> + </appender> + + <!-- Allows writing to a log file --> <appender name="FileAppender" type="log4net.Appender.FileAppender"> <file value="SharpDevelopLog.txt" /> <layout type="log4net.Layout.PatternLayout"> @@ -111,12 +124,14 @@ </layout> </appender> + <!--- Keeps the last few log entries and appends them to bug reports when an exception occurs --> <appender name="Recorder" type="ICSharpCode.SharpDevelop.Sda.LogMessageRecorder, ICSharpCode.SharpDevelop.Sda"> <bufferSize value="25" /> </appender> <root> <level value="DEBUG" /> + <!-- Here you can configure which log appenders should be used --> <appender-ref ref="ColoredConsoleAppender" /> <appender-ref ref="Recorder" /> </root> diff --git a/src/Setup/Files.wxs b/src/Setup/Files.wxs index a49dc5a029..e45f68fd7c 100644 --- a/src/Setup/Files.wxs +++ b/src/Setup/Files.wxs @@ -718,7 +718,6 @@ </Directory> <Directory Id="DocFolder" Name="doc"> <Component Guid="9DCED5AC-B771-4A4F-B4FE-69867BF2EBDE" Id="SharpDevelopDocFiles" DiskId="1"> - <File Source="..\..\doc\AssemblyBaseAddresses.txt" Id="AssemblyBaseAddresses.txt" Name="AssemblyBaseAddresses.txt" /> <File Source="..\..\doc\BuiltWithSharpDevelop.png" Id="BuiltWithSharpDevelop.png" Name="BuiltWithSharpDevelop.png" /> <File Source="..\..\doc\ChangeLog.xml" Id="ChangeLog.xml" Name="ChangeLog.xml" /> <File Source="..\..\doc\copyright.txt" Id="copyright.txt" Name="copyright.txt" /> @@ -1142,6 +1141,9 @@ <Component Guid="6AAC2867-DBA1-4AFA-830B-1FE0A918BA11" Id="NRefactoryToBooConverterDll" DiskId="1"> <File Source="..\..\AddIns\AddIns\BackendBindings\BooBinding\NRefactoryToBooConverter.dll" Name="NRefactoryToBooConverter.dll" Id="NRefactoryToBooConverter.dll" KeyPath="yes" Assembly=".net" AssemblyApplication="NRefactoryToBooConverter.dll" AssemblyManifest="NRefactoryToBooConverter.dll" /> </Component> + <Component Guid="E80EF895-720E-4F38-AFAF-9E33B3D9415E" Id="BooLangPatternMatchingDll" DiskId="1"> + <File Source="..\..\AddIns\AddIns\BackendBindings\BooBinding\Boo.Lang.PatternMatching.dll" Name="Boo.Lang.PatternMatching.dll" Id="Boo.Lang.PatternMatching.dll" KeyPath="yes" /> + </Component> </Directory> <Directory Id="CSharpBindingFolder" Name="CSharpBinding"> <Component Guid="1E6F20EC-6BF4-45C0-AE99-319FBF568BD1" Id="CSharpBindingFiles" DiskId="1"> diff --git a/src/Setup/Setup.wxs b/src/Setup/Setup.wxs index 92957930a3..89c4737dd0 100644 --- a/src/Setup/Setup.wxs +++ b/src/Setup/Setup.wxs @@ -312,6 +312,7 @@ <ComponentRef Id="BooLangCompilerDll"/> <ComponentRef Id="BooLangDll"/> <ComponentRef Id="BooLangExtensionsDll"/> + <ComponentRef Id="BooLangPatternMatchingDll"/> <ComponentRef Id="BooLangInterpreterDll"/> <ComponentRef Id="BooLangParserDll"/> <ComponentRef Id="BooLangUsefulDll"/> diff --git a/src/Tools/NUnit/license.txt b/src/Tools/NUnit/license.txt new file mode 100644 index 0000000000..4beb762c93 --- /dev/null +++ b/src/Tools/NUnit/license.txt @@ -0,0 +1,15 @@ +Copyright � 2002-2007 Charlie Poole +Copyright � 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov +Copyright � 2000-2002 Philip A. Craig + +This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required. + +Portions Copyright � 2002-2007 Charlie Poole or Copyright � 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright � 2000-2002 Philip A. Craig + +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source distribution. diff --git a/src/Tools/NUnit/nunit-console-runner.dll b/src/Tools/NUnit/nunit-console-runner.dll new file mode 100755 index 0000000000..f2dae538b3 Binary files /dev/null and b/src/Tools/NUnit/nunit-console-runner.dll differ diff --git a/src/Tools/NUnit/nunit-console-x86.exe b/src/Tools/NUnit/nunit-console-x86.exe new file mode 100755 index 0000000000..c4f6598689 Binary files /dev/null and b/src/Tools/NUnit/nunit-console-x86.exe differ diff --git a/src/Tools/NUnit/nunit-console-x86.exe.config b/src/Tools/NUnit/nunit-console-x86.exe.config new file mode 100644 index 0000000000..fb30fe3edb --- /dev/null +++ b/src/Tools/NUnit/nunit-console-x86.exe.config @@ -0,0 +1,116 @@ +<configuration> + + <!-- Do not remove. Sets up configsectionhandler section for log4net --> + <configSections> + <section name="log4net" type="System.Configuration.IgnoreSectionHandler" /> + </configSections> + + <!-- + Application settings for NUnit-console.exe. Do NOT put settings + for use by your tests here. + --> + <appSettings> + + <!-- + Specify the location to be used by .NET for the cache + --> + <add key="shadowfiles.path" value="%temp%\nunit20\ShadowCopyCache" /> + + </appSettings> + + <system.diagnostics> + <switches> + <add name="NTrace" value="4" /> + </switches> + <trace autoflush="true" indentsize="4"> + <listeners> + <add name="NUnitInternalTrace" type="System.Diagnostics.TextWriterTraceListener" + initializeData="C:\NUnitPrimaryTrace.txt"/> + </listeners> + </trace> + </system.diagnostics> + + <!-- + The startup section may be used to specify the runtime versions + supported in the order that they will be used if more than one + is present. As supplied, this section is commented out, which + causes nunit-console to use the version of the framework with + which it was built. + + Since .NET 1.0 does not recognize the <supportedRuntime> elements, + a <requiredRuntime> element is used in case it is the only version + of the framework that is installed. + --> + <!-- + <startup> + <supportedRuntime version="v2.0.50727" /> + <supportedRuntime version="v2.0.50215" /> + <supportedRuntime version="v2.0.40607" /> + <supportedRuntime version="v1.1.4322" /> + <supportedRuntime version="v1.0.3705" /> + + <requiredRuntime version="v1.0.3705" /> + </startup> + --> + + <!-- + The following <runtime> section allows running nunit under + .NET 1.0 by redirecting assemblies. The appliesTo attribute + causes the section to be ignored except under .NET 1.0version 1 + on a machine with only the .NET version 1.0 runtime installed. + If application and its tests were built for .NET 1.1 you will + also need to redirect system assemblies in the test config file. + --> + + <runtime> + + <legacyUnhandledExceptionPolicy enabled="1" /> + + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" + appliesTo="v1.0.3705"> + + <dependentAssembly> + <assemblyIdentity name="System" + publicKeyToken="b77a5c561934e089" + culture="neutral"/> + <bindingRedirect oldVersion="1.0.5000.0" + newVersion="1.0.3300.0"/> + </dependentAssembly> + + <dependentAssembly> + <assemblyIdentity name="System.Data" + publicKeyToken="b77a5c561934e089" + culture="neutral"/> + <bindingRedirect oldVersion="1.0.5000.0" + newVersion="1.0.3300.0"/> + </dependentAssembly> + + <dependentAssembly> + <assemblyIdentity name="System.Drawing" + publicKeyToken="b03f5f7f11d50a3a" + culture="neutral"/> + <bindingRedirect oldVersion="1.0.5000.0" + newVersion="1.0.3300.0"/> + </dependentAssembly> + + <dependentAssembly> + <assemblyIdentity name="System.Windows.Forms" + publicKeyToken="b77a5c561934e089" + culture="neutral"/> + <bindingRedirect oldVersion="1.0.5000.0" + newVersion="1.0.3300.0"/> + </dependentAssembly> + + <dependentAssembly> + <assemblyIdentity name="System.Xml" + publicKeyToken="b77a5c561934e089" + culture="neutral"/> + <bindingRedirect oldVersion="1.0.5000.0" + newVersion="1.0.3300.0"/> + </dependentAssembly> + + </assemblyBinding> + + </runtime> + +</configuration> \ No newline at end of file diff --git a/src/Tools/NUnit/nunit-console.exe b/src/Tools/NUnit/nunit-console.exe new file mode 100755 index 0000000000..4045f6a41d Binary files /dev/null and b/src/Tools/NUnit/nunit-console.exe differ diff --git a/src/Tools/NUnit/nunit-console.exe.config b/src/Tools/NUnit/nunit-console.exe.config new file mode 100644 index 0000000000..fb30fe3edb --- /dev/null +++ b/src/Tools/NUnit/nunit-console.exe.config @@ -0,0 +1,116 @@ +<configuration> + + <!-- Do not remove. Sets up configsectionhandler section for log4net --> + <configSections> + <section name="log4net" type="System.Configuration.IgnoreSectionHandler" /> + </configSections> + + <!-- + Application settings for NUnit-console.exe. Do NOT put settings + for use by your tests here. + --> + <appSettings> + + <!-- + Specify the location to be used by .NET for the cache + --> + <add key="shadowfiles.path" value="%temp%\nunit20\ShadowCopyCache" /> + + </appSettings> + + <system.diagnostics> + <switches> + <add name="NTrace" value="4" /> + </switches> + <trace autoflush="true" indentsize="4"> + <listeners> + <add name="NUnitInternalTrace" type="System.Diagnostics.TextWriterTraceListener" + initializeData="C:\NUnitPrimaryTrace.txt"/> + </listeners> + </trace> + </system.diagnostics> + + <!-- + The startup section may be used to specify the runtime versions + supported in the order that they will be used if more than one + is present. As supplied, this section is commented out, which + causes nunit-console to use the version of the framework with + which it was built. + + Since .NET 1.0 does not recognize the <supportedRuntime> elements, + a <requiredRuntime> element is used in case it is the only version + of the framework that is installed. + --> + <!-- + <startup> + <supportedRuntime version="v2.0.50727" /> + <supportedRuntime version="v2.0.50215" /> + <supportedRuntime version="v2.0.40607" /> + <supportedRuntime version="v1.1.4322" /> + <supportedRuntime version="v1.0.3705" /> + + <requiredRuntime version="v1.0.3705" /> + </startup> + --> + + <!-- + The following <runtime> section allows running nunit under + .NET 1.0 by redirecting assemblies. The appliesTo attribute + causes the section to be ignored except under .NET 1.0version 1 + on a machine with only the .NET version 1.0 runtime installed. + If application and its tests were built for .NET 1.1 you will + also need to redirect system assemblies in the test config file. + --> + + <runtime> + + <legacyUnhandledExceptionPolicy enabled="1" /> + + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" + appliesTo="v1.0.3705"> + + <dependentAssembly> + <assemblyIdentity name="System" + publicKeyToken="b77a5c561934e089" + culture="neutral"/> + <bindingRedirect oldVersion="1.0.5000.0" + newVersion="1.0.3300.0"/> + </dependentAssembly> + + <dependentAssembly> + <assemblyIdentity name="System.Data" + publicKeyToken="b77a5c561934e089" + culture="neutral"/> + <bindingRedirect oldVersion="1.0.5000.0" + newVersion="1.0.3300.0"/> + </dependentAssembly> + + <dependentAssembly> + <assemblyIdentity name="System.Drawing" + publicKeyToken="b03f5f7f11d50a3a" + culture="neutral"/> + <bindingRedirect oldVersion="1.0.5000.0" + newVersion="1.0.3300.0"/> + </dependentAssembly> + + <dependentAssembly> + <assemblyIdentity name="System.Windows.Forms" + publicKeyToken="b77a5c561934e089" + culture="neutral"/> + <bindingRedirect oldVersion="1.0.5000.0" + newVersion="1.0.3300.0"/> + </dependentAssembly> + + <dependentAssembly> + <assemblyIdentity name="System.Xml" + publicKeyToken="b77a5c561934e089" + culture="neutral"/> + <bindingRedirect oldVersion="1.0.5000.0" + newVersion="1.0.3300.0"/> + </dependentAssembly> + + </assemblyBinding> + + </runtime> + +</configuration> \ No newline at end of file diff --git a/src/Tools/NUnit/nunit-console/App.ico b/src/Tools/NUnit/nunit-console/App.ico new file mode 100644 index 0000000000..3a5525fd79 Binary files /dev/null and b/src/Tools/NUnit/nunit-console/App.ico differ diff --git a/src/Tools/NUnit/nunit-console/AssemblyInfo.cs b/src/Tools/NUnit/nunit-console/AssemblyInfo.cs new file mode 100644 index 0000000000..4801183106 --- /dev/null +++ b/src/Tools/NUnit/nunit-console/AssemblyInfo.cs @@ -0,0 +1,39 @@ +// **************************************************************** +// This is free software licensed under the NUnit license. You +// may obtain a copy of the license as well as information regarding +// copyright ownership at http://nunit.org/?p=license&r=2.4. +// + +using System.Reflection; + +// +// Common Information about all NUnit assemblies is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("Extended NUnit console runner")] +[assembly: AssemblyDescription("NUnit-console extended by Daniel Grunwald and Matt Ward to support writing test results to a file as results are known")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("NUnit.org")] +[assembly: AssemblyProduct("NUnit")] +[assembly: AssemblyCopyright("Copyright (C) 2002-2007 Charlie Poole.\r\n" + + "Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.\r\n" + + "Copyright (C) 2000-2003 Philip Craig.\r\n" + + "Copyright (C) 2006 Daniel Grunwald.\r\n" + + "Copyright (C) 2006-2008 Matt Ward.\r\n" + + "All Rights Reserved.")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// 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 Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("2.4.8")] diff --git a/src/Tools/NUnit/nunit-console/EventCollector.cs b/src/Tools/NUnit/nunit-console/EventCollector.cs new file mode 100644 index 0000000000..0a9a45282e --- /dev/null +++ b/src/Tools/NUnit/nunit-console/EventCollector.cs @@ -0,0 +1,274 @@ +using System; +using System.IO; +using System.Diagnostics; +using System.Text.RegularExpressions; +using System.Text; +using System.Collections; +using System.Collections.Specialized; +using NUnit.Core; +using NUnit.Util; + +namespace NUnit.ConsoleRunner +{ + /// <summary> + /// Custom event listener that writes out test results as they + /// occur to a separate file. + /// </summary> + public class ExtendedEventCollector : MarshalByRefObject, EventListener + { + private int testRunCount; + private int testIgnoreCount; + private int failureCount; + private int level; + + private ConsoleOptions options; + private TextWriter outWriter; + private TextWriter errorWriter; + private TextWriter testResultWriter; + + StringCollection messages; + + private bool progress = false; + private string currentTestName; + private bool writeResults = false; + + private ArrayList unhandledExceptions = new ArrayList(); + + public ExtendedEventCollector( ConsoleOptions options, TextWriter outWriter, TextWriter errorWriter, TextWriter testResultWriter) + { + level = 0; + this.options = options; + this.outWriter = outWriter; + this.errorWriter = errorWriter; + this.currentTestName = string.Empty; + this.progress = !options.xmlConsole && !options.labels && !options.nodots; + this.testResultWriter = testResultWriter; + this.writeResults = testResultWriter != null; + + AppDomain.CurrentDomain.UnhandledException += + new UnhandledExceptionEventHandler(OnUnhandledException); + } + + public bool HasExceptions + { + get { return unhandledExceptions.Count > 0; } + } + + public void WriteExceptions() + { + Console.WriteLine(); + Console.WriteLine("Unhandled exceptions:"); + int index = 1; + foreach( string msg in unhandledExceptions ) + Console.WriteLine( "{0}) {1}", index++, msg ); + } + + public void RunStarted(string name, int testCount) + { + } + + public void RunFinished(TestResult result) + { + } + + public void RunFinished(Exception exception) + { + } + + public void TestFinished(TestCaseResult testResult) + { + if(testResult.Executed) + { + testRunCount++; + + if(testResult.IsFailure) + { + failureCount++; + + if ( progress ) + Console.Write("F"); + + messages.Add( string.Format( "{0}) {1} :", failureCount, testResult.Test.TestName.FullName ) ); + messages.Add( testResult.Message.Trim( Environment.NewLine.ToCharArray() ) ); + + string stackTrace = StackTraceFilter.Filter( testResult.StackTrace ); + if ( stackTrace != null && stackTrace != string.Empty ) + { + string[] trace = stackTrace.Split( System.Environment.NewLine.ToCharArray() ); + foreach( string s in trace ) + { + if ( s != string.Empty ) + { + string link = Regex.Replace( s.Trim(), @".* in (.*):line (.*)", "$1($2)"); + messages.Add( string.Format( "at\n{0}", link ) ); + } + } + } + } + } + else + { + testIgnoreCount++; + + if ( progress ) + Console.Write("N"); + } + + if (writeResults) { + WriteTestResult(testResult); + } + + currentTestName = string.Empty; + } + + public void TestStarted(TestName testName) + { + currentTestName = testName.FullName; + + if ( options.labels ) + outWriter.WriteLine("***** {0}", currentTestName ); + + if ( progress ) + Console.Write("."); + } + + public void SuiteStarted(TestName testName) + { + if ( level++ == 0 ) + { + messages = new StringCollection(); + testRunCount = 0; + testIgnoreCount = 0; + failureCount = 0; + Trace.WriteLine( "################################ UNIT TESTS ################################" ); + Trace.WriteLine( "Running tests in '" + testName.FullName + "'..." ); + } + } + + public void SuiteFinished(TestSuiteResult suiteResult) + { + if ( --level == 0) + { + Trace.WriteLine( "############################################################################" ); + + if (messages.Count == 0) + { + Trace.WriteLine( "############## S U C C E S S #################" ); + } + else + { + Trace.WriteLine( "############## F A I L U R E S #################" ); + + foreach ( string s in messages ) + { + Trace.WriteLine(s); + } + } + + Trace.WriteLine( "############################################################################" ); + Trace.WriteLine( "Executed tests : " + testRunCount ); + Trace.WriteLine( "Ignored tests : " + testIgnoreCount ); + Trace.WriteLine( "Failed tests : " + failureCount ); + Trace.WriteLine( "Unhandled exceptions : " + unhandledExceptions.Count); + Trace.WriteLine( "Total time : " + suiteResult.Time + " seconds" ); + Trace.WriteLine( "############################################################################"); + } + } + + private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e) + { + if (e.ExceptionObject.GetType() != typeof(System.Threading.ThreadAbortException)) + { + this.UnhandledException((Exception)e.ExceptionObject); + } + } + + + public void UnhandledException( Exception exception ) + { + // If we do labels, we already have a newline + unhandledExceptions.Add(currentTestName + " : " + exception.ToString()); + //if (!options.labels) outWriter.WriteLine(); + string msg = string.Format("##### Unhandled Exception while running {0}", currentTestName); + //outWriter.WriteLine(msg); + //outWriter.WriteLine(exception.ToString()); + + Trace.WriteLine(msg); + Trace.WriteLine(exception.ToString()); + } + + public void TestOutput( TestOutput output) + { + switch ( output.Type ) + { + case TestOutputType.Out: + outWriter.Write( output.Text ); + break; + case TestOutputType.Error: + errorWriter.Write( output.Text ); + break; + } + } + + + public override object InitializeLifetimeService() + { + return null; + } + + /// <summary> + /// Writes a single test result to the output result file. + /// </summary> + void WriteTestResult(TestCaseResult testResult) + { + testResultWriter.WriteLine("Name: " + testResult.Name); + + if (testResult.IsFailure) + { + testResultWriter.WriteLine("Result: Failure"); + testResultWriter.WriteLine("Message: " + EncodeText(testResult.Message)); + testResultWriter.WriteLine("StackTrace: " + EncodeText(StackTraceFilter.Filter(testResult.StackTrace))); + } + else if (!testResult.Executed) + { + testResultWriter.WriteLine("Result: Ignored"); + } + else if (testResult.IsSuccess) + { + testResultWriter.WriteLine("Result: Success"); + } + } + + /// <summary> + /// Replaces the first character on each new line with a space. + /// The first line does not have the extra space added. + /// </summary> + static string EncodeText(string s) + { + if (s == null || s.Length == 0) + { + return String.Empty; + } + + s = s.TrimEnd(Environment.NewLine.ToCharArray()); + + StringBuilder encodedText = new StringBuilder(); + foreach (char ch in s) + { + switch (ch) + { + case '\n': + encodedText.Append("\r\n "); + break; + case '\r': + // Ignore. + break; + default: + encodedText.Append(ch); + break; + } + } + return encodedText.ToString(); + } + } +} diff --git a/src/Tools/NUnit/nunit-console/ExtendedConsoleOptions.cs b/src/Tools/NUnit/nunit-console/ExtendedConsoleOptions.cs new file mode 100644 index 0000000000..271685b383 --- /dev/null +++ b/src/Tools/NUnit/nunit-console/ExtendedConsoleOptions.cs @@ -0,0 +1,28 @@ +/* + * Created by SharpDevelop. + * User: Daniel Grunwald + * Date: 03.02.2006 + * Time: 23:13 + */ + +using System; +using Codeblast; + +namespace NUnit.ConsoleRunner +{ + public class ExtendedConsoleOptions : ConsoleOptions + { + public ExtendedConsoleOptions(string[] args) : base(args) {} + + [Option(Description="File to receive test results as each test is run")] + public string results; + + public bool IsResults + { + get + { + return (results != null) && (results.Length != 0); + } + } + } +} diff --git a/src/Tools/NUnit/nunit-console/ExtendedConsoleUi.cs b/src/Tools/NUnit/nunit-console/ExtendedConsoleUi.cs new file mode 100644 index 0000000000..62541f9ec5 --- /dev/null +++ b/src/Tools/NUnit/nunit-console/ExtendedConsoleUi.cs @@ -0,0 +1,225 @@ +// **************************************************************** +// This is free software licensed under the NUnit license. You +// may obtain a copy of the license as well as information regarding +// copyright ownership at http://nunit.org/?p=license&r=2.4. +// **************************************************************** + +// This version of NUnit-console is modified to support: +// 1) Writing all tests results to a file as the test results are known. + +// **************************************************************** +// This is free software licensed under the NUnit license. You +// may obtain a copy of the license as well as information regarding +// copyright ownership at http://nunit.org/?p=license&r=2.4. +// **************************************************************** + +namespace NUnit.ConsoleRunner +{ + using System; + using System.IO; + using System.Reflection; + using System.Xml; + using System.Resources; + using System.Text; + using NUnit.Core; + using NUnit.Core.Filters; + using NUnit.Util; + + /// <summary> + /// Summary description for ConsoleUi. + /// </summary> + public class ExtendedConsoleUi + { + public static readonly int OK = 0; + public static readonly int INVALID_ARG = -1; + public static readonly int FILE_NOT_FOUND = -2; + public static readonly int FIXTURE_NOT_FOUND = -3; + public static readonly int TRANSFORM_ERROR = -4; + public static readonly int UNEXPECTED_ERROR = -100; + + public ExtendedConsoleUi() + { + } + + public int Execute( ExtendedConsoleOptions options ) + { + XmlTextReader transformReader = GetTransformReader(options); + if(transformReader == null) return FILE_NOT_FOUND; + + TextWriter outWriter = Console.Out; + bool redirectOutput = options.output != null && options.output != string.Empty; + if ( redirectOutput ) + { + StreamWriter outStreamWriter = new StreamWriter( options.output ); + outStreamWriter.AutoFlush = true; + outWriter = outStreamWriter; + } + + TextWriter errorWriter = Console.Error; + bool redirectError = options.err != null && options.err != string.Empty; + if ( redirectError ) + { + StreamWriter errorStreamWriter = new StreamWriter( options.err ); + errorStreamWriter.AutoFlush = true; + errorWriter = errorStreamWriter; + } + + TextWriter testResultWriter = null; + if ( options.IsResults ) + { + testResultWriter = new StreamWriter ( options.results, false, Encoding.UTF8 ); + ((StreamWriter)testResultWriter).AutoFlush = true; + } + + TestRunner testRunner = MakeRunnerFromCommandLine( options ); + + try + { + if (testRunner.Test == null) + { + testRunner.Unload(); + Console.Error.WriteLine("Unable to locate fixture {0}", options.fixture); + return FIXTURE_NOT_FOUND; + } + + ExtendedEventCollector collector = new ExtendedEventCollector( options, outWriter, errorWriter, testResultWriter ); + + TestFilter testFilter = TestFilter.Empty; + if ( options.run != null && options.run != string.Empty ) + { + Console.WriteLine( "Selected test: " + options.run ); + testFilter = new SimpleNameFilter( options.run ); + } + + if ( options.include != null && options.include != string.Empty ) + { + Console.WriteLine( "Included categories: " + options.include ); + TestFilter includeFilter = new CategoryExpression( options.include ).Filter; + if ( testFilter.IsEmpty ) + testFilter = includeFilter; + else + testFilter = new AndFilter( testFilter, includeFilter ); + } + + if ( options.exclude != null && options.exclude != string.Empty ) + { + Console.WriteLine( "Excluded categories: " + options.exclude ); + TestFilter excludeFilter = new NotFilter( new CategoryExpression( options.exclude ).Filter ); + if ( testFilter.IsEmpty ) + testFilter = excludeFilter; + else if ( testFilter is AndFilter ) + ((AndFilter)testFilter).Add( excludeFilter ); + else + testFilter = new AndFilter( testFilter, excludeFilter ); + } + + TestResult result = null; + string savedDirectory = Environment.CurrentDirectory; + TextWriter savedOut = Console.Out; + TextWriter savedError = Console.Error; + + try + { + result = testRunner.Run( collector, testFilter ); + } + finally + { + outWriter.Flush(); + errorWriter.Flush(); + + if ( redirectOutput ) + outWriter.Close(); + if ( redirectError ) + errorWriter.Close(); + if ( options.IsResults ) + testResultWriter.Close(); + + Environment.CurrentDirectory = savedDirectory; + Console.SetOut( savedOut ); + Console.SetError( savedError ); + } + + Console.WriteLine(); + + string xmlOutput = CreateXmlOutput( result ); + + if (options.xmlConsole) + { + Console.WriteLine(xmlOutput); + } + else + { + try + { + //CreateSummaryDocument(xmlOutput, transformReader ); + XmlResultTransform xform = new XmlResultTransform( transformReader ); + xform.Transform( new StringReader( xmlOutput ), Console.Out ); + } + catch( Exception ex ) + { + Console.WriteLine( "Error: {0}", ex.Message ); + return TRANSFORM_ERROR; + } + } + + // Write xml output here + string xmlResultFile = options.xml == null || options.xml == string.Empty + ? "TestResult.xml" : options.xml; + + if( options.xml != null ) + { + using ( StreamWriter writer = new StreamWriter( xmlResultFile ) ) + { + writer.Write(xmlOutput); + } + } + + //if ( testRunner != null ) + // testRunner.Unload(); + + if ( collector.HasExceptions ) + { + collector.WriteExceptions(); + return UNEXPECTED_ERROR; + } + + if ( !result.IsFailure ) return OK; + + ResultSummarizer summ = new ResultSummarizer( result ); + return summ.FailureCount; + } + finally + { + testRunner.Unload(); + } + } + + #region Helper Methods + private static XmlTextReader GetTransformReader(ConsoleOptions parser) + { + return (XmlTextReader)typeof(ConsoleUi).InvokeMember("GetTransformReader", + BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.InvokeMethod, + null, null, new object[] { parser }); + } + + private static TestRunner MakeRunnerFromCommandLine( ConsoleOptions options ) + { + return (TestRunner)typeof(ConsoleUi).InvokeMember("MakeRunnerFromCommandLine", + BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.InvokeMethod, + null, null, new object[] { options }); + + } + + private static string CreateXmlOutput( TestResult result ) + { + StringBuilder builder = new StringBuilder(); + XmlResultVisitor resultVisitor = new XmlResultVisitor(new StringWriter( builder ), result); + result.Accept(resultVisitor); + resultVisitor.Write(); + + return builder.ToString(); + } + #endregion + } +} + diff --git a/src/Tools/NUnit/nunit-console/ExtendedRunner.cs b/src/Tools/NUnit/nunit-console/ExtendedRunner.cs new file mode 100644 index 0000000000..b2700bdab9 --- /dev/null +++ b/src/Tools/NUnit/nunit-console/ExtendedRunner.cs @@ -0,0 +1,121 @@ +// This version of NUnit-console is modified to support: +// 1) Writing all tests results to a file as the test results are known. + +using System; +using System.IO; +using System.Reflection; +using NUnit.Core; +using NUnit.Util; + + +namespace NUnit.ConsoleRunner +{ + /// <summary> + /// Modified version of NUnit's Runner class to support the ExtendedConsoleOptions + /// and the ExtendedConsoleUi class. + /// </summary> + public class Runner + { + [STAThread] + public static int Main(string[] args) + { + NTrace.Info( "NUnit-console.exe starting" ); + + ExtendedConsoleOptions options = new ExtendedConsoleOptions(args); + + if(!options.nologo) + WriteCopyright(); + + if(options.help) + { + options.Help(); + return ConsoleUi.OK; + } + + if(options.NoArgs) + { + Console.Error.WriteLine("fatal error: no inputs specified"); + options.Help(); + return ConsoleUi.OK; + } + + if(!options.Validate()) + { + foreach( string arg in options.InvalidArguments ) + Console.Error.WriteLine("fatal error: invalid argument: {0}", arg ); + options.Help(); + return ConsoleUi.INVALID_ARG; + } + + // Add Standard Services to ServiceManager + ServiceManager.Services.AddService( new SettingsService() ); + ServiceManager.Services.AddService( new DomainManager() ); + //ServiceManager.Services.AddService( new RecentFilesService() ); + //ServiceManager.Services.AddService( new TestLoader() ); + ServiceManager.Services.AddService( new AddinRegistry() ); + ServiceManager.Services.AddService( new AddinManager() ); + // TODO: Resolve conflict with gui testagency when running + // console tests under the gui. + //ServiceManager.Services.AddService( new TestAgency() ); + + // Initialize Services + ServiceManager.Services.InitializeServices(); + + try + { + ExtendedConsoleUi consoleUi = new ExtendedConsoleUi(); + return consoleUi.Execute( options ); + } + catch( FileNotFoundException ex ) + { + Console.WriteLine( ex.Message ); + return ConsoleUi.FILE_NOT_FOUND; + } + catch( Exception ex ) + { + Console.WriteLine( "Unhandled Exception:\n{0}", ex.ToString() ); + return ConsoleUi.UNEXPECTED_ERROR; + } + finally + { + if(options.wait) + { + Console.Out.WriteLine("\nHit <enter> key to continue"); + Console.ReadLine(); + } + + NTrace.Info( "NUnit-console.exe terminating" ); + } + + } + + private static void WriteCopyright() + { + Assembly executingAssembly = Assembly.GetExecutingAssembly(); + System.Version version = executingAssembly.GetName().Version; + + string productName = "NUnit"; + string copyrightText = "Copyright (C) 2002-2007 Charlie Poole.\r\nCopyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.\r\nCopyright (C) 2000-2002 Philip Craig.\r\nAll Rights Reserved."; + + object[] objectAttrs = executingAssembly.GetCustomAttributes(typeof(AssemblyProductAttribute), false); + if ( objectAttrs.Length > 0 ) + productName = ((AssemblyProductAttribute)objectAttrs[0]).Product; + + objectAttrs = executingAssembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); + if ( objectAttrs.Length > 0 ) + copyrightText = ((AssemblyCopyrightAttribute)objectAttrs[0]).Copyright; + + Console.WriteLine(String.Format("{0} version {1}", productName, version.ToString(3))); + Console.WriteLine(copyrightText); + Console.WriteLine(); + + Console.WriteLine( "Runtime Environment - " ); + RuntimeFramework framework = RuntimeFramework.CurrentFramework; + Console.WriteLine( string.Format(" OS Version: {0}", Environment.OSVersion ) ); + Console.WriteLine( string.Format(" CLR Version: {0} ( {1} )", + Environment.Version, framework.GetDisplayName() ) ); + + Console.WriteLine(); + } + } +} diff --git a/src/Tools/NUnit/nunit-console/build.bat b/src/Tools/NUnit/nunit-console/build.bat new file mode 100755 index 0000000000..17a603d29a --- /dev/null +++ b/src/Tools/NUnit/nunit-console/build.bat @@ -0,0 +1,9 @@ +:: ----------------------------------------------------------------- +:: Builds the 32bit version of NUnit Console and the AnyCPU version. +:: ----------------------------------------------------------------- + +%windir%\microsoft.net\framework\v3.5\msbuild nunit-console.sln /p:PlatformTarget=x86 /property:Configuration=Release /t:Rebuild +move ..\nunit-console.exe ..\nunit-console-x86.exe +%windir%\microsoft.net\framework\v3.5\msbuild nunit-console.sln /property:Configuration=Release /t:Rebuild + +@IF %ERRORLEVEL% NEQ 0 PAUSE \ No newline at end of file diff --git a/src/Tools/NUnit/nunit-console/nunit-console.csproj b/src/Tools/NUnit/nunit-console/nunit-console.csproj new file mode 100644 index 0000000000..e34dd64ae8 --- /dev/null +++ b/src/Tools/NUnit/nunit-console/nunit-console.csproj @@ -0,0 +1,69 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> + <PropertyGroup> + <OutputType>Exe</OutputType> + <RootNamespace>NUnit.ConsoleRunner</RootNamespace> + <AssemblyName>nunit-console</AssemblyName> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{FCF6B5AB-45DE-4E4B-A7D4-2F531C2A12BC}</ProjectGuid> + <AllowUnsafeBlocks>False</AllowUnsafeBlocks> + <NoStdLib>False</NoStdLib> + <RegisterForComInterop>False</RegisterForComInterop> + <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> + <BaseAddress>285212672</BaseAddress> + <PlatformTarget>AnyCPU</PlatformTarget> + <FileAlignment>512</FileAlignment> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>false</TreatWarningsAsErrors> + <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> + <ApplicationIcon>App.ico</ApplicationIcon> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> + <OutputPath>..\</OutputPath> + <Optimize>False</Optimize> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DebugSymbols>true</DebugSymbols> + <DebugType>Full</DebugType> + <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)' == 'Release' "> + <OutputPath>..\</OutputPath> + <Optimize>True</Optimize> + <DefineConstants>TRACE</DefineConstants> + <DebugSymbols>false</DebugSymbols> + <DebugType>None</DebugType> + <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> + </PropertyGroup> + <ItemGroup> + <Reference Include="nunit.core.interfaces"> + <HintPath>..\nunit.core.interfaces.dll</HintPath> + <SpecificVersion>False</SpecificVersion> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + <Reference Include="nunit.util"> + <HintPath>..\nunit.util.dll</HintPath> + <SpecificVersion>False</SpecificVersion> + <Private>False</Private> + </Reference> + <Reference Include="nunit.core"> + <HintPath>..\nunit.core.dll</HintPath> + <SpecificVersion>False</SpecificVersion> + <Private>False</Private> + </Reference> + <Reference Include="nunit-console-runner"> + <HintPath>..\nunit-console-runner.dll</HintPath> + <SpecificVersion>False</SpecificVersion> + <Private>False</Private> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="ExtendedConsoleUi.cs" /> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="ExtendedConsoleOptions.cs" /> + <Compile Include="EventCollector.cs" /> + <Compile Include="ExtendedRunner.cs" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> +</Project> \ No newline at end of file diff --git a/src/Tools/NUnit/nunit-console/nunit-console.sln b/src/Tools/NUnit/nunit-console/nunit-console.sln new file mode 100644 index 0000000000..34bd9237a7 --- /dev/null +++ b/src/Tools/NUnit/nunit-console/nunit-console.sln @@ -0,0 +1,18 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +# SharpDevelop 3.0.0.2745 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit-console", "nunit-console.csproj", "{FCF6B5AB-45DE-4E4B-A7D4-2F531C2A12BC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FCF6B5AB-45DE-4E4B-A7D4-2F531C2A12BC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FCF6B5AB-45DE-4E4B-A7D4-2F531C2A12BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FCF6B5AB-45DE-4E4B-A7D4-2F531C2A12BC}.Release|Any CPU.Build.0 = Release|Any CPU + {FCF6B5AB-45DE-4E4B-A7D4-2F531C2A12BC}.Release|Any CPU.ActiveCfg = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/src/Tools/NUnit/nunit.core.dll b/src/Tools/NUnit/nunit.core.dll new file mode 100755 index 0000000000..a31edfdd9e Binary files /dev/null and b/src/Tools/NUnit/nunit.core.dll differ diff --git a/src/Tools/NUnit/nunit.core.extensions.dll b/src/Tools/NUnit/nunit.core.extensions.dll new file mode 100755 index 0000000000..ca1ce33531 Binary files /dev/null and b/src/Tools/NUnit/nunit.core.extensions.dll differ diff --git a/src/Tools/NUnit/nunit.core.interfaces.dll b/src/Tools/NUnit/nunit.core.interfaces.dll new file mode 100755 index 0000000000..2c48764c8a Binary files /dev/null and b/src/Tools/NUnit/nunit.core.interfaces.dll differ diff --git a/src/Tools/NUnit/nunit.framework.dll b/src/Tools/NUnit/nunit.framework.dll new file mode 100755 index 0000000000..2a0a0aa326 Binary files /dev/null and b/src/Tools/NUnit/nunit.framework.dll differ diff --git a/src/Tools/NUnit/nunit.uikit.dll b/src/Tools/NUnit/nunit.uikit.dll new file mode 100755 index 0000000000..448142988e Binary files /dev/null and b/src/Tools/NUnit/nunit.uikit.dll differ diff --git a/src/Tools/NUnit/nunit.util.dll b/src/Tools/NUnit/nunit.util.dll new file mode 100755 index 0000000000..8f51b27842 Binary files /dev/null and b/src/Tools/NUnit/nunit.util.dll differ diff --git a/src/Tools/NUnit/rowtest-license.txt b/src/Tools/NUnit/rowtest-license.txt new file mode 100644 index 0000000000..fb345fb72f --- /dev/null +++ b/src/Tools/NUnit/rowtest-license.txt @@ -0,0 +1,22 @@ +Copyright (c) 2007 Andreas Schlapsi + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/Tools/PartCover/Interop.PartCover.dll b/src/Tools/PartCover/Interop.PartCover.dll new file mode 100755 index 0000000000..c585f5ae36 Binary files /dev/null and b/src/Tools/PartCover/Interop.PartCover.dll differ diff --git a/src/Tools/PartCover/PartCover Console Manual.rtf b/src/Tools/PartCover/PartCover Console Manual.rtf new file mode 100644 index 0000000000..19fee120c8 --- /dev/null +++ b/src/Tools/PartCover/PartCover Console Manual.rtf @@ -0,0 +1,203 @@ +{\rtf1\adeflang44101\ansi\ansicpg1251\uc1\adeff0\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1049\deflangfe1049{\fonttbl{\f0\froman\fcharset204\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\f1\fswiss\fcharset204\fprq2{\*\panose 020b0604020202020204}Arial;}{\f2\fmodern\fcharset204\fprq1{\*\panose 02070309020205020404}Courier New;}{\f36\fswiss\fcharset204\fprq2{\*\panose 020b0604030504040204}Tahoma;} +{\f125\froman\fcharset0\fprq2 Times New Roman;}{\f123\froman\fcharset238\fprq2 Times New Roman CE;}{\f126\froman\fcharset161\fprq2 Times New Roman Greek;}{\f127\froman\fcharset162\fprq2 Times New Roman Tur;} +{\f128\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f129\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f130\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f131\froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\f135\fswiss\fcharset0\fprq2 Arial;}{\f133\fswiss\fcharset238\fprq2 Arial CE;}{\f136\fswiss\fcharset161\fprq2 Arial Greek;}{\f137\fswiss\fcharset162\fprq2 Arial Tur;}{\f138\fswiss\fcharset177\fprq2 Arial (Hebrew);} +{\f139\fswiss\fcharset178\fprq2 Arial (Arabic);}{\f140\fswiss\fcharset186\fprq2 Arial Baltic;}{\f141\fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f145\fmodern\fcharset0\fprq1 Courier New;}{\f143\fmodern\fcharset238\fprq1 Courier New CE;} +{\f146\fmodern\fcharset161\fprq1 Courier New Greek;}{\f147\fmodern\fcharset162\fprq1 Courier New Tur;}{\f148\fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f149\fmodern\fcharset178\fprq1 Courier New (Arabic);} +{\f150\fmodern\fcharset186\fprq1 Courier New Baltic;}{\f151\fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f485\fswiss\fcharset0\fprq2 Tahoma;}{\f483\fswiss\fcharset238\fprq2 Tahoma CE;}{\f486\fswiss\fcharset161\fprq2 Tahoma Greek;} +{\f487\fswiss\fcharset162\fprq2 Tahoma Tur;}{\f488\fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f489\fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f490\fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f491\fswiss\fcharset163\fprq2 Tahoma (Vietnamese);} +{\f492\fswiss\fcharset222\fprq2 Tahoma (Thai);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255; +\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{ +\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fcs1 \af0\afs24\alang1025 \fcs0 \fs24\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 \snext0 Normal;}{ +\s1\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \fcs1 \ab\af0\afs32\alang1025 \fcs0 \b\f1\fs32\lang1049\langfe1049\kerning32\cgrid\langnp1049\langfenp1049 \sbasedon0 \snext0 \styrsid4662214 +heading 1;}{\s2\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \fcs1 \ab\ai\af0\afs28\alang1025 \fcs0 \b\i\f1\fs28\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 +\sbasedon0 \snext0 \styrsid4662214 heading 2;}{\*\cs10 \additive \ssemihidden Default Paragraph Font;}{\* +\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv +\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fcs1 \af0\afs20 \fcs0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}{ +\s15\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fcs1 \af0\afs20\alang1025 \fcs0 \f2\fs20\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 \sbasedon0 \snext15 Plain Text;}{ +\s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \cbpat9 \fcs1 \af0\afs20\alang1025 \fcs0 \f36\fs20\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 \sbasedon0 \snext16 \ssemihidden \styrsid3550821 Document Map;}{\* +\ts17\tsrowd\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 +\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fcs1 +\af0\afs20\alang44101 \fcs0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \sbasedon11 \snext17 \styrsid2687420 Table Grid;}}{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\rsidtbl \rsid1901268\rsid2687420\rsid3550821\rsid4662214\rsid6780895 +\rsid8656177\rsid8991132\rsid9193294\rsid11103014\rsid11949287\rsid12545791\rsid12652468\rsid12850468}{\*\generator Microsoft Word 11.0.6359;}{\info{\title Parameters for running PartCover}{\author Oleg Loginov}{\operator Oleg Loginov} +{\creatim\yr2006\mo8\dy24\hr12\min56}{\revtim\yr2006\mo8\dy24\hr13\min9}{\version14}{\edmins9}{\nofpages3}{\nofwords655}{\nofchars3738}{\*\company STAR}{\nofcharsws4385}{\vern24703}}\paperw11906\paperh16838\margl1152\margr1152\margt1134\margb1134 +\deftab708\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1152\dgvorigin1134\dghshow1\dgvshow1 +\jexpand\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct +\asianbrkrule\rsidroot8991132\newtblstyruls\nogrowautofit \fet0\sectd \linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid8656177\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2 +\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6 +\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang +{\pntxtb (}{\pntxta )}}\pard\plain \s1\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid4662214 \fcs1 \ab\af0\afs32\alang1025 \fcs0 +\b\f1\fs32\lang1049\langfe1049\kerning32\cgrid\langnp1049\langfenp1049 {\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 Parameters for running PartCover.exe (console version) +\par }\pard\plain \s15\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid3550821 \fcs1 \af0\afs20\alang1025 \fcs0 \f2\fs20\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 See section }{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid3550821 \'93}{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 Run Arguments Examples}{ +\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid3550821 \'94}{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 for examples +\par }\pard\plain \s2\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid4662214 \fcs1 \ab\ai\af0\afs28\alang1025 \fcs0 \b\i\f1\fs28\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af0 +\fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 --target=<filename> +\par }\pard\plain \s15\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8656177 \fcs1 \af0\afs20\alang1025 \fcs0 \f2\fs20\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 Argument specifies path to executable file to count coverage. <filename> may be either full path or relative path to file. +\par }\pard\plain \s2\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid11103014 \fcs1 \ab\ai\af0\afs28\alang1025 \fcs0 \b\i\f1\fs28\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af0 +\fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 --target-work-dir=<path> +\par }\pard\plain \s15\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8656177 \fcs1 \af0\afs20\alang1025 \fcs0 \f2\fs20\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 Argument specifies working directory to target process. By default, working directory will be working directory for PartCover.exe +\par }\pard\plain \s2\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid11103014 \fcs1 \ab\ai\af0\afs28\alang1025 \fcs0 \b\i\f1\fs28\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af0 +\fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 --target-args=<arguments> +\par }\pard\plain \s15\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8656177 \fcs1 \af0\afs20\alang1025 \fcs0 \f2\fs20\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 Argument specifies arguments for target process. If target argument contains spaces - quote <argument>. If you want specify quote (") in <arguments>, then precede it by slash (\\) +\par }\pard\plain \s2\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid11103014 \fcs1 \ab\ai\af0\afs28\alang1025 \fcs0 \b\i\f1\fs28\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af0 +\fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 --include=<item>, --exclude=<item> +\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9193294 \fcs1 \af0\afs24\alang1025 \fcs0 \fs24\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af0 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 These two specifies item to include or exclude from report. Item is in following format: +\par \tab [<assembly_regexp>]<class_regexp> +\par where <regexp> is simple regular expression, containing only asterix and characters to point item. For example: +\par [mscorlib]* +\par [System.*]System.IO.* +\par [System]System.Colle* +\par [Test]Test.*+InnerClass+SecondInners* +\par For additional examples, see section }{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid9193294\charrsid1901268 \'93}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 Rules}{\fcs1 \af0 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid9193294\charrsid1901268 \'94}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 . +\par }\pard\plain \s2\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid11103014 \fcs1 \ab\ai\af0\afs28\alang1025 \fcs0 \b\i\f1\fs28\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af0 +\fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 --settings=<file_name> +\par }\pard\plain \s15\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8656177 \fcs1 \af0\afs20\alang1025 \fcs0 \f2\fs20\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 This specifies input settings in xml file. +\par }\pard\plain \s2\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid11103014 \fcs1 \ab\ai\af0\afs28\alang1025 \fcs0 \b\i\f1\fs28\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af0 +\fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 --generate=<file_name> +\par }\pard\plain \s15\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8656177 \fcs1 \af0\afs20\alang1025 \fcs0 \f2\fs20\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 This generates setting file using settings specified. By default, file generated will be processed via console output. +\par }\pard\plain \s2\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid11103014 \fcs1 \ab\ai\af0\afs28\alang1025 \fcs0 \b\i\f1\fs28\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af0 +\fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 --output=<file_name> +\par }\pard\plain \s15\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8656177 \fcs1 \af0\afs20\alang1025 \fcs0 \f2\fs20\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 This specifies output file for writing result xml. It will be placed in UTF-8 encoding. By default, output data will be processed via console output. +\par }\pard\plain \s2\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid11103014 \fcs1 \ab\ai\af0\afs28\alang1025 \fcs0 \b\i\f1\fs28\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af0 +\fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 --log=<log_level> : +\par }\pard\plain \s15\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8656177 \fcs1 \af0\afs20\alang1025 \fcs0 \f2\fs20\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 This specifies log level for driver. If <log_level> greater than 0, log file will be created in working directory for PartCover.exe +\par }\pard\plain \s2\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid11103014 \fcs1 \ab\ai\af0\afs28\alang1025 \fcs0 \b\i\f1\fs28\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af0 +\fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 --version +\par }\pard\plain \s15\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8656177 \fcs1 \af0\afs20\alang1025 \fcs0 \f2\fs20\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 This shows version of PartCover.exe console application +\par }\pard\plain \s1\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid11103014 \fcs1 \ab\af0\afs32\alang1025 \fcs0 \b\f1\fs32\lang1049\langfe1049\kerning32\cgrid\langnp1049\langfenp1049 {\fcs1 +\af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 Rules +\par }\pard\plain \s15\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8656177 \fcs1 \af0\afs20\alang1025 \fcs0 \f2\fs20\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 Common form for rules is +\par +\par \tab [<assembly_regexp>]<class_regexp> +\par +\par Regexp can contains digits, letters, asterisks and pluses. Asterisk means zero or more letters and digits in template, plus means inner state of classes. +\par For example, +\par +\par [mscorlib]* +\par [System.*]System.IO.* +\par [System]System.Colle* +\par [Test]Test.*+InnerClass+SecondInners* +\par +\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9193294 \fcs1 \af0\afs24\alang1025 \fcs0 \fs24\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af0 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 Look at the table with examples}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132 +\par }\trowd \irow0\irowband0\ts17\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 +\trftsWidth3\trwWidth9828\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tbllkhdrrows\tbllklastrow\tbllkhdrcols\tbllklastcol \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb +\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth3348\clshdrawnil \cellx4549\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth6480\clshdrawnil \cellx9720 +\pard\plain \s15\ql \li0\ri0\widctlpar\intbl\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\pararsid3550821\yts17 \fcs1 \af0\afs20\alang1025 \fcs0 \f2\fs20\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 [mscorlib]*}{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420 \cell }{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 +Describes all classes from assembly }{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420 \'93}{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 mscorlib}{\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid2687420 \'94}{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420\charrsid2687420 \cell }\pard\plain \ql \li0\ri0\widctlpar\intbl\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \fcs1 \af0\afs24\alang1025 +\fcs0 \fs24\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420 \trowd \irow0\irowband0\ts17\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr +\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \trftsWidth3\trwWidth9828\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tbllkhdrrows\tbllklastrow\tbllkhdrcols\tbllklastcol \clvertalt +\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth3348\clshdrawnil \cellx4549\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 +\cltxlrtb\clftsWidth3\clwWidth6480\clshdrawnil \cellx9720\row }\pard\plain \s15\ql \li0\ri0\widctlpar\intbl\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\pararsid3550821\yts17 \fcs1 \af0\afs20\alang1025 \fcs0 +\f2\fs20\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 [System.*]System.IO.*\cell Describes assemblies that start from }{\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid2687420 \'93}{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 System.}{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420 \'94}{\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 and classes within it which name starts from }{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420 \'93}{\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 System.IO.}{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420 \'94}{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 \cell }\pard\plain +\ql \li0\ri0\widctlpar\intbl\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \fcs1 \af0\afs24\alang1025 \fcs0 \fs24\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420 \trowd \irow1\irowband1 +\ts17\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 +\trftsWidth3\trwWidth9828\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tbllkhdrrows\tbllklastrow\tbllkhdrcols\tbllklastcol \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb +\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth3348\clshdrawnil \cellx4549\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth6480\clshdrawnil \cellx9720 +\row }\pard\plain \s15\ql \li0\ri0\widctlpar\intbl\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\pararsid3550821\yts17 \fcs1 \af0\afs20\alang1025 \fcs0 \f2\fs20\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 [System]System.Colle*\cell Describes classes from assembly }{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420 \'93}{\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 System}{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420 \'94}{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 which name start from }{\fcs1 +\af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420 \'93}{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 System.Colle}{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420 \'94}{\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 and have free ending part of name\cell }\pard\plain \ql \li0\ri0\widctlpar\intbl\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \fcs1 \af0\afs24\alang1025 \fcs0 +\fs24\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420 \trowd \irow2\irowband2\ts17\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr +\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \trftsWidth3\trwWidth9828\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tbllkhdrrows\tbllklastrow\tbllkhdrcols\tbllklastcol \clvertalt +\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth3348\clshdrawnil \cellx4549\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 +\cltxlrtb\clftsWidth3\clwWidth6480\clshdrawnil \cellx9720\row }\pard\plain \s15\ql \li0\ri0\widctlpar\intbl\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\pararsid3550821\yts17 \fcs1 \af0\afs20\alang1025 \fcs0 +\f2\fs20\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 [Test]Test.*+InnerClass+SecondInners*\cell Describes classes from assembly }{\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid2687420 \'93}{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 Test}{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420 \'94}{\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 which name starts from }{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420 \'93}{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 SecondInners}{ +\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420 \'94 }{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 and which are inner for class with name }{\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid2687420 \'93}{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 InnerClass}{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420 \'94}{\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 which are inner for class with name starting with }{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420 \'93}{\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 Test.}{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420 \'94}{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420\charrsid2687420 \cell }\pard\plain +\ql \li0\ri0\widctlpar\intbl\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \fcs1 \af0\afs24\alang1025 \fcs0 \fs24\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid2687420 +\trowd \irow3\irowband3\lastrow \ts17\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 +\trftsWidth3\trwWidth9828\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tbllkhdrrows\tbllklastrow\tbllkhdrcols\tbllklastcol \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb +\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth3348\clshdrawnil \cellx4549\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth6480\clshdrawnil \cellx9720 +\row }\pard\plain \s15\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8656177 \fcs1 \af0\afs20\alang1025 \fcs0 \f2\fs20\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid2687420\charrsid3550821 }{\fcs1 \af2 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 +\par }\pard\plain \s1\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid2687420 \fcs1 \ab\af0\afs32\alang1025 \fcs0 \b\f1\fs32\lang1049\langfe1049\kerning32\cgrid\langnp1049\langfenp1049 {\fcs1 +\af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 Run Arguments Examples +\par }\pard\plain \s15\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8656177 \fcs1 \af0\afs20\alang1025 \fcs0 \f2\fs20\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af2 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid3550821 +\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12545791 \fcs1 \af0\afs24\alang1025 \fcs0 \fs24\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af0 \fcs0 +\cf2\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 PartCover.exe --version +\par }{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 +\par Shows version of PartCover.exe and exits +\par +\par }{\fcs1 \af0 \fcs0 \cf2\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 PartCover.exe --target=../../bin/partcover.test.exe +\par }{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 +\par Run target from path }{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid11949287\charrsid1901268 \'93}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 ../../bin/partcover.test.exe}{\fcs1 \af0 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid11949287\charrsid1901268 \'94}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 and shows report on screen +\par +\par }{\fcs1 \af0 \fcs0 \cf2\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 PartCover.exe --target=../../bin/partcover.test.exe --include=[Test]* +\par }{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 +\par Run target from path }{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid11949287\charrsid1901268 \'93}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 ../../bin/partcover.test.exe}{\fcs1 \af0 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid11949287\charrsid1901268 \'94}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 and shows report on screen. Reports will include only classes from assembly }{\fcs1 \af0 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid11949287\charrsid1901268 \'93}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 Test}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid11949287\charrsid1901268 \'94}{\fcs1 \af0 +\fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 +\par +\par }{\fcs1 \af0 \fcs0 \cf2\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 PartCover.exe --target=../../bin/partcover.test.exe --include=[Test]* --exclude=[Test]DS* +\par }{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 +\par Run target from path }{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid11949287\charrsid1901268 \'93}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 ../../bin/partcover.test.exe}{\fcs1 \af0 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid11949287\charrsid1901268 \'94}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 and shows report on screen. Reports will include only classes from assembly }{\fcs1 \af0 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid11949287\charrsid1901268 \'93}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 Test}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid11949287\charrsid1901268 \'94}{\fcs1 \af0 +\fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 and all classes from assembly }{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid11949287\charrsid1901268 \'93}{\fcs1 \af0 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 Test}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid11949287\charrsid1901268 \'94}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 + which name starts with }{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid11949287\charrsid1901268 \'93}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 DS}{\fcs1 \af0 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid11949287\charrsid1901268 \'94}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 will be thrown out from report. So, you can exclude all dataset classes, generated by tools. +\par +\par }{\fcs1 \af0 \fcs0 \cf2\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 PartCover.exe --target=../../bin/partcover.test.exe --include=[Test]* --include=[*.Data.*]* }{\fcs1 \af0 \fcs0 \cf2\lang1033\langfe1049\langnp1033\insrsid12545791 + +\par }{\fcs1 \af0 \fcs0 \cf2\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 --exclude=[Test]DS* --exclude=[Test.Data*]pr_* +\par }{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 +\par Run target from path }{\fcs1 \af0 \fcs0 \insrsid8991132\charrsid12545791 \'d3}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 ../../bin/partcover.test.exe}{\fcs1 \af0 \fcs0 \insrsid8991132\charrsid12545791 \'d4}{\fcs1 +\af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 and shows report on screen. Reports will include only classes from assembly }{\fcs1 \af0 \fcs0 \insrsid8991132\charrsid12545791 \'d3}{\fcs1 \af0 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 Test}{\fcs1 \af0 \fcs0 \insrsid8991132\charrsid12545791 \'d4}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 and assemblies which name contains }{\fcs1 \af0 +\fcs0 \insrsid8991132\charrsid12545791 \'d3}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 .Data.}{\fcs1 \af0 \fcs0 \insrsid8991132\charrsid12545791 \'d4}{\fcs1 \af0 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 . All classes from assembly }{\fcs1 \af0 \fcs0 \insrsid8991132\charrsid12545791 \'d3}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 Test}{\fcs1 \af0 \fcs0 +\insrsid8991132\charrsid12545791 \'d4}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 which name starts with }{\fcs1 \af0 \fcs0 \insrsid8991132\charrsid12545791 \'d3}{\fcs1 \af0 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 DS}{\fcs1 \af0 \fcs0 \insrsid8991132\charrsid12545791 \'d4}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 will be thrown out from report. +All classes which name starts from }{\fcs1 \af0 \fcs0 \insrsid8991132\charrsid12545791 \'d3}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 pr_}{\fcs1 \af0 \fcs0 \insrsid8991132\charrsid12545791 \'d4}{\fcs1 \af0 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 from assemblies which name start with }{\fcs1 \af0 \fcs0 \insrsid8991132\charrsid12545791 \'d3}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 Test.Data}{ +\fcs1 \af0 \fcs0 \insrsid8991132\charrsid12545791 \'d4}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132\charrsid1901268 will be also thrown out.}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid8991132 +\par }{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid1901268 +\par }\pard\plain \s1\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid1901268 \fcs1 \ab\af0\afs32\alang1025 \fcs0 \b\f1\fs32\lang1049\langfe1049\kerning32\cgrid\langnp1049\langfenp1049 {\fcs1 +\af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid1901268 XSLT transforms +\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1901268 \fcs1 \af0\afs24\alang1025 \fcs0 \fs24\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af0 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid1901268 You can use xslt from folder \'93xslt\'94 to transform report}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid1901268\charrsid1901268 }{\fcs1 \af0 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid1901268 xml in other readable xml.}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid12850468 If you want to look at the report in browser \endash add the following string in report xml header a +nd your browser will perform xslt-transformation:}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid1901268 +\par }{\fcs1 \af0 \fcs0 \cf2\lang1033\langfe1049\langnp1033\insrsid12850468\charrsid12850468 <?xml-stylesheet type="text/xsl" href="}{\fcs1 \af0 \fcs0 \cf2\lang1033\langfe1049\langnp1033\insrsid12850468 <path to assembly}{\fcs1 \af0 \fcs0 +\cf2\lang1033\langfe1049\langnp1033\insrsid12850468\charrsid12850468 .report.xslt}{\fcs1 \af0 \fcs0 \cf2\lang1033\langfe1049\langnp1033\insrsid12850468 >}{\fcs1 \af0 \fcs0 \cf2\lang1033\langfe1049\langnp1033\insrsid12850468\charrsid12850468 /}{\fcs1 \af0 +\fcs0 \cf2\lang1033\langfe1049\langnp1033\insrsid12850468 assembly}{\fcs1 \af0 \fcs0 \cf2\lang1033\langfe1049\langnp1033\insrsid12850468\charrsid12850468 .report.xslt"?>}{\fcs1 \af0 \fcs0 \cf2\lang1033\langfe1049\langnp1033\insrsid12850468 +\par }{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid12850468 +\par }\pard\plain \s2\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid1901268 \fcs1 \ab\ai\af0\afs28\alang1025 \fcs0 \b\i\f1\fs28\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af0 +\fcs0 \lang1033\langfe1049\langnp1033\insrsid1901268\charrsid1901268 assembly.report.xslt}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid1901268 +\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1901268 \fcs1 \af0\afs24\alang1025 \fcs0 \fs24\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af0 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid12652468 Shows report by assemblies}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid1901268 +\par }\pard\plain \s2\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid1901268 \fcs1 \ab\ai\af0\afs28\alang1025 \fcs0 \b\i\f1\fs28\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af0 +\fcs0 \lang1033\langfe1049\langnp1033\insrsid1901268\charrsid1901268 class.report.xslt +\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1901268 \fcs1 \af0\afs24\alang1025 \fcs0 \fs24\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\fcs1 \af0 \fcs0 +\lang1033\langfe1049\langnp1033\insrsid1901268 Shows report by class}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid12652468 es}{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid1901268\charrsid1901268 +\par }{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid1901268 +\par }{\fcs1 \af0 \fcs0 \lang1033\langfe1049\langnp1033\insrsid12850468\charrsid1901268 +\par }} \ No newline at end of file diff --git a/src/Tools/PartCover/PartCover.CorDriver.dll b/src/Tools/PartCover/PartCover.CorDriver.dll new file mode 100755 index 0000000000..65479fa9b9 Binary files /dev/null and b/src/Tools/PartCover/PartCover.CorDriver.dll differ diff --git a/src/Tools/PartCover/PartCover.Framework.dll b/src/Tools/PartCover/PartCover.Framework.dll new file mode 100755 index 0000000000..351da138f5 Binary files /dev/null and b/src/Tools/PartCover/PartCover.Framework.dll differ diff --git a/src/Tools/PartCover/PartCover.exe b/src/Tools/PartCover/PartCover.exe new file mode 100755 index 0000000000..ab93abde71 Binary files /dev/null and b/src/Tools/PartCover/PartCover.exe differ diff --git a/src/Tools/PartCover/PartCover.exe.config b/src/Tools/PartCover/PartCover.exe.config new file mode 100644 index 0000000000..b7d8d1dcdf --- /dev/null +++ b/src/Tools/PartCover/PartCover.exe.config @@ -0,0 +1,4 @@ +<?xml version="1.0"?> +<configuration> + <startup> + </startup></configuration> diff --git a/src/Tools/PartCover/xslt/PartCoverToNCover.xsl b/src/Tools/PartCover/xslt/PartCoverToNCover.xsl new file mode 100644 index 0000000000..19f337aa43 --- /dev/null +++ b/src/Tools/PartCover/xslt/PartCoverToNCover.xsl @@ -0,0 +1,14 @@ +<!-- + Converts PartCover code coverage output report to an NCover report. +--> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + <xsl:output version="1.0" encoding="utf-8" omit-xml-declaration="no"/> + + <xsl:template match="/"> + <xsl:element name="coverage"> + <xsl:attribute name="name"> + <xsl:value-of select="" + </xsl:attribute> + </xsl:element> + </xsl:template> +</xsl:stylesheet> \ No newline at end of file diff --git a/src/Tools/PartCover/xslt/assembly.report.xslt b/src/Tools/PartCover/xslt/assembly.report.xslt new file mode 100644 index 0000000000..16c9e469af --- /dev/null +++ b/src/Tools/PartCover/xslt/assembly.report.xslt @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt"> +<xsl:output method="html" indent="no"/> + +<xsl:template match="/"> + + <xsl:variable name="cov0style" select="'background:#E79090;text-align:right;'"/> + <xsl:variable name="cov20style" select="'background:#D79797;text-align:right;'"/> + <xsl:variable name="cov40style" select="'background:#D7A0A0;text-align:right;'"/> + <xsl:variable name="cov60style" select="'background:#C7A7A7;text-align:right;'"/> + <xsl:variable name="cov80style" select="'background:#C0B0B0;text-align:right;'"/> + <xsl:variable name="cov100style" select="'background:#D7D7D7;text-align:right;'"/> + + <table style="border-collapse: collapse;"> + <tr style="font-weight:bold; background:whitesmoke;"><td colspan="2">Coverage by assembly</td></tr> + + <xsl:variable name="unique-asms" select="/PartCoverReport/type[not(@asm=following::type/@asm)]"/> + <xsl:for-each select="$unique-asms"> + <xsl:variable name="current-asm" select="./@asm"/> + <tr> + + <xsl:element name="td"> + <xsl:attribute name="style">background:ghostwhite; padding: 5px 30px 5px 5px;</xsl:attribute> + <xsl:value-of select="$current-asm"/> + </xsl:element> + + <xsl:variable name="codeSize" select="sum(/PartCoverReport/type[@asm=$current-asm]/method/code/pt/@len)+0"/> + <xsl:variable name="coveredCodeSize" select="sum(/PartCoverReport/type[@asm=$current-asm]/method/code/pt[@visit>0]/@len)+0"/> + + <xsl:element name="td"> + <xsl:if test="$codeSize=0"> + <xsl:attribute name="style"><xsl:value-of select="$cov0style"/></xsl:attribute> + 0% + </xsl:if> + + <xsl:if test="$codeSize > 0"> + <xsl:variable name="coverage" select="ceiling(100 * $coveredCodeSize div $codeSize)"/> + + <xsl:if test="$coverage >= 0 and $coverage < 20"><xsl:attribute name="style"><xsl:value-of select="$cov20style"/></xsl:attribute></xsl:if> + <xsl:if test="$coverage >= 20 and $coverage < 40"><xsl:attribute name="style"><xsl:value-of select="$cov40style"/></xsl:attribute></xsl:if> + <xsl:if test="$coverage >= 40 and $coverage < 60"><xsl:attribute name="style"><xsl:value-of select="$cov60style"/></xsl:attribute></xsl:if> + <xsl:if test="$coverage >= 60 and $coverage < 80"><xsl:attribute name="style"><xsl:value-of select="$cov80style"/></xsl:attribute></xsl:if> + <xsl:if test="$coverage >= 80"><xsl:attribute name="style"><xsl:value-of select="$cov100style"/></xsl:attribute></xsl:if> + <xsl:value-of select="$coverage"/>% + </xsl:if> + + </xsl:element> + </tr> + </xsl:for-each> + </table> + +</xsl:template> + +</xsl:stylesheet> diff --git a/src/Tools/PartCover/xslt/class.report.xslt b/src/Tools/PartCover/xslt/class.report.xslt new file mode 100644 index 0000000000..c61fd6ed25 --- /dev/null +++ b/src/Tools/PartCover/xslt/class.report.xslt @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt"> +<xsl:output method="html" indent="no"/> + +<xsl:template match="/"> + + <xsl:variable name="cov0style" select="'background:#FF4040;text-align:right;'"/> + <xsl:variable name="cov20style" select="'background:#F06060;text-align:right;'"/> + <xsl:variable name="cov40style" select="'background:#E78080;text-align:right;'"/> + <xsl:variable name="cov60style" select="'background:#E0A0A0;text-align:right;'"/> + <xsl:variable name="cov80style" select="'background:#D7B0B0;text-align:right;'"/> + <xsl:variable name="cov100style" select="'background:#E0E0E0;text-align:right;'"/> + + <table style="border-collapse: collapse;"> + <tr style="font-weight:bold; background:whitesmoke;"><td colspan="2">Coverage by class</td></tr> + + <xsl:for-each select="/PartCoverReport/type"> + <tr> + + <xsl:element name="td"> + <xsl:attribute name="style">background:ghostwhite; padding: 5px 30px 5px 5px;</xsl:attribute> + <xsl:value-of select="@name"/> + </xsl:element> + + <xsl:variable name="codeSize" select="sum(./method/code/pt/@len)+0"/> + <xsl:variable name="coveredCodeSize" select="sum(./method/code/pt[@visit>0]/@len)+0"/> + + <xsl:element name="td"> + <xsl:if test="$codeSize=0"> + <xsl:attribute name="style"><xsl:value-of select="$cov0style"/></xsl:attribute> + 0% + </xsl:if> + + <xsl:if test="$codeSize > 0"> + <xsl:variable name="coverage" select="ceiling(100 * $coveredCodeSize div $codeSize)"/> + + <xsl:if test="$coverage >= 0 and $coverage < 20"><xsl:attribute name="style"><xsl:value-of select="$cov20style"/></xsl:attribute></xsl:if> + <xsl:if test="$coverage >= 20 and $coverage < 40"><xsl:attribute name="style"><xsl:value-of select="$cov40style"/></xsl:attribute></xsl:if> + <xsl:if test="$coverage >= 40 and $coverage < 60"><xsl:attribute name="style"><xsl:value-of select="$cov60style"/></xsl:attribute></xsl:if> + <xsl:if test="$coverage >= 60 and $coverage < 80"><xsl:attribute name="style"><xsl:value-of select="$cov80style"/></xsl:attribute></xsl:if> + <xsl:if test="$coverage >= 80"><xsl:attribute name="style"><xsl:value-of select="$cov100style"/></xsl:attribute></xsl:if> + <xsl:value-of select="$coverage"/>% + </xsl:if> + + </xsl:element> + </tr> + </xsl:for-each> + </table> + +</xsl:template> + +</xsl:stylesheet> diff --git a/src/Tools/UpdateAssemblyInfo/bin/Debug/AprSharp.dll b/src/Tools/UpdateAssemblyInfo/bin/Debug/AprSharp.dll new file mode 100755 index 0000000000..1a351c29f8 Binary files /dev/null and b/src/Tools/UpdateAssemblyInfo/bin/Debug/AprSharp.dll differ diff --git a/src/Tools/UpdateAssemblyInfo/bin/Debug/SubversionSharp.dll b/src/Tools/UpdateAssemblyInfo/bin/Debug/SubversionSharp.dll new file mode 100755 index 0000000000..c7a71494f8 Binary files /dev/null and b/src/Tools/UpdateAssemblyInfo/bin/Debug/SubversionSharp.dll differ diff --git a/src/Tools/UpdateAssemblyInfo/bin/Debug/UpdateAssemblyInfo.exe b/src/Tools/UpdateAssemblyInfo/bin/Debug/UpdateAssemblyInfo.exe new file mode 100755 index 0000000000..1580980c5d Binary files /dev/null and b/src/Tools/UpdateAssemblyInfo/bin/Debug/UpdateAssemblyInfo.exe differ diff --git a/src/Tools/wix/Bitmaps/New.ico b/src/Tools/wix/Bitmaps/New.ico new file mode 100644 index 0000000000..27881dfe97 Binary files /dev/null and b/src/Tools/wix/Bitmaps/New.ico differ diff --git a/src/Tools/wix/Bitmaps/Up.ico b/src/Tools/wix/Bitmaps/Up.ico new file mode 100644 index 0000000000..86f6b5a847 Binary files /dev/null and b/src/Tools/wix/Bitmaps/Up.ico differ diff --git a/src/Tools/wix/Bitmaps/bannrbmp.bmp b/src/Tools/wix/Bitmaps/bannrbmp.bmp new file mode 100644 index 0000000000..fd007ae80c Binary files /dev/null and b/src/Tools/wix/Bitmaps/bannrbmp.bmp differ diff --git a/src/Tools/wix/Bitmaps/dlgbmp.bmp b/src/Tools/wix/Bitmaps/dlgbmp.bmp new file mode 100644 index 0000000000..64cf77768c Binary files /dev/null and b/src/Tools/wix/Bitmaps/dlgbmp.bmp differ diff --git a/src/Tools/wix/Bitmaps/exclamic.ico b/src/Tools/wix/Bitmaps/exclamic.ico new file mode 100644 index 0000000000..906ce3246d Binary files /dev/null and b/src/Tools/wix/Bitmaps/exclamic.ico differ diff --git a/src/Tools/wix/Bitmaps/info.ico b/src/Tools/wix/Bitmaps/info.ico new file mode 100644 index 0000000000..7e0ff7f14c Binary files /dev/null and b/src/Tools/wix/Bitmaps/info.ico differ diff --git a/src/Tools/wix/CPL.TXT b/src/Tools/wix/CPL.TXT new file mode 100644 index 0000000000..e887791df0 --- /dev/null +++ b/src/Tools/wix/CPL.TXT @@ -0,0 +1,94 @@ +Common Public License Version 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + + +1. DEFINITIONS + +"Contribution" means: + +a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and + +b) in the case of each subsequent Contributor: + +i) changes to the Program, and + +ii) additions to the Program; + +where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. + +"Program" means the Contributions distributed in accordance with this Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. + + +2. GRANT OF RIGHTS + +a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. + +b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. + + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: + +a) it complies with the terms and conditions of this Agreement; and + +b) its license agreement: + +i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; + +ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; + +iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and + +iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. + +When the Program is made available in source code form: + +a) it must be made available under this Agreement; and + +b) a copy of this Agreement must be included with each copy of the Program. + +Contributors may not remove or alter any copyright notices contained within the Program. + +Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. + + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. + + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. + + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. diff --git a/src/Tools/wix/Microsoft.Tools.WindowsInstallerXml.NAntTasks.dll b/src/Tools/wix/Microsoft.Tools.WindowsInstallerXml.NAntTasks.dll new file mode 100755 index 0000000000..0a43f79e3c Binary files /dev/null and b/src/Tools/wix/Microsoft.Tools.WindowsInstallerXml.NAntTasks.dll differ diff --git a/src/Tools/wix/WixComPlusExtension.dll b/src/Tools/wix/WixComPlusExtension.dll new file mode 100755 index 0000000000..d45bdfa208 Binary files /dev/null and b/src/Tools/wix/WixComPlusExtension.dll differ diff --git a/src/Tools/wix/WixCop.exe b/src/Tools/wix/WixCop.exe new file mode 100755 index 0000000000..b1c23eec33 Binary files /dev/null and b/src/Tools/wix/WixCop.exe differ diff --git a/src/Tools/wix/WixDifxAppExtension.dll b/src/Tools/wix/WixDifxAppExtension.dll new file mode 100755 index 0000000000..baf9d24f8a Binary files /dev/null and b/src/Tools/wix/WixDifxAppExtension.dll differ diff --git a/src/Tools/wix/WixDirectXExtension.dll b/src/Tools/wix/WixDirectXExtension.dll new file mode 100755 index 0000000000..df89988258 Binary files /dev/null and b/src/Tools/wix/WixDirectXExtension.dll differ diff --git a/src/Tools/wix/WixFirewallExtension.dll b/src/Tools/wix/WixFirewallExtension.dll new file mode 100755 index 0000000000..8e9cb343bc Binary files /dev/null and b/src/Tools/wix/WixFirewallExtension.dll differ diff --git a/src/Tools/wix/WixGamingExtension.dll b/src/Tools/wix/WixGamingExtension.dll new file mode 100755 index 0000000000..30f6acad18 Binary files /dev/null and b/src/Tools/wix/WixGamingExtension.dll differ diff --git a/src/Tools/wix/WixIIsExtension.dll b/src/Tools/wix/WixIIsExtension.dll new file mode 100755 index 0000000000..67c0fd11ed Binary files /dev/null and b/src/Tools/wix/WixIIsExtension.dll differ diff --git a/src/Tools/wix/WixIsolatedAppExtension.dll b/src/Tools/wix/WixIsolatedAppExtension.dll new file mode 100755 index 0000000000..a1e316ef20 Binary files /dev/null and b/src/Tools/wix/WixIsolatedAppExtension.dll differ diff --git a/src/Tools/wix/WixMsmqExtension.dll b/src/Tools/wix/WixMsmqExtension.dll new file mode 100755 index 0000000000..bb2cdfbb61 Binary files /dev/null and b/src/Tools/wix/WixMsmqExtension.dll differ diff --git a/src/Tools/wix/WixNetFxExtension.dll b/src/Tools/wix/WixNetFxExtension.dll new file mode 100755 index 0000000000..e32244c9a6 Binary files /dev/null and b/src/Tools/wix/WixNetFxExtension.dll differ diff --git a/src/Tools/wix/WixOfficeExtension.dll b/src/Tools/wix/WixOfficeExtension.dll new file mode 100755 index 0000000000..838ea52959 Binary files /dev/null and b/src/Tools/wix/WixOfficeExtension.dll differ diff --git a/src/Tools/wix/WixPSExtension.dll b/src/Tools/wix/WixPSExtension.dll new file mode 100755 index 0000000000..9bd47af192 Binary files /dev/null and b/src/Tools/wix/WixPSExtension.dll differ diff --git a/src/Tools/wix/WixSqlExtension.dll b/src/Tools/wix/WixSqlExtension.dll new file mode 100755 index 0000000000..607fe9555b Binary files /dev/null and b/src/Tools/wix/WixSqlExtension.dll differ diff --git a/src/Tools/wix/WixTasks.dll b/src/Tools/wix/WixTasks.dll new file mode 100755 index 0000000000..a56c075d5a Binary files /dev/null and b/src/Tools/wix/WixTasks.dll differ diff --git a/src/Tools/wix/WixUIExtension.dll b/src/Tools/wix/WixUIExtension.dll new file mode 100755 index 0000000000..93b3a60b9e Binary files /dev/null and b/src/Tools/wix/WixUIExtension.dll differ diff --git a/src/Tools/wix/WixUtilExtension.dll b/src/Tools/wix/WixUtilExtension.dll new file mode 100755 index 0000000000..e569c7b894 Binary files /dev/null and b/src/Tools/wix/WixUtilExtension.dll differ diff --git a/src/Tools/wix/WixVSExtension.dll b/src/Tools/wix/WixVSExtension.dll new file mode 100755 index 0000000000..88348f39b9 Binary files /dev/null and b/src/Tools/wix/WixVSExtension.dll differ diff --git a/src/Tools/wix/candle.exe b/src/Tools/wix/candle.exe new file mode 100755 index 0000000000..ecdb4c57e7 Binary files /dev/null and b/src/Tools/wix/candle.exe differ diff --git a/src/Tools/wix/candle.exe.config b/src/Tools/wix/candle.exe.config new file mode 100644 index 0000000000..cae9da72a8 --- /dev/null +++ b/src/Tools/wix/candle.exe.config @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (c) Microsoft Corporation. All rights reserved. +--> +<configuration> + <startup> + <supportedRuntime version="v2.0.50727" /> + </startup> +</configuration> diff --git a/src/Tools/wix/darice.cub b/src/Tools/wix/darice.cub new file mode 100644 index 0000000000..b2f3d0455c Binary files /dev/null and b/src/Tools/wix/darice.cub differ diff --git a/src/Tools/wix/dark.exe b/src/Tools/wix/dark.exe new file mode 100755 index 0000000000..e2ed293b3b Binary files /dev/null and b/src/Tools/wix/dark.exe differ diff --git a/src/Tools/wix/dark.exe.config b/src/Tools/wix/dark.exe.config new file mode 100644 index 0000000000..a6d0ce1469 --- /dev/null +++ b/src/Tools/wix/dark.exe.config @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (c) Microsoft Corporation. All rights reserved. +--> +<configuration> + <appSettings> + <add key="extensions" value="WixDifxAppExtension;WixDirectXExtension;WixFirewallExtension;WixGamingExtension;WixIIsExtension;WixNetFxExtension;WixSqlExtension;WixUIExtension;WixUtilExtension;WixVSExtension" /> + </appSettings> + <startup> + <supportedRuntime version="v2.0.50727" /> + </startup> +</configuration> diff --git a/src/Tools/wix/difxapp_x64.wixlib b/src/Tools/wix/difxapp_x64.wixlib new file mode 100644 index 0000000000..82121deb7d Binary files /dev/null and b/src/Tools/wix/difxapp_x64.wixlib differ diff --git a/src/Tools/wix/difxapp_x86.wixlib b/src/Tools/wix/difxapp_x86.wixlib new file mode 100644 index 0000000000..25b5135d89 Binary files /dev/null and b/src/Tools/wix/difxapp_x86.wixlib differ diff --git a/src/Tools/wix/heat.exe b/src/Tools/wix/heat.exe new file mode 100755 index 0000000000..f56bed083d Binary files /dev/null and b/src/Tools/wix/heat.exe differ diff --git a/src/Tools/wix/heat.exe.config b/src/Tools/wix/heat.exe.config new file mode 100644 index 0000000000..a8eba5561e --- /dev/null +++ b/src/Tools/wix/heat.exe.config @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (c) Microsoft Corporation. All rights reserved. +--> +<configuration> + <appSettings> + <add key="extensions" value="WixIIsExtension;WixUtilExtension;WixVSExtension"/> + </appSettings> + <startup> + <supportedRuntime version="v2.0.50727" /> + </startup> +</configuration> diff --git a/src/Tools/wix/light.exe b/src/Tools/wix/light.exe new file mode 100755 index 0000000000..c6a13179b9 Binary files /dev/null and b/src/Tools/wix/light.exe differ diff --git a/src/Tools/wix/light.exe.config b/src/Tools/wix/light.exe.config new file mode 100644 index 0000000000..cae9da72a8 --- /dev/null +++ b/src/Tools/wix/light.exe.config @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (c) Microsoft Corporation. All rights reserved. +--> +<configuration> + <startup> + <supportedRuntime version="v2.0.50727" /> + </startup> +</configuration> diff --git a/src/Tools/wix/lit.exe b/src/Tools/wix/lit.exe new file mode 100755 index 0000000000..ed9c42744e Binary files /dev/null and b/src/Tools/wix/lit.exe differ diff --git a/src/Tools/wix/lit.exe.config b/src/Tools/wix/lit.exe.config new file mode 100644 index 0000000000..cae9da72a8 --- /dev/null +++ b/src/Tools/wix/lit.exe.config @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (c) Microsoft Corporation. All rights reserved. +--> +<configuration> + <startup> + <supportedRuntime version="v2.0.50727" /> + </startup> +</configuration> diff --git a/src/Tools/wix/melt.exe b/src/Tools/wix/melt.exe new file mode 100755 index 0000000000..56f6f1b90d Binary files /dev/null and b/src/Tools/wix/melt.exe differ diff --git a/src/Tools/wix/melt.exe.config b/src/Tools/wix/melt.exe.config new file mode 100644 index 0000000000..1b3e15d4c8 --- /dev/null +++ b/src/Tools/wix/melt.exe.config @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (c) Microsoft Corporation. All rights reserved. +--> +<configuration> + <appSettings> + </appSettings> + <startup> + <supportedRuntime version="v2.0.50727" /> + </startup> +</configuration> diff --git a/src/Tools/wix/mergemod.cub b/src/Tools/wix/mergemod.cub new file mode 100644 index 0000000000..2042a99e4f Binary files /dev/null and b/src/Tools/wix/mergemod.cub differ diff --git a/src/Tools/wix/mergemod.dll b/src/Tools/wix/mergemod.dll new file mode 100755 index 0000000000..0834660baa Binary files /dev/null and b/src/Tools/wix/mergemod.dll differ diff --git a/src/Tools/wix/mspatchc.dll b/src/Tools/wix/mspatchc.dll new file mode 100755 index 0000000000..4720f1a070 Binary files /dev/null and b/src/Tools/wix/mspatchc.dll differ diff --git a/src/Tools/wix/pyro.exe b/src/Tools/wix/pyro.exe new file mode 100755 index 0000000000..d8caa733f1 Binary files /dev/null and b/src/Tools/wix/pyro.exe differ diff --git a/src/Tools/wix/pyro.exe.config b/src/Tools/wix/pyro.exe.config new file mode 100644 index 0000000000..cae9da72a8 --- /dev/null +++ b/src/Tools/wix/pyro.exe.config @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (c) Microsoft Corporation. All rights reserved. +--> +<configuration> + <startup> + <supportedRuntime version="v2.0.50727" /> + </startup> +</configuration> diff --git a/src/Tools/wix/smoke.exe b/src/Tools/wix/smoke.exe new file mode 100755 index 0000000000..88a5a2bcd6 Binary files /dev/null and b/src/Tools/wix/smoke.exe differ diff --git a/src/Tools/wix/smoke.exe.config b/src/Tools/wix/smoke.exe.config new file mode 100644 index 0000000000..cae9da72a8 --- /dev/null +++ b/src/Tools/wix/smoke.exe.config @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (c) Microsoft Corporation. All rights reserved. +--> +<configuration> + <startup> + <supportedRuntime version="v2.0.50727" /> + </startup> +</configuration> diff --git a/src/Tools/wix/torch.exe b/src/Tools/wix/torch.exe new file mode 100755 index 0000000000..4e7390b97e Binary files /dev/null and b/src/Tools/wix/torch.exe differ diff --git a/src/Tools/wix/torch.exe.config b/src/Tools/wix/torch.exe.config new file mode 100644 index 0000000000..cae9da72a8 --- /dev/null +++ b/src/Tools/wix/torch.exe.config @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (c) Microsoft Corporation. All rights reserved. +--> +<configuration> + <startup> + <supportedRuntime version="v2.0.50727" /> + </startup> +</configuration> diff --git a/src/Tools/wix/wconsole.dll b/src/Tools/wix/wconsole.dll new file mode 100755 index 0000000000..2c4139b1c9 Binary files /dev/null and b/src/Tools/wix/wconsole.dll differ diff --git a/src/Tools/wix/winterop.dll b/src/Tools/wix/winterop.dll new file mode 100755 index 0000000000..cca786ee0d Binary files /dev/null and b/src/Tools/wix/winterop.dll differ diff --git a/src/Tools/wix/wix.dll b/src/Tools/wix/wix.dll new file mode 100755 index 0000000000..87d1bca3ad Binary files /dev/null and b/src/Tools/wix/wix.dll differ diff --git a/src/Tools/wix/wix.targets b/src/Tools/wix/wix.targets new file mode 100644 index 0000000000..aefdb483e1 --- /dev/null +++ b/src/Tools/wix/wix.targets @@ -0,0 +1,2177 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +**************************************************************************************************** +wix.targets + +WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have + created a backup copy. Incorrect changes to this file will make it + impossible to load or build your projects from the command-line or the IDE. + +This file defines the steps in the standard build process for WiX projects (.wixproj). + +Conventions: + * Targets and properties that start with an underscore (_) are considered private and should not + be used outside of this file. + +Coding Conventions: + * Two-space indentation of nested elements + + * Self-closing elements should have a space before the /> ("<MyProperty />") + + * Conditions should have a space before and after the "" and between any operators. For example: + <MyProperty Condition=" '$(MyProperty)' == '' ">Value</MyProperty> + + * Targets should have each attribute on a single line and indented by two spaces. Also, there + should be a blank line between the Target and the beginning of the contents (a blank line is + optional before the closing </Target> tag). + For example: + <Target + Name="MyTarget" + DependsOnTargets="$(MyTargetDependsOn)"> + + <Message Importance="low" Text="MyTarget is doing something." /> + </Target> + +Copyright (c) Microsoft Corporation. All rights reserved. +**************************************************************************************************** +--> +<Project + xmlns="http://schemas.microsoft.com/developer/msbuild/2003" + InitialTargets="_CheckRequiredProperties; + _SetDefaultPathValues"> + + <!-- + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + Extension Points + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + --> + + <!-- Allow a user-customized targets files to be used as part of the build. --> + <PropertyGroup> + <UserTargetsPath>$(MSBuildProjectFullPath).user</UserTargetsPath> + </PropertyGroup> + <Import Project="$(UserTargetsPath)" Condition="Exists('$(UserTargetsPath)')" /> + <Import Project="$(CustomBeforeWixTargets)" Condition=" '$(CustomBeforeWixTargets)' != '' and Exists('$(CustomBeforeWixTargets)')" /> + + <!-- These properties can be overridden to support non-default installations. --> + <PropertyGroup> + <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.0\Wix.targets</WixTargetsPath> + <WixTasksPath Condition=" '$(WixTasksPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.0\WixTasks.dll</WixTasksPath> + </PropertyGroup> + + <!-- This makes the project files a dependency of all targets so that things rebuild if they change --> + <PropertyGroup> + <MSBuildAllProjects Condition="Exists('$(MSBuildProjectFullPath)')">$(MSBuildAllProjects);$(MSBuildProjectFullPath)</MSBuildAllProjects> + <MSBuildAllProjects Condition="Exists('$(WixTargetsPath)')">$(MSBuildAllProjects);$(WixTargetsPath)</MSBuildAllProjects> + <MSBuildAllProjects Condition="Exists('$(UserTargetsPath)')">$(MSBuildAllProjects);$(UserTargetsPath)</MSBuildAllProjects> + <MSBuildAllProjects Condition="Exists('$(CustomBeforeWixTargets)')">$(MSBuildAllProjects);$(CustomBeforeWixTargets)</MSBuildAllProjects> + <MSBuildAllProjects Condition="Exists('$(CustomAfterWixTargets)')">$(MSBuildAllProjects);$(CustomAfterWixTargets)</MSBuildAllProjects> + </PropertyGroup> + + <!-- + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + Property Declarations + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + --> + + <!-- These tasks can be used as general-purpose build tasks. --> + <UsingTask TaskName="Candle" AssemblyFile="$(WixTasksPath)" /> + <UsingTask TaskName="Lit" AssemblyFile="$(WixTasksPath)" /> + <UsingTask TaskName="Light" AssemblyFile="$(WixTasksPath)" /> + <UsingTask TaskName="Torch" AssemblyFile="$(WixTasksPath)" /> + <UsingTask TaskName="ReadRegistry" AssemblyFile="$(WixTasksPath)" /> + + <!-- These tasks are extensions for harvesting WiX source code from other sources. --> + <UsingTask TaskName="HeatFile" AssemblyFile="$(WixToolPath)WixUtilExtension.dll" /> + <UsingTask TaskName="HeatDirectory" AssemblyFile="$(WixToolPath)WixUtilExtension.dll" /> + <UsingTask TaskName="HeatProject" AssemblyFile="$(WixToolPath)WixVSExtension.dll" /> + + <!-- These tasks are specific to the build process defined in this file, and are not considered general-purpose build tasks. --> + <UsingTask TaskName="AssignProjectConfiguration" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Condition=" '$(Framework35Dir)' == '' " /> + <UsingTask TaskName="AssignTargetPath" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Condition=" '$(Framework35Dir)' == '' " /> + <UsingTask TaskName="ResolveNonMSBuildProjectOutput" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Condition=" '$(Framework35Dir)' == '' " /> + <UsingTask TaskName="ResolveVCProjectOutput" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Condition=" '$(Framework35Dir)' == '' " /> + + <UsingTask TaskName="AssignProjectConfiguration" AssemblyName="Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Condition=" '$(Framework35Dir)' != '' " /> + <UsingTask TaskName="AssignTargetPath" AssemblyName="Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Condition=" '$(Framework35Dir)' != '' " /> + <UsingTask TaskName="ResolveNonMSBuildProjectOutput" AssemblyName="Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Condition=" '$(Framework35Dir)' != '' " /> + <UsingTask TaskName="ResolveVCProjectOutput" AssemblyName="Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Condition=" '$(Framework35Dir)' != '' " /> + + <UsingTask TaskName="CreateProjectReferenceDefineConstants" AssemblyFile="$(WixTasksPath)" /> + <UsingTask TaskName="WixAssignCulture" AssemblyFile="$(WixTasksPath)" /> + + <!-- + Several properties must be set in the main project file, before using this .targets file. + However, if the properties are not set, we pick some defaults. + --> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)'=='' ">AnyCPU</Platform> + <OutputPath Condition=" '$(OutputPath)' == '' ">bin\$(Configuration)\</OutputPath> + <!-- Ensure any OutputPath has a trailing slash, so it can be concatenated --> + <OutputPath Condition=" '$(OutputPath)' != '' and !HasTrailingSlash('$(OutputPath)') ">$(OutputPath)\</OutputPath> + <_OriginalOutputType>$(OutputType)</_OriginalOutputType> + <OutputType Condition=" '$(OutputType)' == '' ">Package</OutputType> + </PropertyGroup> + + <!-- Properties for the intermediate object output --> + <PropertyGroup> + <BaseIntermediateOutputPath Condition=" '$(BaseIntermediateOutputPath)' == '' ">obj\</BaseIntermediateOutputPath> + <IntermediateOutputPath Condition=" '$(IntermediateOutputPath)' != '' and !HasTrailingSlash('$(IntermediateOutputPath)') ">$(IntermediateOutputPath)\</IntermediateOutputPath> + <IntermediateOutputPath Condition=" '$(IntermediateOutputPath)' == '' and '$(Platform)' == 'AnyCPU' ">$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath> + <IntermediateOutputPath Condition=" '$(IntermediateOutputPath)' == '' and '$(Platform)' != 'AnyCPU' ">$(BaseIntermediateOutputPath)$(Platform)\$(Configuration)\</IntermediateOutputPath> + <IntermediateExt Condition=" '$(IntermediateExt)' == '' ">.wixobj</IntermediateExt> + <CleanFile Condition=" '$(CleanFile)' == '' ">$(MSBuildProjectFile).FileList.txt</CleanFile> + </PropertyGroup> + + <!-- + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + IDE Macro Property Declarations + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + --> + + <!-- + IDE Macros available from both integrated builds and from command line builds. + The following properties are 'macros' that are available via IDE for pre and post build steps. + All of them should be added to WixBuildMacroCollection to ensure that they are shown in the UI. + --> + <PropertyGroup> + <TargetExt Condition=" '$(OutputType)' == 'Package' ">.msi</TargetExt> + <TargetExt Condition=" '$(OutputType)' == 'Module' ">.msm</TargetExt> + <TargetExt Condition=" '$(OutputType)' == 'Library' ">.wixlib</TargetExt> + </PropertyGroup> + + <PropertyGroup> + <!-- Example, bin\Debug\ --> + <OutDir Condition=" '$(OutDir)' == '' ">$(OutputPath)</OutDir> + <!-- Ensure OutDir has a trailing slash, so it can be concatenated --> + <OutDir Condition=" '$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)') ">$(OutDir)\</OutDir> + + <!-- Example, MySetup --> + <ProjectName Condition=" '$(ProjectName)' == '' ">$(MSBuildProjectName)</ProjectName> + + <!-- Example, MySetup.wixproj --> + <ProjectFileName Condition=" '$(ProjectFileName)' == '' ">$(MSBuildProjectFile)</ProjectFileName> + + <!-- Example, .wixproj --> + <ProjectExt Condition=" '$(ProjectExt)' == '' ">$(MSBuildProjectExtension)</ProjectExt> + + <!-- Example, c:\MyProjects\MySetup\ --> + <ProjectDir Condition=" '$(ProjectDir)' == '' ">$(MSBuildProjectDirectory)\</ProjectDir> + + <!-- Example, c:\MyProjects\MySetup\MySetup.msi --> + <ProjectPath Condition=" '$(ProjectPath)' == '' ">$(ProjectDir)$(ProjectFileName)</ProjectPath> + + <!-- Example, .wixpdb --> + <TargetPdbExt Condition=" '$(TargetPdbExt)' == '' ">.wixpdb</TargetPdbExt> + + <!-- Example, MySetup --> + <TargetName Condition=" '$(TargetName)' == '' ">$(OutputName)</TargetName> + + <!-- Example, MySetup.msi --> + <TargetFileName Condition=" '$(TargetFileName)' == '' ">$(TargetName)$(TargetExt)</TargetFileName> + + <!-- Example, MySetup.wixpdb" --> + <TargetPdbName Condition=" '$(TargetPdbName)' == '' ">$(TargetName)$(TargetPdbExt)</TargetPdbName> + + <!-- Example, Debug --> + <ConfigurationName Condition=" '$(ConfigurationName)' == '' ">$(Configuration)</ConfigurationName> + + <!-- Example, AnyCPU --> + <PlatformName Condition=" '$(PlatformName)' == '' ">$(Platform)</PlatformName> + </PropertyGroup> + + <ItemGroup> + <!-- Create the output path as an item so that we can use %(FullPath) on it. --> + <_OutputPathItem Include="$(OutDir)" /> + <_IntermediateOutputPathItem Include="$(IntermediateOutputPath)" /> + </ItemGroup> + + <PropertyGroup> + <!-- Example, c:\MyProjects\MySetup\bin\debug\ --> + <!-- + Condition intentionally omitted on this one, because it causes problems + when we pick up the value of an environment variable named TargetDir + --> + <TargetDir>@(_OutputPathItem->'%(FullPath)')</TargetDir> + + <!-- Example, C:\MyProjects\MySetup\bin\debug\MySetup.msi --> + <TargetPath Condition=" '$(TargetPath)' == '' ">@(_OutputPathItem->'%(FullPath)$(TargetFileName)')</TargetPath> + + <TargetPdbPath Condition=" '$(TargetPdbPath)' == '' ">@(_OutputPathItem->'%(FullPath)$(TargetPdbName)')</TargetPdbPath> + </PropertyGroup> + + <!-- + IDE Macros available only from integrated builds. The following properties are 'macros' that are + available via IDE for pre and post build steps. However, they are not defined when directly + building a project from the command line, only when building a solution. + --> + <PropertyGroup> + <DevEnvDir Condition=" '$(DevEnvDir)' == '' ">*Undefined if not building from within Visual Studio*</DevEnvDir> + + <!-- Example, MySolution --> + <SolutionName Condition=" '$(SolutionName)' == '' ">*Undefined if not building a solution or within Visual Studio*</SolutionName> + + <!-- Example, MySolution.sln --> + <SolutionFileName Condition=" '$(SolutionFileName)' == '' ">*Undefined if not building a solution or within Visual Studio*</SolutionFileName> + + <!-- Example, C:\MySolutions\MySolution\MySolution.sln --> + <SolutionPath Condition=" '$(SolutionPath)' == '' ">*Undefined if not building a solution or within Visual Studio*</SolutionPath> + + <!-- Example, C:\MySolutions\MySolution\ --> + <SolutionDir Condition=" '$(SolutionDir)' == '' ">*Undefined if not building a solution or within Visual Studio*</SolutionDir> + + <!-- Example, .sln --> + <SolutionExt Condition=" '$(SolutionExt)' == '' ">*Undefined if not building a solution or within Visual Studio*</SolutionExt> + </PropertyGroup> + + <!-- Convert $(TargetPath) to an item so we can use %(ModifiedTime) on it. --> + <ItemGroup> + <TargetOutput Include="$(TargetPath)" /> + </ItemGroup> + + <!-- + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + Default Compiler, Linker, and Librarian Property Declarations + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + --> + + <!-- If WixExtension was passed in via the command line, then convert it to an ItemGroup --> + <ItemGroup> + <WixExtension Include="$(WixExtension)" Condition=" '$(WixExtension)' != '' " /> + </ItemGroup> + + <!-- Defaut Compiler properties. --> + <PropertyGroup> + <CompilerNoLogo Condition=" '$(CompilerNoLogo)' == '' ">$(NoLogo)</CompilerNoLogo> + <CompilerSuppressAllWarnings Condition=" '$(CompilerSuppressAllWarnings)' == '' ">$(SuppressAllWarnings)</CompilerSuppressAllWarnings> + <CompilerSuppressSpecificWarnings Condition=" '$(CompilerSuppressSpecificWarnings)' == '' ">$(SuppressSpecificWarnings)</CompilerSuppressSpecificWarnings> + <CompilerSuppressSchemaValidation Condition=" '$(CompilerSuppressSchemaValidation)' == '' ">$(SuppressSchemaValidation)</CompilerSuppressSchemaValidation> + <CompilerTreatWarningsAsErrors Condition=" '$(CompilerTreatWarningsAsErrors)' == '' ">$(TreatWarningsAsErrors)</CompilerTreatWarningsAsErrors> + <CompilerTreatSpecificWarningsAsErrors Condition=" '$(CompilerTreatSpecificWarningsAsErrors)' == '' ">$(TreatSpecificWarningsAsErrors)</CompilerTreatSpecificWarningsAsErrors> + <CompilerVerboseOutput Condition=" '$(CompilerVerboseOutput)' == '' ">$(VerboseOutput)</CompilerVerboseOutput> + <InstallerPlatform Condition=" '$(InstallerPlatform)' == '' and '$(Platform)' != 'AnyCPU' and '$(Platform)' != 'Any CPU' ">$(Platform)</InstallerPlatform> + </PropertyGroup> + + <!-- Default Lib properties. --> + <PropertyGroup> + <LibNoLogo Condition=" '$(LibNoLogo)' == '' ">$(NoLogo)</LibNoLogo> + <LibBindFiles Condition=" '$(LibBindFiles)' == '' ">$(BindFiles)</LibBindFiles> + <LibPedantic Condition=" '$(LibPedantic)' == '' ">$(Pedantic)</LibPedantic> + <LibSuppressAllWarnings Condition=" '$(LibSuppressAllWarnings)' == '' ">$(SuppressAllWarnings)</LibSuppressAllWarnings> + <LibSuppressSpecificWarnings Condition=" '$(LibSuppressSpecificWarnings)' == '' ">$(SuppressSpecificWarnings)</LibSuppressSpecificWarnings> + <LibSuppressSchemaValidation Condition=" '$(LibSuppressSchemaValidation)' == '' ">$(SuppressSchemaValidation)</LibSuppressSchemaValidation> + <LibSuppressIntermediateFileVersionMatching Condition=" '$(LibSuppressIntermediateFileVersionMatching)' == '' ">$(SuppressIntermediateFileVersionMatching)</LibSuppressIntermediateFileVersionMatching> + <LibTreatWarningsAsErrors Condition=" '$(LibTreatWarningsAsErrors)' == '' ">$(TreatWarningsAsErrors)</LibTreatWarningsAsErrors> + <LibTreatSpecificWarningsAsErrors Condition=" '$(LibTreatSpecificWarningsAsErrors)' == '' ">$(TreatSpecificWarningsAsErrors)</LibTreatSpecificWarningsAsErrors> + <LibVerboseOutput Condition=" '$(LibVerboseOutput)' == '' ">$(VerboseOutput)</LibVerboseOutput> + </PropertyGroup> + + <!-- Default Linker properties. --> + <PropertyGroup> + <LinkerNoLogo Condition=" '$(LinkerNoLogo)' == '' ">$(NoLogo)</LinkerNoLogo> + <LinkerBaseInputPaths Condition=" '$(LinkerBaseInputPaths)' == '' ">$(BaseInputPaths)</LinkerBaseInputPaths> + <LinkerBindFiles Condition=" '$(LinkerBindFiles)' == '' ">$(BindFiles)</LinkerBindFiles> + <LinkerPedantic Condition=" '$(LinkerPedantic)' == '' ">$(Pedantic)</LinkerPedantic> + <LinkerSuppressAllWarnings Condition=" '$(LinkerSuppressAllWarnings)' == '' ">$(SuppressAllWarnings)</LinkerSuppressAllWarnings> + <LinkerSuppressSpecificWarnings Condition=" '$(LinkerSuppressSpecificWarnings)' == '' ">$(SuppressSpecificWarnings)</LinkerSuppressSpecificWarnings> + <LinkerSuppressSchemaValidation Condition=" '$(LinkerSuppressSchemaValidation)' == '' ">$(SuppressSchemaValidation)</LinkerSuppressSchemaValidation> + <LinkerSuppressIntermediateFileVersionMatching Condition=" '$(LinkerSuppressIntermediateFileVersionMatching)' == '' ">$(SuppressIntermediateFileVersionMatching)</LinkerSuppressIntermediateFileVersionMatching> + <LinkerTreatWarningsAsErrors Condition=" '$(LinkerTreatWarningsAsErrors)' == '' ">$(TreatWarningsAsErrors)</LinkerTreatWarningsAsErrors> + <LinkerTreatSpecificWarningsAsErrors Condition=" '$(LinkerTreatSpecificWarningsAsErrors)' == '' ">$(TreatSpecificWarningsAsErrors)</LinkerTreatSpecificWarningsAsErrors> + <LinkerVerboseOutput Condition=" '$(LinkerVerboseOutput)' == '' ">$(VerboseOutput)</LinkerVerboseOutput> + </PropertyGroup> + + <!-- + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + Initial Targets + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + --> + + <!-- + ================================================================================================== + _CheckRequiredProperties + + Checks properties that must be set in the main project file or on the command line before + using this .TARGETS file. + + [IN] + $(OutputName) - The name of the MSI/MSM/wixlib to build (without the extension) + $(OutputType) - Possible values are 'package', 'module', 'library' + ================================================================================================== + --> + <PropertyGroup> + <_PleaseSetThisInProjectFile>Please set this in the project file before the <Import> of the wix.targets file.</_PleaseSetThisInProjectFile> + <_OutputTypeDescription>The OutputType defines whether a Windows Installer package (.msi), merge module (.msm), or wix library (.wixlib) is being built. $(_PleaseSetThisInProjectFile) Possible values are 'Package', 'Module', and 'Library'.</_OutputTypeDescription> + </PropertyGroup> + <Target Name="_CheckRequiredProperties"> + + <Error + Code="WIXTARGETS100" + Condition=" '$(OutputName)' == '' " + Text="The OutputName property is not set in project "$(MSBuildProjectFile)". The OutputName defines the name of the output without a file extension. $(_PleaseSetThisInProjectFile)" /> + + <Warning + Code="WIXTARGETS101" + Condition=" '$(_OriginalOutputType)' == '' " + Text="The OutputType property is not set in project "$(MSBuildProjectFile)". Defaulting to 'Package'. $(_OutputTypeDescription)" /> + + <Error + Code="WIXTARGETS102" + Condition=" '$(OutputType)' != 'Package' and '$(OutputType)' != 'Module' and '$(OutputType)' != 'Library' " + Text="The OutputType property '$(OutputType)' is not valid in project "$(MSBuildProjectFile)". $(_OutputTypeDescription)" /> + + <!-- Although we try to ensure a trailing slash, it's possible to circumvent this if the property is set on the command line --> + <Error + Code="WIXTARGETS103" + Condition="'$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')" + Text="The OutDir property must end with a trailing slash." /> + + </Target> + + <!-- + ================================================================================================== + _SetDefaultPathValues + + Gets the default values of some paths from the registry. + + [OUT] + $(WixExtDir) - Default Wix Extension Directory + $(WixToolPath) - Default Wix Tool install folder + ================================================================================================== + --> + <PropertyGroup> + <WixInstallRegKey>SOFTWARE\Microsoft\Windows Installer XML\3.0</WixInstallRegKey> + <WixInstallRegKeyWow64>SOFTWARE\Wow6432Node\Microsoft\Windows Installer XML\3.0</WixInstallRegKeyWow64> + </PropertyGroup> + <Target + Name="_SetDefaultPathValues"> + + <ReadRegistry + Hive="LocalMachine" + Key="$(WixInstallRegKey)" + Name="InstallRoot" + FailIfMissing="false" + Condition=" '$(WixExtDir)' == '' "> + + <Output TaskParameter="Value" PropertyName="WixExtDir" /> + </ReadRegistry> + + <ReadRegistry + Hive="LocalMachine" + Key="$(WixInstallRegKey)" + Name="InstallRoot" + FailIfMissing="false" + Condition=" '$(WixToolPath)' == '' "> + + <Output TaskParameter="Value" PropertyName="WixToolPath" /> + </ReadRegistry> + + <!-- If we didn't find the first registry paths, assume we're in a 64bit process. --> + <!-- WiX tools are 32bit EXEs, so run them out-of-proc when MSBuild is 64bit. --> + <CreateProperty Value="true" Condition=" '$(WixToolPath)' == '' "> + <Output TaskParameter="Value" PropertyName="RunWixToolsOutOfProc" /> + </CreateProperty> + + <ReadRegistry + Hive="LocalMachine" + Key="$(WixInstallRegKeyWow64)" + Name="InstallRoot" + FailIfMissing="false" + Condition=" '$(WixExtDir)' == '' "> + + <Output TaskParameter="Value" PropertyName="WixExtDir" /> + </ReadRegistry> + + <ReadRegistry + Hive="LocalMachine" + Key="$(WixInstallRegKeyWow64)" + Name="InstallRoot" + FailIfMissing="false" + Condition=" '$(WixToolPath)' == '' "> + + <Output TaskParameter="Value" PropertyName="WixToolPath" /> + </ReadRegistry> + + <CreateProperty Value="$(WixToolPath)" Condition=" '$(WixExtDir)' == '' "> + <Output TaskParameter="Value" PropertyName="WixExtDir" /> + </CreateProperty> + + </Target> + + <!-- + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + Build Targets + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + --> + + <!-- + ================================================================================================== + Build + + The main build entry point. + ================================================================================================== + --> + <PropertyGroup> + <BuildDependsOn> + BeforeBuild; + CoreBuild; + AfterBuild + </BuildDependsOn> + </PropertyGroup> + <Target + Name="Build" + DependsOnTargets="$(BuildDependsOn)" + Outputs="$(TargetPath)"> + </Target> + + <!-- + ================================================================================================== + BeforeBuild + + Redefine this target in your project in order to run tasks just before Build. + ================================================================================================== + --> + <Target Name="BeforeBuild" /> + + <!-- + ================================================================================================== + AfterBuild + + Redefine this target in your project in order to run tasks just after Build. + ================================================================================================== + --> + <Target Name="AfterBuild" /> + + <!-- + ================================================================================================== + CoreBuild + + The core build step calls each of the build targets. + ================================================================================================== + --> + <PropertyGroup> + <CoreBuildDependsOn> + BuildOnlySettings; + PrepareForBuild; + PreBuildEvent; + ResolveReferences; + AddCompilerDefineConstants; + CompileAndLink; + GetTargetPath; + IncrementalClean; + PostBuildEvent + </CoreBuildDependsOn> + </PropertyGroup> + <Target + Name="CoreBuild" + DependsOnTargets="$(CoreBuildDependsOn)"> + + <OnError + ExecuteTargets="_TimeStampAfterCompileAndLink;PostBuildEvent" + Condition=" '$(RunPostBuildEvent)' == 'Always' or '$(RunPostBuildEvent)' == 'OnOutputUpdated' " /> + + <OnError ExecuteTargets="_CleanRecordFileWrites" /> + + </Target> + + <!-- + ================================================================================================== + Rebuild + + Delete all intermediate and final build outputs, and then build the project from scratch. + ================================================================================================== + --> + <PropertyGroup> + <RebuildDependsOn> + BeforeRebuild; + Clean; + $(MSBuildProjectDefaultTargets); + AfterRebuild; + </RebuildDependsOn> + + <RebuildDependsOn Condition=" '$(MSBuildProjectDefaultTargets)' == 'Rebuild' "> + BeforeRebuild; + Clean; + Build; + AfterRebuild; + </RebuildDependsOn> + </PropertyGroup> + + <Target + Name="Rebuild" + DependsOnTargets="$(RebuildDependsOn)" + Outputs="$(TargetPath)" /> + + <!-- + ================================================================================================== + BeforeRebuild + + Redefine this target in your project in order to run tasks just before Rebuild. + ================================================================================================== + --> + <Target Name="BeforeRebuild" /> + + <!-- + ================================================================================================== + AfterRebuild + + Redefine this target in your project in order to run tasks just after Rebuild. + ================================================================================================== + --> + <Target Name="AfterRebuild" /> + + <!-- + ================================================================================================== + BuildOnlySettings + + This target is called only when doing a real build. It is not called during project load. + ================================================================================================== + --> + <PropertyGroup> + <BuildingProject>false</BuildingProject> + </PropertyGroup> + <Target Name="BuildOnlySettings"> + + <CreateProperty Value="true"> + <Output TaskParameter="Value" PropertyName="BuildingProject" /> + </CreateProperty> + + </Target> + + <!-- + ================================================================================================== + PrepareForBuild + + Prepare the prerequisites for building. + ================================================================================================== + --> + <Target + Name="PrepareForBuild"> + + <!-- + These CreateProperty calls are required because TargetDir and TargetPath are defined + to contain an item list. We want that item list to be expanded so that it can be used + as a regular property value and not as an item-list-with-transform. + --> + <CreateProperty Value="$(TargetDir)"> + <Output TaskParameter="Value" PropertyName="TargetDir" /> + </CreateProperty> + + <CreateProperty Value="$(TargetPath)"> + <Output TaskParameter="Value" PropertyName="TargetPath" /> + </CreateProperty> + + <CreateProperty Value="$(TargetPdbPath)"> + <Output TaskParameter="Value" PropertyName="TargetPdbPath" /> + </CreateProperty> + + <!-- Create the directories for intermediate and final build products. --> + <MakeDir Directories="$(IntermediateOutputPath);$(OutDir)" /> + </Target> + + <!-- + ================================================================================================== + ResolveWixExtensionPaths + + Resolves WiX extension references to full paths. Any properties you use + to resolve paths to extensions must be defined before importing this + file or the extensions will be automatically resolved to $(WixExtDir). + + [IN] + @(WixExtension) - WixExtension item group + + [OUT] + @(_ResolvedWixExtensionPaths) - Item group with full paths to extensions + ================================================================================================== + --> + <Target + Name="ResolveWixExtensionPaths"> + + <!-- Generate flat item group without metadata --> + <CreateItem Include="@(WixExtension)" Condition=" '%(WixExtension.HintPath)' == '' "> + <Output TaskParameter="Include" ItemName="_AllWixExtensions" /> + </CreateItem> + + <CreateItem Include="@(WixExtension->'%(HintPath)')" Condition=" '%(WixExtension.HintPath)' != '' "> + <Output TaskParameter="Include" ItemName="_AllWixExtensions" /> + </CreateItem> + + <!-- Resolve flat item group to full paths, defaulting to WixExtDir --> + <CreateItem Include="@(_AllWixExtensions)" Condition="Exists('%(_AllWixExtensions.FullPath)')"> + <Output TaskParameter="Include" ItemName="_AllResolvedWixExtensionPaths" /> + </CreateItem> + + <CreateItem Include="@(_AllWixExtensions->'$(WixExtDir)%(Filename).dll')" Condition="!Exists('%(_AllWixExtensions.FullPath)') and '%(_AllWixExtensions.Extension)' == '' "> + <Output TaskParameter="Include" ItemName="_AllResolvedWixExtensionPaths" /> + </CreateItem> + + <CreateItem Include="@(_AllWixExtensions->'$(WixExtDir)%(Filename)%(Extension)')" Condition="!Exists('%(_AllWixExtensions.FullPath)') and '%(_AllWixExtensions.Extension)' != '' "> + <Output TaskParameter="Include" ItemName="_AllResolvedWixExtensionPaths" /> + </CreateItem> + + <!-- Remove duplicate extension items that would cause build errors --> + <RemoveDuplicates Inputs="@(_AllResolvedWixExtensionPaths)"> + <Output TaskParameter="Filtered" ItemName="_ResolvedWixExtensionPaths" /> + </RemoveDuplicates> + </Target> + + <!-- + ================================================================================================== + PreBuildEvent + + Run the pre-build event if there is one. + ================================================================================================== + --> + <PropertyGroup> + <PreBuildEventDependsOn></PreBuildEventDependsOn> + </PropertyGroup> + <Target + Name="PreBuildEvent" + DependsOnTargets="$(PreBuildEventDependsOn)" + Condition=" '$(PreBuildEvent)' != '' "> + + <Exec WorkingDirectory="$(OutDir)" Command="$(PreBuildEvent)" /> + </Target> + + <!-- + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + Resolve References Targets + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + --> + + <!-- + ================================================================================================== + ResolveReferences + ================================================================================================== + --> + <PropertyGroup> + <ResolveReferencesDependsOn> + BeforeResolveReferences; + SplitProjectReferencesByType; + ResolveProjectReferences; + ResolveVCProjectReferences; + ResolveWixLibraryReferences; + AfterResolveReferences + </ResolveReferencesDependsOn> + </PropertyGroup> + <Target + Name="ResolveReferences" + DependsOnTargets="$(ResolveReferencesDependsOn)" /> + + <!-- + ================================================================================================== + BeforeResolveReferences + + Redefine this target in your project in order to run tasks just before ResolveReferences. + ================================================================================================== + --> + <Target Name="BeforeResolveReferences" /> + + <!-- + ================================================================================================== + AfterResolveReferences + + Redefine this target in your project in order to run tasks just after ResolveReferences. + ================================================================================================== + --> + <Target Name="AfterResolveReferences" /> + + <!-- + ================================================================================================== + SplitProjectReferencesByType + + Split project references into two lists: VC project references and all others (handled by the + MSBuild engine) + + [IN] + @(ProjectReference) - the list of all project references + + [OUT] + @(VCProjectReference) - the list of VC (managed VC++ to be exact) project references + @(NonVCProjectReference) - the list of non-VC project references (MSBuild and potentially VSIP projects) + ================================================================================================== + --> + <Target + Name="SplitProjectReferencesByType" + Condition=" '@(ProjectReference)' != '' "> + + <!-- Assign a project configuration to each project reference if we're building a solution file. --> + <AssignProjectConfiguration + ProjectReferences="@(ProjectReference)" + SolutionConfigurationContents="$(CurrentSolutionConfigurationContents)" + Condition=" '$(BuildingSolutionFile)' == 'true' "> + + <Output TaskParameter="AssignedProjects" ItemName="_ProjectReferenceWithConfiguration" /> + </AssignProjectConfiguration> + + <!-- + Otherwise (regular command line build or building inside the IDE) just copy the references + as we don't need their configurations. + --> + <CreateItem Include="@(ProjectReference)" Condition=" '$(BuildingSolutionFile)' != 'true' "> + <Output TaskParameter="Include" ItemName="_ProjectReferenceWithConfiguration" /> + </CreateItem> + + <!-- Copy all VC project references to the VCProjectReference item list (using the VC project extension) --> + <CreateItem + Include="@(_ProjectReferenceWithConfiguration)" + Condition=" '%(Extension)' == '.vcproj' " + AdditionalMetadata="MSBuildSourceProjectFileFullPath=%(FullPath)"> + + <Output TaskParameter="Include" ItemName="VCProjectReference" /> + </CreateItem> + + <!-- Copy the rest of the project references to the NonVCProjectReference item list --> + <CreateItem + Include="@(_ProjectReferenceWithConfiguration)" + Condition=" '%(Extension)' != '.vcproj' " + AdditionalMetadata="MSBuildSourceProjectFileFullPath=%(FullPath)"> + + <Output TaskParameter="Include" ItemName="NonVCProjectReference" /> + </CreateItem> + </Target> + + + <!-- + ================================================================================================== + _SplitProjectReferencesByFileExistence + + Split referenced projects into two lists: those that exist on disk and those that don't. + + [IN] + @(NonVCProjectReference) - the list of non-VC project references (MSBuild and potentially VSIP projects) + + [OUT] + @(_MSBuildProjectReferenceExistent) - the list of non-VC project references that exist on disk + @(_MSBuildProjectReferenceNonexistent) - the list of non-VC project references that don't exist on disk + ================================================================================================== + --> + <Target + Name="_SplitProjectReferencesByFileExistence" + DependsOnTargets="SplitProjectReferencesByType" + Condition=" '@(NonVCProjectReference)' != '' "> + + <!-- + Use this task for matching projects with pre-resolved project outputs set by the IDE if building + inside the IDE. The IDE only includes non-MSBuild projects in the output list. We'll use MSBuild + to resolve MSBuild projects. This task will resolve VSIP (3rd party) project references and + create a new item list with only project references to projects in the MSBuild format. + --> + <ResolveNonMSBuildProjectOutput + ProjectReferences="@(NonVCProjectReference)" + PreresolvedProjectOutputs="$(VSIDEResolvedNonMSBuildProjectOutputs)" + Condition=" '$(BuildingInsideVisualStudio)' == 'true' "> + + <Output TaskParameter="ResolvedOutputPaths" ItemName="_ResolvedProjectReferencePaths" /> + <Output TaskParameter="UnresolvedProjectReferences" ItemName="_MSBuildProjectReference" /> + + </ResolveNonMSBuildProjectOutput> + + <!-- + If building from the command line, simply copy the NonVCProjectReference item list to + _MSBuildProjectReference, since we have to assume all non-VC projects are in the MSBuild format. + We have no way of building VSIP (3rd party) projects from the command line. + --> + <CreateItem Include="@(NonVCProjectReference)" Condition=" '$(BuildingInsideVisualStudio)' != 'true' "> + <Output TaskParameter="Include" ItemName="_MSBuildProjectReference" /> + </CreateItem> + + <!-- Break the project list into two lists: those that exist on disk and those that don't. --> + <CreateItem Include="@(_MSBuildProjectReference)" Condition="Exists('%(Identity)')"> + <Output TaskParameter="Include" ItemName="_MSBuildProjectReferenceExistent" /> + </CreateItem> + + <CreateItem Include="@(_MSBuildProjectReference)" Condition="!Exists('%(Identity)')"> + <Output TaskParameter="Include" ItemName="_MSBuildProjectReferenceNonexistent" /> + </CreateItem> + + </Target> + + <!-- + ================================================================================================ + ResolveProjectReferences + + Builds all of the referenced projects to get their outputs. + + [IN] + @(NonVCProjectReference) - The list of non-VC project references. + + [OUT] + @(_ResolvedProjectReferencePaths) - Paths to referenced projects. + ================================================================================================ + --> + <Target + Name="ResolveProjectReferences" + DependsOnTargets="_SplitProjectReferencesByFileExistence" + Condition=" '@(NonVCProjectReference)' != '' "> + + <!-- + When building this project from the IDE or when building a .sln from the command line, just + gather the referenced build outputs. The code that builds the .sln will already have built + the project, so there's no need to do it again here. + + The ContinueOnError setting is here so that, during project load, as much information as + possible will be passed to the compilers. + --> + <MSBuild + Projects="@(_MSBuildProjectReferenceExistent)" + Targets="GetTargetPath" + Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform)" + Condition="('$(BuildingSolutionFile)' == 'true' or '$(BuildingInsideVisualStudio)' == 'true') and '@(_MSBuildProjectReferenceExistent)' != '' " + ContinueOnError="!$(BuildingProject)"> + + <Output TaskParameter="TargetOutputs" ItemName="_ResolvedProjectReferencePaths" /> + </MSBuild> + + <!-- + Build referenced projects when building from the command line. + + The $(ProjectReferenceBuildTargets) will normally be blank so that the project's default target + is used during a P2P reference. However if a custom build process requires that the referenced + project has a different target to build it can be specified. + --> + <MSBuild + Projects="@(_MSBuildProjectReferenceExistent)" + Targets="$(ProjectReferenceBuildTargets)" + Condition=" '$(BuildingInsideVisualStudio)' != 'true' and '$(BuildingSolutionFile)' != 'true' and '@(_MSBuildProjectReferenceExistent)' != '' "> + + <Output TaskParameter="TargetOutputs" ItemName="_ResolvedProjectReferencePaths" /> + </MSBuild> + + <!-- Issue a warning for each non-existent project. --> + <Warning + Text="The referenced project '%(_MSBuildProjectReferenceNonexistent.Identity)' does not exist." + Condition=" '@(_MSBuildProjectReferenceNonexistent)' != '' " /> + + <!-- Create list of all .wixlib project references--> + <CreateItem + Include="@(_ResolvedProjectReferencePaths)" + Condition=" '%(Extension)' == '.wixlib' "> + + <Output TaskParameter="Include" ItemName="WixLibProjects" /> + </CreateItem> + + </Target> + + <!-- + ================================================================================================ + GetTargetPath + + This stand-alone target returns the name of the build product (i.e. MSI, MSM) that would be + produced if we built this project. + ================================================================================================ + --> + <Target + Name="GetTargetPath" + DependsOnTargets="PrepareForBuild" + Outputs="$(TargetPath)" /> + + <!-- + ================================================================================================ + ResolveVCProjectReferences + + Find outputs of referenced VC projects (currently we never build VC projects ourselves). + + [IN] + @(VCProjectReference) - the list of VC project references + + [OUT] + @(_ResolvedProjectReferencePaths) - paths to projects' outputs + ================================================================================================ + --> + <Target + Name="ResolveVCProjectReferences" + Condition=" '@(VCProjectReference)' != '' " + DependsOnTargets="SplitProjectReferencesByType"> + + <!-- + Use the task for matching projects with pre-resolved project outputs set by the IDE + if building inside the IDE. + --> + <ResolveNonMSBuildProjectOutput + ProjectReferences="@(VCProjectReference)" + PreresolvedProjectOutputs="$(VSIDEResolvedNonMSBuildProjectOutputs)" + Condition=" '$(BuildingInsideVisualStudio)' == 'true' "> + + <Output TaskParameter="ResolvedOutputPaths" ItemName="_ResolvedVCProjectReferencePaths" /> + </ResolveNonMSBuildProjectOutput> + + <!-- + Use the task that uses VC project engine if building from the command line. Invoking this + task only makes sense for building solution files, otherwise we won't have the necessary + configuration information. + --> + <ResolveVCProjectOutput + ProjectReferences="@(VCProjectReference)" + Configuration="%(VCProjectReference.FullConfiguration)" + SolutionFile="$(SolutionPath)" + Override="$(VCBuildOverride)" + Condition=" '$(BuildingSolutionFile)' == 'true' "> + + <Output TaskParameter="ResolvedOutputPaths" ItemName="_ResolvedVCProjectReferencePaths" /> + </ResolveVCProjectOutput> + + <Error + Text="MSBuild cannot resolve the reference to the Visual C++ project '%(VCProjectReference.Identity)' when building a stand-alone MSBuild project. To correctly resolve this reference, please build the solution file containing these projects." + Condition=" '$(BuildingSolutionFile)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true' " /> + + <CreateItem Include="@(_ResolvedVCProjectReferencePaths)"> + <Output TaskParameter="Include" ItemName="_ResolvedProjectReferencePaths" /> + </CreateItem> + + </Target> + + <!-- + ================================================================================================ + ResolveWixLibraryReferences + + Resolve the library references by copying them to the local build directory. Used in Votive + when CopyLocal = true on a wixlib or wix extension reference node. + + [IN] + @(WixLibrary) - The list of .wixlib files. + @(WixExtension) - The list of wix dll extension files. + ================================================================================================ + --> + <!-- Resolve the library references by copying them to the local build directory. Used in Votive when CopyLocal = true on a wixlib reference node. --> + <PropertyGroup> + <ResolveWixLibraryReferencesDependsOn> + PrepareForBuild; + ResolveWixExtensionPaths + </ResolveWixLibraryReferencesDependsOn> + </PropertyGroup> + <Target + Name="ResolveWixLibraryReferences" + Inputs="@(WixLibrary); + @(_ResolvedWixExtensionPaths); + $(MSBuildAllProjects)" + Outputs="@(WixLibrary->'$(OutDir)%(Filename)%(Extension)'); + @(_ResolvedWixExtensionPaths->'$(OutDir)%(Filename)%(Extension)')" + DependsOnTargets="$(ResolveWixLibraryReferencesDependsOn)" + Condition=" '@(WixLibrary)@(_ResolvedWixExtensionPaths)' != ''"> + + <!-- TODO: Recurse any project references that build wixlibs or wixext and add their outputs to WixLibrary or WixExtension --> + <!-- TODO: Copy the references marked with CopyLocal=true to the output directory --> + </Target> + + <!-- + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + Compiler Define Targets + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + --> + + <!-- + ================================================================================================== + AddCompilerDefineConstants + + Adds solution and project references to the constants passed into the compiler. + ================================================================================================== + --> + <PropertyGroup> + <AddCompilerDefineConstantsDependsOn> + ResolveReferences; + AddSolutionDefineConstants; + AddProjectReferenceDefineConstants; + </AddCompilerDefineConstantsDependsOn> + </PropertyGroup> + <Target + Name="AddCompilerDefineConstants" + DependsOnTargets="$(AddCompilerDefineConstantsDependsOn)"> + + <CreateProperty Value=" + Configuration=$(ConfigurationName); + OutDir=$(OutDir); + Platform=$(PlatformName); + ProjectDir=$(ProjectDir); + ProjectExt=$(ProjectExt); + ProjectFileName=$(ProjectFileName); + ProjectName=$(ProjectName); + ProjectPath=$(ProjectPath); + TargetDir=$(TargetDir); + TargetExt=$(TargetExt); + TargetFileName=$(TargetFileName); + TargetName=$(TargetName); + TargetPath=$(TargetPath); + "> + <Output TaskParameter="Value" PropertyName="ProjectDefineConstants" /> + </CreateProperty> + + </Target> + + <!-- + ================================================================================================== + AddSolutionDefineConstants + + Adds solution references to the constants passed into the compiler, but only when building + from the Visual Studio IDE or when building a solution file via the command line. + + [OUT] + $(SolutionDefineConstants) - the list of solution variables to be passed into the compiler + ================================================================================================== + --> + <PropertyGroup> + <DefineSolutionProperties Condition=" '$(DefineSolutionProperties)' == '' ">true</DefineSolutionProperties> + </PropertyGroup> + <Target + Name="AddSolutionDefineConstants" + Condition=" '$(DefineSolutionProperties)' == 'true' "> + + <Warning + Text="Solution properties are only available during IDE builds or when building the solution file from the command line. To turn off this warning set <DefineSolutionProperties>false</DefineSolutionProperties> in your .wixproj file." + Condition=" '$(BuildingInsideVisualStudio)' != 'true' and '$(BuildingSolutionFile)' != 'true' " /> + + <CreateProperty Value="$(SolutionDefineConstants);DevEnvDir=$(DevEnvDir)" Condition=" '$(DevEnvDir)' != '' "> + <Output TaskParameter="Value" PropertyName="SolutionDefineConstants" /> + </CreateProperty> + <CreateProperty Value="$(SolutionDefineConstants);SolutionDir=$(SolutionDir)" Condition=" '$(SolutionDir)' != '' "> + <Output TaskParameter="Value" PropertyName="SolutionDefineConstants" /> + </CreateProperty> + <CreateProperty Value="$(SolutionDefineConstants);SolutionExt=$(SolutionExt)" Condition=" '$(SolutionExt)' != '' "> + <Output TaskParameter="Value" PropertyName="SolutionDefineConstants" /> + </CreateProperty> + <CreateProperty Value="$(SolutionDefineConstants);SolutionFileName=$(SolutionFileName)" Condition=" '$(SolutionFileName)' != '' "> + <Output TaskParameter="Value" PropertyName="SolutionDefineConstants" /> + </CreateProperty> + <CreateProperty Value="$(SolutionDefineConstants);SolutionName=$(SolutionName)" Condition=" '$(SolutionName)' != '' "> + <Output TaskParameter="Value" PropertyName="SolutionDefineConstants" /> + </CreateProperty> + <CreateProperty Value="$(SolutionDefineConstants);SolutionPath=$(SolutionPath)" Condition=" '$(SolutionPath)' != '' "> + <Output TaskParameter="Value" PropertyName="SolutionDefineConstants" /> + </CreateProperty> + + </Target> + + <!-- + ================================================================================================== + AddProjectReferenceDefineConstants + + Adds project references to the constants passed into the compiler. + + [IN] + @(_ResolvedProjectReferencePaths) - paths to projects' outputs + $(VSProjectConfigurations) - map of project names to configurations, provided by VS when building in the IDE + + [OUT] + $(ProjectReferenceDefineConstants) - the list of referenced project variables to be passed into the compiler + ================================================================================================== + --> + <Target + Name="AddProjectReferenceDefineConstants" + Condition=" '@(_ResolvedProjectReferencePaths)' != '' "> + + <CreateProjectReferenceDefineConstants + ProjectReferencePaths="@(_ResolvedProjectReferencePaths)" + ProjectConfigurations="$(VSProjectConfigurations)"> + + <Output TaskParameter="DefineConstants" PropertyName="ProjectReferenceDefineConstants" /> + </CreateProjectReferenceDefineConstants> + </Target> + + <!-- + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + CompileAndLink Targets + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + --> + + <!-- + ================================================================================================== + CompileAndLink + ================================================================================================== + --> + <PropertyGroup> + <CompileAndLinkDependsOn> + ResolveReferences; + BeforeCompileAndLink; + _TimeStampBeforeCompileAndLink; + HarvestProjects; + Compile; + Lib; + LinkUnlocalizedProject; + LinkLocalizedProject; + _TimeStampAfterCompileAndLink; + AfterCompileAndLink + </CompileAndLinkDependsOn> + </PropertyGroup> + <Target + Name="CompileAndLink" + DependsOnTargets="$(CompileAndLinkDependsOn)" /> + + <!-- + ================================================================================================== + BeforeCompileAndLink + + Redefine this target in your project in order to run tasks just before CompileAndLink. + ================================================================================================== + --> + <Target Name="BeforeCompileAndLink" /> + + <!-- + ================================================================================================== + AfterCompileAndLink + + Redefine this target in your project in order to run tasks just after CompileAndLink. + ================================================================================================== + --> + <Target Name="AfterCompileAndLink" /> + + <!-- + ================================================================================================== + _TimeStampBeforeCompileAndLink + + If post-build events are set to fire "OnOutputUpdated", then take before and after timestamps + so that we can compare them. + ================================================================================================== + --> + <Target + Name="_TimeStampBeforeCompileAndLink" + Condition=" '$(RunPostBuildEvent)' == 'OnOutputUpdated' "> + + <CreateItem Include="%(TargetOutput.ModifiedTime)"> + <Output TaskParameter="Include" PropertyName="_TargetOutputTimestampBeforeCompileAndLink" /> + </CreateItem> + + </Target> + + <!-- + ================================================================================================== + _TimeStampAfterCompileAndLink + + If post-build events are set to fire "OnOutputUpdated", then take before and after timestamps + so that we can compare them. + ================================================================================================== + --> + <Target + Name="_TimeStampAfterCompileAndLink" + Condition=" '$(RunPostBuildEvent)' == 'OnOutputUpdated' "> + + <CreateItem Include="%(TargetOutput.ModifiedTime)"> + <Output TaskParameter="Include" PropertyName="_TargetOutputTimestampAfterCompileAndLink" /> + </CreateItem> + + </Target> + + <!-- + ================================================================================================ + HarvestProjects + + Harvests outputs of other MSBuild projects files using the VS project extension to heat.exe. + + [IN] + @(HeatProject) - The list of projects to harvest. + %(HeatProject.Transforms) - XSL transforms to apply to the harvested WiX. + + [OUT] + $(IntermediateOutputPath)_%(HeatProject.Filename).wxs + - The generated .wxs files which are added to the @(Compile) item list. + ================================================================================================ + --> + <Target Name="HarvestProjects" + Inputs="@(HeatProject);%(HeatProject.Transforms);$(MSBuildAllProjects)" + Outputs="$(IntermediateOutputPath)_%(HeatProject.Filename).wxs" + Condition=" '@(HeatProject)' != '' "> + + <HeatProject + AutogenerateGuids="true" + NoLogo="$(NoLogo)" + OutputFile="$(IntermediateOutputPath)_%(HeatProject.Filename).wxs" + Project="@(HeatProject)" + ProjectOutputGroups="%(HeatProject.ProjectOutputGroups)" + SuppressFragments="true" + ToolPath="$(WixToolPath)" + Transforms="%(HeatProject.Transforms)" /> + + <CreateItem Include="$(IntermediateOutputPath)_%(HeatProject.Filename).wxs"> + <Output TaskParameter="Include" ItemName="Compile" /> + </CreateItem> + + </Target> + + <!-- + ================================================================================================ + Compile + + Compiles the wxs files into wixobj files using candle.exe. + + [IN] + @(Compile) - The list of wxs files to compile. + @(Content) - Files that the project uses in the installer. + @(WixExtension) - The list of wixlib or wix dll extensions. + + [OUT] + @(CompileObjOutput) - The compiled .wixobj files. + ================================================================================================ + --> + <PropertyGroup> + <CompileDependsOn> + PrepareForBuild; + ResolveWixExtensionPaths + </CompileDependsOn> + </PropertyGroup> + <Target + Name="Compile" + Inputs="@(Compile); + @(Content); + @(_ResolvedWixExtensionPaths); + @(_ResolvedProjectReferencePaths); + $(MSBuildAllProjects)" + Outputs="$(IntermediateOutputPath)%(Compile.Filename)$(IntermediateExt)" + DependsOnTargets="$(CompileDependsOn)" + Condition=" '@(Compile)' != '' "> + + <Candle + SourceFiles="@(Compile)" + AdditionalOptions="$(CompilerAdditionalOptions)" + DefineConstants="$(DefineConstants);$(SolutionDefineConstants);$(ProjectDefineConstants);$(ProjectReferenceDefineConstants)" + ExtensionDirectory="$(WixExtDir)" + Extensions="@(_ResolvedWixExtensionPaths)" + SuppressFilesVitalByDefault="$(SuppressFilesVitalByDefault)" + PreprocessToStdOut="$(PreprocessToStdOut)" + PreprocessToFile="$(PreprocessToFile)" + IncludeSearchPaths="$(IncludeSearchPaths)" + InstallerPlatform="$(InstallerPlatform)" + NoLogo="$(CompilerNoLogo)" + OnlyValidateDocuments="$(OnlyValidateDocuments)" + OutputFile="$(IntermediateOutputPath)%(Compile.Filename)$(IntermediateExt)" + Pedantic="$(Pedantic)" + ReferencePaths="$(ReferencePath)" + RunAsSeparateProcess="$(RunWixToolsOutOfProc)" + ShowSourceTrace="$(ShowSourceTrace)" + SuppressAllWarnings="$(CompilerSuppressAllWarnings)" + SuppressSchemaValidation="$(CompilerSuppressSchemaValidation)" + SuppressSpecificWarnings="$(CompilerSuppressSpecificWarnings)" + ToolPath="$(WixToolPath)" + TreatWarningsAsErrors="$(CompilerTreatWarningsAsErrors)" + TreatSpecificWarningsAsErrors="$(CompilerTreatSpecificWarningsAsErrors)" + VerboseOutput="$(CompilerVerboseOutput)"> + + <Output TaskParameter="OutputFile" ItemName="CompileObjOutput" /> + </Candle> + </Target> + + <!-- + ================================================================================================ + Lib + + Links the .wixobj, .wxl, .wixlib, wix extensions into a .wixlib file using lit.exe. + + [IN] + @(CompileObjOutput) - The compiled .wixobj file. + @(EmbeddedResource) - The list of wxl files to use for localization. + @(WixObject) - The list of .wixobj files. + @(WixLibrary) - The list of .wixlib files. + @(WixExtension) - The list of wix dll extension files. + + [OUT] + $(TargetPath) - The compiled .wixlib file. + ================================================================================================ + --> + <PropertyGroup> + <LibDependsOn> + PrepareForBuild; + ResolveWixExtensionPaths + </LibDependsOn> + </PropertyGroup> + <Target + Name="Lib" + Inputs="@(CompileObjOutput); + @(EmbeddedResource); + @(WixObject); + @(WixLibrary); + @(_ResolvedWixExtensionPaths); + $(MSBuildAllProjects)" + Outputs="$(TargetPath)" + DependsOnTargets="$(LibDependsOn)" + Condition=" '$(OutputType)' == 'Library' "> + + <Lit + ObjectFiles="@(CompileObjOutput);@(WixObject);@(WixLibProjects);@(WixLibrary)" + AdditionalOptions="$(LibAdditionalOptions)" + BaseInputPaths="$(LinkerBaseInputPaths)" + BindFiles="$(LibBindFiles)" + ExtensionDirectory="$(WixExtDir)" + Extensions="@(_ResolvedWixExtensionPaths)" + LocalizationFiles="@(EmbeddedResource)" + NoLogo="$(LibNoLogo)" + OutputFile="$(TargetPath)" + Pedantic="$(LibPedantic)" + ReferencePaths="$(ReferencePath)" + RunAsSeparateProcess="$(RunWixToolsOutOfProc)" + SuppressAllWarnings="$(LibSuppressAllWarnings)" + SuppressIntermediateFileVersionMatching="$(LibSuppressIntermediateFileVersionMatching)" + SuppressSchemaValidation="$(LibSuppressSchemaValidation)" + SuppressSpecificWarnings="$(LibSuppressSpecificWarnings)" + ToolPath="$(WixToolPath)" + TreatWarningsAsErrors="$(LibTreatWarningsAsErrors)" + VerboseOutput="$(LibVerboseOutput)" /> + </Target> + + <!-- + ================================================================================================ + LinkUnlocalizedProject + + Links the .wixobj, .wxl, .wixlib, wix extensions into an .msi or .msm file using light.exe, + when there are no localized resources specified in the project file. + + [IN] + @(CompileObjOutput) - The compiled .wixobj file. + @(EmbeddedResource) - The list of wxl files to use for localization. + @(WixObject) - The list of .wixobj files. + @(WixLibrary) - The list of .wixlib files. + @(WixExtension) - The list of wix dll extension files. + + [OUT] + $(TargetPath) - The compiled .msi or .msm file. + ================================================================================================ + --> + <PropertyGroup> + <LinkUnlocalizedProjectDependsOn> + PrepareForBuild; + ResolveWixExtensionPaths + </LinkUnlocalizedProjectDependsOn> + </PropertyGroup> + + <Target + Name="LinkUnlocalizedProject" + Inputs="@(CompileObjOutput); + @(WixObject); + @(WixLibrary); + @(_ResolvedWixExtensionPaths); + $(MSBuildAllProjects)" + Outputs="$(TargetPath)" + DependsOnTargets="$(LinkUnlocalizedProjectDependsOn)" + Condition=" ('$(OutputType)' == 'Package' or '$(OutputType)' == 'Module') and '@(EmbeddedResource)' == '' "> + + <Light + ObjectFiles="@(CompileObjOutput);@(WixObject);@(WixLibProjects);@(WixLibrary)" + AdditionalOptions="$(LinkerAdditionalOptions)" + AllowIdenticalRows="$(AllowIdenticalRows)" + AllowUnresolvedReferences="$(AllowUnresolvedReferences)" + AdditionalCub="$(AdditionalCub)" + BackwardsCompatibleGuidGeneration="$(BackwardsCompatibleGuidGeneration)" + BaseInputPaths="$(LinkerBaseInputPaths)" + BindFiles="$(LinkerBindFiles)" + CabinetCachePath="$(CabinetCachePath)" + CabinetCreationThreadCount="$(CabinetCreationThreadCount)" + Cultures="$(Cultures)" + DefaultCompressionLevel="$(DefaultCompressionLevel)" + DropUnrealTables="$(DropUnrealTables)" + ExtensionDirectory="$(WixExtDir)" + Extensions="@(_ResolvedWixExtensionPaths)" + Ices="$(Ices)" + LeaveTemporaryFiles="$(LeaveTemporaryFiles)" + NoLogo="$(LinkerNoLogo)" + OutputAsXml="$(OutputAsXml)" + OutputFile="$(TargetPath)" + PdbOutputFile="$(TargetPdbPath)" + Pedantic="$(LinkerPedantic)" + ReferencePaths="$(ReferencePath)" + ReuseCabinetCache="$(ReuseCabinetCache)" + RunAsSeparateProcess="$(RunWixToolsOutOfProc)" + SetMsiAssemblyNameFileVersion="$(SetMsiAssemblyNameFileVersion)" + SuppressAclReset="$(SuppressAclReset)" + SuppressAllWarnings="$(LinkerSuppressAllWarnings)" + SuppressAssemblies="$(SuppressAssemblies)" + SuppressDefaultAdminSequenceActions="$(SuppressDefaultAdminSequenceActions)" + SuppressDefaultAdvSequenceActions="$(SuppressDefaultAdvSequenceActions)" + SuppressDefaultUISequenceActions="$(SuppressDefaultUISequenceActions)" + SuppressFileHashAndInfo="$(SuppressFileHashAndInfo)" + SuppressFiles="$(SuppressFiles)" + SuppressIntermediateFileVersionMatching="$(LinkerSuppressIntermediateFileVersionMatching)" + SuppressIces="$(SuppressIces)" + SuppressLayout="$(SuppressLayout)" + SuppressLocalization="$(SuppressLocalization)" + SuppressMsiAssemblyTableProcessing="$(SuppressMsiAssemblyTableProcessing)" + SuppressPdbOutput="$(SuppressPdbOutput)" + SuppressSchemaValidation="$(LinkerSuppressSchemaValidation)" + SuppressValidation="$(SuppressValidation)" + SuppressSpecificWarnings="$(LinkerSuppressSpecificWarnings)" + SuppressTagSectionIdAttributeOnTuples="$(SuppressTagSectionIdAttributeOnTuples)" + ToolPath="$(WixToolPath)" + TreatWarningsAsErrors="$(LinkerTreatWarningsAsErrors)" + UnreferencedSymbolsFile="$(UnreferencedSymbolsFile)" + VerboseOutput="$(LinkerVerboseOutput)" + WixVariables="$(WixVariables)" /> + </Target> + + <!-- + ================================================================================================ + AssignCultures + + Takes any .wxl files in the project and assigns culture metadata to them based on the file name. + If the file is of the form name.culture.wxl, the culture metadata will be set to the culture + portion of the file name. If the culture is already specified via metadata in the project file it + will be left untouched. + + [IN] + @(EmbeddedResource) - The list of wxl files to use for localization. + + [OUT] + @(EmbeddedResourceWithCulture) - The list of wxl files with the culture metadata set. + ================================================================================================ + --> + <Target Name="AssignCultures"> + <WixAssignCulture + Files="@(EmbeddedResource)" + Condition=" '%(Extension)' == '.wxl' "> + + <Output TaskParameter="AllFilesWithCulture" ItemName="_TempEmbeddedResourceWithCulture" /> + </WixAssignCulture> + + <!-- Now that we have the cultures assigned to the files we only want to build the ones specified --> + <!-- in the Cultures list from the project properties. --> + + <!-- If the Cultures list is empty include all the cultures. --> + <CreateItem + Include="@(_TempEmbeddedResourceWithCulture)" + Condition=" '$(Cultures)' == '' "> + + <Output TaskParameter="Include" ItemName="EmbeddedResourceWithCulture" /> + </CreateItem> + + <!-- If the Cultures list isn't empty then only include items where the culture matches a --> + <!-- culture in the Cultures list. First we have to create an item list out of the semicolon --> + <!-- separated property list. Then we have to set the Culture metadata property on it. --> + <!-- After all that, it is possible to do a merge of the two lists to only get the embedded --> + <!-- resources that have the specified cultures to build. For an explanation of why --> + <!-- the condition on the last CreateItem works, see http://blogs.msdn.com/msbuild/archive/2006/05/18/601146.aspx. --> + <CreateItem Include="$(Cultures)"> + <Output TaskParameter="Include" ItemName="_CulturesToBuild" /> + </CreateItem> + + <CreateItem + Include="@(_CulturesToBuild)" + AdditionalMetadata="Culture=%(Identity)"> + + <Output TaskParameter="Include" ItemName="_CulturesToBuildWithMetadata" /> + </CreateItem> + + <CreateItem + Include="@(_TempEmbeddedResourceWithCulture)" + Condition=" '%(Culture)' != '' and '@(_TempEmbeddedResourceWithCulture)'!= '' and '@(_CulturesToBuildWithMetadata)' != '' "> + + <Output TaskParameter="Include" ItemName="EmbeddedResourceWithCulture" /> + </CreateItem> + </Target> + + <!-- + ================================================================================================ + LinkLocalizedProject + + Links the .wixobj, .wxl, .wixlib, wix extensions into an .msi or .msm file using light.exe, + once per language. If multiple .wxl files are present with the same culture they will all + be passed to a single light.exe call with multiple -loc parameters. + + [IN] + @(CompileObjOutput) - The compiled .wixobj file. + @(EmbeddedResource) - The list of wxl files to use for localization. + @(WixObject) - The list of .wixobj files. + @(WixLibrary) - The list of .wixlib files. + @(WixExtension) - The list of wix dll extension files. + + [OUT] + $(TargetDir)\%(Culture)\$(TargetName)$(TargetExt) - The compiled .msi or .msm files. + ================================================================================================ + --> + <PropertyGroup> + <LinkLocalizedProjectDependsOn> + PrepareForBuild; + ResolveWixExtensionPaths; + AssignCultures; + </LinkLocalizedProjectDependsOn> + </PropertyGroup> + + <Target + Name="LinkLocalizedProject" + Inputs="@(CompileObjOutput); + @(EmbeddedResourceWithCulture); + @(WixObject); + @(WixLibrary); + @(_ResolvedWixExtensionPaths); + $(MSBuildAllProjects)" + Outputs="$(TargetDir)%(EmbeddedResourceWithCulture.Culture)\$(TargetName)$(TargetExt)" + DependsOnTargets="$(LinkLocalizedProjectDependsOn)" + Condition=" ('$(OutputType)' == 'Package' or '$(OutputType)' == 'Module') and '@(EmbeddedResource)' != '' "> + + <!-- Call light using the culture subdirectory for output --> + <Light + ObjectFiles="@(CompileObjOutput);@(WixObject);@(WixLibProjects);@(WixLibrary)" + AdditionalOptions="$(LinkerAdditionalOptions)" + AllowIdenticalRows="$(AllowIdenticalRows)" + AllowUnresolvedReferences="$(AllowUnresolvedReferences)" + AdditionalCub="$(AdditionalCub)" + BackwardsCompatibleGuidGeneration="$(BackwardsCompatibleGuidGeneration)" + BaseInputPaths="$(LinkerBaseInputPaths)" + BindFiles="$(LinkerBindFiles)" + CabinetCachePath="$(CabinetCachePath)" + CabinetCreationThreadCount="$(CabinetCreationThreadCount)" + Cultures="%(EmbeddedResourceWithCulture.Culture)" + DefaultCompressionLevel="$(DefaultCompressionLevel)" + DropUnrealTables="$(DropUnrealTables)" + ExtensionDirectory="$(WixExtDir)" + Extensions="@(_ResolvedWixExtensionPaths)" + Ices="$(Ices)" + LeaveTemporaryFiles="$(LeaveTemporaryFiles)" + LocalizationFiles="@(EmbeddedResourceWithCulture)" + NoLogo="$(LinkerNoLogo)" + OutputAsXml="$(OutputAsXml)" + OutputFile="$(TargetDir)%(EmbeddedResourceWithCulture.Culture)\$(TargetName)$(TargetExt)" + PdbOutputFile="$(TargetDir)%(EmbeddedResourceWithCulture.Culture)\$(TargetName)$(TargetPdbExt)" + Pedantic="$(LinkerPedantic)" + ReferencePaths="$(ReferencePath)" + ReuseCabinetCache="$(ReuseCabinetCache)" + RunAsSeparateProcess="$(RunWixToolsOutOfProc)" + SetMsiAssemblyNameFileVersion="$(SetMsiAssemblyNameFileVersion)" + SuppressAclReset="$(SuppressAclReset)" + SuppressAllWarnings="$(LinkerSuppressAllWarnings)" + SuppressAssemblies="$(SuppressAssemblies)" + SuppressDefaultAdminSequenceActions="$(SuppressDefaultAdminSequenceActions)" + SuppressDefaultAdvSequenceActions="$(SuppressDefaultAdvSequenceActions)" + SuppressDefaultUISequenceActions="$(SuppressDefaultUISequenceActions)" + SuppressFileHashAndInfo="$(SuppressFileHashAndInfo)" + SuppressFiles="$(SuppressFiles)" + SuppressIntermediateFileVersionMatching="$(LinkerSuppressIntermediateFileVersionMatching)" + SuppressIces="$(SuppressIces)" + SuppressLayout="$(SuppressLayout)" + SuppressLocalization="$(SuppressLocalization)" + SuppressMsiAssemblyTableProcessing="$(SuppressMsiAssemblyTableProcessing)" + SuppressPdbOutput="$(SuppressPdbOutput)" + SuppressSchemaValidation="$(LinkerSuppressSchemaValidation)" + SuppressValidation="$(SuppressValidation)" + SuppressSpecificWarnings="$(LinkerSuppressSpecificWarnings)" + SuppressTagSectionIdAttributeOnTuples="$(SuppressTagSectionIdAttributeOnTuples)" + ToolPath="$(WixToolPath)" + TreatWarningsAsErrors="$(LinkerTreatWarningsAsErrors)" + UnreferencedSymbolsFile="$(UnreferencedSymbolsFile)" + VerboseOutput="$(LinkerVerboseOutput)" + WixVariables="$(WixVariables)" + Condition="%(EmbeddedResourceWithCulture.Culture) != ''" /> + + <!-- Culture invaiant output goes in the output directory with no culture subdirectory, we need a second task + because batching (%) occurs at the task level --> + <Light + ObjectFiles="@(CompileObjOutput);@(WixObject);@(WixLibProjects);@(WixLibrary)" + AdditionalOptions="$(LinkerAdditionalOptions)" + AllowIdenticalRows="$(AllowIdenticalRows)" + AllowUnresolvedReferences="$(AllowUnresolvedReferences)" + AdditionalCub="$(AdditionalCub)" + BackwardsCompatibleGuidGeneration="$(BackwardsCompatibleGuidGeneration)" + BaseInputPaths="$(LinkerBaseInputPaths)" + BindFiles="$(LinkerBindFiles)" + CabinetCachePath="$(CabinetCachePath)" + CabinetCreationThreadCount="$(CabinetCreationThreadCount)" + Cultures="%(EmbeddedResourceWithCulture.Culture)" + DefaultCompressionLevel="$(DefaultCompressionLevel)" + DropUnrealTables="$(DropUnrealTables)" + ExtensionDirectory="$(WixExtDir)" + Extensions="@(_ResolvedWixExtensionPaths)" + Ices="$(Ices)" + LeaveTemporaryFiles="$(LeaveTemporaryFiles)" + LocalizationFiles="@(EmbeddedResourceWithCulture)" + NoLogo="$(LinkerNoLogo)" + OutputAsXml="$(OutputAsXml)" + OutputFile="$(TargetPath)" + PdbOutputFile="$(TargetPdbPath)" + Pedantic="$(LinkerPedantic)" + ReferencePaths="$(ReferencePath)" + ReuseCabinetCache="$(ReuseCabinetCache)" + RunAsSeparateProcess="$(RunWixToolsOutOfProc)" + SetMsiAssemblyNameFileVersion="$(SetMsiAssemblyNameFileVersion)" + SuppressAclReset="$(SuppressAclReset)" + SuppressAllWarnings="$(LinkerSuppressAllWarnings)" + SuppressAssemblies="$(SuppressAssemblies)" + SuppressDefaultAdminSequenceActions="$(SuppressDefaultAdminSequenceActions)" + SuppressDefaultAdvSequenceActions="$(SuppressDefaultAdvSequenceActions)" + SuppressDefaultUISequenceActions="$(SuppressDefaultUISequenceActions)" + SuppressFileHashAndInfo="$(SuppressFileHashAndInfo)" + SuppressFiles="$(SuppressFiles)" + SuppressIntermediateFileVersionMatching="$(LinkerSuppressIntermediateFileVersionMatching)" + SuppressIces="$(SuppressIces)" + SuppressLayout="$(SuppressLayout)" + SuppressMsiAssemblyTableProcessing="$(SuppressMsiAssemblyTableProcessing)" + SuppressPdbOutput="$(SuppressPdbOutput)" + SuppressSchemaValidation="$(LinkerSuppressSchemaValidation)" + SuppressValidation="$(SuppressValidation)" + SuppressSpecificWarnings="$(LinkerSuppressSpecificWarnings)" + SuppressTagSectionIdAttributeOnTuples="$(SuppressTagSectionIdAttributeOnTuples)" + ToolPath="$(WixToolPath)" + TreatWarningsAsErrors="$(LinkerTreatWarningsAsErrors)" + UnreferencedSymbolsFile="$(UnreferencedSymbolsFile)" + VerboseOutput="$(LinkerVerboseOutput)" + WixVariables="$(WixVariables)" + Condition="%(EmbeddedResourceWithCulture.Culture) == ''" /> + + </Target> + + <!-- + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + IncrementalClean Targets + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + --> + + <!-- + ================================================================================================== + IncrementalClean + + Remove files that were produced in a prior build but weren't produced in the current build. + The reason is that if, for example, the name of the .msi/.msm has changed we want to delete the + old copy. + + Leave the Clean cache file containing only the files produced in the current build. + ================================================================================================== + --> + <Target + Name="IncrementalClean" + DependsOnTargets="_CleanGetCurrentAndPriorFileWrites"> + + <!-- Subtract list of files produced in prior builds from list of files produced in this build. --> + <CreateItem Include="@(_CleanPriorFileWrites)" Exclude="@(_CleanCurrentFileWrites)"> + <Output TaskParameter="Include" ItemName="_CleanOrphanFileWrites" /> + </CreateItem> + + <!-- Find all files in the final output directory. --> + <FindUnderPath Path="$(OutDir)" Files="@(_CleanOrphanFileWrites)"> + <Output TaskParameter="InPath" ItemName="_CleanOrphanFileWritesInOutput" /> + </FindUnderPath> + + <!-- Find all files in the intermediate output directory. --> + <FindUnderPath Path="$(IntermediateOutputPath)" Files="@(_CleanOrphanFileWrites)"> + <Output TaskParameter="InPath" ItemName="_CleanOrphanFileWritesInIntermediate" /> + </FindUnderPath> + + <!-- Delete the orphaned files. --> + <Delete + Files="@(_CleanOrphanFileWritesInIntermediate);@(_CleanOrphanFileWritesInOutput)" + TreatErrorsAsWarnings="true"> + + <Output TaskParameter="DeletedFiles" ItemName="_CleanOrphanFilesDeleted" /> + </Delete> + + <!-- Create a list of everything that wasn't deleted. --> + <CreateItem Include="@(_CleanPriorFileWrites);@(_CleanCurrentFileWrites)" Exclude="@(_CleanOrphanFilesDeleted)"> + <Output TaskParameter="Include" ItemName="_CleanRemainingFileWritesAfterIncrementalClean" /> + </CreateItem> + + <!-- Remove duplicates. --> + <RemoveDuplicates Inputs="@(_CleanRemainingFileWritesAfterIncrementalClean)"> + <Output TaskParameter="Filtered" ItemName="_CleanUniqueRemainingFileWritesAfterIncrementalClean" /> + </RemoveDuplicates> + + <!-- Make sure the directory exists. --> + <MakeDir Directories="$(BaseIntermediateOutputPath)" /> + + <!-- Write new list of current files back to disk, replacing the existing list.--> + <WriteLinesToFile + File="$(BaseIntermediateOutputPath)$(CleanFile)" + Lines="@(_CleanUniqueRemainingFileWritesAfterIncrementalClean)" + Overwrite="true" /> + + </Target> + + <!-- + ================================================================================================== + _CleanGetCurrentAndPriorFileWrites + + Get the list of files built in the current build and in prior builds. + ================================================================================================== + --> + <Target + Name="_CleanGetCurrentAndPriorFileWrites" + DependsOnTargets="_CheckForCompileAndLinkOutputs"> + + <!-- Read the list of files produced by a prior builds from disk. --> + <ReadLinesFromFile File="$(BaseIntermediateOutputPath)$(CleanFile)"> + <Output TaskParameter="Lines" ItemName="_CleanPriorFileWrites" /> + </ReadLinesFromFile> + + <!-- Find all files in the final output directory. --> + <FindUnderPath Path="$(OutDir)" Files="@(FileWrites)"> + <Output TaskParameter="InPath" ItemName="_CleanCurrentFileWritesInOutput" /> + </FindUnderPath> + + <!-- Find all files in the intermediate output directory. --> + <FindUnderPath Path="$(IntermediateOutputPath)" Files="@(FileWrites)"> + <Output TaskParameter="InPath" ItemName="_CleanCurrentFileWritesInIntermediate" /> + </FindUnderPath> + + <!-- Remove duplicates from files produced in this build. --> + <RemoveDuplicates Inputs="@(_CleanCurrentFileWritesInOutput);@(_CleanCurrentFileWritesInIntermediate)"> + <Output TaskParameter="Filtered" ItemName="_CleanCurrentFileWrites" /> + </RemoveDuplicates> + + </Target> + + <!-- + ================================================================================================== + _CheckForCompileAndLinkOutputs + + Checks each file output from the main CompileAndLink target to make sure they really exist. + If they do, then record them in the clean cache. + ================================================================================================== + --> + <Target Name="_CheckForCompileAndLinkOutputs"> + + <!--Record the main compile outputs --> + <CreateItem Include="@(CompileObjOutput)" Condition="Exists('%(FullPath)')"> + <Output TaskParameter="Include" ItemName="FileWrites" /> + </CreateItem> + + <!-- Record the link ouput --> + <CreateItem Include="$(TargetPath)" Condition="Exists('$(TargetPath)')"> + <Output TaskParameter="Include" ItemName="FileWrites" /> + </CreateItem> + + <!-- Record the wixpdb file generated --> + <CreateItem Include="$(TargetPdbPath)" Condition="Exists('$(TargetPdbPath)')"> + <Output TaskParameter="Include" ItemName="FileWrites" /> + </CreateItem> + + <!-- Record the localized link output --> + <CreateItem + Include="$(TargetDir)%(EmbeddedResourceWithCulture.Culture)\$(TargetName)$(TargetExt)" + Condition="Exists('$(TargetDir)%(EmbeddedResourceWithCulture.Culture)\$(TargetName)$(TargetExt)') And '%(EmbeddedResourceWithCulture.Culture)' != ''"> + + <Output TaskParameter="Include" ItemName="FileWrites" /> + </CreateItem> + + <!-- Record the localized wixpdb output --> + <CreateItem + Include="$(TargetDir)%(EmbeddedResourceWithCulture.Culture)\$(TargetName)$(TargetPdbExt)" + Condition="Exists('$(TargetDir)%(EmbeddedResourceWithCulture.Culture)\$(TargetName)$(TargetPdbExt)') And '%(EmbeddedResourceWithCulture.Culture)' != ''"> + + <Output TaskParameter="Include" ItemName="FileWrites" /> + </CreateItem> + </Target> + + <!-- + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + Clean Targets + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + --> + + <!-- + ================================================================================================== + Clean + + Delete all intermediate and final build outputs. + ================================================================================================== + --> + <PropertyGroup> + <CleanDependsOn> + BeforeClean; + CleanReferencedProjects; + CoreClean; + AfterClean + </CleanDependsOn> + </PropertyGroup> + <Target + Name="Clean" + DependsOnTargets="$(CleanDependsOn)" /> + + <!-- + ================================================================================================== + BeforeClean + + Redefine this target in your project in order to run tasks just before Clean. + ================================================================================================== + --> + <Target Name="BeforeClean" /> + + <!-- + ================================================================================================== + AfterClean + + Redefine this target in your project in order to run tasks just after Clean. + ================================================================================================== + --> + <Target Name="AfterClean" /> + + <!-- + ================================================================================================== + CleanReferencedProjects + + Call Clean target on all Referenced Projects. + ================================================================================================== + --> + <Target + Name="CleanReferencedProjects"> + + <!-- TODO --> + <!-- + When building the project directly from the command-line, clean those referenced projects that + exist on disk. For IDE builds and command-line .SLN builds, the solution build manager takes + care of this. + --> + <!--MSBuild + Projects="@(_MSBuildProjectReferenceExistent)" + Targets="Clean" + Condition=" '$(BuildingInsideVisualStudio)' != 'true' and '$(BuildingSolutionFile)' != 'true' and '@(_MSBuildProjectReferenceExistent)' != '' " /--> + + </Target> + + <!-- + ================================================================================================== + CoreClean + + Cleans all of the compile and link outputs as well as any intermediate files generated along + the way. + ================================================================================================== + --> + <PropertyGroup> + <CoreCleanDependsOn></CoreCleanDependsOn> + </PropertyGroup> + <Target + Name="CoreClean" + DependsOnTargets="$(CoreCleanDependsOn)"> + + <!-- Read in list of files that were written to disk in past builds. --> + <ReadLinesFromFile File="$(BaseIntermediateOutputPath)$(CleanFile)"> + <Output TaskParameter="Lines" ItemName="_CleanPriorFileWrites" /> + </ReadLinesFromFile> + + <!-- Find all files in the final output directory. --> + <FindUnderPath Path="$(OutDir)" Files="@(_CleanPriorFileWrites)"> + <Output TaskParameter="InPath" ItemName="_CleanPriorFileWritesInOutput" /> + </FindUnderPath> + + <!-- Find all files in the intermediate output directory. --> + <FindUnderPath Path="$(IntermediateOutputPath)" Files="@(_CleanPriorFileWrites)"> + <Output TaskParameter="InPath" ItemName="_CleanPriorFileWritesInIntermediate" /> + </FindUnderPath> + + <!-- Delete those files. --> + <Delete Files="@(_CleanPriorFileWritesInOutput);@(_CleanPriorFileWritesInIntermediate)" TreatErrorsAsWarnings="true"> + <Output TaskParameter="DeletedFiles" ItemName="_CleanPriorFileWritesDeleted" /> + </Delete> + + <!-- Create a list of everything that wasn't deleted. --> + <CreateItem Include="@(_CleanPriorFileWrites)" Exclude="@(_CleanPriorFileWritesDeleted)"> + <Output TaskParameter="Include" ItemName="_CleanRemainingFileWritesAfterClean" /> + </CreateItem> + + <!-- Remove duplicates. --> + <RemoveDuplicates Inputs="@(_CleanRemainingFileWritesAfterClean)"> + <Output TaskParameter="Filtered" ItemName="_CleanUniqueRemainingFileWrites" /> + </RemoveDuplicates> + + <!-- Make sure the directory exists. --> + <MakeDir Directories="$(BaseIntermediateOutputPath)" /> + + <!-- Write new list of current files back to disk. --> + <WriteLinesToFile File="$(BaseIntermediateOutputPath)$(CleanFile)" Lines="@(_CleanUniqueRemainingFileWrites)" Overwrite="true" /> + + </Target> + + <!-- + ================================================================================================== + _CleanRecordFileWrites + + Save the list of all files written to disk so that it can be used for "Clean" later. + Files written in prior builds are not removed from Clean cache. + ================================================================================================== + --> + <Target + Name="_CleanRecordFileWrites" + DependsOnTargets="_CleanGetCurrentAndPriorFileWrites"> + + <!-- Merge list of files from prior builds with the current build and then remove duplicates. --> + <RemoveDuplicates Inputs="@(_CleanPriorFileWrites);@(_CleanCurrentFileWrites)"> + <Output TaskParameter="Filtered" ItemName="_CleanUniqueFileWrites" /> + </RemoveDuplicates> + + <!-- Make sure the directory exists. --> + <MakeDir Directories="$(BaseIntermediateOutputPath)" /> + + <!-- Write merged file list back to disk, replacing existing contents. --> + <WriteLinesToFile + File="$(BaseIntermediateOutputPath)$(CleanFile)" + Lines="@(_CleanUniqueFileWrites)" + Overwrite="true" /> + + </Target> + + <!-- + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + PostBuildEvent Targets + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + --> + + <!-- + ================================================================================================== + PostBuildEvent + + Run the post-build event. This step is driven by two parameters: + + 1) $(RunPostBuildEvent) is set by the user through the IDE and can be one of four values: + 1) OnBuildSuccess: In this case, every step of the build must succeed for the post-build + step to run. + 2) <Blank>: This is the same as OnBuildSuccess. + 3) OnOutputUpdated: In this case, the post-build step will run only if the main output was + actually updated. + 4) Always: The post-build step is always run. + + 2) $(_TargetOutputTimestampBeforeCompileAndLink) and $(_TargetOutputTimestampAfterCompileAndLink) + are set by the _TimeStampBeforeCompileAndLink and _TimeStampAfterCompileAndLink targets. If + the output was actually rebuilt during this build, then the two values will be different. + ================================================================================================== + --> + <PropertyGroup> + <PostBuildEventDependsOn></PostBuildEventDependsOn> + </PropertyGroup> + <Target + Name="PostBuildEvent" + Condition=" '$(PostBuildEvent)' != '' and + ( '$(RunPostBuildEvent)' != 'OnOutputUpdated' or '$(_TargetOutputTimestampBeforeCompileAndLink)' != '$(_TargetOutputTimestampAfterCompileAndLink)' )" + DependsOnTargets="$(PostBuildEventDependsOn)"> + + <Exec WorkingDirectory="$(OutDir)" Command="$(PostBuildEvent)" /> + </Target> + + <!-- + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + AllProjectOutputGroups Section + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + --> + + <!-- + ================================================================================================== + AllProjectOutputGroups + + The targets below drive output groups, which provide generic information about a + project's inputs (e.g., content files, compilation sources, etc.) and built outputs + (e.g., built EXE/DLL, PDB, XML documentation files, etc.) + + Each target may produce two kinds of items: outputs and dependencies. Outputs are + items from the current project; dependencies are items that are brought into the + current project as a result of referencing other projects or components. + + For both outputs and dependencies, the Include attribute + specifies the location of the output/dependency; it must be a full path. Any number + of additional attributes may be placed on an output/dependency item. + ================================================================================================== + --> + <Target + Name="AllProjectOutputGroups" + DependsOnTargets=" + BuiltProjectOutputGroup; + DebugSymbolsProjectOutputGroup; + DocumentationProjectOutputGroup; + SatelliteDllsProjectOutputGroup; + SourceFilesProjectOutputGroup; + ContentFilesProjectOutputGroup; + SGenFilesOutputGroup" /> + + <!-- + This is the key output for the BuiltProjectOutputGroup and is meant to be read directly from the IDE. + Reading an item is faster than invoking a target. + --> + <ItemGroup> + <BuiltProjectOutputGroupKeyOutput Include="$(TargetPath)"> + <IsKeyOutput>true</IsKeyOutput> + <FinalOutputPath>$(TargetPath)</FinalOutputPath> + <TargetPath>$(TargetFileName)</TargetPath> + </BuiltProjectOutputGroupKeyOutput> + </ItemGroup> + + <!-- + ================================================================================================== + BuiltProjectOutputGroup + ================================================================================================== + --> + <PropertyGroup> + <BuiltProjectOutputGroupDependsOn>PrepareForBuild;AssignCultures</BuiltProjectOutputGroupDependsOn> + <AddAppConfigToBuildOutputs Condition="('$(AddAppConfigToBuildOutputs)' == '') and ('$(OutputType)' != 'library')">true</AddAppConfigToBuildOutputs> + </PropertyGroup> + <Target + Name="BuiltProjectOutputGroup" + Outputs="@(BuiltProjectOutputGroupOutput)" + DependsOnTargets="$(BuiltProjectOutputGroupDependsOn)"> + + <CreateItem Include="@(BuiltProjectOutputGroupKeyOutput)"> + <Output TaskParameter="Include" ItemName="_BuiltProjectOutputGroupOutputIntermediate" /> + </CreateItem> + + <!-- Convert intermediate items into final items; this way we can get the full path for each item --> + <CreateItem Include="@(_BuiltProjectOutputGroupOutputIntermediate->'%(FullPath)')"> + <Output TaskParameter="Include" ItemName="BuiltProjectOutputGroupOutput" /> + </CreateItem> + + <!-- Figure out the localized versions of the output and include if appropriate --> + <CreateItem + Include="$(TargetDir)%(EmbeddedResourceWithCulture.Culture)\$(TargetName)$(TargetExt)" + Condition=" '%(EmbeddedResourceWithCulture.Culture)' != '' "> + + <Output TaskParameter="Include" ItemName="BuiltProjectOutputGroupOutput" /> + </CreateItem> + </Target> + + <!-- + ================================================================================================== + DebugSymbolsProjectOutputGroup + + Populates the Debug Symbols project output group. + ================================================================================================== + --> + <PropertyGroup> + <DebugSymbolsProjectOutputGroupDependsOn>AssignCultures</DebugSymbolsProjectOutputGroupDependsOn> + </PropertyGroup> + <ItemGroup Condition=" '$(_DebugSymbolsProduced)' != 'false' "> + <DebugSymbolsProjectOutputGroupOutput Include="@(_IntermediateOutputPathItem->'%(FullPath)$(TargetName).pdb')"> + <FinalOutputPath>@(_OutputPathItem->'%(FullPath)$(TargetName).pdb')</FinalOutputPath> + <TargetPath>$(TargetName).pdb</TargetPath> + </DebugSymbolsProjectOutputGroupOutput> + </ItemGroup> + <Target + Name="DebugSymbolsProjectOutputGroup" + Outputs="@(DebugSymbolsProjectOutputGroupOutput)" + DependsOnTargets="$(DebugSymbolsProjectOutputGroupDependsOn)"> + + <!-- Include the localized pdb files, if this project is localizable. --> + <CreateItem + Include="$(TargetDir)%(EmbeddedResourceWithCulture.Culture)\$(TargetName)$(TargetPdbExt)" + Condition=" '%(EmbeddedResourceWithCulture.Culture)' != '' "> + + <Output TaskParameter="Include" ItemName="DebugSymbolsProjectOutputGroupOutput" /> + </CreateItem> + </Target> + + <!-- + ================================================================================================== + DocumentationProjectOutputGroup + + Populates the Documentation project output group. + ================================================================================================== + --> + <PropertyGroup> + <DocumentationProjectOutputGroupDependsOn></DocumentationProjectOutputGroupDependsOn> + </PropertyGroup> + <Target + Name="DocumentationProjectOutputGroup" + Outputs="@(DocumentationProjectOutputGroupOutput)" + DependsOnTargets="$(DocumentationProjectOutputGroupDependsOn)" /> + + <!-- + ================================================================================================== + SatelliteDllsProjectOutputGroup + + Populates the Satellite Files project output group. + ================================================================================================== + --> + <PropertyGroup> + <SatelliteDllsProjectOutputGroupDependsOn>PrepareForBuild</SatelliteDllsProjectOutputGroupDependsOn> + </PropertyGroup> + <Target + Name="SatelliteDllsProjectOutputGroup" + Outputs="@(SatelliteDllsProjectOutputGroupOutput)" + DependsOnTargets="$(SatelliteDllsProjectOutputGroupDependsOn)" /> + + <!-- + ================================================================================================== + SourceFilesProjectOutputGroup + + Populates the Source Files project output group. + Source files are items in the project whose type is "Compile" and "EmbeddedResource". + ================================================================================================== + --> + <PropertyGroup> + <SourceFilesProjectOutputGroupDependsOn>PrepareForBuild</SourceFilesProjectOutputGroupDependsOn> + </PropertyGroup> + <Target + Name="SourceFilesProjectOutputGroup" + Outputs="@(SourceFilesProjectOutputGroupOutput)" + DependsOnTargets="$(SourceFilesProjectOutputGroupDependsOn)"> + + <AssignTargetPath Files="@(Compile)" RootFolder="$(MSBuildProjectDirectory)"> + <Output TaskParameter="AssignedFiles" ItemName="_CompileWithTargetPath" /> + </AssignTargetPath> + + <AssignTargetPath Files="@(EmbeddedResource)" RootFolder="$(MSBuildProjectDirectory)"> + <Output TaskParameter="AssignedFiles" ItemName="_EmbeddedResourceWithTargetPath" /> + </AssignTargetPath> + + <!-- First we deal with Compile and EmbeddedResource --> + <CreateItem Include="@(_CompileWithTargetPath->'%(FullPath)');@(_EmbeddedResourceWithTargetPath->'%(FullPath)')"> + <Output TaskParameter="Include" ItemName="SourceFilesProjectOutputGroupOutput" /> + </CreateItem> + + <!-- Include the project file --> + <CreateItem Include="$(MSBuildProjectFullPath)" AdditionalMetadata="TargetPath=$(ProjectFileName)"> + <Output TaskParameter="Include" ItemName="SourceFilesProjectOutputGroupOutput" /> + </CreateItem> + + </Target> + + <!-- + ================================================================================================== + ContentFilesProjectOutputGroup + + Populates the Content Files project output group. + Content files are items in the project whose type is "Content". + ================================================================================================== + --> + <PropertyGroup> + <ContentFilesProjectOutputGroupDependsOn>PrepareForBuild</ContentFilesProjectOutputGroupDependsOn> + </PropertyGroup> + <Target + Name="ContentFilesProjectOutputGroup" + Outputs="@(ContentFilesProjectOutputGroupOutput)" + DependsOnTargets="$(ContentFilesProjectOutputGroupDependsOn)"> + + <AssignTargetPath Files="@(Content)" RootFolder="$(MSBuildProjectDirectory)"> + <Output TaskParameter="AssignedFiles" ItemName="ContentWithTargetPath" /> + </AssignTargetPath> + + <!-- Convert items into final items; this way we can get the full path for each item. --> + <CreateItem Include="@(ContentWithTargetPath->'%(FullPath)')"> + <Output TaskParameter="Include" ItemName="ContentFilesProjectOutputGroupOutput" /> + </CreateItem> + + </Target> + + <!-- + ================================================================================================== + SGenFilesOutputGroup + + Populates the GenerateSerializationAssemblies Files project output group. + GenerateSerializationAssemblies files are those generated by the GenerateSerializationAssemblies + target and task. + ================================================================================================== + --> + <PropertyGroup> + <SGenFilesOutputGroupDependsOn></SGenFilesOutputGroupDependsOn> + </PropertyGroup> + <Target + Name="SGenFilesOutputGroup" + Outputs="@(SGenFilesOutputGroupOutput)" + DependsOnTargets="$(SGenFilesOutputGroupDependsOn)" /> + + <!-- Extension point: Define CustomAfterWixTargets to a .targets file that you want to include after this file. --> + <Import Project="$(CustomAfterWixTargets)" Condition=" '$(CustomAfterWixTargets)' != '' and Exists('$(CustomAfterWixTargets)')" /> + +</Project> diff --git a/src/Tools/wix/wui.dll b/src/Tools/wix/wui.dll new file mode 100755 index 0000000000..5cf166c5c1 Binary files /dev/null and b/src/Tools/wix/wui.dll differ