From mono-patches-list at lists.ximian.com Tue Sep 1 00:00:39 2009 From: mono-patches-list at lists.ximian.com (Ankit Jain (radical@corewars.org)) Date: Tue, 1 Sep 2009 00:00:39 -0400 (EDT) Subject: [Mono-patches] r140998 - in trunk/mcs/class: Microsoft.Build.Engine/Microsoft.Build.BuildEngine Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks Message-ID: <20090901040039.396C09472C@mono-cvs.ximian.com> Author: ankit Date: 2009-09-01 00:00:38 -0400 (Tue, 01 Sep 2009) New Revision: 140998 Modified: trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BatchingImplBase.cs trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionFactorExpresion.cs trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Expression.cs trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ItemReference.cs trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/MetadataReference.cs trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TargetBatchingImpl.cs trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/UsingTask.cs trunk/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ChangeLog trunk/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TaskBatchingTest.cs Log: In class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine: * Expression.cs (ParseOptions): New enum. Replace the bool params of exression.Parse with this. Add option to control expansion of metadata references. (CopyToExpressionCollection): Track api changes. Update all expr.Parse calls to use the new enum. * BuildItem.cs, BuildProperty.cs, BuildTask.cs, Import.cs, Target.cs, TargetBatchingImpl.cs, UsingTask.cs: Track api changes. * BatchingImplBase.cs: Track api changes. Allow metadata refs in task attributes. * ConditionFactorExpression.cs: Allow metadata refs in conditions. * ItemReference.cs: Allow metadata in transforms. * TaskEngine.cs: Allow metadata refs. * MetadataReference.cs (.ctor): Add a 'original string' param. In class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks: * TaskBatchingTest.cs: Add new tests for metadata refs found in places other than task attributes. Modified: trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BatchingImplBase.cs =================================================================== --- trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BatchingImplBase.cs 2009-09-01 03:14:07 UTC (rev 140997) +++ trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BatchingImplBase.cs 2009-09-01 04:00:38 UTC (rev 140998) @@ -106,7 +106,7 @@ protected void ParseAttribute (string value) { Expression expr = new Expression (); - expr.Parse (value, true); + expr.Parse (value, ParseOptions.AllowItemsMetadataAndSplit); foreach (object o in expr.Collection) { MetadataReference mr = o as MetadataReference; Modified: trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs =================================================================== --- trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs 2009-09-01 03:14:07 UTC (rev 140997) +++ trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs 2009-09-01 04:00:38 UTC (rev 140998) @@ -227,7 +227,7 @@ { if (parent_item_group != null) { Expression e = new Expression (); - e.Parse (value, true); + e.Parse (value, ParseOptions.AllowItemsNoMetadataAndSplit); evaluatedMetadata [name] = (string) e.ConvertTo (parent_item_group.ParentProject, typeof (string), ExpressionOptions.ExpandItemRefs); } else @@ -264,9 +264,9 @@ string includes, excludes; includeExpr = new Expression (); - includeExpr.Parse (Include, true); + includeExpr.Parse (Include, ParseOptions.AllowItemsNoMetadataAndSplit); excludeExpr = new Expression (); - excludeExpr.Parse (Exclude, true); + excludeExpr.Parse (Exclude, ParseOptions.AllowItemsNoMetadataAndSplit); includes = (string) includeExpr.ConvertTo (project, typeof (string), ExpressionOptions.ExpandItemRefs); excludes = (string) excludeExpr.ConvertTo (project, typeof (string), ExpressionOptions.ExpandItemRefs); @@ -360,7 +360,7 @@ // but letting this be here, incase BI.ConvertTo* // is called directly Expression expr = new Expression (); - expr.Parse (finalItemSpec, true); + expr.Parse (finalItemSpec, ParseOptions.AllowItemsNoMetadataAndSplit); return (string) expr.ConvertTo (parent_item_group.ParentProject, typeof (string), ExpressionOptions.ExpandItemRefs); Modified: trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs =================================================================== --- trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs 2009-09-01 03:14:07 UTC (rev 140997) +++ trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs 2009-09-01 04:00:38 UTC (rev 140998) @@ -122,7 +122,7 @@ // In evaluate phase, properties are not expanded Expression exp = new Expression (); - exp.Parse (Value, false, false); + exp.Parse (Value, ParseOptions.None); evaluated.finalValue = (string) exp.ConvertTo (parentProject, typeof (string), ExpressionOptions.DoNotExpandItemRefs); @@ -150,7 +150,8 @@ Expression exp = new Expression (); // in non-evaluation phase, properties are always expanded - exp.Parse (FinalValue, options == ExpressionOptions.ExpandItemRefs, false); + exp.Parse (FinalValue, options == ExpressionOptions.ExpandItemRefs ? + ParseOptions.AllowItems : ParseOptions.None); return (string) exp.ConvertTo (project, typeof (string), options); } finally { converting = false; @@ -172,7 +173,8 @@ Expression exp = new Expression (); // in non-evaluation phase, properties are always expanded - exp.Parse (FinalValue, options == ExpressionOptions.ExpandItemRefs, false); + exp.Parse (FinalValue, options == ExpressionOptions.ExpandItemRefs ? + ParseOptions.AllowItems : ParseOptions.None); return (ITaskItem[]) exp.ConvertTo (project, typeof (ITaskItem[]), options); } finally { converting = false; Modified: trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs =================================================================== --- trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs 2009-09-01 03:14:07 UTC (rev 140997) +++ trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs 2009-09-01 04:00:38 UTC (rev 140998) @@ -230,7 +230,7 @@ return false; else { Expression exp = new Expression (); - exp.Parse (str, true); + exp.Parse (str, ParseOptions.AllowItemsNoMetadataAndSplit); return (bool) exp.ConvertTo (parentTarget.Project, typeof (bool), ExpressionOptions.ExpandItemRefs); } Modified: trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog =================================================================== --- trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog 2009-09-01 03:14:07 UTC (rev 140997) +++ trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog 2009-09-01 04:00:38 UTC (rev 140998) @@ -1,3 +1,22 @@ +2009-09-01 Ankit Jain + + * Expression.cs (ParseOptions): New enum. Replace the bool params + of exression.Parse with this. Add option to control expansion of + metadata references. + (CopyToExpressionCollection): Track api changes. + + Update all expr.Parse calls to use the new enum. + * BuildItem.cs, BuildProperty.cs, BuildTask.cs, Import.cs, + Target.cs, TargetBatchingImpl.cs, UsingTask.cs: Track api changes. + + * BatchingImplBase.cs: Track api changes. Allow metadata refs + in task attributes. + * ConditionFactorExpression.cs: Allow metadata refs in conditions. + * ItemReference.cs: Allow metadata in transforms. + * TaskEngine.cs: Allow metadata refs. + + * MetadataReference.cs (.ctor): Add a 'original string' param. + 2009-08-29 Ankit Jain * Expression.cs (ExpressionOptions): New. Modified: trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionFactorExpresion.cs =================================================================== --- trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionFactorExpresion.cs 2009-09-01 03:14:07 UTC (rev 140997) +++ trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionFactorExpresion.cs 2009-09-01 04:00:38 UTC (rev 140998) @@ -122,7 +122,7 @@ static Token EvaluateToken (Token token, Project context) { Expression oe = new Expression (); - oe.Parse (token.Value, true); + oe.Parse (token.Value, ParseOptions.AllowItemsMetadataAndSplit); return new Token ((string) oe.ConvertTo (context, typeof (string)), token.Type); } } Modified: trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Expression.cs =================================================================== --- trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Expression.cs 2009-09-01 03:14:07 UTC (rev 140997) +++ trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Expression.cs 2009-09-01 04:00:38 UTC (rev 140998) @@ -65,18 +65,19 @@ this.expressionCollection = new ExpressionCollection (); } - public void Parse (string expression, bool allowItems) - { - Parse (expression, allowItems, true); - } - - // @split: Split on ';' + // Split: Split on ';' // Eg. Property values don't need to be split // - // @allowItems: item refs should not be treated as item refs! + // AllowItems: if false, item refs should not be treated as item refs! // it converts them to strings in the final expressionCollection - public void Parse (string expression, bool allowItems, bool split) + // + // AllowMetadata: same as AllowItems, for metadata + public void Parse (string expression, ParseOptions options) { + bool split = (options & ParseOptions.Split) == ParseOptions.Split; + bool allowItems = (options & ParseOptions.AllowItems) == ParseOptions.AllowItems; + bool allowMd = (options & ParseOptions.AllowMetadata) == ParseOptions.AllowMetadata; + expression = expression.Replace ('/', Path.DirectorySeparatorChar); expression = expression.Replace ('\\', Path.DirectorySeparatorChar); @@ -117,7 +118,7 @@ } } - CopyToExpressionCollection (p3, allowItems); + CopyToExpressionCollection (p3, allowItems, allowMd); } void Prepare (List l, int length) @@ -126,7 +127,7 @@ l.Add (null); } - void CopyToExpressionCollection (List lists, bool allowItems) + void CopyToExpressionCollection (List lists, bool allowItems, bool allowMd) { for (int i = 0; i < lists.Count; i++) { foreach (object o in lists [i]) { @@ -134,6 +135,9 @@ expressionCollection.Add (Utilities.Unescape ((string) o)); else if (!allowItems && o is ItemReference) expressionCollection.Add (((ItemReference) o).OriginalString); + else if (!allowMd && o is MetadataReference) { + expressionCollection.Add (((MetadataReference) o).OriginalString); + } else if (o is IReference) expressionCollection.Add ((IReference) o); } @@ -246,7 +250,8 @@ meta = m.Groups [MetadataRegex.GroupNumberFromName ("meta")].Value; - mr = new MetadataReference (name, meta, m.Groups [0].Index, m.Groups [0].Length); + mr = new MetadataReference (text.Substring (m.Groups [0].Index, m.Groups [0].Length), + name, meta, m.Groups [0].Index, m.Groups [0].Length); phase1.Add (mr); m = m.NextMatch (); } @@ -326,6 +331,21 @@ } } + [Flags] + enum ParseOptions { + // absence of one of these flags, means + // false for that option + AllowItems = 0x1, + Split = 0x2, + AllowMetadata = 0x4, + + None = 0x8, // == no items, no metadata, and no split + + // commonly used options + AllowItemsMetadataAndSplit = AllowItems | Split | AllowMetadata, + AllowItemsNoMetadataAndSplit = AllowItems | Split + } + enum ExpressionOptions { ExpandItemRefs, DoNotExpandItemRefs Modified: trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs =================================================================== --- trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs 2009-09-01 03:14:07 UTC (rev 140997) +++ trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs 2009-09-01 04:00:38 UTC (rev 140998) @@ -81,7 +81,7 @@ Expression exp; exp = new Expression (); - exp.Parse (file, false); + exp.Parse (file, ParseOptions.Split); return (string) exp.ConvertTo (project, typeof (string)); } Modified: trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ItemReference.cs =================================================================== --- trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ItemReference.cs 2009-09-01 03:14:07 UTC (rev 140997) +++ trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ItemReference.cs 2009-09-01 04:00:38 UTC (rev 140998) @@ -53,12 +53,12 @@ // Transform and separator are never expanded for item refs if (transform != null) { this.transform = new Expression (); - this.transform.Parse (transform, false); + this.transform.Parse (transform, ParseOptions.AllowMetadata | ParseOptions.Split); } if (separator != null) { this.separator = new Expression (); - this.separator.Parse (separator, false); + this.separator.Parse (separator, ParseOptions.Split); } } Modified: trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/MetadataReference.cs =================================================================== --- trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/MetadataReference.cs 2009-09-01 03:14:07 UTC (rev 140997) +++ trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/MetadataReference.cs 2009-09-01 04:00:38 UTC (rev 140998) @@ -40,9 +40,11 @@ string metadataName; int start; int length; + string original; - public MetadataReference (string itemName, string metadataName, int start, int length) + public MetadataReference (string original, string itemName, string metadataName, int start, int length) { + this.original = original; this.itemName = itemName; this.metadataName = metadataName; this.start = start; @@ -128,6 +130,10 @@ else return String.Format ("%({0})", metadataName); } + + public string OriginalString { + get { return original; } + } } } Modified: trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs =================================================================== --- trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs 2009-09-01 03:14:07 UTC (rev 140997) +++ trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs 2009-09-01 04:00:38 UTC (rev 140998) @@ -157,7 +157,7 @@ if (DependsOnTargets != String.Empty) { deps = new Expression (); - deps.Parse (DependsOnTargets, true); + deps.Parse (DependsOnTargets, ParseOptions.AllowItemsNoMetadataAndSplit); targetNames = (string []) deps.ConvertTo (Project, typeof (string [])); foreach (string dep_name in targetNames) { t = project.Targets [dep_name.Trim ()]; @@ -291,7 +291,7 @@ return new ITaskItem [0]; Expression e = new Expression (); - e.Parse (outputs, true); + e.Parse (outputs, ParseOptions.AllowItemsNoMetadataAndSplit); return (ITaskItem []) e.ConvertTo (project, typeof (ITaskItem [])); } Modified: trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TargetBatchingImpl.cs =================================================================== --- trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TargetBatchingImpl.cs 2009-09-01 03:14:07 UTC (rev 140997) +++ trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TargetBatchingImpl.cs 2009-09-01 04:00:38 UTC (rev 140998) @@ -176,11 +176,11 @@ return true; Expression e = new Expression (); - e.Parse (inputs, true); + e.Parse (inputs, ParseOptions.AllowItemsNoMetadataAndSplit); inputFiles = (ITaskItem[]) e.ConvertTo (project, typeof (ITaskItem[]), ExpressionOptions.ExpandItemRefs); e = new Expression (); - e.Parse (outputs, true); + e.Parse (outputs, ParseOptions.AllowItemsNoMetadataAndSplit); outputFiles = (ITaskItem[]) e.ConvertTo (project, typeof (ITaskItem[]), ExpressionOptions.ExpandItemRefs); if (inputFiles == null || inputFiles.Length == 0) Modified: trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs =================================================================== --- trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs 2009-09-01 03:14:07 UTC (rev 140997) +++ trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs 2009-09-01 04:00:38 UTC (rev 140998) @@ -225,7 +225,7 @@ result = null; e = new Expression (); - e.Parse (raw, true); + e.Parse (raw, ParseOptions.AllowItemsMetadataAndSplit); // See rules in comment for 'Prepare' string str = (string) e.ConvertTo (parentProject, typeof (string)); Modified: trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/UsingTask.cs =================================================================== --- trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/UsingTask.cs 2009-09-01 03:14:07 UTC (rev 140997) +++ trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/UsingTask.cs 2009-09-01 04:00:38 UTC (rev 140998) @@ -73,7 +73,7 @@ } else if (AssemblyFile != null) { Expression exp = new Expression (); // FIXME: test it - exp.Parse (AssemblyFile, false); + exp.Parse (AssemblyFile, ParseOptions.Split); string filename = (string) exp.ConvertTo (project, typeof (string)); if (Path.IsPathRooted (filename) == false) { Modified: trunk/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ChangeLog =================================================================== --- trunk/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ChangeLog 2009-09-01 03:14:07 UTC (rev 140997) +++ trunk/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ChangeLog 2009-09-01 04:00:38 UTC (rev 140998) @@ -1,3 +1,8 @@ +2009-09-01 Ankit Jain + + * TaskBatchingTest.cs: Add new tests for metadata refs found + in places other than task attributes. + 2009-08-28 Ankit Jain * CopyTest.cs (TestCopy_EmptySources): New. Modified: trunk/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TaskBatchingTest.cs =================================================================== --- trunk/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TaskBatchingTest.cs 2009-09-01 03:14:07 UTC (rev 140997) +++ trunk/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TaskBatchingTest.cs 2009-09-01 04:00:38 UTC (rev 140998) @@ -507,6 +507,110 @@ CheckEngineEventCounts (testLogger, 1, 1, 2, 2); } + [Test] + // test for metadata refs in properties or items + public void TestNoBatching () { + string projectString = @" + + + + + + + %(item0.Identity) + + + + + +"; + + Engine engine = new Engine (Consts.BinPath); + Project project = engine.CreateNewProject (); + + TestMessageLogger testLogger = new TestMessageLogger (); + engine.RegisterLogger (testLogger); + + project.LoadXml (projectString); + if (!project.Build ("1")) { + testLogger.DumpMessages (); + Assert.Fail ("Build failed"); + } + + testLogger.CheckLoggedMessageHead ("Prop1: %(item0.Identity)", "A1"); + testLogger.CheckLoggedMessageHead ("Item2: %(item3.Identity)", "A2"); + Assert.AreEqual (0, testLogger.NormalMessageCount, "Unexpected extra messages found"); + } + + [Test] + // test for metadata refs via metadata refs + // batching should happen only on basis of the task attributes, + // and not the resolved expression values + public void TestBatching1 () { + string projectString = @" + + + + + + + + + + +"; + + Engine engine = new Engine (Consts.BinPath); + Project project = engine.CreateNewProject (); + + TestMessageLogger testLogger = new TestMessageLogger (); + engine.RegisterLogger (testLogger); + + project.LoadXml (projectString); + if (!project.Build ("1")) { + testLogger.DumpMessages (); + Assert.Fail ("Build failed"); + } + + testLogger.CheckLoggedMessageHead ("Item4: %(item2.Identity)", "A1"); + testLogger.CheckLoggedMessageHead ("Item4: foo", "A2"); + testLogger.CheckLoggedMessageHead ("Item4: bar", "A3"); + Assert.AreEqual (0, testLogger.NormalMessageCount, "Unexpected extra messages found"); + } + + [Test] + // test for metadata refs via metadata refs + // batching should happen only on basis of the task attributes, + // and not the resolved expression values + public void TestConditionalBatching2 () { + string projectString = @" + + + + + + + + +"; + + Engine engine = new Engine (Consts.BinPath); + Project project = engine.CreateNewProject (); + + TestMessageLogger testLogger = new TestMessageLogger (); + engine.RegisterLogger (testLogger); + + project.LoadXml (projectString); + if (!project.Build ("1")) { + testLogger.DumpMessages (); + Assert.Fail ("Build failed"); + } + + testLogger.CheckLoggedMessageHead ("Item3: %(item3.Identity)", "A1"); + testLogger.CheckLoggedMessageHead ("Item4: %(item2.Identity)", "A2"); + Assert.AreEqual (0, testLogger.NormalMessageCount, "Unexpected extra messages found"); + } + //Target batching [Test] From mono-patches-list at lists.ximian.com Tue Sep 1 00:04:11 2009 From: mono-patches-list at lists.ximian.com (Ankit Jain (radical@corewars.org)) Date: Tue, 1 Sep 2009 00:04:11 -0400 (EDT) Subject: [Mono-patches] r140999 - trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine Message-ID: <20090901040411.BCE529472C@mono-cvs.ximian.com> Author: ankit Date: 2009-09-01 00:04:11 -0400 (Tue, 01 Sep 2009) New Revision: 140999 Modified: trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/DirectoryScanner.cs Log: * DirectoryScanner.cs (Scan): Ignore empty entries in includes and excludes. Modified: trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog =================================================================== --- trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog 2009-09-01 04:00:38 UTC (rev 140998) +++ trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog 2009-09-01 04:04:11 UTC (rev 140999) @@ -1,5 +1,10 @@ 2009-09-01 Ankit Jain + * DirectoryScanner.cs (Scan): Ignore empty entries in includes and + excludes. + +2009-09-01 Ankit Jain + * Expression.cs (ParseOptions): New enum. Replace the bool params of exression.Parse with this. Add option to control expansion of metadata references. Modified: trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/DirectoryScanner.cs =================================================================== --- trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/DirectoryScanner.cs 2009-09-01 04:00:38 UTC (rev 140998) +++ trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/DirectoryScanner.cs 2009-09-01 04:04:11 UTC (rev 140999) @@ -59,8 +59,8 @@ excludedItems = new Dictionary (); includedItems = new List (); - splitInclude = includes.Split (';'); - splitExclude = excludes.Split (';'); + splitInclude = includes.Split (new char[] {';'}, StringSplitOptions.RemoveEmptyEntries); + splitExclude = excludes.Split (new char[] {';'}, StringSplitOptions.RemoveEmptyEntries); if (excludes != String.Empty) { foreach (string si in splitExclude) { From mono-patches-list at lists.ximian.com Tue Sep 1 00:04:29 2009 From: mono-patches-list at lists.ximian.com (Ankit Jain (radical@corewars.org)) Date: Tue, 1 Sep 2009 00:04:29 -0400 (EDT) Subject: [Mono-patches] r141000 - trunk/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks Message-ID: <20090901040429.6C9629472C@mono-cvs.ximian.com> Author: ankit Date: 2009-09-01 00:04:29 -0400 (Tue, 01 Sep 2009) New Revision: 141000 Modified: trunk/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog trunk/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs Log: * ResolveAssemblyReference.cs (ResolveReference): targetFrameworkDirectories can be null. Modified: trunk/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog =================================================================== --- trunk/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog 2009-09-01 04:04:11 UTC (rev 140999) +++ trunk/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog 2009-09-01 04:04:29 UTC (rev 141000) @@ -1,3 +1,8 @@ +2009-09-01 Ankit Jain + + * ResolveAssemblyReference.cs (ResolveReference): targetFrameworkDirectories + can be null. + 2009-08-28 Ankit Jain * AssignCulture.cs, AssignTargetPath.cs, Modified: trunk/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs =================================================================== --- trunk/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs 2009-09-01 04:04:11 UTC (rev 140999) +++ trunk/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs 2009-09-01 04:04:29 UTC (rev 141000) @@ -193,6 +193,8 @@ if (String.Compare (spath, "{HintPathFromItem}") == 0) { resolved = assembly_resolver.ResolveHintPathReference (item, specific_version); } else if (String.Compare (spath, "{TargetFrameworkDirectory}") == 0) { + if (targetFrameworkDirectories == null) + continue; foreach (string fpath in targetFrameworkDirectories) { resolved = assembly_resolver.FindInTargetFramework (item, fpath, specific_version); From mono-patches-list at lists.ximian.com Tue Sep 1 00:28:36 2009 From: mono-patches-list at lists.ximian.com (Geoff Norton (gnorton@novell.com)) Date: Tue, 1 Sep 2009 00:28:36 -0400 (EDT) Subject: [Mono-patches] r141001 - trunk/mono/mono/mini Message-ID: <20090901042836.929589472C@mono-cvs.ximian.com> Author: gnorton Date: 2009-09-01 00:28:29 -0400 (Tue, 01 Sep 2009) New Revision: 141001 Modified: trunk/mono/mono/mini/ChangeLog trunk/mono/mono/mini/mini.c Log: 2009-09-01 Geoff Norton * mini.c (mono_get_lmf_addr): Fix jit_thread_attach for native to managed wrappers in full aot. Modified: trunk/mono/mono/mini/ChangeLog =================================================================== --- trunk/mono/mono/mini/ChangeLog 2009-09-01 04:04:29 UTC (rev 141000) +++ trunk/mono/mono/mini/ChangeLog 2009-09-01 04:28:29 UTC (rev 141001) @@ -1,3 +1,8 @@ +2009-09-01 Geoff Norton + + * mini.c (mono_get_lmf_addr): Fix jit_thread_attach for native to + managed wrappers in full aot. + 2009-08-31 Zoltan Varga * exceptions-x86.c (get_throw_exception): Align the stack on osx. Modified: trunk/mono/mono/mini/mini.c =================================================================== --- trunk/mono/mono/mini/mini.c 2009-09-01 04:04:29 UTC (rev 141000) +++ trunk/mono/mono/mini/mini.c 2009-09-01 04:28:29 UTC (rev 141001) @@ -2163,6 +2163,19 @@ if ((jit_tls = TlsGetValue (mono_jit_tls_id))) return &jit_tls->lmf; + /* + * When resolving the call to mono_jit_thread_attach full-aot will look + * in the plt, which causes a call into the generic trampoline, which in turn + * tries to resolve the lmf_addr creating a cyclic dependency. We cannot + * call mono_jit_thread_attach from the native-to-managed wrapper, without + * mono_get_lmf_addr, and mono_get_lmf_addr requires the thread to be attached. + */ + + mono_jit_thread_attach (NULL); + + if ((jit_tls = TlsGetValue (mono_jit_tls_id))) + return &jit_tls->lmf; + g_assert_not_reached (); return NULL; #endif From mono-patches-list at lists.ximian.com Tue Sep 1 02:11:38 2009 From: mono-patches-list at lists.ximian.com (Mike Krüger (mkrueger@novell.com)) Date: Tue, 1 Sep 2009 02:11:38 -0400 (EDT) Subject: [Mono-patches] r141002 - in trunk/monodevelop/main/src/addins/MonoDevelop.Gettext: . MonoDevelop.Gettext.Editor Message-ID: <20090901061138.690369472C@mono-cvs.ximian.com> Author: mkrueger Date: 2009-09-01 02:11:38 -0400 (Tue, 01 Sep 2009) New Revision: 141002 Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Gettext/ChangeLog trunk/monodevelop/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs Log: * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Show file icon in found in list. Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Gettext/ChangeLog =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Gettext/ChangeLog 2009-09-01 04:28:29 UTC (rev 141001) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Gettext/ChangeLog 2009-09-01 06:11:38 UTC (rev 141002) @@ -1,3 +1,8 @@ +2009-09-01 Mike Kr?ger + + * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Show file icon + in found in list. + 2009-08-31 Lluis Sanchez Gual * MonoDevelop.Gettext.addin.xml: Don't use the text editor Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs 2009-09-01 04:28:29 UTC (rev 141001) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs 2009-09-01 06:11:38 UTC (rev 141002) @@ -144,17 +144,26 @@ treeviewEntries.GetColumn (3).Resizable = true; treeviewEntries.GetColumn (3).Expand = true; // found in tree view - foundInStore = new ListStore (typeof (string), typeof (string), typeof (string)); + foundInStore = new ListStore (typeof (string), typeof (string), typeof (string), typeof (Pixbuf)); this.treeviewFoundIn.Model = foundInStore; - treeviewFoundIn.AppendColumn ("", new CellRendererText (), "text", FoundInColumns.File); + TreeViewColumn fileColumn = new TreeViewColumn (); + CellRendererPixbuf pixbufRenderer = new CellRendererPixbuf (); + fileColumn.PackStart (pixbufRenderer, false); + fileColumn.SetAttributes (pixbufRenderer, "pixbuf", FoundInColumns.Pixbuf); + + CellRendererText textRenderer = new CellRendererText (); + fileColumn.PackStart (textRenderer, true); + fileColumn.SetAttributes (textRenderer, "text", FoundInColumns.File); + treeviewFoundIn.AppendColumn (fileColumn); + treeviewFoundIn.AppendColumn ("", new CellRendererText (), "text", FoundInColumns.Line); treeviewFoundIn.HeadersVisible = false; treeviewFoundIn.GetColumn (1).FixedWidth = 100; treeviewFoundIn.RowActivated += delegate (object sender, RowActivatedArgs e) { Gtk.TreeIter iter; - foundInStore.GetIter (out iter, e.Path); + foundInStore.GetIter (out iter, e.Path); string line = foundInStore.GetValue (iter, (int)FoundInColumns.Line) as string; string file = foundInStore.GetValue (iter, (int)FoundInColumns.FullFileName) as string; int lineNr = 1; @@ -632,7 +641,7 @@ line = "?"; } string fullName = System.IO.Path.Combine (System.IO.Path.GetDirectoryName (this.poFileName), file); - this.foundInStore.AppendValues (file, line, fullName); + this.foundInStore.AppendValues (file, line, fullName, DesktopService.GetPixbufForFile (fullName, IconSize.Menu)); } } @@ -665,7 +674,8 @@ { File, Line, - FullFileName + FullFileName, + Pixbuf } protected override void OnStyleSet (Gtk.Style previous_style) From mono-patches-list at lists.ximian.com Tue Sep 1 02:24:35 2009 From: mono-patches-list at lists.ximian.com (Mike Krüger (mkrueger@novell.com)) Date: Tue, 1 Sep 2009 02:24:35 -0400 (EDT) Subject: [Mono-patches] r141003 - in trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring: . MonoDevelop.Refactoring Message-ID: <20090901062435.C35529472C@mono-cvs.ximian.com> Author: mkrueger Date: 2009-09-01 02:24:35 -0400 (Tue, 01 Sep 2009) New Revision: 141003 Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/ChangeLog trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs Log: * MonoDevelop.Refactoring/RefactoryCommands.cs: ResolvedType is no longer used for the resolve namespace feature. Therefore replaced the check with an expression check. Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/ChangeLog =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/ChangeLog 2009-09-01 06:11:38 UTC (rev 141002) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/ChangeLog 2009-09-01 06:24:35 UTC (rev 141003) @@ -1,3 +1,9 @@ +2009-09-01 Mike Kr?ger + + * MonoDevelop.Refactoring/RefactoryCommands.cs: ResolvedType + is no longer used for the resolve namespace feature. + Therefore replaced the check with an expression check. + 2009-08-31 Mike Kr?ger * MonoDevelop.Refactoring/RefactoringOptions.cs: Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs 2009-09-01 06:11:38 UTC (rev 141002) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs 2009-09-01 06:24:35 UTC (rev 141003) @@ -169,7 +169,7 @@ eitem = null; } } - if (resolveResult != null && resolveResult.ResolvedType != null) { + if (resolveResult != null && resolveResult.ResolvedExpression != null && !string.IsNullOrEmpty (resolveResult.ResolvedExpression.Expression)) { IReturnType returnType = new DomReturnType (resolveResult.ResolvedExpression.Expression); List namespaces = new List (ctx.ResolvePossibleNamespaces (returnType)); if (item == null || namespaces.Count > 1) { From mono-patches-list at lists.ximian.com Tue Sep 1 02:41:15 2009 From: mono-patches-list at lists.ximian.com (Mike Krüger (mkrueger@novell.com)) Date: Tue, 1 Sep 2009 02:41:15 -0400 (EDT) Subject: [Mono-patches] r141004 - in trunk/monodevelop/main/src/core/MonoDevelop.Projects: . MonoDevelop.Projects.Dom Message-ID: <20090901064115.2D4099472C@mono-cvs.ximian.com> Author: mkrueger Date: 2009-09-01 02:41:14 -0400 (Tue, 01 Sep 2009) New Revision: 141004 Modified: trunk/monodevelop/main/src/core/MonoDevelop.Projects/ChangeLog trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/CompilationUnit.cs trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomUsing.cs trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/ICompilationUnit.cs Log: * MonoDevelop.Projects.Dom/DomUsing.cs: * MonoDevelop.Projects.Dom/CompilationUnit.cs: * MonoDevelop.Projects.Dom/ICompilationUnit.cs: Added some helper functions. Modified: trunk/monodevelop/main/src/core/MonoDevelop.Projects/ChangeLog =================================================================== --- trunk/monodevelop/main/src/core/MonoDevelop.Projects/ChangeLog 2009-09-01 06:24:35 UTC (rev 141003) +++ trunk/monodevelop/main/src/core/MonoDevelop.Projects/ChangeLog 2009-09-01 06:41:14 UTC (rev 141004) @@ -1,3 +1,10 @@ +2009-09-01 Mike Kr?ger + + * MonoDevelop.Projects.Dom/DomUsing.cs: + * MonoDevelop.Projects.Dom/CompilationUnit.cs: + * MonoDevelop.Projects.Dom/ICompilationUnit.cs: Added some + helper functions. + 2009-08-31 Lluis Sanchez Gual * MonoDevelop.Projects.Formats.MSBuild\SlnFileFormat.cs: Fix Modified: trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/CompilationUnit.cs =================================================================== --- trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/CompilationUnit.cs 2009-09-01 06:24:35 UTC (rev 141003) +++ trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/CompilationUnit.cs 2009-09-01 06:41:14 UTC (rev 141004) @@ -27,6 +27,7 @@ // using System; +using System.Linq; using System.Collections.Generic; using System.Collections.ObjectModel; using MonoDevelop.Core; @@ -98,11 +99,21 @@ } return null; } + + public IType GetTypeAt (DomLocation location) + { + return GetTypeAt (location.Line, location.Column); + } + public IType GetTypeAt (int line, int column) { return GetTypeAt (types, line, column); } + public IMember GetMemberAt (DomLocation location) + { + return GetMemberAt (location.Line, location.Column); + } public IMember GetMemberAt (int line, int column) { IType type = GetTypeAt (line, column); @@ -129,6 +140,16 @@ types.Add (newType); } + public bool IsNamespaceUsedAt (string name, int line, int column) + { + return IsNamespaceUsedAt (name, new DomLocation (line, column)); + } + + public bool IsNamespaceUsedAt (string name, DomLocation location) + { + return usings.Where (u => ((!u.IsFromNamespace && u.Region.Start < location) || u.Region.Contains (location)) && u.Namespaces.Contains (name)).Any (); + } + public void GetNamespaceContents (List list, string subNamespace, bool caseSensitive) { foreach (IType type in Types) { Modified: trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomUsing.cs =================================================================== --- trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomUsing.cs 2009-09-01 06:24:35 UTC (rev 141003) +++ trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/DomUsing.cs 2009-09-01 06:41:14 UTC (rev 141004) @@ -92,5 +92,11 @@ { return visitor.Visit (this, data); } + + public override string ToString () + { + return string.Format ("[DomUsing: Region={0}, Namespaces=({1}), IsFromNamespace={2}]", Region, string.Join (",", namespaces.ToArray ()), IsFromNamespace); + } + } } Modified: trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/ICompilationUnit.cs =================================================================== --- trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/ICompilationUnit.cs 2009-09-01 06:24:35 UTC (rev 141003) +++ trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/ICompilationUnit.cs 2009-09-01 06:41:14 UTC (rev 141004) @@ -53,7 +53,14 @@ IType GetType (string fullName, int genericParameterCount); IType GetTypeAt (int line, int column); + IType GetTypeAt (DomLocation location); + IMember GetMemberAt (int line, int column); + IMember GetMemberAt (DomLocation location); + void GetNamespaceContents (List list, string subNameSpace, bool caseSensitive); + + bool IsNamespaceUsedAt (string name, int line, int column); + bool IsNamespaceUsedAt (string name, DomLocation location); } } From mono-patches-list at lists.ximian.com Tue Sep 1 03:07:30 2009 From: mono-patches-list at lists.ximian.com (Atsushi Enomoto (atsushi@ximian.com)) Date: Tue, 1 Sep 2009 03:07:30 -0400 (EDT) Subject: [Mono-patches] r141005 - in trunk/mcs/class/System.ServiceModel.Web: . System.ServiceModel.Web Test/System.ServiceModel.Web Message-ID: <20090901070730.9B5FF9472C@mono-cvs.ximian.com> Author: atsushi Date: 2009-09-01 03:07:30 -0400 (Tue, 01 Sep 2009) New Revision: 141005 Added: trunk/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebOperationContextTest.cs Modified: trunk/mcs/class/System.ServiceModel.Web/ChangeLog trunk/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/ChangeLog trunk/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/IncomingWebRequestContext.cs trunk/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/IncomingWebResponseContext.cs trunk/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/WebOperationContext.cs trunk/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web_test.dll.sources trunk/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/ChangeLog trunk/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebInvokeAttributeTest.cs Log: 2009-09-01 Atsushi Enomoto * WebOperationContext.cs : Current is automatically created (even without WebHttpBehavior or WebChannelFactory). * IncomingWebRequestContext.cs, IncomingWebResponseContext.cs: WebOperationContext could be created regardless of whether it is request or not. So do not premise incoming members existence. * WebOperationContextTest.cs : new test. * WebInvokeAttributeTest.cs : new test, not working. * System.ServiceModel.Web_test.dll.sources : added WebOperationContextTest.cs. Modified: trunk/mcs/class/System.ServiceModel.Web/ChangeLog =================================================================== --- trunk/mcs/class/System.ServiceModel.Web/ChangeLog 2009-09-01 06:41:14 UTC (rev 141004) +++ trunk/mcs/class/System.ServiceModel.Web/ChangeLog 2009-09-01 07:07:30 UTC (rev 141005) @@ -1,3 +1,8 @@ +2009-09-01 Atsushi Enomoto + + * System.ServiceModel.Web_test.dll.sources : + added WebOperationContextTest.cs. + 2009-07-20 Jb Evain * Makefile: filter the valid profile on the framework version, Modified: trunk/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/ChangeLog =================================================================== --- trunk/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/ChangeLog 2009-09-01 06:41:14 UTC (rev 141004) +++ trunk/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/ChangeLog 2009-09-01 07:07:30 UTC (rev 141005) @@ -1,3 +1,11 @@ +2009-09-01 Atsushi Enomoto + + * WebOperationContext.cs : Current is automatically created (even + without WebHttpBehavior or WebChannelFactory). + * IncomingWebRequestContext.cs, IncomingWebResponseContext.cs: + WebOperationContext could be created regardless of whether it is + request or not. So do not premise incoming members existence. + 2009-08-11 Atsushi Enomoto * WebChannelFactory.cs : added missing constructors. Modified: trunk/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/IncomingWebRequestContext.cs =================================================================== --- trunk/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/IncomingWebRequestContext.cs 2009-09-01 06:41:14 UTC (rev 141004) +++ trunk/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/IncomingWebRequestContext.cs 2009-09-01 07:07:30 UTC (rev 141005) @@ -39,7 +39,10 @@ internal IncomingWebRequestContext (OperationContext context) { - hp = (HttpRequestMessageProperty) context.IncomingMessageProperties [HttpRequestMessageProperty.Name]; + if (context.IncomingMessageProperties != null) + hp = (HttpRequestMessageProperty) context.IncomingMessageProperties [HttpRequestMessageProperty.Name]; + else + hp = new HttpRequestMessageProperty (); } public string Accept { Modified: trunk/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/IncomingWebResponseContext.cs =================================================================== --- trunk/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/IncomingWebResponseContext.cs 2009-09-01 06:41:14 UTC (rev 141004) +++ trunk/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/IncomingWebResponseContext.cs 2009-09-01 07:07:30 UTC (rev 141005) @@ -38,7 +38,10 @@ internal IncomingWebResponseContext (OperationContext context) { - hp = (HttpResponseMessageProperty) context.IncomingMessageProperties [HttpResponseMessageProperty.Name]; + if (context.IncomingMessageProperties != null) + hp = (HttpResponseMessageProperty) context.IncomingMessageProperties [HttpResponseMessageProperty.Name]; + else + hp = new HttpResponseMessageProperty (); } public long ContentLength { Modified: trunk/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/WebOperationContext.cs =================================================================== --- trunk/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/WebOperationContext.cs 2009-09-01 06:41:14 UTC (rev 141004) +++ trunk/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/WebOperationContext.cs 2009-09-01 07:07:30 UTC (rev 141005) @@ -35,7 +35,16 @@ public class WebOperationContext : IExtension { public static WebOperationContext Current { - get { return OperationContext.Current != null ? OperationContext.Current.Extensions.Find () : null; } + get { + if (OperationContext.Current == null) + return null; + var ret = OperationContext.Current.Extensions.Find (); + if (ret == null) { + ret = new WebOperationContext (OperationContext.Current); + OperationContext.Current.Extensions.Add (ret); + } + return ret; + } } IncomingWebRequestContext incoming_request; Modified: trunk/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web_test.dll.sources =================================================================== --- trunk/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web_test.dll.sources 2009-09-01 06:41:14 UTC (rev 141004) +++ trunk/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web_test.dll.sources 2009-09-01 07:07:30 UTC (rev 141005) @@ -23,6 +23,7 @@ System.ServiceModel.Syndication/XmlSyndicationContentTest.cs System.ServiceModel.Web/WebGetAttributeTest.cs System.ServiceModel.Web/WebInvokeAttributeTest.cs +System.ServiceModel.Web/WebOperationContextTest.cs System.ServiceModel.Web/WebServiceHostTest.cs System.ServiceModel/WebHttpBindingTest.cs System/UriTemplateTest.cs Modified: trunk/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/ChangeLog =================================================================== --- trunk/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/ChangeLog 2009-09-01 06:41:14 UTC (rev 141004) +++ trunk/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/ChangeLog 2009-09-01 07:07:30 UTC (rev 141005) @@ -1,3 +1,8 @@ +2009-09-01 Atsushi Enomoto + + * WebOperationContextTest.cs : new test. + * WebInvokeAttributeTest.cs : new test, not working. + 2008-04-21 Igor Zelmanovich * WebServiceHostTest.cs: new testfixture. Modified: trunk/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebInvokeAttributeTest.cs =================================================================== --- trunk/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebInvokeAttributeTest.cs 2009-09-01 06:41:14 UTC (rev 141004) +++ trunk/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebInvokeAttributeTest.cs 2009-09-01 07:07:30 UTC (rev 141005) @@ -56,11 +56,27 @@ oper.Validate (od); } + [Test] + [Ignore ("seems not valid test yet")] + [ExpectedException (typeof (InvalidOperationException))] + public void RejectTwoParametersWhenNotWrapped () + { + WebChannelFactory.CreateChannel (new WebHttpBinding (), new EndpointAddress ("http://localhost:37564")); + } + [ServiceContract] public interface TestService { [OperationContract] string TestMethod (string input); } + + [ServiceContract] + public interface IBogusService1 + { + [OperationContract] + [WebInvoke] + string Join (string s1, string s2); + } } } Added: trunk/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebOperationContextTest.cs =================================================================== --- trunk/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebOperationContextTest.cs (rev 0) +++ trunk/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebOperationContextTest.cs 2009-09-01 07:07:30 UTC (rev 141005) @@ -0,0 +1,67 @@ +// +// WebOperationContextTest.cs +// +// Author: +// Atsushi Enomoto +// +// Copyright (C) 2009 Novell, Inc (http://www.novell.com) +// +// 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. +// +using System; +using System.ServiceModel; +using System.ServiceModel.Channels; +using System.ServiceModel.Description; +using System.ServiceModel.Web; +using NUnit.Framework; + +using CategoryAttribute = NUnit.Framework.CategoryAttribute; + +namespace MonoTests.System.ServiceModel.Web +{ + [TestFixture] + public class WebOperationContextTest + { + [Test] + public void Current () + { + Assert.IsNull (WebOperationContext.Current, "#1"); + var binding = new WebHttpBinding (); + var address = new EndpointAddress ("http://localhost:37564"); + var ch = (IContextChannel) WebChannelFactory.CreateChannel (binding, address); + using (var ocs = new OperationContextScope (ch)) { + Assert.IsNotNull (WebOperationContext.Current, "#2"); + Assert.IsNotNull (WebOperationContext.Current.OutgoingRequest, "#3"); + Assert.IsNotNull (WebOperationContext.Current.IncomingRequest, "#4"); + Assert.IsNotNull (WebOperationContext.Current.IncomingResponse, "#5"); + Assert.IsNotNull (WebOperationContext.Current.OutgoingResponse, "#6"); // pointless though. + } + ch.Close (); + } + } + + [ServiceContract] + public interface IHogeService + { + [WebGet] + [OperationContract] + string Join (string s1, string s2); + } +} Property changes on: trunk/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebOperationContextTest.cs ___________________________________________________________________ Added: svn:eol-style + native From mono-patches-list at lists.ximian.com Tue Sep 1 03:40:15 2009 From: mono-patches-list at lists.ximian.com (Mike Krüger (mkrueger@novell.com)) Date: Tue, 1 Sep 2009 03:40:15 -0400 (EDT) Subject: [Mono-patches] r141006 - in trunk/monodevelop/main/src/core/MonoDevelop.Projects: . MonoDevelop.Projects.Dom Message-ID: <20090901074015.408569472C@mono-cvs.ximian.com> Author: mkrueger Date: 2009-09-01 03:40:15 -0400 (Tue, 01 Sep 2009) New Revision: 141006 Modified: trunk/monodevelop/main/src/core/MonoDevelop.Projects/ChangeLog trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/CompilationUnit.cs trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/ICompilationUnit.cs Log: * MonoDevelop.Projects.Dom/CompilationUnit.cs: * MonoDevelop.Projects.Dom/ICompilationUnit.cs: Moved shorten type name method to compilation unit. Modified: trunk/monodevelop/main/src/core/MonoDevelop.Projects/ChangeLog =================================================================== --- trunk/monodevelop/main/src/core/MonoDevelop.Projects/ChangeLog 2009-09-01 07:07:30 UTC (rev 141005) +++ trunk/monodevelop/main/src/core/MonoDevelop.Projects/ChangeLog 2009-09-01 07:40:15 UTC (rev 141006) @@ -1,5 +1,11 @@ 2009-09-01 Mike Kr?ger + * MonoDevelop.Projects.Dom/CompilationUnit.cs: + * MonoDevelop.Projects.Dom/ICompilationUnit.cs: Moved shorten + type name method to compilation unit. + +2009-09-01 Mike Kr?ger + * MonoDevelop.Projects.Dom/DomUsing.cs: * MonoDevelop.Projects.Dom/CompilationUnit.cs: * MonoDevelop.Projects.Dom/ICompilationUnit.cs: Added some Modified: trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/CompilationUnit.cs =================================================================== --- trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/CompilationUnit.cs 2009-09-01 07:07:30 UTC (rev 141005) +++ trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/CompilationUnit.cs 2009-09-01 07:40:15 UTC (rev 141006) @@ -168,5 +168,38 @@ } } } + + public IReturnType ShortenTypeName (IReturnType fullyQualfiedType, DomLocation location) + { + return new ShortenTypeNameVistior (this, location).Visit (fullyQualfiedType, null) as IReturnType; + } + + class ShortenTypeNameVistior : CopyDomVisitor + { + ICompilationUnit unit; + DomLocation location; + + public ShortenTypeNameVistior (ICompilationUnit unit, DomLocation location) + { + this.unit = unit; + this.location = location; + } + + public override IDomVisitable Visit (IReturnType type, object data) + { + IReturnType returnType = (IReturnType)base.Visit (type, data); + string longest = ""; + foreach (IUsing u in unit.Usings.Where (u => ((!u.IsFromNamespace && u.Region.Start < location) || u.Region.Contains (location)))) { + foreach (string ns in u.Namespaces.Where (ns => returnType.Namespace == ns || returnType.Namespace.StartsWith (ns + "."))) { + if (longest.Length < ns.Length) + longest = ns; + } + } + if (longest.Length > 0) + returnType.Namespace = returnType.Namespace == longest ? "" : returnType.Namespace.Substring (longest.Length + 1); + return returnType; + } + } + } } Modified: trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/ICompilationUnit.cs =================================================================== --- trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/ICompilationUnit.cs 2009-09-01 07:07:30 UTC (rev 141005) +++ trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/ICompilationUnit.cs 2009-09-01 07:40:15 UTC (rev 141006) @@ -62,5 +62,7 @@ bool IsNamespaceUsedAt (string name, int line, int column); bool IsNamespaceUsedAt (string name, DomLocation location); + + IReturnType ShortenTypeName (IReturnType fullyQualfiedType, DomLocation location); } } From mono-patches-list at lists.ximian.com Tue Sep 1 03:40:51 2009 From: mono-patches-list at lists.ximian.com (Mike Krüger (mkrueger@novell.com)) Date: Tue, 1 Sep 2009 03:40:51 -0400 (EDT) Subject: [Mono-patches] r141007 - in trunk/monodevelop/main/src/core/MonoDevelop.Ide: . MonoDevelop.Ide.CodeTemplates Message-ID: <20090901074051.93FEC9472C@mono-cvs.ximian.com> Author: mkrueger Date: 2009-09-01 03:40:51 -0400 (Tue, 01 Sep 2009) New Revision: 141007 Modified: trunk/monodevelop/main/src/core/MonoDevelop.Ide/ChangeLog trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs Log: * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs: Now using (the more correct) shorten type name method from compilation unit. Modified: trunk/monodevelop/main/src/core/MonoDevelop.Ide/ChangeLog =================================================================== --- trunk/monodevelop/main/src/core/MonoDevelop.Ide/ChangeLog 2009-09-01 07:40:15 UTC (rev 141006) +++ trunk/monodevelop/main/src/core/MonoDevelop.Ide/ChangeLog 2009-09-01 07:40:51 UTC (rev 141007) @@ -1,3 +1,9 @@ +2009-09-01 Mike Kr?ger + + * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs: Now using + (the more correct) shorten type name method from compilation + unit. + 2009-08-31 Lluis Sanchez Gual * BuildVariables.cs: Modified: trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs =================================================================== --- trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs 2009-09-01 07:40:15 UTC (rev 141006) +++ trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs 2009-09-01 07:40:51 UTC (rev 141007) @@ -175,28 +175,10 @@ public string GetSimpleTypeName (string fullTypeName) { - IType foundType = null; + if (CurrentContext.ParsedDocument == null) + return fullTypeName; - string curType = fullTypeName; - while (foundType == null) { - foundType = CurrentContext.ProjectDom.GetType (curType); - int idx = curType.LastIndexOf ('.'); - if (idx < 0) - break; - curType = fullTypeName.Substring (0, idx); - } - - if (foundType == null) - foundType = new DomType (fullTypeName); - if (CurrentContext.ParsedDocument != null) { - foreach (IUsing u in CurrentContext.ParsedDocument.CompilationUnit.Usings) { - foreach (string includedNamespace in u.Namespaces) { - if (includedNamespace == foundType.Namespace) - return fullTypeName.Substring (includedNamespace.Length + 1); - } - } - } - return fullTypeName; + return CurrentContext.ParsedDocument.CompilationUnit.ShortenTypeName (new DomReturnType (fullTypeName), CurrentContext.InsertPosition).FullName; } static Regex functionRegEx = new Regex ("([^(]*)\\(([^(]*)\\)", RegexOptions.Compiled); From mono-patches-list at lists.ximian.com Tue Sep 1 03:51:26 2009 From: mono-patches-list at lists.ximian.com (Mike Krüger (mkrueger@novell.com)) Date: Tue, 1 Sep 2009 03:51:26 -0400 (EDT) Subject: [Mono-patches] r141008 - in trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring: . MonoDevelop.CodeGeneration MonoDevelop.Refactoring MonoDevelop.Refactoring.DeclareLocal Message-ID: <20090901075126.7A9F89472C@mono-cvs.ximian.com> Author: mkrueger Date: 2009-09-01 03:51:26 -0400 (Tue, 01 Sep 2009) New Revision: 141008 Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/ChangeLog trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/CodeGenerationOptions.cs trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/NullCheckGenerator.cs trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/OverrideMembersGenerator.cs trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/RaiseEventMethodGenerator.cs trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringOptions.cs trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs Log: * MonoDevelop.Refactoring/RefactoryCommands.cs: * MonoDevelop.Refactoring/RefactoringOptions.cs: * MonoDevelop.CodeGeneration/NullCheckGenerator.cs: * MonoDevelop.CodeGeneration/CodeGenerationOptions.cs: * MonoDevelop.CodeGeneration/OverrideMembersGenerator.cs: * MonoDevelop.CodeGeneration/RaiseEventMethodGenerator.cs: * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs: Worked on refactoring/use shorten type name method. Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/ChangeLog =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/ChangeLog 2009-09-01 07:40:51 UTC (rev 141007) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/ChangeLog 2009-09-01 07:51:26 UTC (rev 141008) @@ -1,5 +1,16 @@ 2009-09-01 Mike Kr?ger + * MonoDevelop.Refactoring/RefactoryCommands.cs: + * MonoDevelop.Refactoring/RefactoringOptions.cs: + * MonoDevelop.CodeGeneration/NullCheckGenerator.cs: + * MonoDevelop.CodeGeneration/CodeGenerationOptions.cs: + * MonoDevelop.CodeGeneration/OverrideMembersGenerator.cs: + * MonoDevelop.CodeGeneration/RaiseEventMethodGenerator.cs: + * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs: + Worked on refactoring/use shorten type name method. + +2009-09-01 Mike Kr?ger + * MonoDevelop.Refactoring/RefactoryCommands.cs: ResolvedType is no longer used for the resolve namespace feature. Therefore replaced the check with an expression check. Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/CodeGenerationOptions.cs =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/CodeGenerationOptions.cs 2009-09-01 07:40:51 UTC (rev 141007) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/CodeGenerationOptions.cs 2009-09-01 07:51:26 UTC (rev 141008) @@ -71,22 +71,9 @@ return ProjectDomService.GetParser (Document.FileName, MimeType); } - public ICSharpCode.NRefactory.Ast.TypeReference MatchNamespaceImports (ICSharpCode.NRefactory.Ast.TypeReference typeReference) + public ICSharpCode.NRefactory.Ast.TypeReference ShortenTypeName (ICSharpCode.NRefactory.Ast.TypeReference typeReference) { - string prefix = ""; - foreach (IUsing u in Document.CompilationUnit.Usings) { - if (!u.IsFromNamespace || u.Region.Contains (Document.TextEditor.CursorLine, Document.TextEditor.CursorColumn)) { - foreach (string n in u.Namespaces) { - if (n.Length <= prefix.Length) - continue; - if (typeReference.Type.StartsWith (n + ".")) - prefix = n; - } - } - } - if (!string.IsNullOrEmpty (prefix)) - typeReference.Type = typeReference.Type.Substring (prefix.Length + 1); - return typeReference; + return Document.CompilationUnit.ShortenTypeName (typeReference.ConvertToReturnType (), Document.TextEditor.CursorLine, Document.TextEditor.CursorColumn).ConvertToTypeReference (); } public IResolver GetResolver () Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/NullCheckGenerator.cs =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/NullCheckGenerator.cs 2009-09-01 07:40:51 UTC (rev 141007) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/NullCheckGenerator.cs 2009-09-01 07:51:26 UTC (rev 141008) @@ -97,7 +97,7 @@ new PrimitiveExpression (null) ), new ThrowStatement ( new ObjectCreateExpression ( - Options.MatchNamespaceImports (new TypeReference ("System.ArgumentNullException")), + Options.ShortenTypeName (new TypeReference ("System.ArgumentNullException")), new List { new PrimitiveExpression (member.Name) } ) ) Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/OverrideMembersGenerator.cs =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/OverrideMembersGenerator.cs 2009-09-01 07:40:51 UTC (rev 141007) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/OverrideMembersGenerator.cs 2009-09-01 07:51:26 UTC (rev 141008) @@ -148,7 +148,7 @@ List arguments = new List (); foreach (IParameter parameter in method.Parameters) { - methodDeclaration.Parameters.Add (new ParameterDeclarationExpression (Options.MatchNamespaceImports (parameter.ReturnType.ConvertToTypeReference ()), parameter.Name, GetModifier (parameter))); + methodDeclaration.Parameters.Add (new ParameterDeclarationExpression (Options.ShortenTypeName (parameter.ReturnType.ConvertToTypeReference ()), parameter.Name, GetModifier (parameter))); arguments.Add (new DirectionExpression (GetDirection (parameter), new IdentifierExpression (parameter.Name))); } @@ -168,7 +168,7 @@ if (member is IProperty) { IProperty property = (IProperty)member; PropertyDeclaration propertyDeclaration = new PropertyDeclaration (modifier, null, member.Name, null); - propertyDeclaration.TypeReference = Options.MatchNamespaceImports (member.ReturnType.ConvertToTypeReference ()); + propertyDeclaration.TypeReference = Options.ShortenTypeName (member.ReturnType.ConvertToTypeReference ()); if (property.HasGet) { BlockStatement block = new BlockStatement (); block.AddChild (isInterfaceMember ? throwNotImplemented : new ReturnStatement (baseReference)); Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/RaiseEventMethodGenerator.cs =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/RaiseEventMethodGenerator.cs 2009-09-01 07:40:51 UTC (rev 141007) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/RaiseEventMethodGenerator.cs 2009-09-01 07:51:26 UTC (rev 141008) @@ -107,11 +107,11 @@ IType type = Options.Dom.SearchType (new SearchTypeRequest (Options.Document.ParsedDocument.CompilationUnit, member.ReturnType, Options.EnclosingType)); IMethod invokeMethod = type.Methods.First (); - methodDeclaration.Parameters.Add (new ParameterDeclarationExpression (Options.MatchNamespaceImports (invokeMethod.Parameters[1].ReturnType.ConvertToTypeReference ()), invokeMethod.Parameters[1].Name)); + methodDeclaration.Parameters.Add (new ParameterDeclarationExpression (Options.ShortenTypeName (invokeMethod.Parameters[1].ReturnType.ConvertToTypeReference ()), invokeMethod.Parameters[1].Name)); const string handlerName = "handler"; LocalVariableDeclaration handlerVariable = new LocalVariableDeclaration (new VariableDeclaration (handlerName, new MemberReferenceExpression (new ThisReferenceExpression (), member.Name))); - handlerVariable.TypeReference = Options.MatchNamespaceImports (member.ReturnType.ConvertToTypeReference ()); + handlerVariable.TypeReference = Options.ShortenTypeName (member.ReturnType.ConvertToTypeReference ()); methodDeclaration.Body.AddChild (handlerVariable); IfElseStatement ifStatement = new IfElseStatement (null); Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringOptions.cs =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringOptions.cs 2009-09-01 07:40:51 UTC (rev 141007) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringOptions.cs 2009-09-01 07:51:26 UTC (rev 141008) @@ -139,10 +139,14 @@ return GetIndent (Document, member); } + public IReturnType ShortenTypeName (IReturnType fullyQualifiedTypeName) + { + return Document.ParsedDocument.CompilationUnit.ShortenTypeName (fullyQualifiedTypeName, Document.TextEditor.CursorLine, Document.TextEditor.CursorColumn); + } + public ParsedDocument ParseDocument () { return ProjectDomService.Parse (Dom.Project, Document.FileName, DesktopService.GetMimeTypeForUri (Document.FileName), Document.TextEditor.Text); } - } } Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs 2009-09-01 07:40:51 UTC (rev 141007) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs 2009-09-01 07:51:26 UTC (rev 141008) @@ -169,6 +169,7 @@ eitem = null; } } + if (resolveResult != null && resolveResult.ResolvedExpression != null && !string.IsNullOrEmpty (resolveResult.ResolvedExpression.Expression)) { IReturnType returnType = new DomReturnType (resolveResult.ResolvedExpression.Expression); List namespaces = new List (ctx.ResolvePossibleNamespaces (returnType)); @@ -181,11 +182,15 @@ info.Icon = MonoDevelop.Core.Gui.Stock.AddNamespace; } resolveMenu.CommandInfos.AddSeparator (); + } else { + // remove all unused namespaces (for resolving conflicts) + namespaces.RemoveAll (ns => !doc.CompilationUnit.IsNamespaceUsedAt (ns, resolveResult.ResolvedExpression.Region.Start)); } + foreach (string ns in namespaces) { resolveMenu.CommandInfos.Add (ns, new RefactoryOperation (new ResolveNameOperation (ctx, doc, resolveResult, ns).ResolveName)); } - if (namespaces.Count > 0) + if (namespaces.Count > (item == null ? 0 : 1)) ainfo.Add (resolveMenu, null); } } Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs 2009-09-01 07:40:51 UTC (rev 141007) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs 2009-09-01 07:51:26 UTC (rev 141008) @@ -136,7 +136,10 @@ ResolveResult resolveResult; LineSegment lineSegment; if (data.IsSomethingSelected) { - resolveResult = resolver.Resolve (new ExpressionResult (data.SelectedText), new DomLocation (data.Caret.Line, data.Caret.Column)); + ExpressionResult expressionResult = new ExpressionResult (data.SelectedText.Trim ()); + if (expressionResult.Expression.Contains (" ") || expressionResult.Expression.Contains ("\t")) + expressionResult.Expression = "(" + expressionResult.Expression + ")"; + resolveResult = resolver.Resolve (expressionResult, new DomLocation (data.Caret.Line, data.Caret.Column)); if (resolveResult == null) return result; string varName = CreateVariableName (resolveResult.ResolvedType); @@ -144,11 +147,12 @@ if (resolveResult.ResolvedType == null) { returnType = new TypeReference ("var"); } else { - returnType = resolveResult.ResolvedType.ConvertToTypeReference (); + + returnType = options.ShortenTypeName (resolveResult.ResolvedType).ConvertToTypeReference (); } options.ParseMember (resolveResult.CallingMember); - - /* Statement lastStatement = null; + /* + Statement lastStatement = null; Location curLocation = new Location (data.Caret.Column, data.Caret.Line); foreach (Statement statement in options.ParseMember (options.ResolveResult.CallingMember).Children) { if (statement.StartLocation > curLocation) @@ -165,7 +169,7 @@ lineSegment = data.Document.GetLine (data.Caret.Line); insert.Offset = lineSegment.Offset; - LocalVariableDeclaration varDecl = new LocalVariableDeclaration (ConvertToTypeRef (options, resolveResult.ResolvedType)); + LocalVariableDeclaration varDecl = new LocalVariableDeclaration (returnType); varDecl.Variables.Add (new VariableDeclaration (varName, provider.ParseExpression (data.SelectedText))); insert.InsertedText = options.GetWhitespaces (lineSegment.Offset) +provider.OutputNode (options.Dom, varDecl) + Environment.NewLine; result.Add (insert); @@ -211,6 +215,8 @@ static string CreateVariableName (MonoDevelop.Projects.Dom.IReturnType returnType) { + if (returnType == null) + return "aVar"; return "a" + returnType.Name; } From mono-patches-list at lists.ximian.com Tue Sep 1 03:51:56 2009 From: mono-patches-list at lists.ximian.com (Mike Krüger (mkrueger@novell.com)) Date: Tue, 1 Sep 2009 03:51:56 -0400 (EDT) Subject: [Mono-patches] r141009 - in trunk/monodevelop/main/src/core/MonoDevelop.Projects: . MonoDevelop.Projects.Dom Message-ID: <20090901075156.E77D69472C@mono-cvs.ximian.com> Author: mkrueger Date: 2009-09-01 03:51:56 -0400 (Tue, 01 Sep 2009) New Revision: 141009 Modified: trunk/monodevelop/main/src/core/MonoDevelop.Projects/ChangeLog trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/CompilationUnit.cs trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/ICompilationUnit.cs Log: * MonoDevelop.Projects.Dom/CompilationUnit.cs: * MonoDevelop.Projects.Dom/ICompilationUnit.cs: Added shorten type name overload. Modified: trunk/monodevelop/main/src/core/MonoDevelop.Projects/ChangeLog =================================================================== --- trunk/monodevelop/main/src/core/MonoDevelop.Projects/ChangeLog 2009-09-01 07:51:26 UTC (rev 141008) +++ trunk/monodevelop/main/src/core/MonoDevelop.Projects/ChangeLog 2009-09-01 07:51:56 UTC (rev 141009) @@ -1,6 +1,12 @@ 2009-09-01 Mike Kr?ger * MonoDevelop.Projects.Dom/CompilationUnit.cs: + * MonoDevelop.Projects.Dom/ICompilationUnit.cs: Added shorten + type name overload. + +2009-09-01 Mike Kr?ger + + * MonoDevelop.Projects.Dom/CompilationUnit.cs: * MonoDevelop.Projects.Dom/ICompilationUnit.cs: Moved shorten type name method to compilation unit. Modified: trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/CompilationUnit.cs =================================================================== --- trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/CompilationUnit.cs 2009-09-01 07:51:26 UTC (rev 141008) +++ trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/CompilationUnit.cs 2009-09-01 07:51:56 UTC (rev 141009) @@ -169,6 +169,12 @@ } } + + public IReturnType ShortenTypeName (IReturnType fullyQualfiedType, int line, int column) + { + return ShortenTypeName (fullyQualfiedType, new DomLocation (line, column)); + } + public IReturnType ShortenTypeName (IReturnType fullyQualfiedType, DomLocation location) { return new ShortenTypeNameVistior (this, location).Visit (fullyQualfiedType, null) as IReturnType; Modified: trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/ICompilationUnit.cs =================================================================== --- trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/ICompilationUnit.cs 2009-09-01 07:51:26 UTC (rev 141008) +++ trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/ICompilationUnit.cs 2009-09-01 07:51:56 UTC (rev 141009) @@ -64,5 +64,6 @@ bool IsNamespaceUsedAt (string name, DomLocation location); IReturnType ShortenTypeName (IReturnType fullyQualfiedType, DomLocation location); + IReturnType ShortenTypeName (IReturnType fullyQualfiedType, int line, int column); } } From mono-patches-list at lists.ximian.com Tue Sep 1 03:56:40 2009 From: mono-patches-list at lists.ximian.com (Mike Krüger (mkrueger@novell.com)) Date: Tue, 1 Sep 2009 03:56:40 -0400 (EDT) Subject: [Mono-patches] r141010 - in trunk/monodevelop/main/src/core/MonoDevelop.Projects: . MonoDevelop.Projects.Dom Message-ID: <20090901075640.6DED99472C@mono-cvs.ximian.com> Author: mkrueger Date: 2009-09-01 03:56:40 -0400 (Tue, 01 Sep 2009) New Revision: 141010 Modified: trunk/monodevelop/main/src/core/MonoDevelop.Projects/ChangeLog trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/CompilationUnit.cs Log: * MonoDevelop.Projects.Dom/CompilationUnit.cs: Check if built in types are shortened (they don't need to). Modified: trunk/monodevelop/main/src/core/MonoDevelop.Projects/ChangeLog =================================================================== --- trunk/monodevelop/main/src/core/MonoDevelop.Projects/ChangeLog 2009-09-01 07:51:56 UTC (rev 141009) +++ trunk/monodevelop/main/src/core/MonoDevelop.Projects/ChangeLog 2009-09-01 07:56:40 UTC (rev 141010) @@ -1,5 +1,10 @@ 2009-09-01 Mike Kr?ger + * MonoDevelop.Projects.Dom/CompilationUnit.cs: Check if built + in types are shortened (they don't need to). + +2009-09-01 Mike Kr?ger + * MonoDevelop.Projects.Dom/CompilationUnit.cs: * MonoDevelop.Projects.Dom/ICompilationUnit.cs: Added shorten type name overload. Modified: trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/CompilationUnit.cs =================================================================== --- trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/CompilationUnit.cs 2009-09-01 07:51:56 UTC (rev 141009) +++ trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom/CompilationUnit.cs 2009-09-01 07:56:40 UTC (rev 141010) @@ -191,9 +191,18 @@ this.location = location; } + static HashSet builtInTypes = new HashSet (new string[] { + "System.Void", "System.Object","System.Boolean","System.Byte", "System.SByte", + "System.Char", "System.Enum", "System.Int16", "System.Int32", "System.Int64", + "System.UInt16", "System.UInt32", "System.UInt64", "System.Single", "System.Double", "System.Decimal", + "System.String" + }); + public override IDomVisitable Visit (IReturnType type, object data) { IReturnType returnType = (IReturnType)base.Visit (type, data); + if (builtInTypes.Contains (returnType.FullName)) + return returnType; string longest = ""; foreach (IUsing u in unit.Usings.Where (u => ((!u.IsFromNamespace && u.Region.Start < location) || u.Region.Contains (location)))) { foreach (string ns in u.Namespaces.Where (ns => returnType.Namespace == ns || returnType.Namespace.StartsWith (ns + "."))) { From mono-patches-list at lists.ximian.com Tue Sep 1 04:00:29 2009 From: mono-patches-list at lists.ximian.com (Mike Krüger (mkrueger@novell.com)) Date: Tue, 1 Sep 2009 04:00:29 -0400 (EDT) Subject: [Mono-patches] r141011 - in trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring: . MonoDevelop.Refactoring.DeclareLocal MonoDevelop.Refactoring.ExtractMethod Message-ID: <20090901080029.239519472C@mono-cvs.ximian.com> Author: mkrueger Date: 2009-09-01 04:00:29 -0400 (Tue, 01 Sep 2009) New Revision: 141011 Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/ChangeLog trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs Log: * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs: * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs: Use shorten type name method. Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/ChangeLog =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/ChangeLog 2009-09-01 07:56:40 UTC (rev 141010) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/ChangeLog 2009-09-01 08:00:29 UTC (rev 141011) @@ -1,5 +1,11 @@ 2009-09-01 Mike Kr?ger + * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs: + * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs: + Use shorten type name method. + +2009-09-01 Mike Kr?ger + * MonoDevelop.Refactoring/RefactoryCommands.cs: * MonoDevelop.Refactoring/RefactoringOptions.cs: * MonoDevelop.CodeGeneration/NullCheckGenerator.cs: Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs 2009-09-01 07:56:40 UTC (rev 141010) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs 2009-09-01 08:00:29 UTC (rev 141011) @@ -81,40 +81,6 @@ return resolveResult.ResolvedType != null && !string.IsNullOrEmpty (resolveResult.ResolvedType.FullName) && resolveResult.ResolvedType.FullName != DomReturnType.Void.FullName; } - static HashSet builtInTypes = new HashSet (new string[] { - "System.Void", "System.Object","System.Boolean","System.Byte", "System.SByte", - "System.Char", "System.Enum", "System.Int16", "System.Int32", "System.Int64", - "System.UInt16", "System.UInt32", "System.UInt64", "System.Single", "System.Double", "System.Decimal", - "System.String" - }); - - public string GetSimpleTypeName (RefactoringOptions options, string fullTypeName) - { - if (builtInTypes.Contains (fullTypeName)) - return fullTypeName; - IType foundType = null; - string curType = fullTypeName; - while (foundType == null) { - foundType = options.Dom.GetType (curType); - int idx = curType.LastIndexOf ('.'); - if (idx < 0) - break; - curType = fullTypeName.Substring (0, idx); - } - - if (foundType == null) - foundType = new DomType (fullTypeName); - if (options.Document.ParsedDocument != null) { - foreach (IUsing u in options.Document.ParsedDocument.CompilationUnit.Usings) { - foreach (string includedNamespace in u.Namespaces) { - if (includedNamespace == foundType.Namespace) - return fullTypeName.Substring (includedNamespace.Length + 1); - } - } - } - return fullTypeName; - } - public override void Run (RefactoringOptions options) { base.Run (options); @@ -201,7 +167,7 @@ insert.Description = GettextCatalog.GetString ("Insert variable declaration"); insert.Offset = lineSegment.Offset + options.GetWhitespaces (lineSegment.Offset).Length; string varName = CreateVariableName (resolveResult.ResolvedType); - LocalVariableDeclaration varDecl = new LocalVariableDeclaration (ConvertToTypeRef (options, resolveResult.ResolvedType)); + LocalVariableDeclaration varDecl = new LocalVariableDeclaration (options.ShortenTypeName (resolveResult.ResolvedType).ConvertToTypeReference ()); varDecl.Variables.Add (new VariableDeclaration (varName, expression)); insert.RemovedChars = expression.EndLocation.Column - 1; insert.InsertedText = provider.OutputNode (options.Dom, varDecl); @@ -220,16 +186,5 @@ return "a" + returnType.Name; } - - TypeReference ConvertToTypeRef (RefactoringOptions options, MonoDevelop.Projects.Dom.IReturnType returnType) - { - TypeReference result = new TypeReference (GetSimpleTypeName (options, returnType.FullName)); - result.IsKeyword = true; - foreach (IReturnType generic in returnType.GenericArguments) { - result.GenericTypes.Add (ConvertToTypeRef (options, generic)); - } - return result; - } - } } Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs 2009-09-01 07:56:40 UTC (rev 141010) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs 2009-09-01 08:00:29 UTC (rev 141011) @@ -230,7 +230,7 @@ varGen.Offset = line.Offset + line.EditableLength; varGen.InsertedText = Environment.NewLine + options.GetWhitespaces (line.Offset); foreach (VariableDescriptor var in variablesToGenerate) { - TypeReference tr = var.ReturnType.ConvertToTypeReference (); + TypeReference tr = options.ShortenTypeName (var.ReturnType).ConvertToTypeReference (); varGen.InsertedText += provider.OutputNode (options.Dom, new LocalVariableDeclaration (new VariableDeclaration (var.Name, null, tr))); } result.Add (varGen); @@ -259,7 +259,7 @@ INode outputNode; if (oneChangedVariable) { string name = param.ChangedVariables.First (); - returnType = param.Variables.Find (v => v.Name == name).ReturnType.ConvertToTypeReference (); + returnType = options.ShortenTypeName (param.Variables.Find (v => v.Name == name).ReturnType).ConvertToTypeReference (); if (visitor.VariableList.Any (v => v.Name == name && !v.IsDefined)) { LocalVariableDeclaration varDecl = new LocalVariableDeclaration (returnType); varDecl.Variables.Add (new VariableDeclaration (name, invocation)); @@ -296,7 +296,7 @@ node.AcceptVisitor (transformer, null); if (!oneChangedVariable && node is Expression) { ResolveResult resolveResult = resolver.Resolve (new ExpressionResult (text), new DomLocation (options.Document.TextEditor.CursorLine, options.Document.TextEditor.CursorColumn)); - returnType = resolveResult.ResolvedType.ConvertToTypeReference (); + returnType = options.ShortenTypeName (resolveResult.ResolvedType).ConvertToTypeReference (); } MethodDeclaration methodDecl = new MethodDeclaration (); @@ -317,13 +317,13 @@ foreach (VariableDescriptor var in variablesToDefine) { BlockStatement block = methodDecl.Body; - LocalVariableDeclaration varDecl = new LocalVariableDeclaration (var.ReturnType.ConvertToTypeReference()); + LocalVariableDeclaration varDecl = new LocalVariableDeclaration (options.ShortenTypeName (var.ReturnType).ConvertToTypeReference()); varDecl.Variables.Add (new VariableDeclaration (var.Name)); block.Children.Insert (0, varDecl); } foreach (VariableDescriptor var in param.Parameters) { - TypeReference typeReference = var.ReturnType.ConvertToTypeReference (); + TypeReference typeReference = options.ShortenTypeName (var.ReturnType).ConvertToTypeReference (); ParameterDeclarationExpression pde = new ParameterDeclarationExpression (typeReference, var.Name); if (!oneChangedVariable && param.ChangedVariables.Contains (var.Name)) pde.ParamModifier |= ICSharpCode.NRefactory.Ast.ParameterModifiers.Ref; @@ -331,7 +331,7 @@ } foreach (VariableDescriptor var in variablesToGenerate) { - TypeReference typeReference = var.ReturnType.ConvertToTypeReference (); + TypeReference typeReference = options.ShortenTypeName (var.ReturnType).ConvertToTypeReference (); ParameterDeclarationExpression pde = new ParameterDeclarationExpression (typeReference, var.Name); if (!oneChangedVariable && param.ChangedVariables.Contains (var.Name)) pde.ParamModifier |= ICSharpCode.NRefactory.Ast.ParameterModifiers.Out; From mono-patches-list at lists.ximian.com Tue Sep 1 04:13:44 2009 From: mono-patches-list at lists.ximian.com (Mike Krüger (mkrueger@novell.com)) Date: Tue, 1 Sep 2009 04:13:44 -0400 (EDT) Subject: [Mono-patches] r141012 - in trunk/monodevelop/main/src/addins/CSharpBinding: . Gui Message-ID: <20090901081344.CE0D39472C@mono-cvs.ximian.com> Author: mkrueger Date: 2009-09-01 04:13:44 -0400 (Tue, 01 Sep 2009) New Revision: 141012 Modified: trunk/monodevelop/main/src/addins/CSharpBinding/ChangeLog trunk/monodevelop/main/src/addins/CSharpBinding/Gui/NRefactoryResolver.cs Log: * Gui/NRefactoryResolver.cs: Fixed "Bug 535187 - Resolver result wrong when property name matches type". Modified: trunk/monodevelop/main/src/addins/CSharpBinding/ChangeLog =================================================================== --- trunk/monodevelop/main/src/addins/CSharpBinding/ChangeLog 2009-09-01 08:00:29 UTC (rev 141011) +++ trunk/monodevelop/main/src/addins/CSharpBinding/ChangeLog 2009-09-01 08:13:44 UTC (rev 141012) @@ -1,3 +1,8 @@ +2009-09-01 Mike Kr?ger + + * Gui/NRefactoryResolver.cs: Fixed "Bug 535187 - Resolver + result wrong when property name matches type". + 2009-08-31 Mike Kr?ger * Parser/CodeGenerator.cs: Fixed unit tests. Modified: trunk/monodevelop/main/src/addins/CSharpBinding/Gui/NRefactoryResolver.cs =================================================================== --- trunk/monodevelop/main/src/addins/CSharpBinding/Gui/NRefactoryResolver.cs 2009-09-01 08:00:29 UTC (rev 141011) +++ trunk/monodevelop/main/src/addins/CSharpBinding/Gui/NRefactoryResolver.cs 2009-09-01 08:13:44 UTC (rev 141012) @@ -749,8 +749,26 @@ goto end; } } - if (this.callingMember != null) { + + // special handling of property return types, they can have the same name as the return type + // ex.: MyType MyType { get; set; } + if (callingMember is IProperty && identifier == callingMember.Name) { + int pos = editor.GetPositionFromLineColumn (resolvePosition.Line, resolvePosition.Column); + while (pos < editor.TextLength && !Char.IsWhiteSpace (editor.GetCharAt (pos))) + pos++; + while (pos < editor.TextLength && Char.IsWhiteSpace (editor.GetCharAt (pos))) + pos++; + StringBuilder memberName = new StringBuilder (); + while (pos < editor.TextLength && !Char.IsWhiteSpace (editor.GetCharAt (pos))) { + memberName.Append (editor.GetCharAt (pos)); + pos++; + } + if (memberName.ToString () == identifier) { + result = visitor.CreateResult (callingMember.ReturnType); + goto end; + } + } if (identifier == "value" && this.callingMember is IProperty) { result = new MemberResolveResult (this.callingMember); result.UnresolvedType = ((IProperty)this.callingMember).ReturnType; From mono-patches-list at lists.ximian.com Tue Sep 1 05:06:02 2009 From: mono-patches-list at lists.ximian.com (Mike Krüger (mkrueger@novell.com)) Date: Tue, 1 Sep 2009 05:06:02 -0400 (EDT) Subject: [Mono-patches] r141013 - in trunk/monodevelop/main/src/addins/CSharpBinding: . Parser Message-ID: <20090901090602.3BCAE9472C@mono-cvs.ximian.com> Author: mkrueger Date: 2009-09-01 05:06:02 -0400 (Tue, 01 Sep 2009) New Revision: 141013 Modified: trunk/monodevelop/main/src/addins/CSharpBinding/ChangeLog trunk/monodevelop/main/src/addins/CSharpBinding/Parser/CSharpNRefactoryASTProvider.cs Log: * Parser/CSharpNRefactoryASTProvider.cs: Implementet parsetypereference. Modified: trunk/monodevelop/main/src/addins/CSharpBinding/ChangeLog =================================================================== --- trunk/monodevelop/main/src/addins/CSharpBinding/ChangeLog 2009-09-01 08:13:44 UTC (rev 141012) +++ trunk/monodevelop/main/src/addins/CSharpBinding/ChangeLog 2009-09-01 09:06:02 UTC (rev 141013) @@ -1,5 +1,10 @@ 2009-09-01 Mike Kr?ger + * Parser/CSharpNRefactoryASTProvider.cs: Implementet + parsetypereference. + +2009-09-01 Mike Kr?ger + * Gui/NRefactoryResolver.cs: Fixed "Bug 535187 - Resolver result wrong when property name matches type". Modified: trunk/monodevelop/main/src/addins/CSharpBinding/Parser/CSharpNRefactoryASTProvider.cs =================================================================== --- trunk/monodevelop/main/src/addins/CSharpBinding/Parser/CSharpNRefactoryASTProvider.cs 2009-09-01 08:13:44 UTC (rev 141012) +++ trunk/monodevelop/main/src/addins/CSharpBinding/Parser/CSharpNRefactoryASTProvider.cs 2009-09-01 09:06:02 UTC (rev 141013) @@ -96,6 +96,17 @@ return parser.CompilationUnit; } } - + + public TypeReference ParseTypeReference (string content) + { + content = content.Trim (); + using (ICSharpCode.NRefactory.IParser parser = ICSharpCode.NRefactory.ParserFactory.CreateParser (SupportedLanguage.CSharp, new StringReader (content))) { + try { + return parser.ParseTypeReference (); + } catch (Exception) { + } + } + return null; + } } } From mono-patches-list at lists.ximian.com Tue Sep 1 05:07:16 2009 From: mono-patches-list at lists.ximian.com (Mike Krüger (mkrueger@novell.com)) Date: Tue, 1 Sep 2009 05:07:16 -0400 (EDT) Subject: [Mono-patches] r141014 - in trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring: . MonoDevelop.Refactoring Message-ID: <20090901090716.BF95E9472C@mono-cvs.ximian.com> Author: mkrueger Date: 2009-09-01 05:07:16 -0400 (Tue, 01 Sep 2009) New Revision: 141014 Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/ChangeLog trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/INRefactoryASTProvider.cs trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs Log: * MonoDevelop.Refactoring/RefactoryCommands.cs: * MonoDevelop.Refactoring/INRefactoryASTProvider.cs: Resolve type now works with templates with >=2 type arguments. Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/ChangeLog =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/ChangeLog 2009-09-01 09:06:02 UTC (rev 141013) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/ChangeLog 2009-09-01 09:07:16 UTC (rev 141014) @@ -1,5 +1,11 @@ 2009-09-01 Mike Kr?ger + * MonoDevelop.Refactoring/RefactoryCommands.cs: + * MonoDevelop.Refactoring/INRefactoryASTProvider.cs: Resolve + type now works with templates with >=2 type arguments. + +2009-09-01 Mike Kr?ger + * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs: * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs: Use shorten type name method. Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/INRefactoryASTProvider.cs =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/INRefactoryASTProvider.cs 2009-09-01 09:06:02 UTC (rev 141013) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/INRefactoryASTProvider.cs 2009-09-01 09:07:16 UTC (rev 141014) @@ -31,7 +31,6 @@ using System.IO; using MonoDevelop.Projects.Dom.Parser; - namespace MonoDevelop.Refactoring { public interface INRefactoryASTProvider @@ -42,6 +41,7 @@ INode ParseText (string text); Expression ParseExpression (string expressionText); CompilationUnit ParseFile (string content); + TypeReference ParseTypeReference (string typeText); bool CanGenerateASTFrom (string mimeType); } Modified: trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs 2009-09-01 09:06:02 UTC (rev 141013) +++ trunk/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs 2009-09-01 09:07:16 UTC (rev 141014) @@ -171,7 +171,13 @@ } if (resolveResult != null && resolveResult.ResolvedExpression != null && !string.IsNullOrEmpty (resolveResult.ResolvedExpression.Expression)) { - IReturnType returnType = new DomReturnType (resolveResult.ResolvedExpression.Expression); + + IReturnType returnType = null; + INRefactoryASTProvider astProvider = RefactoringService.GetASTProvider (MonoDevelop.Core.Gui.DesktopService.GetMimeTypeForUri (doc.FileName)); + if (astProvider != null) + returnType = astProvider.ParseTypeReference (resolveResult.ResolvedExpression.Expression).ConvertToReturnType (); + if (returnType == null) + returnType = DomReturnType.FromInvariantString (resolveResult.ResolvedExpression.Expression); List namespaces = new List (ctx.ResolvePossibleNamespaces (returnType)); if (item == null || namespaces.Count > 1) { CommandInfoSet resolveMenu = new CommandInfoSet (); From mono-patches-list at lists.ximian.com Tue Sep 1 05:35:31 2009 From: mono-patches-list at lists.ximian.com (Lluis Sanchez (lluis@ximian.com)) Date: Tue, 1 Sep 2009 05:35:31 -0400 (EDT) Subject: [Mono-patches] r141015 - trunk/monodevelop/main/src/core/MonoDevelop.Dock Message-ID: <20090901093531.436E39472C@mono-cvs.ximian.com> Author: lluis Date: 2009-09-01 05:35:31 -0400 (Tue, 01 Sep 2009) New Revision: 141015 Modified: trunk/monodevelop/main/src/core/MonoDevelop.Dock/ChangeLog trunk/monodevelop/main/src/core/MonoDevelop.Dock/DockItem.cs Log: * DockItem.cs: Fire the ContentRequired event only when the content is really required, that is, when it is going to be shown. It won't be fired for example, if the pad is selected but not visible in a notebook. Modified: trunk/monodevelop/main/src/core/MonoDevelop.Dock/ChangeLog =================================================================== --- trunk/monodevelop/main/src/core/MonoDevelop.Dock/ChangeLog 2009-09-01 09:07:16 UTC (rev 141014) +++ trunk/monodevelop/main/src/core/MonoDevelop.Dock/ChangeLog 2009-09-01 09:35:31 UTC (rev 141015) @@ -1,3 +1,10 @@ +2009-09-01 Lluis Sanchez Gual + + * DockItem.cs: Fire the ContentRequired event only when the + content is really required, that is, when it is going to be + shown. It won't be fired for example, if the pad is selected + but not visible in a notebook. + 2009-08-27 Mike Kr?ger * TabStrip.cs: Modified: trunk/monodevelop/main/src/core/MonoDevelop.Dock/DockItem.cs =================================================================== --- trunk/monodevelop/main/src/core/MonoDevelop.Dock/DockItem.cs 2009-09-01 09:07:16 UTC (rev 141014) +++ trunk/monodevelop/main/src/core/MonoDevelop.Dock/DockItem.cs 2009-09-01 09:35:31 UTC (rev 141015) @@ -120,30 +120,40 @@ get { if (widget == null) { widget = new DockItemContainer (frame, this); + widget.Visible = false; // Required to ensure that the Shown event is fired widget.Label = label; - if (ContentRequired != null) { - gettingContent = true; - try { - ContentRequired (this, EventArgs.Empty); - } finally { - gettingContent = false; - } - } - widget.UpdateContent (); - widget.Shown += delegate { - UpdateContentVisibleStatus (); - }; - widget.Hidden += delegate { - UpdateContentVisibleStatus (); - }; - widget.ParentSet += delegate { - UpdateContentVisibleStatus (); - }; + widget.Shown += SetupContent; } return widget; } } + void SetupContent (object ob, EventArgs args) + { + widget.Shown -= SetupContent; + + if (ContentRequired != null) { + gettingContent = true; + try { + ContentRequired (this, EventArgs.Empty); + } finally { + gettingContent = false; + } + } + + widget.UpdateContent (); + widget.Shown += delegate { + UpdateContentVisibleStatus (); + }; + widget.Hidden += delegate { + UpdateContentVisibleStatus (); + }; + widget.ParentSet += delegate { + UpdateContentVisibleStatus (); + }; + UpdateContentVisibleStatus (); + } + public Widget Content { get { return content; From mono-patches-list at lists.ximian.com Tue Sep 1 05:37:50 2009 From: mono-patches-list at lists.ximian.com (Christian Hergert (chris@mosaix.net)) Date: Tue, 1 Sep 2009 05:37:50 -0400 (EDT) Subject: [Mono-patches] r141016 - in trunk/monodevelop/main/src/core/MonoDevelop.Projects.Gui: . MonoDevelop.Projects.Gui.Dialogs.OptionPanels Message-ID: <20090901093750.BE85E9472C@mono-cvs.ximian.com> Author: chergert Date: 2009-09-01 05:37:50 -0400 (Tue, 01 Sep 2009) New Revision: 141016 Modified: trunk/monodevelop/main/src/core/MonoDevelop.Projects.Gui/ChangeLog trunk/monodevelop/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs.OptionPanels/CodeFormattingPanel.cs Log: 2009-09-01 Christian Hergert * MonoDevelop.Projects.Gui.Dialogs.OptionPanels/CodeFormattingPanel.cs: Fix NRE. Modified: trunk/monodevelop/main/src/core/MonoDevelop.Projects.Gui/ChangeLog =================================================================== --- trunk/monodevelop/main/src/core/MonoDevelop.Projects.Gui/ChangeLog 2009-09-01 09:35:31 UTC (rev 141015) +++ trunk/monodevelop/main/src/core/MonoDevelop.Projects.Gui/ChangeLog 2009-09-01 09:37:50 UTC (rev 141016) @@ -1,3 +1,8 @@ +2009-09-01 Christian Hergert + + * MonoDevelop.Projects.Gui.Dialogs.OptionPanels/CodeFormattingPanel.cs: + Fix NRE. + 2009-08-27 Mike Kr?ger * MonoDevelop.Projects.Gui.Completion/CompletionListWindow.cs: Modified: trunk/monodevelop/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs.OptionPanels/CodeFormattingPanel.cs =================================================================== --- trunk/monodevelop/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs.OptionPanels/CodeFormattingPanel.cs 2009-09-01 09:35:31 UTC (rev 141015) +++ trunk/monodevelop/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs.OptionPanels/CodeFormattingPanel.cs 2009-09-01 09:37:50 UTC (rev 141016) @@ -182,7 +182,7 @@ public bool IsUserMimeType (string type) { - return globalMimeTypes.Contains (type); + return globalMimeTypes != null && globalMimeTypes.Contains (type); } void GetItemMimeTypes (HashSet types, SolutionItem item) From mono-patches-list at lists.ximian.com Tue Sep 1 05:50:58 2009 From: mono-patches-list at lists.ximian.com (Lluis Sanchez (lluis@ximian.com)) Date: Tue, 1 Sep 2009 05:50:58 -0400 (EDT) Subject: [Mono-patches] r141017 - in trunk/mono-addins: . Mono.Addins Mono.Addins.CecilReflector Mono.Addins.Gui Mono.Addins.MSBuild Mono.Addins.Setup Message-ID: <20090901095058.D1DF69472C@mono-cvs.ximian.com> Author: lluis Date: 2009-09-01 05:50:58 -0400 (Tue, 01 Sep 2009) New Revision: 141017 Modified: trunk/mono-addins/ChangeLog trunk/mono-addins/Mono.Addins.CecilReflector/AssemblyInfo.cs trunk/mono-addins/Mono.Addins.CecilReflector/ChangeLog trunk/mono-addins/Mono.Addins.Gui/AssemblyInfo.cs trunk/mono-addins/Mono.Addins.Gui/ChangeLog trunk/mono-addins/Mono.Addins.MSBuild/AssemblyInfo.cs trunk/mono-addins/Mono.Addins.MSBuild/ChangeLog trunk/mono-addins/Mono.Addins.Setup/AssemblyInfo.cs trunk/mono-addins/Mono.Addins.Setup/ChangeLog trunk/mono-addins/Mono.Addins/AssemblyInfo.cs trunk/mono-addins/Mono.Addins/ChangeLog trunk/mono-addins/configure.ac Log: * configure.ac: * Mono.Addins/AssemblyInfo.cs: * Mono.Addins.Gui/AssemblyInfo.cs: * Mono.Addins.Setup/AssemblyInfo.cs: * Mono.Addins.MSBuild/AssemblyInfo.cs: * Mono.Addins.CecilReflector/AssemblyInfo.cs: Bump Mono.Addins version. Modified: trunk/mono-addins/ChangeLog =================================================================== --- trunk/mono-addins/ChangeLog 2009-09-01 09:37:50 UTC (rev 141016) +++ trunk/mono-addins/ChangeLog 2009-09-01 09:50:58 UTC (rev 141017) @@ -1,3 +1,7 @@ +2009-09-01 Lluis Sanchez Gual + + * configure.ac: Bump Mono.Addins version. + 2009-08-25 Lluis Sanchez Gual * Mono.Addins.sln: Disable some projects on windows. Modified: trunk/mono-addins/Mono.Addins/AssemblyInfo.cs =================================================================== --- trunk/mono-addins/Mono.Addins/AssemblyInfo.cs 2009-09-01 09:37:50 UTC (rev 141016) +++ trunk/mono-addins/Mono.Addins/AssemblyInfo.cs 2009-09-01 09:50:58 UTC (rev 141017) @@ -17,4 +17,4 @@ // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("0.4.0.0")] +[assembly: AssemblyVersion("0.5.0.0")] Modified: trunk/mono-addins/Mono.Addins/ChangeLog =================================================================== --- trunk/mono-addins/Mono.Addins/ChangeLog 2009-09-01 09:37:50 UTC (rev 141016) +++ trunk/mono-addins/Mono.Addins/ChangeLog 2009-09-01 09:50:58 UTC (rev 141017) @@ -1,3 +1,7 @@ +2009-09-01 Lluis Sanchez Gual + + * AssemblyInfo.cs: Bump Mono.Addins version. + 2009-08-20 Lluis Sanchez Gual * Makefile.am: Added a new project which Implements an msbuild Modified: trunk/mono-addins/Mono.Addins.CecilReflector/AssemblyInfo.cs =================================================================== --- trunk/mono-addins/Mono.Addins.CecilReflector/AssemblyInfo.cs 2009-09-01 09:37:50 UTC (rev 141016) +++ trunk/mono-addins/Mono.Addins.CecilReflector/AssemblyInfo.cs 2009-09-01 09:50:58 UTC (rev 141017) @@ -17,4 +17,4 @@ // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("0.4.0.0")] +[assembly: AssemblyVersion("0.5.0.0")] Modified: trunk/mono-addins/Mono.Addins.CecilReflector/ChangeLog =================================================================== --- trunk/mono-addins/Mono.Addins.CecilReflector/ChangeLog 2009-09-01 09:37:50 UTC (rev 141016) +++ trunk/mono-addins/Mono.Addins.CecilReflector/ChangeLog 2009-09-01 09:50:58 UTC (rev 141017) @@ -1,3 +1,7 @@ +2009-09-01 Lluis Sanchez Gual + + * AssemblyInfo.cs: Bump Mono.Addins version. + 2009-08-19 Lluis Sanchez Gual * Mono.Addins.CecilReflector.csproj: Update target framework Modified: trunk/mono-addins/Mono.Addins.Gui/AssemblyInfo.cs =================================================================== --- trunk/mono-addins/Mono.Addins.Gui/AssemblyInfo.cs 2009-09-01 09:37:50 UTC (rev 141016) +++ trunk/mono-addins/Mono.Addins.Gui/AssemblyInfo.cs 2009-09-01 09:50:58 UTC (rev 141017) @@ -17,4 +17,4 @@ // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("0.4.0.0")] +[assembly: AssemblyVersion("0.5.0.0")] Modified: trunk/mono-addins/Mono.Addins.Gui/ChangeLog =================================================================== --- trunk/mono-addins/Mono.Addins.Gui/ChangeLog 2009-09-01 09:37:50 UTC (rev 141016) +++ trunk/mono-addins/Mono.Addins.Gui/ChangeLog 2009-09-01 09:50:58 UTC (rev 141017) @@ -1,3 +1,7 @@ +2009-09-01 Lluis Sanchez Gual + + * AssemblyInfo.cs: Bump Mono.Addins version. + 2009-08-20 Lluis Sanchez Gual * Makefile.am: Build using gmcs. Modified: trunk/mono-addins/Mono.Addins.MSBuild/AssemblyInfo.cs =================================================================== --- trunk/mono-addins/Mono.Addins.MSBuild/AssemblyInfo.cs 2009-09-01 09:37:50 UTC (rev 141016) +++ trunk/mono-addins/Mono.Addins.MSBuild/AssemblyInfo.cs 2009-09-01 09:50:58 UTC (rev 141017) @@ -42,7 +42,7 @@ // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. -[assembly: AssemblyVersion("0.4.0.0")] +[assembly: AssemblyVersion("0.5.0.0")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. Modified: trunk/mono-addins/Mono.Addins.MSBuild/ChangeLog =================================================================== --- trunk/mono-addins/Mono.Addins.MSBuild/ChangeLog 2009-09-01 09:37:50 UTC (rev 141016) +++ trunk/mono-addins/Mono.Addins.MSBuild/ChangeLog 2009-09-01 09:50:58 UTC (rev 141017) @@ -1,3 +1,7 @@ +2009-09-01 Lluis Sanchez Gual + + * AssemblyInfo.cs: Bump Mono.Addins version. + 2009-08-25 Lluis Sanchez Gual * Mono.Addins.MSBuild.csproj: Added Default configuration. Modified: trunk/mono-addins/Mono.Addins.Setup/AssemblyInfo.cs =================================================================== --- trunk/mono-addins/Mono.Addins.Setup/AssemblyInfo.cs 2009-09-01 09:37:50 UTC (rev 141016) +++ trunk/mono-addins/Mono.Addins.Setup/AssemblyInfo.cs 2009-09-01 09:50:58 UTC (rev 141017) @@ -17,4 +17,4 @@ // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("0.4.0.0")] +[assembly: AssemblyVersion("0.5.0.0")] Modified: trunk/mono-addins/Mono.Addins.Setup/ChangeLog =================================================================== --- trunk/mono-addins/Mono.Addins.Setup/ChangeLog 2009-09-01 09:37:50 UTC (rev 141016) +++ trunk/mono-addins/Mono.Addins.Setup/ChangeLog 2009-09-01 09:50:58 UTC (rev 141017) @@ -1,3 +1,7 @@ +2009-09-01 Lluis Sanchez Gual + + * AssemblyInfo.cs: Bump Mono.Addins version. + 2009-08-25 Lluis Sanchez Gual * Mono.Addins.Setup/PcFileCache.cs: Updated from MD. Modified: trunk/mono-addins/configure.ac =================================================================== --- trunk/mono-addins/configure.ac 2009-09-01 09:37:50 UTC (rev 141016) +++ trunk/mono-addins/configure.ac 2009-09-01 09:50:58 UTC (rev 141017) @@ -1,7 +1,7 @@ dnl Warning: This is an automatically generated file, do not edit! dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.54]) -AC_INIT([mono-addins], [0.4]) +AC_INIT([mono-addins], [0.5]) AM_INIT_AUTOMAKE([foreign tar-ustar]) AM_MAINTAINER_MODE @@ -11,9 +11,9 @@ AC_MSG_ERROR([You need to install pkg-config]) fi -API_VERSION=0.4.0.0 +API_VERSION=0.5.0.0 AC_SUBST(API_VERSION) -POLICY_VERSIONS="0.2 0.3" +POLICY_VERSIONS="0.2 0.3 0.4" AC_SUBST(POLICY_VERSIONS) AC_PROG_INSTALL From mono-patches-list at lists.ximian.com Tue Sep 1 05:52:44 2009 From: mono-patches-list at lists.ximian.com (Christian Hergert (chris@mosaix.net)) Date: Tue, 1 Sep 2009 05:52:44 -0400 (EDT) Subject: [Mono-patches] r141018 - in trunk/monodevelop/extras/PyBinding/PyBinding: . PyBinding.Parser Message-ID: <20090901095244.C71879472C@mono-cvs.ximian.com> Author: chergert Date: 2009-09-01 05:52:44 -0400 (Tue, 01 Sep 2009) New Revision: 141018 Modified: trunk/monodevelop/extras/PyBinding/PyBinding/ChangeLog trunk/monodevelop/extras/PyBinding/PyBinding/PyBinding.Parser/ParserDatabase.cs Log: * PyBinding.Parser/ParserDatabase.cs: Handle the case where there is no completion database created. Modified: trunk/monodevelop/extras/PyBinding/PyBinding/ChangeLog =================================================================== --- trunk/monodevelop/extras/PyBinding/PyBinding/ChangeLog 2009-09-01 09:50:58 UTC (rev 141017) +++ trunk/monodevelop/extras/PyBinding/PyBinding/ChangeLog 2009-09-01 09:52:44 UTC (rev 141018) @@ -1,3 +1,8 @@ +2009-09-01 Christian Hergert + + * PyBinding.Parser/ParserDatabase.cs: Handle the case where + there is no completion database created. + 2009-08-28 Christian Hergert * Resources/EmptyPyProject.xpt.xml: Open main.py by default Modified: trunk/monodevelop/extras/PyBinding/PyBinding/PyBinding.Parser/ParserDatabase.cs =================================================================== --- trunk/monodevelop/extras/PyBinding/PyBinding/PyBinding.Parser/ParserDatabase.cs 2009-09-01 09:50:58 UTC (rev 141017) +++ trunk/monodevelop/extras/PyBinding/PyBinding/PyBinding.Parser/ParserDatabase.cs 2009-09-01 09:52:44 UTC (rev 141018) @@ -71,7 +71,9 @@ bool NeedsUpgrade { get { - if (!File.Exists (VersionFile)) + if (!File.Exists (m_FileName)) + return false; + else if (!File.Exists (VersionFile)) return true; int version; string content = File.ReadAllText (VersionFile).Trim (); @@ -100,8 +102,10 @@ // Backup if needed var backup = m_FileName + ".bak"; var needsUpgrade = NeedsUpgrade; - if (needsUpgrade) + if (needsUpgrade && File.Exists (m_FileName)) File.Move (m_FileName, backup); + else if (!File.Exists (m_FileName)) + File.WriteAllText (VersionFile, String.Format ("{0}", s_version)); // Build m_conn = new SqliteConnection (connString); @@ -109,7 +113,7 @@ EnsureTables (); if (needsUpgrade) { - File.WriteAllText (m_FileName + ".version", String.Format ("{0}", s_version)); + File.WriteAllText (VersionFile, String.Format ("{0}", s_version)); // Open backup database var conn = new SqliteConnection (ConnStrForFile (backup)); @@ -125,7 +129,9 @@ conn.Close (); conn.Dispose (); - File.Delete (backup); + + if (File.Exists (backup)) + File.Delete (backup); }); } } @@ -257,7 +263,7 @@ void EnsureTables () { - string schemaSql = String.Empty; + string schemaSql; using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream ("Schema.sql")) using (var reader = new StreamReader (stream)) From mono-patches-list at lists.ximian.com Tue Sep 1 05:53:15 2009 From: mono-patches-list at lists.ximian.com (Lluis Sanchez (lluis@ximian.com)) Date: Tue, 1 Sep 2009 05:53:15 -0400 (EDT) Subject: [Mono-patches] r141019 - trunk/monodevelop/extras/MonoDevelop.AddinAuthoring Message-ID: <20090901095315.0CF2E9472C@mono-cvs.ximian.com> Author: lluis Date: 2009-09-01 05:53:14 -0400 (Tue, 01 Sep 2009) New Revision: 141019 Modified: trunk/monodevelop/extras/MonoDevelop.AddinAuthoring/ChangeLog trunk/monodevelop/extras/MonoDevelop.AddinAuthoring/configure Log: * configure: Bump mono-addins dependency. Modified: trunk/monodevelop/extras/MonoDevelop.AddinAuthoring/ChangeLog =================================================================== --- trunk/monodevelop/extras/MonoDevelop.AddinAuthoring/ChangeLog 2009-09-01 09:52:44 UTC (rev 141018) +++ trunk/monodevelop/extras/MonoDevelop.AddinAuthoring/ChangeLog 2009-09-01 09:53:14 UTC (rev 141019) @@ -1,5 +1,9 @@ 2009-09-01 Lluis Sanchez Gual + * configure: Bump mono-addins dependency. + +2009-09-01 Lluis Sanchez Gual + * configure: Updated deps. 2009-08-21 Lluis Sanchez Gual Modified: trunk/monodevelop/extras/MonoDevelop.AddinAuthoring/configure =================================================================== --- trunk/monodevelop/extras/MonoDevelop.AddinAuthoring/configure 2009-09-01 09:52:44 UTC (rev 141018) +++ trunk/monodevelop/extras/MonoDevelop.AddinAuthoring/configure 2009-09-01 09:53:14 UTC (rev 141019) @@ -4,7 +4,7 @@ prefix=/usr/local config=DEBUG configurations=" RELEASE DEBUG" -common_packages=" monodevelop;2.1.0 gtk-sharp-2.0;2.12.8 mono-addins-setup;0.4 mono-addins;0.4" +common_packages=" monodevelop;2.1.0 gtk-sharp-2.0;2.12.8 mono-addins-setup;0.4 mono-addins;0.5" usage () From mono-patches-list at lists.ximian.com Tue Sep 1 05:54:56 2009 From: mono-patches-list at lists.ximian.com (Raja R Harinath (rharinath@novell.com)) Date: Tue, 1 Sep 2009 05:54:56 -0400 (EDT) Subject: [Mono-patches] r141020 - in trunk/mcs/class/System: System Test/System Message-ID: <20090901095456.B77E19472C@mono-cvs.ximian.com> Author: raja Date: 2009-09-01 05:54:56 -0400 (Tue, 01 Sep 2009) New Revision: 141020 Modified: trunk/mcs/class/System/System/ChangeLog trunk/mcs/class/System/System/Uri.cs trunk/mcs/class/System/Test/System/ChangeLog trunk/mcs/class/System/Test/System/UriTest.cs Log: Fix #533572 * Uri.cs (ParseNoExceptions): Don't look for '@' in absolute unix paths. 2009-09-01 Andres Aragoneses * UriTest.cs: New tests from #533572. Modified: trunk/mcs/class/System/System/ChangeLog =================================================================== --- trunk/mcs/class/System/System/ChangeLog 2009-09-01 09:53:14 UTC (rev 141019) +++ trunk/mcs/class/System/System/ChangeLog 2009-09-01 09:54:56 UTC (rev 141020) @@ -1,3 +1,8 @@ +2009-09-01 Raja R Harinath + + Fix #533572 + * Uri.cs (ParseNoExceptions): Don't look for '@' in absolute unix paths. + 2009-05-16 Sebastien Pouliot * Uri.cs (NET_2_1): Remove some extra code for NET_2_1 @@ -7,7 +12,7 @@ * UriParser.cs: Don't use compiled regex on NET_2_1 (feature is not available) -2009-04-21 Sebastien Pouliot +2009-04-21 Sebastien Pouliot * DefaultUriParser.cs: Add special case for schema * Uri.cs: Make sure we can use a default parser if none was Modified: trunk/mcs/class/System/System/Uri.cs =================================================================== --- trunk/mcs/class/System/System/Uri.cs 2009-09-01 09:53:14 UTC (rev 141019) +++ trunk/mcs/class/System/System/Uri.cs 2009-09-01 09:54:56 UTC (rev 141020) @@ -1505,7 +1505,10 @@ } // 4.a user info - pos = uriString.IndexOf ('@', startpos, endpos-startpos); + if (unixAbsPath) + pos = -1; + else + pos = uriString.IndexOf ('@', startpos, endpos-startpos); if (pos != -1) { userinfo = uriString.Substring (startpos, pos-startpos); startpos = pos + 1; Modified: trunk/mcs/class/System/Test/System/ChangeLog =================================================================== --- trunk/mcs/class/System/Test/System/ChangeLog 2009-09-01 09:53:14 UTC (rev 141019) +++ trunk/mcs/class/System/Test/System/ChangeLog 2009-09-01 09:54:56 UTC (rev 141020) @@ -1,3 +1,7 @@ +2009-09-01 Andres Aragoneses + + * UriTest.cs: New tests from #533572. + 2009-06-25 Robert Jordan * UriTest.cs: Upgrade to new NUnit style. @@ -2,3 +6,3 @@ -2009-04-21 Sebastien Pouliot +2009-04-21 Sebastien Pouliot Modified: trunk/mcs/class/System/Test/System/UriTest.cs =================================================================== --- trunk/mcs/class/System/Test/System/UriTest.cs 2009-09-01 09:53:14 UTC (rev 141019) +++ trunk/mcs/class/System/Test/System/UriTest.cs 2009-09-01 09:54:56 UTC (rev 141020) @@ -23,7 +23,7 @@ protected bool isWin32 = false; [TestFixtureSetUp] - public void GetReady () + public void GetReady () { isWin32 = (Path.DirectorySeparatorChar == '\\'); } @@ -45,21 +45,21 @@ uri = new Uri("http://[11:22:33::88]:9090"); Print (uri); - + uri = new Uri("http://[::127.11.22.33]:8080"); Print (uri); - + uri = new Uri("http://[abcde::127.11.22.33]:8080"); - Print (uri); + Print (uri); */ - + /* uri = new Uri ("http://www.contoso.com:1234/foo/bar/"); Print (uri); uri = new Uri ("http://www.contoso.com:1234/foo/bar"); Print (uri); - + uri = new Uri ("http://www.contoso.com:1234/"); Print (uri); @@ -110,7 +110,7 @@ uri = new Uri("myscheme://127.0.0.1:5"); Assert.AreEqual ("myscheme://127.0.0.1:5/", uri.ToString(), "#c1"); - + uri = new Uri (@"\\myserver\mydir\mysubdir\myfile.ext"); Assert.AreEqual ("/mydir/mysubdir/myfile.ext", uri.AbsolutePath, "#n1"); Assert.AreEqual ("file://myserver/mydir/mysubdir/myfile.ext", uri.AbsoluteUri, "#n2"); @@ -135,7 +135,7 @@ Assert.AreEqual ("file", uri.Scheme, "#n15"); Assert.AreEqual (false, uri.UserEscaped, "#n16"); Assert.AreEqual ("", uri.UserInfo, "#n17"); - + uri = new Uri (new Uri("http://www.contoso.com"), "Hello World.htm", true); Assert.AreEqual ("http://www.contoso.com/Hello World.htm", uri.AbsoluteUri, "#rel1a"); Assert.AreEqual (true, uri.UserEscaped, "#rel1b"); @@ -434,7 +434,7 @@ Assert.AreEqual ("foo", u.Host, "#7a"); Assert.AreEqual (UriHostNameType.Dns, u.HostNameType, "#7b"); Assert.AreEqual ("file://foo/bar", u.ToString (), "#7c"); - Assert.AreEqual (true, u.IsUnc, "#7d"); + Assert.AreEqual (true, u.IsUnc, "#7d"); Assert.AreEqual ("file://foo/bar", new Uri ("file://///foo/bar").ToString(), "#9"); @@ -480,7 +480,7 @@ { new Uri ("http:a"); } - + [Test] [ExpectedException (typeof (UriFormatException))] public void HttpHostname3 () @@ -587,7 +587,7 @@ Assert.AreEqual ("file", uri.Scheme, "#1c"); Assert.AreEqual ("", uri.Host, "#1d"); Assert.AreEqual ("c:/tmp/hello.txt", uri.AbsolutePath, "#1e"); - + uri = new Uri ("file:////////cygwin/tmp/hello.txt"); Assert.AreEqual ("file://cygwin/tmp/hello.txt", uri.ToString (), "#3a"); if (isWin32) @@ -607,7 +607,7 @@ Assert.AreEqual ("file", uri.Scheme, "#4c"); Assert.AreEqual ("mymachine", uri.Host, "#4d"); Assert.AreEqual ("/cygwin/tmp/hello.txt", uri.AbsolutePath, "#4e"); - + uri = new Uri ("file://///c:/cygwin/tmp/hello.txt"); Assert.AreEqual ("file:///c:/cygwin/tmp/hello.txt", uri.ToString (), "#5a"); Assert.AreEqual ("c:\\cygwin\\tmp\\hello.txt", uri.LocalPath, "#5b"); @@ -709,30 +709,30 @@ { Uri u1 = new Uri("http://localhost:8080/test.aspx?ReturnUrl=%2fSearchDoc%2fSearcher.aspx"); Uri u2 = new Uri("http://localhost:8080/test.aspx?ReturnUrl=%252fSearchDoc%252fSearcher.aspx"); - + Assert.AreEqual (u1.ToString (), "http://localhost:8080/test.aspx?ReturnUrl=/SearchDoc/Searcher.aspx", "QE1"); Assert.AreEqual (u2.ToString (), "http://localhost:8080/test.aspx?ReturnUrl=%2fSearchDoc%2fSearcher.aspx", "QE2"); } - + [Test] public void UnixPath () { if (!isWin32) Assert.AreEqual ("file:///cygwin/tmp/hello.txt", new Uri ("/cygwin/tmp/hello.txt").ToString (), "#6a"); } - + [Test] public void Unc () { Uri uri = new Uri ("http://www.contoso.com"); Assert.IsTrue (!uri.IsUnc, "#1"); - + uri = new Uri ("news:123456 at contoso.com"); Assert.IsTrue (!uri.IsUnc, "#2"); uri = new Uri ("file://server/filename.ext"); Assert.IsTrue (uri.IsUnc, "#3"); - uri = new Uri (@"\\server\share\filename.ext"); + uri = new Uri (@"\\server\share\filename.ext"); Assert.IsTrue (uri.IsUnc, "#6"); uri = new Uri (@"a:\dir\filename.ext"); @@ -750,7 +750,7 @@ } [Test] - public void FromHex () + public void FromHex () { Assert.AreEqual (0, Uri.FromHex ('0'), "#1"); Assert.AreEqual (9, Uri.FromHex ('9'), "#2"); @@ -801,28 +801,28 @@ } [Test] - public void HexEscape () + public void HexEscape () { - Assert.AreEqual ("%20", Uri.HexEscape (' '), "#1"); - Assert.AreEqual ("%A9", Uri.HexEscape ((char) 0xa9), "#2"); - Assert.AreEqual ("%41", Uri.HexEscape ('A'), "#3"); + Assert.AreEqual ("%20", Uri.HexEscape (' '), "#1"); + Assert.AreEqual ("%A9", Uri.HexEscape ((char) 0xa9), "#2"); + Assert.AreEqual ("%41", Uri.HexEscape ('A'), "#3"); try { Uri.HexEscape ((char) 0x0369); Assert.Fail ("#4"); } catch (ArgumentOutOfRangeException) {} } - [Test] - public void MoreHexEscape() - { - string url = "http://guyc-2003-sp/wiki/wiki%20document%20library/??%20???.docx"; - string escapedAbsolutePath = "/wiki/wiki%20document%20library/%D7%91%D7%93%20%D7%99%D7%A7%D7%94.docx"; - Uri u = new Uri(url); - Assert.AreEqual (escapedAbsolutePath, u.AbsolutePath, "Escaped non-english combo"); - } + [Test] + public void MoreHexEscape() + { + string url = "http://guyc-2003-sp/wiki/wiki%20document%20library/??%20???.docx"; + string escapedAbsolutePath = "/wiki/wiki%20document%20library/%D7%91%D7%93%20%D7%99%D7%A7%D7%94.docx"; + Uri u = new Uri(url); + Assert.AreEqual (escapedAbsolutePath, u.AbsolutePath, "Escaped non-english combo"); + } [Test] - public void HexUnescape () + public void HexUnescape () { int i = 0; Assert.AreEqual (' ', Uri.HexUnescape ("%20", ref i), "#1"); @@ -853,7 +853,7 @@ [Category ("NotDotNet")] #endif [Test] - public void HexUnescapeMultiByte () + public void HexUnescapeMultiByte () { // Tests from bug 74872 // Note: These won't pass exactly with MS.NET, due to differences in the @@ -874,19 +874,19 @@ Assert.AreEqual (0xDB40, path [6], "#4"); Assert.AreEqual (0xDD00, path [7], "#5"); Assert.AreEqual (0x62, path [8], "#6"); - + // 2-byte escape sequence, 2 individual characters uri = new Uri ("file:///foo/a%C2%F8b", true); path = uri.LocalPath; Assert.AreEqual (9, path.Length, "#7"); Assert.AreEqual (0xC2, path [6], "#8"); - Assert.AreEqual (0xF8, path [7], "#9"); + Assert.AreEqual (0xF8, path [7], "#9"); } [Test] - public void IsHexDigit () + public void IsHexDigit () { - Assert.IsTrue (Uri.IsHexDigit ('a'), "#1"); + Assert.IsTrue (Uri.IsHexDigit ('a'), "#1"); Assert.IsTrue (Uri.IsHexDigit ('f'), "#2"); Assert.IsTrue (!Uri.IsHexDigit ('g'), "#3"); Assert.IsTrue (Uri.IsHexDigit ('0'), "#4"); @@ -897,14 +897,14 @@ } [Test] - public void IsHexEncoding () + public void IsHexEncoding () { Assert.IsTrue (Uri.IsHexEncoding ("test%a9test", 4), "#1"); Assert.IsTrue (!Uri.IsHexEncoding ("test%a9test", 3), "#2"); Assert.IsTrue (Uri.IsHexEncoding ("test%a9", 4), "#3"); Assert.IsTrue (!Uri.IsHexEncoding ("test%a", 4), "#4"); } - + [Test] public void GetLeftPart () { @@ -912,7 +912,7 @@ Assert.AreEqual ("http://", uri.GetLeftPart (UriPartial.Scheme), "#1"); Assert.AreEqual ("http://www.contoso.com", uri.GetLeftPart (UriPartial.Authority), "#2"); Assert.AreEqual ("http://www.contoso.com/index.htm", uri.GetLeftPart (UriPartial.Path), "#3"); - + uri = new Uri ("mailto:user at contoso.com?subject=uri"); Assert.AreEqual ("mailto:", uri.GetLeftPart (UriPartial.Scheme), "#4"); Assert.AreEqual ("", uri.GetLeftPart (UriPartial.Authority), "#5"); @@ -921,23 +921,23 @@ uri = new Uri ("nntp://news.contoso.com/123456 at contoso.com"); Assert.AreEqual ("nntp://", uri.GetLeftPart (UriPartial.Scheme), "#7"); Assert.AreEqual ("nntp://news.contoso.com", uri.GetLeftPart (UriPartial.Authority), "#8"); - Assert.AreEqual ("nntp://news.contoso.com/123456 at contoso.com", uri.GetLeftPart (UriPartial.Path), "#9"); - + Assert.AreEqual ("nntp://news.contoso.com/123456 at contoso.com", uri.GetLeftPart (UriPartial.Path), "#9"); + uri = new Uri ("news:123456 at contoso.com"); Assert.AreEqual ("news:", uri.GetLeftPart (UriPartial.Scheme), "#10"); Assert.AreEqual ("", uri.GetLeftPart (UriPartial.Authority), "#11"); - Assert.AreEqual ("news:123456 at contoso.com", uri.GetLeftPart (UriPartial.Path), "#12"); + Assert.AreEqual ("news:123456 at contoso.com", uri.GetLeftPart (UriPartial.Path), "#12"); uri = new Uri ("file://server/filename.ext"); Assert.AreEqual ("file://", uri.GetLeftPart (UriPartial.Scheme), "#13"); Assert.AreEqual ("file://server", uri.GetLeftPart (UriPartial.Authority), "#14"); - Assert.AreEqual ("file://server/filename.ext", uri.GetLeftPart (UriPartial.Path), "#15"); + Assert.AreEqual ("file://server/filename.ext", uri.GetLeftPart (UriPartial.Path), "#15"); uri = new Uri (@"\\server\share\filename.ext"); Assert.AreEqual ("file://", uri.GetLeftPart (UriPartial.Scheme), "#20"); Assert.AreEqual ("file://server", uri.GetLeftPart (UriPartial.Authority), "#21"); Assert.AreEqual ("file://server/share/filename.ext", uri.GetLeftPart (UriPartial.Path), "#22"); - + uri = new Uri ("http://www.contoso.com:8080/index.htm#main"); Assert.AreEqual ("http://", uri.GetLeftPart (UriPartial.Scheme), "#23"); Assert.AreEqual ("http://www.contoso.com:8080", uri.GetLeftPart (UriPartial.Authority), "#24"); @@ -965,7 +965,7 @@ Uri b = new Uri ("http://www.gnome.org"); Uri n = new Uri (b, "blah#main#start"); Assert.AreEqual (n.Fragment, "#main%23start", "#3"); - + n = new Uri (b, "blah#main#start", true); Assert.AreEqual (n.Fragment, "#main#start", "#4"); } @@ -1019,10 +1019,10 @@ Assert.AreEqual (UriHostNameType.Dns, Uri.CheckHostName ("www.contoso.com"), "#9"); Assert.AreEqual (UriHostNameType.Unknown, Uri.CheckHostName (".www.contoso.com"), "#10"); Assert.AreEqual (UriHostNameType.Dns, Uri.CheckHostName ("www.contoso.com."), "#11"); - Assert.AreEqual (UriHostNameType.Dns, Uri.CheckHostName ("www.con-toso.com"), "#12"); - Assert.AreEqual (UriHostNameType.Dns, Uri.CheckHostName ("www.con_toso.com"), "#13"); - Assert.AreEqual (UriHostNameType.Unknown, Uri.CheckHostName ("www.con,toso.com"), "#14"); - + Assert.AreEqual (UriHostNameType.Dns, Uri.CheckHostName ("www.con-toso.com"), "#12"); + Assert.AreEqual (UriHostNameType.Dns, Uri.CheckHostName ("www.con_toso.com"), "#13"); + Assert.AreEqual (UriHostNameType.Unknown, Uri.CheckHostName ("www.con,toso.com"), "#14"); + // test IPv6 Assert.AreEqual (UriHostNameType.IPv6, Uri.CheckHostName ("11:22:33:44:55:66:77:88"), "#15"); Assert.AreEqual (UriHostNameType.IPv6, Uri.CheckHostName ("11::33:44:55:66:77:88"), "#16"); @@ -1059,7 +1059,7 @@ Assert.AreEqual (UriHostNameType.Unknown, Uri.CheckHostName ("*.go-mono.com"), "#46"); Assert.AreEqual (UriHostNameType.Unknown, Uri.CheckHostName ("www*.go-mono.com"), "#47"); } - + [Test] public void IsLoopback () { @@ -1191,7 +1191,7 @@ } [Test] - public void GetHashCodeTest () + public void GetHashCodeTest () { Uri uri1 = new Uri ("http://www.contoso.com/index.htm#main"); Uri uri2 = new Uri ("http://www.contoso.com/index.htm#fragment"); @@ -1247,7 +1247,7 @@ Uri u = new Uri ("foo", UriKind.Relative); u.GetLeftPart (UriPartial.Path); } - + [Test] public void TestPartialToString () { @@ -1257,7 +1257,7 @@ Assert.AreEqual (new Uri ("foo#dingus?aa", UriKind.Relative).ToString (), "foo#dingus?aa", "#4"); Assert.AreEqual (new Uri ("foo?dingus#aa", UriKind.Relative).ToString (), "foo?dingus#aa", "#4"); } - + [Test] public void RelativeGetHashCodeTest() { @@ -1283,30 +1283,30 @@ Assert.AreEqual ("foo/bar/index.htm", uri1.MakeRelative (uri2), "#1"); Assert.AreEqual ("../../index.htm", uri2.MakeRelative (uri1), "#2"); - + Assert.AreEqual ("../../bar/foo/index.htm", uri2.MakeRelative (uri3), "#3"); Assert.AreEqual ("../../foo/bar/index.htm", uri3.MakeRelative (uri2), "#4"); Assert.AreEqual ("../foo2/index.htm", uri3.MakeRelative (uri4), "#5"); Assert.AreEqual ("../foo/index.htm", uri4.MakeRelative (uri3), "#6"); - + Assert.AreEqual ("https://www.contoso.com/bar/foo/index.htm?y=1", uri4.MakeRelative (uri5), "#7"); Assert.AreEqual ("http://www.contoso2.com/bar/foo/index.htm?x=0", uri4.MakeRelative (uri6), "#8"); Assert.AreEqual ("", uri6.MakeRelative (uri6), "#9"); Assert.AreEqual ("foobar.htm", uri6.MakeRelative (uri7), "#10"); - + Uri uri10 = new Uri ("mailto:xxx at xxx.com"); Uri uri11 = new Uri ("mailto:xxx at xxx.com?subject=hola"); Assert.AreEqual ("", uri10.MakeRelative (uri11), "#11"); - + Uri uri12 = new Uri ("mailto:xxx at mail.xxx.com?subject=hola"); Assert.AreEqual ("mailto:xxx at mail.xxx.com?subject=hola", uri10.MakeRelative (uri12), "#12"); - + Uri uri13 = new Uri ("mailto:xxx at xxx.com/foo/bar"); Assert.AreEqual ("/foo/bar", uri10.MakeRelative (uri13), "#13"); - + Assert.AreEqual ("http://www.xxx.com/bar/foo/foobar.htm?z=0&y=5" + (char) 0xa9, uri1.MakeRelative (uri8), "#14"); } @@ -1616,10 +1616,10 @@ public void TestEscapeDataString () { StringBuilder sb = new StringBuilder (); - + for (int i = 0; i < 128; i++) sb.Append ((char) i); - + Assert.AreEqual ("%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20!%22%23%24%25%26'()*%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%7F", Uri.EscapeDataString (sb.ToString ())); @@ -1631,7 +1631,7 @@ StringBuilder sb = new StringBuilder (); for (int i = 0; i < 128; i++) sb.Append ((char) i); - + Assert.AreEqual ("%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20!%22#$%25&'()*+,-./0123456789:;%3C=%3E?@ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%7F", Uri.EscapeUriString (sb.ToString ())); Assert.AreEqual ("%C3%A1", Uri.EscapeDataString ("?")); @@ -1651,7 +1651,7 @@ } // This test doesn't work on Linux, and arguably shouldn't work. - // new Uri("file:///tmp/foo/bar").AbsolutePath returns "/tmp/foo/bar" + // new Uri("file:///tmp/foo/bar").AbsolutePath returns "/tmp/foo/bar" // on Linux, as anyone sane would expect. It *doesn't* under .NET 1.1 // Apparently "tmp" is supposed to be a hostname (!)... // Since "correct" behavior would confuse all Linux developers, and having @@ -1684,7 +1684,7 @@ public static void Print (Uri uri) { - Console.WriteLine ("ToString: " + uri.ToString ()); + Console.WriteLine ("ToString: " + uri.ToString ()); Console.WriteLine ("AbsolutePath: " + uri.AbsolutePath); Console.WriteLine ("AbsoluteUri: " + uri.AbsoluteUri); @@ -1706,12 +1706,126 @@ Console.WriteLine ("Segments:"); string [] segments = uri.Segments; - if (segments == null) + if (segments == null) Console.WriteLine ("\tNo Segments"); - else - for (int i = 0; i < segments.Length; i++) + else + for (int i = 0; i < segments.Length; i++) Console.WriteLine ("\t" + segments[i]); Console.WriteLine (""); } + +//BNC#533572 +#if NET_2_0 + [Test] + public void LocalPath_FileNameWithAtSign1 () + { + string path = "/some/path/file_with_an_ at _sign.mp3"; + string fullpath = "http://thehost" + path; + Uri fileUri = new Uri (fullpath); + + Assert.AreEqual (fileUri.UserInfo, String.Empty, "LocalPath_FileNameWithAtSign UserInfo"); + Assert.AreEqual (fileUri.Host, "thehost", "LocalPath_FileNameWithAtSign Host"); + Assert.IsFalse (fileUri.IsFile, "LocalPath_FileNameWithAtSign IsFile"); + Assert.IsTrue (fileUri.IsAbsoluteUri, "LocalPath_FileNameWithAtSign IsAbsUri"); + Assert.IsFalse (fileUri.IsUnc, "LocalPath_FileNameWithAtSign IsUnc"); + + Assert.AreEqual (fullpath, fileUri.OriginalString, "LocalPath_FileNameWithAtSign OriginalString"); + Assert.AreEqual (path, new DerivedUri (fullpath).TestUnescape (path), "LocalPath_FileNameWithAtSign ProtectedUnescape"); + Assert.AreEqual (path, fileUri.AbsolutePath, "LocalPath_FileNameWithAtSign AbsPath"); + Assert.AreEqual (path, fileUri.LocalPath, "LocalPath_FileNameWithAtSign LocalPath"); + } + + [Test] + public void LocalPath_FileNameWithAtSign2 () + { + string path = "/some/path/file_with_an_ at _sign.mp3"; + string fullpath = "http://user:password at thehost" + path; + Uri fileUri = new Uri (fullpath); + + Assert.AreEqual (fileUri.UserInfo, "user:password", "LocalPath_FileNameWithAtSign UserInfo"); + Assert.AreEqual (fileUri.Host, "thehost", "LocalPath_FileNameWithAtSign Host"); + Assert.IsFalse (fileUri.IsFile, "LocalPath_FileNameWithAtSign IsFile"); + Assert.IsTrue (fileUri.IsAbsoluteUri, "LocalPath_FileNameWithAtSign IsAbsUri"); + Assert.IsFalse (fileUri.IsUnc, "LocalPath_FileNameWithAtSign IsUnc"); + + Assert.AreEqual (fullpath, fileUri.OriginalString, "LocalPath_FileNameWithAtSign OriginalString"); + Assert.AreEqual (path, new DerivedUri (fullpath).TestUnescape (path), "LocalPath_FileNameWithAtSign ProtectedUnescape"); + Assert.AreEqual (path, fileUri.AbsolutePath, "LocalPath_FileNameWithAtSign AbsPath"); + Assert.AreEqual (path, fileUri.LocalPath, "LocalPath_FileNameWithAtSign LocalPath"); + } + + [Test] + public void LocalPath_FileNameWithAtSign3 () + { + string path = "/some/path/file_with_an_ at _sign.mp3"; + string fullpath = "file://" + path; + Uri fileUri = new Uri (fullpath); + + Assert.AreEqual (fileUri.UserInfo, String.Empty, "LocalPath_FileNameWithAtSign UserInfo"); + Assert.AreEqual (fileUri.Host, String.Empty, "LocalPath_FileNameWithAtSign Host"); + Assert.IsTrue (fileUri.IsFile, "LocalPath_FileNameWithAtSign IsFile"); + Assert.IsTrue (fileUri.IsAbsoluteUri, "LocalPath_FileNameWithAtSign IsAbsUri"); + Assert.IsFalse (fileUri.IsUnc, "LocalPath_FileNameWithAtSign IsUnc"); + + Assert.AreEqual (fullpath, fileUri.OriginalString, "LocalPath_FileNameWithAtSign OriginalString"); + Assert.AreEqual (path, new DerivedUri (fullpath).TestUnescape(path), "LocalPath_FileNameWithAtSign ProtectedUnescape"); + Assert.AreEqual (path, fileUri.AbsolutePath, "LocalPath_FileNameWithAtSign AbsPath"); + Assert.AreEqual (path, fileUri.LocalPath, "LocalPath_FileNameWithAtSign LocalPath"); + } + + [Test] + public void LocalPath_FileNameWithAtSign4 () + { + string path = "/some/path/file_with_an_ at _sign.mp3"; + string fullpath = "file://localhost" + path; + Uri fileUri = new Uri (fullpath); + + Assert.AreEqual (fileUri.UserInfo, String.Empty, "LocalPath_FileNameWithAtSign UserInfo"); + Assert.AreEqual (fileUri.Host, "localhost", "LocalPath_FileNameWithAtSign Host"); + Assert.IsTrue (fileUri.IsFile, "LocalPath_FileNameWithAtSign IsFile"); + Assert.IsTrue (fileUri.IsAbsoluteUri, "LocalPath_FileNameWithAtSign IsAbsUri"); + Assert.IsTrue (fileUri.IsUnc, "LocalPath_FileNameWithAtSign IsUnc"); + + Assert.AreEqual (fullpath, fileUri.OriginalString, "LocalPath_FileNameWithAtSign OriginalString"); + Assert.AreEqual (path, new DerivedUri (fullpath).TestUnescape (path), "LocalPath_FileNameWithAtSign ProtectedUnescape"); + Assert.AreEqual (path, fileUri.AbsolutePath, "LocalPath_FileNameWithAtSign AbsPath"); + //this test is marked as NotWorking below: + //Assert.AreEqual ("\\\\localhost" + path.Replace ("/", "\\"), fileUri.LocalPath, "LocalPath_FileNameWithAtSign LocalPath"); + } + + [Test] + [Category ("NotWorking")] + public void LocalPath_FileNameWithAtSign5 () + { + string path = "/some/path/file_with_an_ at _sign.mp3"; + string fullpath = "file://localhost" + path; + Uri fileUri = new Uri (fullpath); + + Assert.AreEqual ("\\\\localhost" + path.Replace ("/", "\\"), fileUri.LocalPath, "LocalPath_FileNameWithAtSign LocalPath"); + } + + [Test] + [Category ("NotWorking")] // MS.NET seems not to like userinfo in a file:// uri... + [ExpectedException (typeof (UriFormatException))] + public void LocalPath_FileNameWithAtSign6 () + { + string path = "/some/path/file_with_an_ at _sign.mp3"; + string fullpath = "file://user:password at localhost" + path; + Uri fileUri = new Uri (fullpath); + } + + + public class DerivedUri : Uri + { + public DerivedUri (string uriString) : base (uriString) + { + } + + internal string TestUnescape (string path) + { + return base.Unescape (path); + } + } +#endif } } From mono-patches-list at lists.ximian.com Tue Sep 1 06:01:43 2009 From: mono-patches-list at lists.ximian.com (Calen Chen (cachen@novell.com)) Date: Tue, 1 Sep 2009 06:01:43 -0400 (EDT) Subject: [Mono-patches] r141021 - in trunk/uia2atk/test/samples/moonlight: . mediaelement mediaelement/MediaElementSample mediaelement/MediaElementSample/MediaElementSample mediaelement/MediaElementSample/MediaElementSample/Bin mediaelement/MediaElementSample/MediaElementSample/Properties mediaelement/MediaElementSample/MediaElementSample/obj mediaelement/MediaElementSample/MediaElementSample/obj/Debug mediaelement/MediaElementSample/MediaElementSample.Web mediaelement/MediaElementSample/MediaElementSample.Web/ClientBin mediaelement/MediaElementSample/MediaElementSample.Web/Properties mediaelement/MediaElementSample/MediaElementSample.Web/obj mediaelement/MediaElementSample/MediaElementSample.Web/obj/Debug Message-ID: <20090901100143.07F789472C@mono-cvs.ximian.com> Author: cachen Date: 2009-09-01 06:01:42 -0400 (Tue, 01 Sep 2009) New Revision: 141021 Added: trunk/uia2atk/test/samples/moonlight/mediaelement/ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample.html trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample.xap trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/App_Data/ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/ClientBin/ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/ClientBin/MediaElementSample.xap trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/ClientBin/media.wmv trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Default.aspx trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Default.aspx.cs trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Default.aspx.designer.cs trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/MediaElementSample.Web.csproj trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/MediaElementSample.Web.csproj.user trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/MediaElementSampleTestPage.aspx trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/MediaElementSampleTestPage.html trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Properties/ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Properties/AssemblyInfo.cs trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Silverlight.js trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Web.config trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/bin/ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/obj/ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/obj/Debug/ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/obj/Debug/TempPE/ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.sln trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.suo trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/App.xaml trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/App.xaml.cs trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/Bin/ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/Bin/Debug/ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/MediaElementSample.csproj trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/MediaElementSample.csproj.user trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/Page.xaml trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/Page.xaml.cs trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/Properties/ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/Properties/AppManifest.xml trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/Properties/AssemblyInfo.cs trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/obj/ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/obj/Debug/ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/obj/Debug/App.g.cs trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/obj/Debug/Page.g.cs trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/obj/Debug/TempPE/ Log: add SL2 MediaElement sample Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/App.xaml =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/App.xaml (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/App.xaml 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,8 @@ +? + + + + Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/App.xaml.cs =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/App.xaml.cs (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/App.xaml.cs 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,66 @@ +?using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace MediaElementSample +{ + public partial class App : Application + { + + public App() + { + this.Startup += this.Application_Startup; + this.Exit += this.Application_Exit; + this.UnhandledException += this.Application_UnhandledException; + + InitializeComponent(); + } + + private void Application_Startup(object sender, StartupEventArgs e) + { + this.RootVisual = new Page(); + } + + private void Application_Exit(object sender, EventArgs e) + { + + } + private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) + { + // If the app is running outside of the debugger then report the exception using + // the browser's exception mechanism. On IE this will display it a yellow alert + // icon in the status bar and Firefox will display a script error. + if (!System.Diagnostics.Debugger.IsAttached) + { + + // NOTE: This will allow the application to continue running after an exception has been thrown + // but not handled. + // For production applications this error handling should be replaced with something that will + // report the error to the website and stop the application. + e.Handled = true; + Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); }); + } + } + private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) + { + try + { + string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; + errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); + + System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight 2 Application " + errorMsg + "\");"); + } + catch (Exception) + { + } + } + } +} Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/MediaElementSample.csproj =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/MediaElementSample.csproj (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/MediaElementSample.csproj 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,94 @@ +? + + Debug + AnyCPU + 9.0.30729 + 2.0 + {3AD3D7D3-BBA4-496B-BF9C-5D3D146CB479} + {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + MediaElementSample + MediaElementSample + v3.5 + true + + + true + true + MediaElementSample.xap + Properties\AppManifest.xml + MediaElementSample.App + TestPage.html + true + true + false + + + true + full + false + Bin\Debug + DEBUG;TRACE;SILVERLIGHT + true + true + prompt + 4 + + + pdbonly + true + Bin\Release + TRACE;SILVERLIGHT + true + true + prompt + 4 + + + + + + + + + + + + + App.xaml + + + Page.xaml + + + + + + MSBuild:MarkupCompilePass1 + Designer + + + MSBuild:MarkupCompilePass1 + Designer + + + + + + + + + + + + + + + \ No newline at end of file Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/MediaElementSample.csproj.user =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/MediaElementSample.csproj.user (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/MediaElementSample.csproj.user 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,25 @@ +? + + + + + + + DynamicPage + True + False + False + + + + + + + + + True + + + + + \ No newline at end of file Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/Page.xaml =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/Page.xaml (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/Page.xaml 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,31 @@ +? + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/Page.xaml.cs =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/Page.xaml.cs (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/Page.xaml.cs 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,68 @@ +?using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; +using System.Windows.Threading; + +namespace MediaElementSample +{ + public partial class Page : UserControl + { + private DispatcherTimer timer; + public Page() + { + InitializeComponent(); + btnPlayPause.Checked += new RoutedEventHandler(btnPlayPause_Checked); + btnPlayPause.Unchecked += new RoutedEventHandler(btnPlayPause_Unchecked); + + VideoElement.CurrentStateChanged += new RoutedEventHandler(VideoElement_CurrentStateChanged); + + timer = new DispatcherTimer(); + timer.Interval = TimeSpan.FromMilliseconds(50); + timer.Tick += new EventHandler(timer_Tick); + } + void timer_Tick(object sender, EventArgs e) + { + if (VideoElement.NaturalDuration.TimeSpan.TotalSeconds > 0) + { + txtVideoPosition.Text = + string.Format("{0:00}:{1:00}", VideoElement.Position.Minutes, VideoElement.Position.Seconds); + + sliderScrubber.Value = VideoElement.Position.TotalSeconds / + VideoElement.NaturalDuration.TimeSpan.TotalSeconds; + } + } + + void VideoElement_CurrentStateChanged(object sender, RoutedEventArgs e) + { + if (VideoElement.CurrentState == MediaElementState.Playing) + { + timer.Start(); + } + else + { + timer.Stop(); + } + } + + void btnPlayPause_Unchecked(object sender, RoutedEventArgs e) + { + VideoElement.Play(); + btnPlayPause.Content = "Pause"; + } + + private void btnPlayPause_Checked(object sender, RoutedEventArgs e) + { + VideoElement.Pause(); + btnPlayPause.Content = "Play"; + } + } +} + Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/Properties/AppManifest.xml =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/Properties/AppManifest.xml (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/Properties/AppManifest.xml 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,6 @@ +? + + + Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/Properties/AssemblyInfo.cs =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/Properties/AssemblyInfo.cs (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/Properties/AssemblyInfo.cs 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,35 @@ +?using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MediaElementSample")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MediaElementSample")] +[assembly: AssemblyCopyright("Copyright ? 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("5d342766-5bd1-4488-9955-3e26ee9a58e6")] + +// 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("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/obj/Debug/App.g.cs =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/obj/Debug/App.g.cs (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/obj/Debug/App.g.cs 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,52 @@ +#pragma checksum "C:\Users\Neville\Documents\Visual Studio 2008\Projects\MediaElementSample\MediaElementSample\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "51E39E598B8C7EF17F2112EFDE6F99EE" +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.4927 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Windows; +using System.Windows.Automation; +using System.Windows.Automation.Peers; +using System.Windows.Automation.Provider; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Interop; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Imaging; +using System.Windows.Resources; +using System.Windows.Shapes; +using System.Windows.Threading; + + +namespace MediaElementSample { + + + public partial class App : System.Windows.Application { + + private bool _contentLoaded; + + /// + /// InitializeComponent + /// + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + public void InitializeComponent() { + if (_contentLoaded) { + return; + } + _contentLoaded = true; + System.Windows.Application.LoadComponent(this, new System.Uri("/MediaElementSample;component/App.xaml", System.UriKind.Relative)); + } + } +} Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/obj/Debug/Page.g.cs =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/obj/Debug/Page.g.cs (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample/obj/Debug/Page.g.cs 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,70 @@ +#pragma checksum "C:\Users\Neville\Documents\Visual Studio 2008\Projects\MediaElementSample\MediaElementSample\Page.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "4DB2E806901A7429902789DE1F221085" +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.4927 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Windows; +using System.Windows.Automation; +using System.Windows.Automation.Peers; +using System.Windows.Automation.Provider; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Interop; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Imaging; +using System.Windows.Resources; +using System.Windows.Shapes; +using System.Windows.Threading; + + +namespace MediaElementSample { + + + public partial class Page : System.Windows.Controls.UserControl { + + internal System.Windows.Controls.Grid LayoutRoot; + + internal System.Windows.Controls.TextBlock label1; + + internal System.Windows.Controls.MediaElement VideoElement; + + internal System.Windows.Controls.Primitives.ToggleButton btnPlayPause; + + internal System.Windows.Controls.Slider sliderScrubber; + + internal System.Windows.Controls.TextBlock txtVideoPosition; + + private bool _contentLoaded; + + /// + /// InitializeComponent + /// + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + public void InitializeComponent() { + if (_contentLoaded) { + return; + } + _contentLoaded = true; + System.Windows.Application.LoadComponent(this, new System.Uri("/MediaElementSample;component/Page.xaml", System.UriKind.Relative)); + this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot"))); + this.label1 = ((System.Windows.Controls.TextBlock)(this.FindName("label1"))); + this.VideoElement = ((System.Windows.Controls.MediaElement)(this.FindName("VideoElement"))); + this.btnPlayPause = ((System.Windows.Controls.Primitives.ToggleButton)(this.FindName("btnPlayPause"))); + this.sliderScrubber = ((System.Windows.Controls.Slider)(this.FindName("sliderScrubber"))); + this.txtVideoPosition = ((System.Windows.Controls.TextBlock)(this.FindName("txtVideoPosition"))); + } + } +} Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/ClientBin/MediaElementSample.xap =================================================================== (Binary files differ) Property changes on: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/ClientBin/MediaElementSample.xap ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/ClientBin/media.wmv =================================================================== (Binary files differ) Property changes on: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/ClientBin/media.wmv ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Default.aspx =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Default.aspx (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Default.aspx 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,16 @@ +?<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MediaElementSample.Web._Default" %> + + + + + + + + +
+
+ +
+
+ + Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Default.aspx.cs =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Default.aspx.cs (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Default.aspx.cs 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,17 @@ +?using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace MediaElementSample.Web +{ + public partial class _Default : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Default.aspx.designer.cs =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Default.aspx.designer.cs (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Default.aspx.designer.cs 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,27 @@ +?//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.42 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace MediaElementSample.Web +{ + + + public partial class _Default + { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + } +} Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/MediaElementSample.Web.csproj =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/MediaElementSample.Web.csproj (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/MediaElementSample.Web.csproj 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,107 @@ +? + + Debug + AnyCPU + 9.0.30729 + 2.0 + {DB90974C-B83E-417F-806B-FB7430F1D2FD} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + MediaElementSample.Web + MediaElementSample.Web + v3.5 + {3AD3D7D3-BBA4-496B-BF9C-5D3D146CB479}|..\MediaElementSample\MediaElementSample.csproj|ClientBin|False + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + 3.5 + + + + + + + + + + + + + + + + + + + + + ASPXCodeBehind + Default.aspx + + + Default.aspx + + + + + + + + + + + + + + False + True + 49182 + / + + + False + False + + + False + + + + + \ No newline at end of file Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/MediaElementSample.Web.csproj.user =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/MediaElementSample.Web.csproj.user (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/MediaElementSample.Web.csproj.user 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,35 @@ +? + + + + + MediaElementSampleTestPage.aspx + SpecificPage + True + True + False + False + RunFiles + + + False + True + + + + + + + + + False + True + False + + MediaElementSample.xap + + + + + + \ No newline at end of file Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/MediaElementSampleTestPage.aspx =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/MediaElementSampleTestPage.aspx (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/MediaElementSampleTestPage.aspx 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,20 @@ +?<%@ Page Language="C#" AutoEventWireup="true" %> + +<%@ Register Assembly="System.Web.Silverlight" Namespace="System.Web.UI.SilverlightControls" + TagPrefix="asp" %> + + + + + + MediaElementSample + + +
+ +
+ +
+
+ + \ No newline at end of file Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/MediaElementSampleTestPage.html =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/MediaElementSampleTestPage.html (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/MediaElementSampleTestPage.html 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,77 @@ +? + + + + MediaElementSample + + + + + + + + +
+ +
+ + + + + + + + Get Microsoft Silverlight + + + +
+ + Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Properties/AssemblyInfo.cs =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Properties/AssemblyInfo.cs (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Properties/AssemblyInfo.cs 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,35 @@ +?using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MediaElementSample.Web")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MediaElementSample.Web")] +[assembly: AssemblyCopyright("Copyright ? 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")] + +// 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("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Silverlight.js =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Silverlight.js (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Silverlight.js 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,486 @@ +?if (!window.Silverlight) +{ + window.Silverlight = { }; +} + +// Silverlight control instance counter for memory mgt +Silverlight._silverlightCount = 0; +Silverlight.fwlinkRoot='http://go2.microsoft.com/fwlink/?LinkID='; +Silverlight.onGetSilverlight = null; +Silverlight.onSilverlightInstalled = function () {window.location.reload(false);}; + +////////////////////////////////////////////////////////////////// +// isInstalled, checks to see if the correct version is installed +////////////////////////////////////////////////////////////////// +Silverlight.isInstalled = function(version) +{ + var isVersionSupported=false; + var container = null; + + try + { + var control = null; + + try + { + control = new ActiveXObject('AgControl.AgControl'); + if ( version == null ) + { + isVersionSupported = true; + } + else if ( control.IsVersionSupported(version) ) + { + isVersionSupported = true; + } + control = null; + } + catch (e) + { + var plugin = navigator.plugins["Silverlight Plug-In"] ; + if ( plugin ) + { + if ( version === null ) + { + isVersionSupported = true; + } + else + { + var actualVer = plugin.description; + if ( actualVer === "1.0.30226.2") + actualVer = "2.0.30226.2"; + var actualVerArray =actualVer.split("."); + while ( actualVerArray.length > 3) + { + actualVerArray.pop(); + } + while ( actualVerArray.length < 4) + { + actualVerArray.push(0); + } + var reqVerArray = version.split("."); + while ( reqVerArray.length > 4) + { + reqVerArray.pop(); + } + + var requiredVersionPart ; + var actualVersionPart + var index = 0; + + + do + { + requiredVersionPart = parseInt(reqVerArray[index]); + actualVersionPart = parseInt(actualVerArray[index]); + index++; + } + while (index < reqVerArray.length && requiredVersionPart === actualVersionPart); + + if ( requiredVersionPart <= actualVersionPart && !isNaN(requiredVersionPart) ) + { + isVersionSupported = true; + } + } + } + } + } + catch (e) + { + isVersionSupported = false; + } + if (container) + { + document.body.removeChild(container); + } + + return isVersionSupported; +} +Silverlight.WaitForInstallCompletion = function() +{ + if ( ! Silverlight.isBrowserRestartRequired && Silverlight.onSilverlightInstalled ) + { + try + { + navigator.plugins.refresh(); + } + catch(e) + { + } + if ( Silverlight.isInstalled(null) ) + { + Silverlight.onSilverlightInstalled(); + } + else + { + setTimeout(Silverlight.WaitForInstallCompletion, 3000); + } + } +} +Silverlight.__startup = function() +{ + Silverlight.isBrowserRestartRequired = Silverlight.isInstalled(null);//(!window.ActiveXObject || Silverlight.isInstalled(null)); + if ( !Silverlight.isBrowserRestartRequired) + { + Silverlight.WaitForInstallCompletion(); + } + if (window.removeEventListener) { + window.removeEventListener('load', Silverlight.__startup , false); + } + else { + window.detachEvent('onload', Silverlight.__startup ); + } +} + +if (window.addEventListener) +{ + window.addEventListener('load', Silverlight.__startup , false); +} +else +{ + window.attachEvent('onload', Silverlight.__startup ); +} + +/////////////////////////////////////////////////////////////////////////////// +// createObject(); Params: +// parentElement of type Element, the parent element of the Silverlight Control +// source of type String +// id of type string +// properties of type String, object literal notation { name:value, name:value, name:value}, +// current properties are: width, height, background, framerate, isWindowless, enableHtmlAccess, inplaceInstallPrompt: all are of type string +// events of type String, object literal notation { name:value, name:value, name:value}, +// current events are onLoad onError, both are type string +// initParams of type Object or object literal notation { name:value, name:value, name:value} +// userContext of type Object +///////////////////////////////////////////////////////////////////////////////// + +Silverlight.createObject = function(source, parentElement, id, properties, events, initParams, userContext) +{ + var slPluginHelper = new Object(); + var slProperties = properties; + var slEvents = events; + + slPluginHelper.version = slProperties.version; + slProperties.source = source; + slPluginHelper.alt = slProperties.alt; + + //rename properties to their tag property names + if ( initParams ) + slProperties.initParams = initParams; + if ( slProperties.isWindowless && !slProperties.windowless) + slProperties.windowless = slProperties.isWindowless; + if ( slProperties.framerate && !slProperties.maxFramerate) + slProperties.maxFramerate = slProperties.framerate; + if ( id && !slProperties.id) + slProperties.id = id; + + // remove elements which are not to be added to the instantiation tag + delete slProperties.ignoreBrowserVer; + delete slProperties.inplaceInstallPrompt; + delete slProperties.version; + delete slProperties.isWindowless; + delete slProperties.framerate; + delete slProperties.data; + delete slProperties.src; + delete slProperties.alt; + + + // detect that the correct version of Silverlight is installed, else display install + + if (Silverlight.isInstalled(slPluginHelper.version)) + { + //move unknown events to the slProperties array + for (var name in slEvents) + { + if ( slEvents[name]) + { + if ( name == "onLoad" && typeof slEvents[name] == "function" && slEvents[name].length != 1 ) + { + var onLoadHandler = slEvents[name]; + slEvents[name]=function (sender){ return onLoadHandler(document.getElementById(id), userContext, sender)}; + } + var handlerName = Silverlight.__getHandlerName(slEvents[name]); + if ( handlerName != null ) + { + slProperties[name] = handlerName; + slEvents[name] = null; + } + else + { + throw "typeof events."+name+" must be 'function' or 'string'"; + } + } + } + slPluginHTML = Silverlight.buildHTML(slProperties); + } + //The control could not be instantiated. Show the installation prompt + else + { + slPluginHTML = Silverlight.buildPromptHTML(slPluginHelper); + } + + // insert or return the HTML + if(parentElement) + { + parentElement.innerHTML = slPluginHTML; + } + else + { + return slPluginHTML; + } + +} + +/////////////////////////////////////////////////////////////////////////////// +// +// create HTML that instantiates the control +// +/////////////////////////////////////////////////////////////////////////////// +Silverlight.buildHTML = function( slProperties) +{ + var htmlBuilder = []; + + htmlBuilder.push(''); + + delete slProperties.id; + delete slProperties.width; + delete slProperties.height; + + for (var name in slProperties) + { + if (slProperties[name]) + { + htmlBuilder.push(''); + } + } + htmlBuilder.push('<\/object>'); + return htmlBuilder.join(''); +} + + + + +// createObjectEx, takes a single parameter of all createObject parameters enclosed in {} +Silverlight.createObjectEx = function(params) +{ + var parameters = params; + var html = Silverlight.createObject(parameters.source, parameters.parentElement, parameters.id, parameters.properties, parameters.events, parameters.initParams, parameters.context); + if (parameters.parentElement == null) + { + return html; + } +} + +/////////////////////////////////////////////////////////////////////////////////////////////// +// Builds the HTML to prompt the user to download and install Silverlight +/////////////////////////////////////////////////////////////////////////////////////////////// +Silverlight.buildPromptHTML = function(slPluginHelper) +{ + var slPluginHTML = ""; + var urlRoot = Silverlight.fwlinkRoot; + var shortVer = slPluginHelper.version ; + if ( slPluginHelper.alt ) + { + slPluginHTML = slPluginHelper.alt; + } + else + { + if (! shortVer ) + { + shortVer=""; + } + slPluginHTML = "Get Microsoft Silverlight"; + slPluginHTML = slPluginHTML.replace('{1}', shortVer ); + slPluginHTML = slPluginHTML.replace('{2}', urlRoot + '108181'); + } + + return slPluginHTML; +} + + +Silverlight.getSilverlight = function(version) +{ + if (Silverlight.onGetSilverlight ) + { + Silverlight.onGetSilverlight(); + } + + var shortVer = ""; + var reqVerArray = String(version).split("."); + if (reqVerArray.length > 1) + { + var majorNum = parseInt(reqVerArray[0] ); + if ( isNaN(majorNum) || majorNum < 2 ) + { + shortVer = "1.0"; + } + else + { + shortVer = reqVerArray[0]+'.'+reqVerArray[1]; + } + } + + var verArg = ""; + + if (shortVer.match(/^\d+\056\d+$/) ) + { + verArg = "&v="+shortVer; + } + + Silverlight.followFWLink("114576" + verArg); +} + + +/////////////////////////////////////////////////////////////////////////////////////////////// +/// Navigates to a url based on fwlinkid +/////////////////////////////////////////////////////////////////////////////////////////////// +Silverlight.followFWLink = function(linkid) +{ + top.location=Silverlight.fwlinkRoot+String(linkid); +} + + + + + + + + + + + + +/////////////////////////////////////////////////////////////////////////////////////////////// +/// Encodes special characters in input strings as charcodes +/////////////////////////////////////////////////////////////////////////////////////////////// +Silverlight.HtmlAttributeEncode = function( strInput ) +{ + var c; + var retVal = ''; + + if(strInput == null) + { + return null; + } + + for(var cnt = 0; cnt < strInput.length; cnt++) + { + c = strInput.charCodeAt(cnt); + + if (( ( c > 96 ) && ( c < 123 ) ) || + ( ( c > 64 ) && ( c < 91 ) ) || + ( ( c > 43 ) && ( c < 58 ) && (c!=47)) || + ( c == 95 )) + { + retVal = retVal + String.fromCharCode(c); + } + else + { + retVal = retVal + '&#' + c + ';'; + } + } + + return retVal; +} +/////////////////////////////////////////////////////////////////////////////// +// +// Default error handling function to be used when a custom error handler is +// not present +// +/////////////////////////////////////////////////////////////////////////////// + +Silverlight.default_error_handler = function (sender, args) +{ + var iErrorCode; + var errorType = args.ErrorType; + + iErrorCode = args.ErrorCode; + + var errMsg = "\nSilverlight error message \n" ; + + errMsg += "ErrorCode: "+ iErrorCode + "\n"; + + + errMsg += "ErrorType: " + errorType + " \n"; + errMsg += "Message: " + args.ErrorMessage + " \n"; + + if (errorType == "ParserError") + { + errMsg += "XamlFile: " + args.xamlFile + " \n"; + errMsg += "Line: " + args.lineNumber + " \n"; + errMsg += "Position: " + args.charPosition + " \n"; + } + else if (errorType == "RuntimeError") + { + if (args.lineNumber != 0) + { + errMsg += "Line: " + args.lineNumber + " \n"; + errMsg += "Position: " + args.charPosition + " \n"; + } + errMsg += "MethodName: " + args.methodName + " \n"; + } + alert (errMsg); +} + +/////////////////////////////////////////////////////////////////////////////////////////////// +/// Releases event handler resources when the page is unloaded +/////////////////////////////////////////////////////////////////////////////////////////////// +Silverlight.__cleanup = function () +{ + for (var i = Silverlight._silverlightCount - 1; i >= 0; i--) { + window['__slEvent' + i] = null; + } + Silverlight._silverlightCount = 0; + if (window.removeEventListener) { + window.removeEventListener('unload', Silverlight.__cleanup , false); + } + else { + window.detachEvent('onunload', Silverlight.__cleanup ); + } +} +/////////////////////////////////////////////////////////////////////////////////////////////// +/// Releases event handler resources when the page is unloaded +/////////////////////////////////////////////////////////////////////////////////////////////// +Silverlight.__getHandlerName = function (handler) +{ + var handlerName = ""; + if ( typeof handler == "string") + { + handlerName = handler; + } + else if ( typeof handler == "function" ) + { + if (Silverlight._silverlightCount == 0) + { + if (window.addEventListener) + { + window.addEventListener('onunload', Silverlight.__cleanup , false); + } + else + { + window.attachEvent('onunload', Silverlight.__cleanup ); + } + } + var count = Silverlight._silverlightCount++; + handlerName = "__slEvent"+count; + + window[handlerName]=handler; + } + else + { + handlerName = null; + } + return handlerName; +} \ No newline at end of file Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Web.config =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Web.config (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.Web/Web.config 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,107 @@ +? + + + + +
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.sln =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.sln (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.sln 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,26 @@ +? +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaElementSample", "MediaElementSample\MediaElementSample.csproj", "{3AD3D7D3-BBA4-496B-BF9C-5D3D146CB479}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaElementSample.Web", "MediaElementSample.Web\MediaElementSample.Web.csproj", "{DB90974C-B83E-417F-806B-FB7430F1D2FD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3AD3D7D3-BBA4-496B-BF9C-5D3D146CB479}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3AD3D7D3-BBA4-496B-BF9C-5D3D146CB479}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3AD3D7D3-BBA4-496B-BF9C-5D3D146CB479}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3AD3D7D3-BBA4-496B-BF9C-5D3D146CB479}.Release|Any CPU.Build.0 = Release|Any CPU + {DB90974C-B83E-417F-806B-FB7430F1D2FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DB90974C-B83E-417F-806B-FB7430F1D2FD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DB90974C-B83E-417F-806B-FB7430F1D2FD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DB90974C-B83E-417F-806B-FB7430F1D2FD}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.suo =================================================================== (Binary files differ) Property changes on: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample/MediaElementSample.suo ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample.html =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample.html (rev 0) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample.html 2009-09-01 10:01:42 UTC (rev 141021) @@ -0,0 +1,77 @@ +? + + + + MediaElementSample + + + + + + + + +
+ +
+ + + + + + + + Get Microsoft Silverlight + + + +
+ + Added: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample.xap =================================================================== (Binary files differ) Property changes on: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample.xap ___________________________________________________________________ Added: svn:mime-type + application/octet-stream From mono-patches-list at lists.ximian.com Tue Sep 1 06:01:59 2009 From: mono-patches-list at lists.ximian.com (Calen Chen (cachen@novell.com)) Date: Tue, 1 Sep 2009 06:01:59 -0400 (EDT) Subject: [Mono-patches] r141022 - trunk/uia2atk/test Message-ID: <20090901100159.15DE79472C@mono-cvs.ximian.com> Author: cachen Date: 2009-09-01 06:01:58 -0400 (Tue, 01 Sep 2009) New Revision: 141022 Modified: trunk/uia2atk/test/ChangeLog Log: update ChangeLog Modified: trunk/uia2atk/test/ChangeLog =================================================================== --- trunk/uia2atk/test/ChangeLog 2009-09-01 10:01:42 UTC (rev 141021) +++ trunk/uia2atk/test/ChangeLog 2009-09-01 10:01:58 UTC (rev 141022) @@ -1,5 +1,9 @@ 2009-09-01 Calen Chen + * samples/moonlight/mediaelement/: add SL2 MediaElement sample + +2009-09-01 Calen Chen + * samples/moonlight/image/: add SL2 Image sample 2009-08-31 Calen Chen From mono-patches-list at lists.ximian.com Tue Sep 1 06:08:37 2009 From: mono-patches-list at lists.ximian.com (Neville Gao (NGao@novell.com)) Date: Tue, 1 Sep 2009 06:08:37 -0400 (EDT) Subject: [Mono-patches] r141023 - in trunk/uia2atk/test: . samples/moonlight samples/moonlight/listbox samples/moonlight/listbox/ListBoxSample samples/moonlight/listbox/ListBoxSample/ListBoxSample samples/moonlight/listbox/ListBoxSample/ListBoxSample/Bin samples/moonlight/listbox/ListBoxSample/ListBoxSample/Bin/Debug samples/moonlight/listbox/ListBoxSample/ListBoxSample/Properties samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug samples/moonlight/passwordbox samples/moonlight/passwordbox/PasswordBox samples/moonlight/passwordbox/PasswordBox/PasswordBox samples/moonlight/passwordbox/PasswordBox/PasswordBox/Bin samples/moonlight/passwordbox/PasswordBox/PasswordBox/Bin/Debug samples/moonlight/passwordbox/PasswordBox/PasswordBox/Properties samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug Message-ID: <20090901100837.190EE9472C@mono-cvs.ximian.com> Author: ngao Date: 2009-09-01 06:08:36 -0400 (Tue, 01 Sep 2009) New Revision: 141023 Added: trunk/uia2atk/test/samples/moonlight/listbox/ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample.html trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample.xap trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample.sln trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample.suo trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/App.xaml trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/App.xaml.cs trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Bin/ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Bin/Debug/ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Bin/Debug/AppManifest.xaml trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Bin/Debug/ListBoxSample.dll trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Bin/Debug/ListBoxSample.pdb trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/ListBoxSample.csproj trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/ListBoxSample.csproj.user trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Page.xaml trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Page.xaml.cs trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Properties/ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Properties/AppManifest.xml trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Properties/AssemblyInfo.cs trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/App.g.cs trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/ListBoxSample.csproj.FileListAbsolute.txt trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/ListBoxSample.dll trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/ListBoxSample.g.resources trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/ListBoxSample.pdb trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/Page.g.cs trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/Refactor/ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/TempPE/ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/XapCacheFile.xml trunk/uia2atk/test/samples/moonlight/passwordbox/ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox.xap trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox.sln trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox.suo trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/App.xaml trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/App.xaml.cs trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Bin/ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Bin/Debug/ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Bin/Debug/AppManifest.xaml trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Bin/Debug/PasswordBox.dll trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Bin/Debug/PasswordBox.pdb trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Page.xaml trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Page.xaml.cs trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/PasswordBox.csproj trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/PasswordBox.csproj.user trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Properties/ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Properties/AppManifest.xml trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Properties/AssemblyInfo.cs trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/App.g.cs trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/Page.g.cs trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/PasswordBox.csproj.FileListAbsolute.txt trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/PasswordBox.dll trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/PasswordBox.g.resources trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/PasswordBox.pdb trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/TempPE/ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/XapCacheFile.xml trunk/uia2atk/test/samples/moonlight/passwordbox/TestPage.html Modified: trunk/uia2atk/test/ChangeLog Log: Added SL2 samples. Modified: trunk/uia2atk/test/ChangeLog =================================================================== --- trunk/uia2atk/test/ChangeLog 2009-09-01 10:01:58 UTC (rev 141022) +++ trunk/uia2atk/test/ChangeLog 2009-09-01 10:08:36 UTC (rev 141023) @@ -1,3 +1,8 @@ +2009-09-01 Neville Gao + + * samples/moonlight/listbox/: + * samples/moonlight/passwordbox/: Added SL2 samples. + 2009-09-01 Calen Chen * samples/moonlight/mediaelement/: add SL2 MediaElement sample Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/App.xaml =================================================================== --- trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/App.xaml (rev 0) +++ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/App.xaml 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,8 @@ +? + + + + Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/App.xaml ___________________________________________________________________ Added: svn:executable + * Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/App.xaml.cs =================================================================== --- trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/App.xaml.cs (rev 0) +++ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/App.xaml.cs 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,66 @@ +?using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace ListBoxSample +{ + public partial class App : Application + { + + public App() + { + this.Startup += this.Application_Startup; + this.Exit += this.Application_Exit; + this.UnhandledException += this.Application_UnhandledException; + + InitializeComponent(); + } + + private void Application_Startup(object sender, StartupEventArgs e) + { + this.RootVisual = new Page(); + } + + private void Application_Exit(object sender, EventArgs e) + { + + } + private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) + { + // If the app is running outside of the debugger then report the exception using + // the browser's exception mechanism. On IE this will display it a yellow alert + // icon in the status bar and Firefox will display a script error. + if (!System.Diagnostics.Debugger.IsAttached) + { + + // NOTE: This will allow the application to continue running after an exception has been thrown + // but not handled. + // For production applications this error handling should be replaced with something that will + // report the error to the website and stop the application. + e.Handled = true; + Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); }); + } + } + private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) + { + try + { + string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; + errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); + + System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight 2 Application " + errorMsg + "\");"); + } + catch (Exception) + { + } + } + } +} Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/App.xaml.cs ___________________________________________________________________ Added: svn:executable + * Added: svn:eol-style + native Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Bin/Debug/AppManifest.xaml =================================================================== --- trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Bin/Debug/AppManifest.xaml (rev 0) +++ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Bin/Debug/AppManifest.xaml 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,5 @@ +? + + + + \ No newline at end of file Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Bin/Debug/AppManifest.xaml ___________________________________________________________________ Added: svn:executable + * Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Bin/Debug/ListBoxSample.dll =================================================================== (Binary files differ) Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Bin/Debug/ListBoxSample.dll ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Bin/Debug/ListBoxSample.pdb =================================================================== (Binary files differ) Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Bin/Debug/ListBoxSample.pdb ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/ListBoxSample.csproj =================================================================== --- trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/ListBoxSample.csproj (rev 0) +++ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/ListBoxSample.csproj 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,94 @@ +? + + Debug + AnyCPU + 9.0.30729 + 2.0 + {024DBEDB-6601-4C36-AC85-EA1177B95AB9} + {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + ListBoxSample + ListBoxSample + v3.5 + true + + + true + true + ListBoxSample.xap + Properties\AppManifest.xml + ListBoxSample.App + TestPage.html + true + true + false + + + true + full + false + Bin\Debug + DEBUG;TRACE;SILVERLIGHT + true + true + prompt + 4 + + + pdbonly + true + Bin\Release + TRACE;SILVERLIGHT + true + true + prompt + 4 + + + + + + + + + + + + + App.xaml + + + Page.xaml + + + + + + MSBuild:MarkupCompilePass1 + Designer + + + MSBuild:MarkupCompilePass1 + Designer + + + + + + + + + + + + + + + \ No newline at end of file Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/ListBoxSample.csproj ___________________________________________________________________ Added: svn:executable + * Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/ListBoxSample.csproj.user =================================================================== --- trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/ListBoxSample.csproj.user (rev 0) +++ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/ListBoxSample.csproj.user 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,25 @@ +? + + + + + + + DynamicPage + True + False + False + + + + + + + + + True + + + + + \ No newline at end of file Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/ListBoxSample.csproj.user ___________________________________________________________________ Added: svn:executable + * Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Page.xaml =================================================================== --- trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Page.xaml (rev 0) +++ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Page.xaml 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,18 @@ +? + + + + + + + + + + + + + + \ No newline at end of file Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Page.xaml ___________________________________________________________________ Added: svn:executable + * Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Page.xaml.cs =================================================================== --- trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Page.xaml.cs (rev 0) +++ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Page.xaml.cs 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,30 @@ +?using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace ListBoxSample +{ + public partial class Page : UserControl + { + public Page() + { + InitializeComponent(); + + textBlock.Text = "You selected no item."; + } + + private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + ListBoxItem listBoxItem = ((sender as ListBox).SelectedItem as ListBoxItem); + textBlock.Text = "You selected " + listBoxItem.Content.ToString() + "."; + } + } +} Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Page.xaml.cs ___________________________________________________________________ Added: svn:executable + * Added: svn:eol-style + native Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Properties/AppManifest.xml =================================================================== --- trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Properties/AppManifest.xml (rev 0) +++ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Properties/AppManifest.xml 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,6 @@ +? + + + Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Properties/AppManifest.xml ___________________________________________________________________ Added: svn:executable + * Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Properties/AssemblyInfo.cs =================================================================== --- trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Properties/AssemblyInfo.cs (rev 0) +++ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Properties/AssemblyInfo.cs 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,35 @@ +?using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ListBoxSample")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ListBoxSample")] +[assembly: AssemblyCopyright("Copyright ? 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d2e57b82-f065-4047-9b8e-b4a1f7baf8e0")] + +// 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("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/Properties/AssemblyInfo.cs ___________________________________________________________________ Added: svn:executable + * Added: svn:eol-style + native Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/App.g.cs =================================================================== --- trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/App.g.cs (rev 0) +++ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/App.g.cs 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,52 @@ +#pragma checksum "C:\Users\Neville\Documents\Visual Studio 2008\Projects\ListBoxSample\ListBoxSample\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "108591D60A8BFE0654AF5908F64E8BD6" +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.4927 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Windows; +using System.Windows.Automation; +using System.Windows.Automation.Peers; +using System.Windows.Automation.Provider; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Interop; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Imaging; +using System.Windows.Resources; +using System.Windows.Shapes; +using System.Windows.Threading; + + +namespace ListBoxSample { + + + public partial class App : System.Windows.Application { + + private bool _contentLoaded; + + /// + /// InitializeComponent + /// + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + public void InitializeComponent() { + if (_contentLoaded) { + return; + } + _contentLoaded = true; + System.Windows.Application.LoadComponent(this, new System.Uri("/ListBoxSample;component/App.xaml", System.UriKind.Relative)); + } + } +} Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/App.g.cs ___________________________________________________________________ Added: svn:executable + * Added: svn:eol-style + native Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/ListBoxSample.csproj.FileListAbsolute.txt =================================================================== --- trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/ListBoxSample.csproj.FileListAbsolute.txt (rev 0) +++ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/ListBoxSample.csproj.FileListAbsolute.txt 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,12 @@ +C:\Users\Neville\Documents\Visual Studio 2008\Projects\ListBoxSample\ListBoxSample\Bin\Debug\AppManifest.xaml +C:\Users\Neville\Documents\Visual Studio 2008\Projects\ListBoxSample\ListBoxSample\Bin\Debug\ListBoxSample.dll +C:\Users\Neville\Documents\Visual Studio 2008\Projects\ListBoxSample\ListBoxSample\Bin\Debug\ListBoxSample.pdb +C:\Users\Neville\Documents\Visual Studio 2008\Projects\ListBoxSample\ListBoxSample\Bin\Debug\ListBoxSample.xap +C:\Users\Neville\Documents\Visual Studio 2008\Projects\ListBoxSample\ListBoxSample\Bin\Debug\TestPage.html +C:\Users\Neville\Documents\Visual Studio 2008\Projects\ListBoxSample\ListBoxSample\obj\Debug\ResolveAssemblyReference.cache +C:\Users\Neville\Documents\Visual Studio 2008\Projects\ListBoxSample\ListBoxSample\obj\Debug\App.g.cs +C:\Users\Neville\Documents\Visual Studio 2008\Projects\ListBoxSample\ListBoxSample\obj\Debug\Page.g.cs +C:\Users\Neville\Documents\Visual Studio 2008\Projects\ListBoxSample\ListBoxSample\obj\Debug\ListBoxSample.g.resources +C:\Users\Neville\Documents\Visual Studio 2008\Projects\ListBoxSample\ListBoxSample\obj\Debug\ListBoxSample.dll +C:\Users\Neville\Documents\Visual Studio 2008\Projects\ListBoxSample\ListBoxSample\obj\Debug\ListBoxSample.pdb +C:\Users\Neville\Documents\Visual Studio 2008\Projects\ListBoxSample\ListBoxSample\obj\Debug\XapCacheFile.xml Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/ListBoxSample.csproj.FileListAbsolute.txt ___________________________________________________________________ Added: svn:executable + * Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/ListBoxSample.dll =================================================================== (Binary files differ) Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/ListBoxSample.dll ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/ListBoxSample.g.resources =================================================================== (Binary files differ) Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/ListBoxSample.g.resources ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/ListBoxSample.pdb =================================================================== (Binary files differ) Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/ListBoxSample.pdb ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/Page.g.cs =================================================================== --- trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/Page.g.cs (rev 0) +++ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/Page.g.cs 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,61 @@ +#pragma checksum "C:\Users\Neville\Documents\Visual Studio 2008\Projects\ListBoxSample\ListBoxSample\Page.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "FEA1A3FFB012F8EAF54D7D55785FC6B9" +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.4927 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Windows; +using System.Windows.Automation; +using System.Windows.Automation.Peers; +using System.Windows.Automation.Provider; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Interop; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Imaging; +using System.Windows.Resources; +using System.Windows.Shapes; +using System.Windows.Threading; + + +namespace ListBoxSample { + + + public partial class Page : System.Windows.Controls.UserControl { + + internal System.Windows.Controls.Grid LayoutRoot; + + internal System.Windows.Controls.TextBlock textBlock; + + internal System.Windows.Controls.ListBox listBox; + + private bool _contentLoaded; + + /// + /// InitializeComponent + /// + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + public void InitializeComponent() { + if (_contentLoaded) { + return; + } + _contentLoaded = true; + System.Windows.Application.LoadComponent(this, new System.Uri("/ListBoxSample;component/Page.xaml", System.UriKind.Relative)); + this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot"))); + this.textBlock = ((System.Windows.Controls.TextBlock)(this.FindName("textBlock"))); + this.listBox = ((System.Windows.Controls.ListBox)(this.FindName("listBox"))); + } + } +} Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/Page.g.cs ___________________________________________________________________ Added: svn:executable + * Added: svn:eol-style + native Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/XapCacheFile.xml =================================================================== --- trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/XapCacheFile.xml (rev 0) +++ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/XapCacheFile.xml 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,4 @@ + + + + \ No newline at end of file Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample/obj/Debug/XapCacheFile.xml ___________________________________________________________________ Added: svn:executable + * Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample.sln =================================================================== --- trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample.sln (rev 0) +++ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample.sln 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,20 @@ +? +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ListBoxSample", "ListBoxSample\ListBoxSample.csproj", "{024DBEDB-6601-4C36-AC85-EA1177B95AB9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {024DBEDB-6601-4C36-AC85-EA1177B95AB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {024DBEDB-6601-4C36-AC85-EA1177B95AB9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {024DBEDB-6601-4C36-AC85-EA1177B95AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {024DBEDB-6601-4C36-AC85-EA1177B95AB9}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample.sln ___________________________________________________________________ Added: svn:executable + * Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample.suo =================================================================== (Binary files differ) Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample/ListBoxSample.suo ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample.html =================================================================== --- trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample.html (rev 0) +++ trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample.html 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,77 @@ +? + + + + ListBoxSample + + + + + + + + +
+ +
+ + + + + + + + Get Microsoft Silverlight + + + +
+ + Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample.html ___________________________________________________________________ Added: svn:executable + * Added: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample.xap =================================================================== (Binary files differ) Property changes on: trunk/uia2atk/test/samples/moonlight/listbox/ListBoxSample.xap ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/App.xaml =================================================================== --- trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/App.xaml (rev 0) +++ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/App.xaml 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,8 @@ +? + + + + Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/App.xaml ___________________________________________________________________ Added: svn:executable + * Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/App.xaml.cs =================================================================== --- trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/App.xaml.cs (rev 0) +++ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/App.xaml.cs 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,66 @@ +?using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace PasswordBox +{ + public partial class App : Application + { + + public App() + { + this.Startup += this.Application_Startup; + this.Exit += this.Application_Exit; + this.UnhandledException += this.Application_UnhandledException; + + InitializeComponent(); + } + + private void Application_Startup(object sender, StartupEventArgs e) + { + this.RootVisual = new Page(); + } + + private void Application_Exit(object sender, EventArgs e) + { + + } + private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) + { + // If the app is running outside of the debugger then report the exception using + // the browser's exception mechanism. On IE this will display it a yellow alert + // icon in the status bar and Firefox will display a script error. + if (!System.Diagnostics.Debugger.IsAttached) + { + + // NOTE: This will allow the application to continue running after an exception has been thrown + // but not handled. + // For production applications this error handling should be replaced with something that will + // report the error to the website and stop the application. + e.Handled = true; + Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); }); + } + } + private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) + { + try + { + string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; + errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); + + System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight 2 Application " + errorMsg + "\");"); + } + catch (Exception) + { + } + } + } +} Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/App.xaml.cs ___________________________________________________________________ Added: svn:executable + * Added: svn:eol-style + native Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Bin/Debug/AppManifest.xaml =================================================================== --- trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Bin/Debug/AppManifest.xaml (rev 0) +++ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Bin/Debug/AppManifest.xaml 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,5 @@ +? + + + + \ No newline at end of file Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Bin/Debug/AppManifest.xaml ___________________________________________________________________ Added: svn:executable + * Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Bin/Debug/PasswordBox.dll =================================================================== (Binary files differ) Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Bin/Debug/PasswordBox.dll ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Bin/Debug/PasswordBox.pdb =================================================================== (Binary files differ) Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Bin/Debug/PasswordBox.pdb ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Page.xaml =================================================================== --- trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Page.xaml (rev 0) +++ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Page.xaml 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,9 @@ +? + + + + + Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Page.xaml ___________________________________________________________________ Added: svn:executable + * Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Page.xaml.cs =================================================================== --- trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Page.xaml.cs (rev 0) +++ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Page.xaml.cs 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,31 @@ +?using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace PasswordBox +{ + public partial class Page : UserControl + { + public Page() + { + InitializeComponent(); + } + + private int pwdChanges = 0; + + private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e) + { + int count = ++pwdChanges; + string s = count == 1 ? "" : "s"; + textBlock.Text = string.Format("You changed {0} time{1}.", Convert.ToString(count), s); + } + } +} Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Page.xaml.cs ___________________________________________________________________ Added: svn:executable + * Added: svn:eol-style + native Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/PasswordBox.csproj =================================================================== --- trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/PasswordBox.csproj (rev 0) +++ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/PasswordBox.csproj 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,94 @@ +? + + Debug + AnyCPU + 9.0.30729 + 2.0 + {5592C7C1-2E00-4E2A-83F2-48457FD5608F} + {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + PasswordBox + PasswordBox + v3.5 + true + + + true + true + PasswordBox.xap + Properties\AppManifest.xml + PasswordBox.App + TestPage.html + true + true + false + + + true + full + false + Bin\Debug + DEBUG;TRACE;SILVERLIGHT + true + true + prompt + 4 + + + pdbonly + true + Bin\Release + TRACE;SILVERLIGHT + true + true + prompt + 4 + + + + + + + + + + + + + App.xaml + + + Page.xaml + + + + + + MSBuild:MarkupCompilePass1 + Designer + + + MSBuild:MarkupCompilePass1 + Designer + + + + + + + + + + + + + + + \ No newline at end of file Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/PasswordBox.csproj ___________________________________________________________________ Added: svn:executable + * Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/PasswordBox.csproj.user =================================================================== --- trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/PasswordBox.csproj.user (rev 0) +++ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/PasswordBox.csproj.user 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,25 @@ +? + + + + + + + DynamicPage + True + False + False + + + + + + + + + True + + + + + \ No newline at end of file Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/PasswordBox.csproj.user ___________________________________________________________________ Added: svn:executable + * Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Properties/AppManifest.xml =================================================================== --- trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Properties/AppManifest.xml (rev 0) +++ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Properties/AppManifest.xml 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,6 @@ +? + + + Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Properties/AppManifest.xml ___________________________________________________________________ Added: svn:executable + * Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Properties/AssemblyInfo.cs =================================================================== --- trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Properties/AssemblyInfo.cs (rev 0) +++ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Properties/AssemblyInfo.cs 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,35 @@ +?using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("PasswordBox")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PasswordBox")] +[assembly: AssemblyCopyright("Copyright ? 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("1ba92941-9256-42f6-830b-61bf20abd81b")] + +// 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("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/Properties/AssemblyInfo.cs ___________________________________________________________________ Added: svn:executable + * Added: svn:eol-style + native Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/App.g.cs =================================================================== --- trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/App.g.cs (rev 0) +++ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/App.g.cs 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,52 @@ +#pragma checksum "C:\Users\Neville\Documents\Visual Studio 2008\Projects\PasswordBox\PasswordBox\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "3446225024FE80A9B8887CCF60EDCBAC" +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.4927 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Windows; +using System.Windows.Automation; +using System.Windows.Automation.Peers; +using System.Windows.Automation.Provider; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Interop; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Imaging; +using System.Windows.Resources; +using System.Windows.Shapes; +using System.Windows.Threading; + + +namespace PasswordBox { + + + public partial class App : System.Windows.Application { + + private bool _contentLoaded; + + /// + /// InitializeComponent + /// + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + public void InitializeComponent() { + if (_contentLoaded) { + return; + } + _contentLoaded = true; + System.Windows.Application.LoadComponent(this, new System.Uri("/PasswordBox;component/App.xaml", System.UriKind.Relative)); + } + } +} Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/App.g.cs ___________________________________________________________________ Added: svn:executable + * Added: svn:eol-style + native Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/Page.g.cs =================================================================== --- trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/Page.g.cs (rev 0) +++ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/Page.g.cs 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,61 @@ +#pragma checksum "C:\Users\Neville\Documents\Visual Studio 2008\Projects\PasswordBox\PasswordBox\Page.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "F48E0A65D6062A0C74675165519677E3" +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.4927 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Windows; +using System.Windows.Automation; +using System.Windows.Automation.Peers; +using System.Windows.Automation.Provider; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Interop; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Imaging; +using System.Windows.Resources; +using System.Windows.Shapes; +using System.Windows.Threading; + + +namespace PasswordBox { + + + public partial class Page : System.Windows.Controls.UserControl { + + internal System.Windows.Controls.Grid LayoutRoot; + + internal System.Windows.Controls.TextBlock textBlock; + + internal System.Windows.Controls.PasswordBox pwdBox; + + private bool _contentLoaded; + + /// + /// InitializeComponent + /// + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + public void InitializeComponent() { + if (_contentLoaded) { + return; + } + _contentLoaded = true; + System.Windows.Application.LoadComponent(this, new System.Uri("/PasswordBox;component/Page.xaml", System.UriKind.Relative)); + this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot"))); + this.textBlock = ((System.Windows.Controls.TextBlock)(this.FindName("textBlock"))); + this.pwdBox = ((System.Windows.Controls.PasswordBox)(this.FindName("pwdBox"))); + } + } +} Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/Page.g.cs ___________________________________________________________________ Added: svn:executable + * Added: svn:eol-style + native Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/PasswordBox.csproj.FileListAbsolute.txt =================================================================== --- trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/PasswordBox.csproj.FileListAbsolute.txt (rev 0) +++ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/PasswordBox.csproj.FileListAbsolute.txt 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,12 @@ +C:\Users\Neville\Documents\Visual Studio 2008\Projects\PasswordBox\PasswordBox\Bin\Debug\AppManifest.xaml +C:\Users\Neville\Documents\Visual Studio 2008\Projects\PasswordBox\PasswordBox\Bin\Debug\PasswordBox.dll +C:\Users\Neville\Documents\Visual Studio 2008\Projects\PasswordBox\PasswordBox\Bin\Debug\PasswordBox.pdb +C:\Users\Neville\Documents\Visual Studio 2008\Projects\PasswordBox\PasswordBox\Bin\Debug\PasswordBox.xap +C:\Users\Neville\Documents\Visual Studio 2008\Projects\PasswordBox\PasswordBox\Bin\Debug\TestPage.html +C:\Users\Neville\Documents\Visual Studio 2008\Projects\PasswordBox\PasswordBox\obj\Debug\ResolveAssemblyReference.cache +C:\Users\Neville\Documents\Visual Studio 2008\Projects\PasswordBox\PasswordBox\obj\Debug\App.g.cs +C:\Users\Neville\Documents\Visual Studio 2008\Projects\PasswordBox\PasswordBox\obj\Debug\Page.g.cs +C:\Users\Neville\Documents\Visual Studio 2008\Projects\PasswordBox\PasswordBox\obj\Debug\PasswordBox.g.resources +C:\Users\Neville\Documents\Visual Studio 2008\Projects\PasswordBox\PasswordBox\obj\Debug\PasswordBox.dll +C:\Users\Neville\Documents\Visual Studio 2008\Projects\PasswordBox\PasswordBox\obj\Debug\PasswordBox.pdb +C:\Users\Neville\Documents\Visual Studio 2008\Projects\PasswordBox\PasswordBox\obj\Debug\XapCacheFile.xml Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/PasswordBox.csproj.FileListAbsolute.txt ___________________________________________________________________ Added: svn:executable + * Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/PasswordBox.dll =================================================================== (Binary files differ) Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/PasswordBox.dll ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/PasswordBox.g.resources =================================================================== (Binary files differ) Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/PasswordBox.g.resources ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/PasswordBox.pdb =================================================================== (Binary files differ) Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/PasswordBox.pdb ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/XapCacheFile.xml =================================================================== --- trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/XapCacheFile.xml (rev 0) +++ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/XapCacheFile.xml 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,4 @@ + + + + \ No newline at end of file Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox/obj/Debug/XapCacheFile.xml ___________________________________________________________________ Added: svn:executable + * Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox.sln =================================================================== --- trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox.sln (rev 0) +++ trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox.sln 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,20 @@ +? +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PasswordBox", "PasswordBox\PasswordBox.csproj", "{5592C7C1-2E00-4E2A-83F2-48457FD5608F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5592C7C1-2E00-4E2A-83F2-48457FD5608F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5592C7C1-2E00-4E2A-83F2-48457FD5608F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5592C7C1-2E00-4E2A-83F2-48457FD5608F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5592C7C1-2E00-4E2A-83F2-48457FD5608F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox.sln ___________________________________________________________________ Added: svn:executable + * Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox.suo =================================================================== (Binary files differ) Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox/PasswordBox.suo ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox.xap =================================================================== (Binary files differ) Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/PasswordBox.xap ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/uia2atk/test/samples/moonlight/passwordbox/TestPage.html =================================================================== --- trunk/uia2atk/test/samples/moonlight/passwordbox/TestPage.html (rev 0) +++ trunk/uia2atk/test/samples/moonlight/passwordbox/TestPage.html 2009-09-01 10:08:36 UTC (rev 141023) @@ -0,0 +1,77 @@ +? + + + + PasswordBox + + + + + + + + +
+ +
+ + + + + + + + Get Microsoft Silverlight + + + +
+ + Property changes on: trunk/uia2atk/test/samples/moonlight/passwordbox/TestPage.html ___________________________________________________________________ Added: svn:executable + * From mono-patches-list at lists.ximian.com Tue Sep 1 06:11:05 2009 From: mono-patches-list at lists.ximian.com (Calen Chen (cachen@novell.com)) Date: Tue, 1 Sep 2009 06:11:05 -0400 (EDT) Subject: [Mono-patches] r141024 - in trunk/uia2atk/test/samples/moonlight/mediaelement: . ClientBin Message-ID: <20090901101105.6EA7D9472C@mono-cvs.ximian.com> Author: cachen Date: 2009-09-01 06:11:05 -0400 (Tue, 01 Sep 2009) New Revision: 141024 Added: trunk/uia2atk/test/samples/moonlight/mediaelement/ClientBin/ trunk/uia2atk/test/samples/moonlight/mediaelement/ClientBin/MediaElementSample.xap trunk/uia2atk/test/samples/moonlight/mediaelement/ClientBin/media.wmv Removed: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample.xap Modified: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample.html Log: update MediaElementSample.html and media source Added: trunk/uia2atk/test/samples/moonlight/mediaelement/ClientBin/MediaElementSample.xap =================================================================== (Binary files differ) Property changes on: trunk/uia2atk/test/samples/moonlight/mediaelement/ClientBin/MediaElementSample.xap ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/uia2atk/test/samples/moonlight/mediaelement/ClientBin/media.wmv =================================================================== (Binary files differ) Property changes on: trunk/uia2atk/test/samples/moonlight/mediaelement/ClientBin/media.wmv ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample.html =================================================================== --- trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample.html 2009-09-01 10:08:36 UTC (rev 141023) +++ trunk/uia2atk/test/samples/moonlight/mediaelement/MediaElementSample.html 2009-09-01 10:11:05 UTC (rev 141024) @@ -17,7 +17,7 @@ height: 100%; } - +