Zero Install .NET API 2.20.0
ZeroInstall.Publish.FeedEditing Class Reference

Represents a Feed being edited using IUndoCommands. More...

Inheritance diagram for ZeroInstall.Publish.FeedEditing:
NanoByte.Common.Undo.CommandManager< Feed > NanoByte::Common::Undo::ICommandManager< class > NanoByte::Common::Undo::ICommandExecutor

Public Member Functions

 FeedEditing (SignedFeed signedFeed)
 Starts with an existing feed. More...
 
 FeedEditing ()
 Starts with an empty feed.
 
bool IsValid ([MaybeNullWhen(true)] out string problem)
 Determines whether the feed is valid and ready for use by 0install. More...
 
override void Save (string path)
 Saves feed to an XML file, adds the default stylesheet and signs it with Publish.SignedFeed.SecretKey (if specified). More...
 
- Public Member Functions inherited from NanoByte.Common.Undo.CommandManager< Feed >
 CommandManager (T target, string? path=null)
 
void Execute (IUndoCommand command)
 
void Undo ()
 
void Redo ()
 

Static Public Member Functions

static new FeedEditing Load (string path)
 Loads a feed from an XML file (feed). More...
 
- Static Public Member Functions inherited from NanoByte.Common.Undo.CommandManager< Feed >
static CommandManager< T > Load (string path)
 
static ICommandManager< T > For (T target, string? path=null)
 

Properties

SignedFeed SignedFeed [get]
 The (optionally signed) feed being edited.
 
string? Passphrase [getset]
 The passphrase to use to unlock Publish.SignedFeed.SecretKey (if specified).
 
bool UnsavedChanges [get]
 Indicates whether there are changes to the feed that have not yet been saved to a file.
 
- Properties inherited from NanoByte.Common.Undo.CommandManager< Feed >
T? Target
 
string? Path
 
bool UndoEnabled
 
bool RedoEnabled
 
- Properties inherited from NanoByte::Common::Undo::ICommandManager< class >
T? Target
 
bool UndoEnabled
 
bool RedoEnabled
 
- Properties inherited from NanoByte::Common::Undo::ICommandExecutor
string? Path
 

Additional Inherited Members

- Protected Member Functions inherited from NanoByte.Common.Undo.CommandManager< Feed >
void ClearUndo ()
 
- Events inherited from NanoByte.Common.Undo.CommandManager< Feed >
Action? TargetUpdated
 
Action? UndoEnabledChanged
 
Action? RedoEnabledChanged
 
- Events inherited from NanoByte::Common::Undo::ICommandManager< class >
Action? TargetUpdated
 
Action? UndoEnabledChanged
 
Action? RedoEnabledChanged
 

Detailed Description

Represents a Feed being edited using IUndoCommands.

Constructor & Destructor Documentation

◆ FeedEditing()

ZeroInstall.Publish.FeedEditing.FeedEditing ( SignedFeed  signedFeed)
inline

Starts with an existing feed.

Parameters
signedFeedThe feed to be edited.

Member Function Documentation

◆ IsValid()

bool ZeroInstall.Publish.FeedEditing.IsValid ( [MaybeNullWhen(true)] out string  problem)
inline

Determines whether the feed is valid and ready for use by 0install.

Parameters
problemReturns human-readable description of the problem if the method result is false.
Returns
true if the feed is valid; false otherwise.

◆ Load()

static new FeedEditing ZeroInstall.Publish.FeedEditing.Load ( string  path)
static

Loads a feed from an XML file (feed).

Parameters
pathThe file to load from.
Returns
A FeedEditing containing the loaded feed.
Exceptions
IOExceptionA problem occurred while reading the file.
UnauthorizedAccessExceptionRead access to the file is not permitted.
InvalidDataExceptionA problem occurred while deserializing the XML data.

◆ Save()

override void ZeroInstall.Publish.FeedEditing.Save ( string  path)
inlinevirtual

Saves feed to an XML file, adds the default stylesheet and signs it with Publish.SignedFeed.SecretKey (if specified).

Writing and signing the feed file are performed as an atomic operation (i.e. if signing fails an existing file remains unchanged).

Parameters
pathThe file to save to.
Exceptions
IOExceptionA problem occurred while writing the file.
UnauthorizedAccessExceptionWrite access to the file is not permitted.
KeyNotFoundExceptionThe specified Publish.SignedFeed.SecretKey could not be found on the system.
WrongPassphraseExceptionPassphrase was incorrect.

Reimplemented from NanoByte.Common.Undo.CommandManager< Feed >.


The documentation for this class was generated from the following file: