Permalink
Browse files

Tons of bugfixes

  • Loading branch information...
1 parent 9ef55d8 commit f3f0b1702954031a1d322b71d28f85abb9e15d6a Garrett Serack committed May 24, 2012
Showing with 584 additions and 453 deletions.
  1. +8 −2 CoApp.Client.csproj
  2. +1 −0 CoApp.Service.csproj
  3. +1 −0 Packaging/Client/Feed.cs
  4. +0 −19 Packaging/Client/FeedState.cs
  5. +3 −15 Packaging/Client/Package.cs
  6. +20 −3 Packaging/Client/PackageManager.cs
  7. +16 −2 Packaging/Client/PackageManagerResponseImpl.cs
  8. +2 −1 Packaging/Client/Session.cs
  9. +5 −4 Packaging/Client/UI/InstSelection.cs
  10. +0 −57 Packaging/Client/UI/InstallChoice.cs
  11. +170 −189 Packaging/Client/UI/Installer.cs
  12. +13 −12 Packaging/Client/UI/InstallerMainWindow.xaml
  13. +50 −7 Packaging/Client/UI/InstallerMainWindow.xaml.cs
  14. +4 −1 Packaging/Common/IPackageManager.cs
  15. +3 −1 Packaging/Common/IPackageManagerResponse.cs
  16. +39 −0 Packaging/Common/Model/Feature.cs
  17. +37 −0 Packaging/Common/Model/Role.cs
  18. +1 −1 Packaging/Service/CoAppServiceInstaller.cs
  19. +1 −0 Packaging/Service/CoAppServiceMain.cs
  20. +10 −8 Packaging/Service/Package.cs
  21. +64 −57 Packaging/Service/PackageManagerImpl.cs
  22. +2 −2 Packaging/Service/PackageRequestData.cs
  23. +1 −1 Packaging/Service/Session.cs
  24. +10 −2 Packaging/Service/feeds/PackageFeed.cs
  25. BIN binaries/CoApp.Resources.dll
  26. +24 −4 cleaner/CleanerMain.cs
  27. +8 −16 cli/CoAppMain.cs
  28. +16 −16 cli/Resources/HelpText.txt
  29. +2 −2 source/CoApp.Bootstrap.VersionInfo.h
  30. +2 −2 source/CoApp.Toolkit.AssemblyStrongName.cs
  31. +4 −3 toolkit/Extensions/StringExtensions.cs
  32. +38 −8 toolkit/Extensions/TypeExtensions.cs
  33. +1 −0 toolkit/Linq/Filter.cs
  34. +1 −1 toolkit/Linq/Serialization/Xml/ExpressionXmlSerializer.cs
  35. +15 −16 toolkit/Pipes/IncomingCallDispatcher.cs
  36. +12 −1 toolkit/Pipes/UrlEncodedMessage.cs
View
@@ -58,14 +58,16 @@
<ItemGroup>
<Compile Include="Packaging\Client\PackageManagerResponseImpl.cs" />
<Compile Include="Packaging\Client\Delegates.cs" />
- <Compile Include="Packaging\Client\UI\InstallChoice.cs" />
<Compile Include="Packaging\Client\UI\InstallerFailureState.cs" />
<Compile Include="Packaging\Client\UI\InstSelection.cs" />
+ <Compile Include="Packaging\Client\UI\PopupQuestion.xaml.cs">
+ <DependentUpon>PopupQuestion.xaml</DependentUpon>
+ </Compile>
<Compile Include="Packaging\Client\UI\RemoveCommand.cs" />
<Compile Include="Packaging\Common\CanonicalName.cs" />
<Compile Include="Packaging\Client\PackageManager.cs" />
<Compile Include="Packaging\Client\Feed.cs" />
- <Compile Include="Packaging\Client\FeedState.cs" />
+ <Compile Include="Packaging\Common\FeedState.cs" />
<Compile Include="Packaging\Client\UI\Installer.cs" />
<Compile Include="Packaging\Client\LoggingSettings.cs" />
<Compile Include="Packaging\Client\Package.cs" />
@@ -141,6 +143,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
+ <Page Include="Packaging\Client\UI\PopupQuestion.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="Packaging\Client\UI\Styles.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
View
@@ -69,6 +69,7 @@
<Compile Include="Packaging\Common\Exceptions\UnableToStartServiceException.cs" />
<Compile Include="Packaging\Common\Exceptions\UnableToStopServiceException.cs" />
<Compile Include="Packaging\Common\Exceptions\UnknownPackageException.cs" />
+ <Compile Include="Packaging\Common\FeedState.cs" />
<Compile Include="Packaging\Common\FlavorString.cs" />
<Compile Include="Packaging\Common\IPackage.cs" />
<Compile Include="Packaging\Common\IPackageManager.cs" />
View
@@ -12,6 +12,7 @@
namespace CoApp.Packaging.Client {
using System;
+ using Common;
public class Feed {
public string Location { get; internal set; }
@@ -1,19 +0,0 @@
-//-----------------------------------------------------------------------
-// <copyright company="CoApp Project">
-// Copyright (c) 2010-2012 Garrett Serack and CoApp Contributors.
-// Contributors can be discovered using the 'git log' command.
-// All rights reserved.
-// </copyright>
-// <license>
-// The software is licensed under the Apache 2.0 License (the "License")
-// You may not use the software except in compliance with the License.
-// </license>
-//-----------------------------------------------------------------------
-
-namespace CoApp.Packaging.Client {
- public enum FeedState {
- Active,
- Passive,
- Ignored
- }
-}
@@ -35,7 +35,7 @@ public class Package : IPackage {
private bool _isDependency;
private bool _isTrimable;
private bool _isInstalled;
- private string _packageItemText;
+
private PackageState _packageState;
private IPackage _availableNewest;
@@ -65,19 +65,6 @@ public class Package : IPackage {
Feeds = Enumerable.Empty<Uri>();
}
-
- [Persistable]
- public string PackageItemText {
- get {
- DemandLoad();
- return _packageItemText;
- }
- internal set {
- IsPackageInfoStale = false;
- _packageItemText = value;
- }
- }
-
[NotPersistable]
internal bool IsPackageInfoStale { get; set; }
@@ -106,8 +93,9 @@ public class Package : IPackage {
[Persistable]
public PackageDetails PackageDetails {
get {
+ DemandLoad();
if (IsPackageDetailsStale) {
- PackageManager.Instance.GetPackageDetails(this);
+ PackageManager.Instance.GetPackageDetails(this).Wait();
}
return _packageDetails;
}
@@ -20,6 +20,7 @@ namespace CoApp.Packaging.Client {
using System.Xml.Linq;
using Common;
using Common.Exceptions;
+ using Common.Model.Atom;
using Toolkit.Extensions;
using Toolkit.Linq;
using Toolkit.Logging;
@@ -508,7 +509,7 @@ public class PackageManager {
}
public Task SetFeed(string feedLocation, FeedState state) {
- return Remote.SetFeedFlags(feedLocation, state.ToString());
+ return Remote.SetFeedFlags(feedLocation, state);
}
public Task<IEnumerable<Feed>> Feeds {
@@ -659,8 +660,24 @@ public class PackageManager {
// GS01: TrustedPublishers Coming Soon.
- public Task RecognizeFile(string filename) {
- return Remote.RecognizeFile("", filename, "");
+ public Task<IEnumerable<Package>> RecognizeFile(string filename) {
+ return (Remote.RecognizeFile(null, filename, null) as Task<PackageManagerResponseImpl>).Continue( response => response.Packages);
+ }
+
+ public Task<IEnumerable<Package>> RecognizeFiles(IEnumerable<string> filenames) {
+ return (Remote.RecognizeFiles(filenames) as Task<PackageManagerResponseImpl>).Continue( response => response.Packages );
+ }
+
+ public Task<AtomItem> GetAtomItem(CanonicalName canonicalName) {
+ return GetAtomFeed(canonicalName.SingleItemAsEnumerable()).Continue( feed => feed.Items.FirstOrDefault() as AtomItem);
+ }
+
+ public Task<AtomFeed> GetAtomFeed(CanonicalName canonicalName) {
+ return GetAtomFeed(canonicalName.SingleItemAsEnumerable());
+ }
+
+ public Task<AtomFeed> GetAtomFeed(IEnumerable<CanonicalName> canonicalNames) {
+ return (Remote.GetAtomFeed(canonicalNames) as Task<PackageManagerResponseImpl>).Continue(response => response.Feed);
}
}
}
@@ -15,10 +15,13 @@ namespace CoApp.Packaging.Client {
using System.Collections.Generic;
using System.IO;
using System.Linq;
+ using System.ServiceModel.Syndication;
using System.Threading.Tasks;
+ using System.Xml;
using Common;
using Common.Exceptions;
using Common.Model;
+ using Common.Model.Atom;
using Toolkit.Collections;
using Toolkit.Exceptions;
using Toolkit.Extensions;
@@ -36,6 +39,7 @@ public class PackageManagerResponseImpl : IPackageManagerResponse {
private readonly Lazy<List<GeneralPackageInformation>> _gpi = new Lazy<List<GeneralPackageInformation>>(() => new List<GeneralPackageInformation>());
private readonly Lazy<List<Policy>> _policies = new Lazy<List<Policy>>(() => new List<Policy>());
private readonly Lazy<List<ScheduledTask>> _scheduledTasks = new Lazy<List<ScheduledTask>>(() => new List<ScheduledTask>());
+ private AtomFeed _feed;
private readonly IncomingCallDispatcher<IPackageManagerResponse> _dispatcher;
@@ -75,6 +79,12 @@ public class PackageManagerResponseImpl : IPackageManagerResponse {
}
}
+ internal AtomFeed Feed {
+ get {
+ return _feed ?? new AtomFeed();
+ }
+ }
+
internal string OperationCanceledReason;
internal Package UpgradablePackage;
internal IEnumerable<Package> PotentialUpgrades;
@@ -132,13 +142,13 @@ public class PackageManagerResponseImpl : IPackageManagerResponse {
result.IsPackageDetailsStale = false;
}
- public void FeedDetails(string location, DateTime lastScanned, bool session, bool suppressed, bool validated, string state) {
+ public void FeedDetails(string location, DateTime lastScanned, bool session, bool suppressed, bool validated, FeedState state) {
_feeds.Value.Add(new Feed {
Location = location,
LastScanned = lastScanned,
IsSession = session,
IsSuppressed = suppressed,
- FeedState = state.ParseEnum(FeedState.Active)
+ FeedState = state
});
}
@@ -388,5 +398,9 @@ public class PackageManagerResponseImpl : IPackageManagerResponse {
public void LoggingSettings(bool messages, bool warnings, bool errors) {
LoggingSettingsResult = new LoggingSettings {Messages = messages, Warnings = warnings, Errors = errors};
}
+
+ public void AtomFeedText(string atomText) {
+ _feed = AtomFeed.Load(atomText);
+ }
}
}
@@ -113,7 +113,8 @@ internal class ManualEventQueue : Queue<UrlEncodedMessage>, IDisposable {
}
}
- private Session() : base(WriteAsync) {
+ private Session()
+ : base(typeof(IPackageManager), WriteAsync) {
_remoteService = this.ActLike();
}
@@ -11,15 +11,16 @@
//-----------------------------------------------------------------------
namespace CoApp.Packaging.Client.UI {
+ using Common;
using Toolkit.Extensions;
public class InstSelection {
- public InstSelection(InstallChoice key, string value, params object[] args) {
- Key = key;
- Value = value.format(args);
+ public InstSelection(IPackage package, string value) {
+ Package = (Package)package;
+ Value = value.format(package.Version);
}
- public InstallChoice Key { get; set; }
+ public Package Package{ get; set; }
public string Value { get; set; }
}
}
@@ -1,57 +0,0 @@
-//-----------------------------------------------------------------------
-// <copyright company="CoApp Project">
-// Copyright (c) 2010-2012 Garrett Serack and CoApp Contributors.
-// Contributors can be discovered using the 'git log' command.
-// All rights reserved.
-// </copyright>
-// <license>
-// The software is licensed under the Apache 2.0 License (the "License")
-// You may not use the software except in compliance with the License.
-// </license>
-//-----------------------------------------------------------------------
-
-namespace CoApp.Packaging.Client.UI {
- using System;
-
- [Flags]
- public enum InstallChoice {
- _Unknown = 0,
- // this choice is informational, not valid
- _InvalidChoice = 0x10000000,
-
- // flags indicating that during the install, the package installed should be marked.
- _DoNotUpdate = 0x00010000,
- _DoNotUpgrade = 0x00020000,
-
- // flags indicating which actual package to install
- _InstallSpecificVersion = 0x00000001,
- _InstallLatestUpdate = 0x00000002,
- _InstallLatestUpgrade = 0x00000004,
-
- _Scenario1 = 0x01000000,
- _Scenario2 = 0x02000000,
- _Scenario3 = 0x04000000,
- _Scenario4 = 0x08000000,
-
- AutoInstallLatest = _Scenario1 | _InstallLatestUpgrade,
- AutoInstallLatestCompatible = _Scenario1 | _DoNotUpgrade | _InstallLatestUpdate,
- InstallSpecificVersion = _Scenario1 | _DoNotUpdate | _InstallSpecificVersion,
-
- UpdateToLatestVersion = _Scenario2 | _InstallLatestUpdate,
- UpdateToLatestVersionNotUpgrade = _Scenario2 | _DoNotUpgrade | _InstallLatestUpdate,
- UpgradeToLatestVersion = _Scenario2 | _InstallLatestUpgrade,
-
- UpgradeToLatestVersion2 = _Scenario3 | _InstallLatestUpgrade,
- UpdateToLatestVersionNotUpgrade2 = _Scenario3 | _DoNotUpgrade | _InstallLatestUpdate,
- InstallSpecificVersion2 = _Scenario3 | _DoNotUpdate | _DoNotUpgrade | _InstallSpecificVersion,
-
- UpgradeToLatestVersion3 = _Scenario4 | _InstallLatestUpgrade,
- // UpdateToLatestVersion3 = _Scenario4 | _DoNotUpgrade | 0x002,
- AutoInstallLatestCompatible3 = _Scenario4 | _DoNotUpgrade | _InstallLatestUpdate,
- InstallSpecificVersion3 = _Scenario4 | _DoNotUpdate | _InstallSpecificVersion,
-
- NewerVersionAlreadyInstalled = _InvalidChoice | 0x001,
- OlderVersionAlreadyInstalled = _InvalidChoice | 0x002,
- ThisVersionAlreadyInstalled = _InvalidChoice | 0x003
- }
-}
Oops, something went wrong.

0 comments on commit f3f0b17

Please sign in to comment.