WIP open a database

This commit is contained in:
2017-09-11 18:25:00 +02:00
parent 766e33c6ab
commit 4487f0343f
286 changed files with 176971 additions and 38 deletions

31
.gitignore vendored
View File

@@ -2,4 +2,35 @@
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
################################################################################
#ignore thumbnails created by windows
Thumbs.db
#Ignore files build by Visual Studio
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
[Bb]in
[Dd]ebug*/
*.lib
*.sbr
obj/
[Rr]elease*/
_ReSharper*/
[Tt]est[Rr]esult*
Translation/TrlUtil.vshost.exe.manifest
*.nupkg
.vs/
/UpgradeLog.htm

Binary file not shown.

View File

@@ -0,0 +1,436 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Windows.System;
using Windows.UI.Core;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
namespace ModernKeePass.Common
{
/// <summary>
/// NavigationHelper aids in navigation between pages. It provides commands used to
/// navigate back and forward as well as registers for standard mouse and keyboard
/// shortcuts used to go back and forward in Windows and the hardware back button in
/// Windows Phone. In addition it integrates SuspensionManger to handle process lifetime
/// management and state management when navigating between pages.
/// </summary>
/// <example>
/// To make use of NavigationHelper, follow these two steps or
/// start with a BasicPage or any other Page item template other than BlankPage.
///
/// 1) Create an instance of the NavigationHelper somewhere such as in the
/// constructor for the page and register a callback for the LoadState and
/// SaveState events.
/// <code>
/// public MyPage()
/// {
/// this.InitializeComponent();
/// var navigationHelper = new NavigationHelper(this);
/// this.navigationHelper.LoadState += navigationHelper_LoadState;
/// this.navigationHelper.SaveState += navigationHelper_SaveState;
/// }
///
/// private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
/// { }
/// private async void navigationHelper_SaveState(object sender, LoadStateEventArgs e)
/// { }
/// </code>
///
/// 2) Register the page to call into the NavigationHelper whenever the page participates
/// in navigation by overriding the <see cref="Windows.UI.Xaml.Controls.Page.OnNavigatedTo"/>
/// and <see cref="Windows.UI.Xaml.Controls.Page.OnNavigatedFrom"/> events.
/// <code>
/// protected override void OnNavigatedTo(NavigationEventArgs e)
/// {
/// navigationHelper.OnNavigatedTo(e);
/// }
///
/// protected override void OnNavigatedFrom(NavigationEventArgs e)
/// {
/// navigationHelper.OnNavigatedFrom(e);
/// }
/// </code>
/// </example>
[Windows.Foundation.Metadata.WebHostHidden]
public class NavigationHelper : DependencyObject
{
private Page Page { get; set; }
private Frame Frame { get { return this.Page.Frame; } }
/// <summary>
/// Initializes a new instance of the <see cref="NavigationHelper"/> class.
/// </summary>
/// <param name="page">A reference to the current page used for navigation.
/// This reference allows for frame manipulation and to ensure that keyboard
/// navigation requests only occur when the page is occupying the entire window.</param>
public NavigationHelper(Page page)
{
this.Page = page;
// When this page is part of the visual tree make two changes:
// 1) Map application view state to visual state for the page
// 2) Handle hardware navigation requests
this.Page.Loaded += (sender, e) =>
{
#if WINDOWS_PHONE_APP
Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
#else
// Keyboard and mouse navigation only apply when occupying the entire window
if (this.Page.ActualHeight == Window.Current.Bounds.Height &&
this.Page.ActualWidth == Window.Current.Bounds.Width)
{
// Listen to the window directly so focus isn't required
Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated +=
CoreDispatcher_AcceleratorKeyActivated;
Window.Current.CoreWindow.PointerPressed +=
this.CoreWindow_PointerPressed;
}
#endif
};
// Undo the same changes when the page is no longer visible
this.Page.Unloaded += (sender, e) =>
{
#if WINDOWS_PHONE_APP
Windows.Phone.UI.Input.HardwareButtons.BackPressed -= HardwareButtons_BackPressed;
#else
Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated -=
CoreDispatcher_AcceleratorKeyActivated;
Window.Current.CoreWindow.PointerPressed -=
this.CoreWindow_PointerPressed;
#endif
};
}
#region Navigation support
RelayCommand _goBackCommand;
RelayCommand _goForwardCommand;
/// <summary>
/// <see cref="RelayCommand"/> used to bind to the back Button's Command property
/// for navigating to the most recent item in back navigation history, if a Frame
/// manages its own navigation history.
///
/// The <see cref="RelayCommand"/> is set up to use the virtual method <see cref="GoBack"/>
/// as the Execute Action and <see cref="CanGoBack"/> for CanExecute.
/// </summary>
public RelayCommand GoBackCommand
{
get
{
if (_goBackCommand == null)
{
_goBackCommand = new RelayCommand(
() => this.GoBack(),
() => this.CanGoBack());
}
return _goBackCommand;
}
set
{
_goBackCommand = value;
}
}
/// <summary>
/// <see cref="RelayCommand"/> used for navigating to the most recent item in
/// the forward navigation history, if a Frame manages its own navigation history.
///
/// The <see cref="RelayCommand"/> is set up to use the virtual method <see cref="GoForward"/>
/// as the Execute Action and <see cref="CanGoForward"/> for CanExecute.
/// </summary>
public RelayCommand GoForwardCommand
{
get
{
if (_goForwardCommand == null)
{
_goForwardCommand = new RelayCommand(
() => this.GoForward(),
() => this.CanGoForward());
}
return _goForwardCommand;
}
}
/// <summary>
/// Virtual method used by the <see cref="GoBackCommand"/> property
/// to determine if the <see cref="Frame"/> can go back.
/// </summary>
/// <returns>
/// true if the <see cref="Frame"/> has at least one entry
/// in the back navigation history.
/// </returns>
public virtual bool CanGoBack()
{
return this.Frame != null && this.Frame.CanGoBack;
}
/// <summary>
/// Virtual method used by the <see cref="GoForwardCommand"/> property
/// to determine if the <see cref="Frame"/> can go forward.
/// </summary>
/// <returns>
/// true if the <see cref="Frame"/> has at least one entry
/// in the forward navigation history.
/// </returns>
public virtual bool CanGoForward()
{
return this.Frame != null && this.Frame.CanGoForward;
}
/// <summary>
/// Virtual method used by the <see cref="GoBackCommand"/> property
/// to invoke the <see cref="Windows.UI.Xaml.Controls.Frame.GoBack"/> method.
/// </summary>
public virtual void GoBack()
{
if (this.Frame != null && this.Frame.CanGoBack) this.Frame.GoBack();
}
/// <summary>
/// Virtual method used by the <see cref="GoForwardCommand"/> property
/// to invoke the <see cref="Windows.UI.Xaml.Controls.Frame.GoForward"/> method.
/// </summary>
public virtual void GoForward()
{
if (this.Frame != null && this.Frame.CanGoForward) this.Frame.GoForward();
}
#if WINDOWS_PHONE_APP
/// <summary>
/// Invoked when the hardware back button is pressed. For Windows Phone only.
/// </summary>
/// <param name="sender">Instance that triggered the event.</param>
/// <param name="e">Event data describing the conditions that led to the event.</param>
private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
{
if (this.GoBackCommand.CanExecute(null))
{
e.Handled = true;
this.GoBackCommand.Execute(null);
}
}
#else
/// <summary>
/// Invoked on every keystroke, including system keys such as Alt key combinations, when
/// this page is active and occupies the entire window. Used to detect keyboard navigation
/// between pages even when the page itself doesn't have focus.
/// </summary>
/// <param name="sender">Instance that triggered the event.</param>
/// <param name="e">Event data describing the conditions that led to the event.</param>
private void CoreDispatcher_AcceleratorKeyActivated(CoreDispatcher sender,
AcceleratorKeyEventArgs e)
{
var virtualKey = e.VirtualKey;
// Only investigate further when Left, Right, or the dedicated Previous or Next keys
// are pressed
if ((e.EventType == CoreAcceleratorKeyEventType.SystemKeyDown ||
e.EventType == CoreAcceleratorKeyEventType.KeyDown) &&
(virtualKey == VirtualKey.Left || virtualKey == VirtualKey.Right ||
(int)virtualKey == 166 || (int)virtualKey == 167))
{
var coreWindow = Window.Current.CoreWindow;
var downState = CoreVirtualKeyStates.Down;
bool menuKey = (coreWindow.GetKeyState(VirtualKey.Menu) & downState) == downState;
bool controlKey = (coreWindow.GetKeyState(VirtualKey.Control) & downState) == downState;
bool shiftKey = (coreWindow.GetKeyState(VirtualKey.Shift) & downState) == downState;
bool noModifiers = !menuKey && !controlKey && !shiftKey;
bool onlyAlt = menuKey && !controlKey && !shiftKey;
if (((int)virtualKey == 166 && noModifiers) ||
(virtualKey == VirtualKey.Left && onlyAlt))
{
// When the previous key or Alt+Left are pressed navigate back
e.Handled = true;
this.GoBackCommand.Execute(null);
}
else if (((int)virtualKey == 167 && noModifiers) ||
(virtualKey == VirtualKey.Right && onlyAlt))
{
// When the next key or Alt+Right are pressed navigate forward
e.Handled = true;
this.GoForwardCommand.Execute(null);
}
}
}
/// <summary>
/// Invoked on every mouse click, touch screen tap, or equivalent interaction when this
/// page is active and occupies the entire window. Used to detect browser-style next and
/// previous mouse button clicks to navigate between pages.
/// </summary>
/// <param name="sender">Instance that triggered the event.</param>
/// <param name="e">Event data describing the conditions that led to the event.</param>
private void CoreWindow_PointerPressed(CoreWindow sender,
PointerEventArgs e)
{
var properties = e.CurrentPoint.Properties;
// Ignore button chords with the left, right, and middle buttons
if (properties.IsLeftButtonPressed || properties.IsRightButtonPressed ||
properties.IsMiddleButtonPressed) return;
// If back or foward are pressed (but not both) navigate appropriately
bool backPressed = properties.IsXButton1Pressed;
bool forwardPressed = properties.IsXButton2Pressed;
if (backPressed ^ forwardPressed)
{
e.Handled = true;
if (backPressed) this.GoBackCommand.Execute(null);
if (forwardPressed) this.GoForwardCommand.Execute(null);
}
}
#endif
#endregion
#region Process lifetime management
private String _pageKey;
/// <summary>
/// Register this event on the current page to populate the page
/// with content passed during navigation as well as any saved
/// state provided when recreating a page from a prior session.
/// </summary>
public event LoadStateEventHandler LoadState;
/// <summary>
/// Register this event on the current page to preserve
/// state associated with the current page in case the
/// application is suspended or the page is discarded from
/// the navigaqtion cache.
/// </summary>
public event SaveStateEventHandler SaveState;
/// <summary>
/// Invoked when this page is about to be displayed in a Frame.
/// This method calls <see cref="LoadState"/>, where all page specific
/// navigation and process lifetime management logic should be placed.
/// </summary>
/// <param name="e">Event data that describes how this page was reached. The Parameter
/// property provides the group to be displayed.</param>
public void OnNavigatedTo(NavigationEventArgs e)
{
var frameState = SuspensionManager.SessionStateForFrame(this.Frame);
this._pageKey = "Page-" + this.Frame.BackStackDepth;
if (e.NavigationMode == NavigationMode.New)
{
// Clear existing state for forward navigation when adding a new page to the
// navigation stack
var nextPageKey = this._pageKey;
int nextPageIndex = this.Frame.BackStackDepth;
while (frameState.Remove(nextPageKey))
{
nextPageIndex++;
nextPageKey = "Page-" + nextPageIndex;
}
// Pass the navigation parameter to the new page
if (this.LoadState != null)
{
this.LoadState(this, new LoadStateEventArgs(e.Parameter, null));
}
}
else
{
// Pass the navigation parameter and preserved page state to the page, using
// the same strategy for loading suspended state and recreating pages discarded
// from cache
if (this.LoadState != null)
{
this.LoadState(this, new LoadStateEventArgs(e.Parameter, (Dictionary<String, Object>)frameState[this._pageKey]));
}
}
}
/// <summary>
/// Invoked when this page will no longer be displayed in a Frame.
/// This method calls <see cref="SaveState"/>, where all page specific
/// navigation and process lifetime management logic should be placed.
/// </summary>
/// <param name="e">Event data that describes how this page was reached. The Parameter
/// property provides the group to be displayed.</param>
public void OnNavigatedFrom(NavigationEventArgs e)
{
var frameState = SuspensionManager.SessionStateForFrame(this.Frame);
var pageState = new Dictionary<String, Object>();
if (this.SaveState != null)
{
this.SaveState(this, new SaveStateEventArgs(pageState));
}
frameState[_pageKey] = pageState;
}
#endregion
}
/// <summary>
/// Represents the method that will handle the <see cref="NavigationHelper.LoadState"/>event
/// </summary>
public delegate void LoadStateEventHandler(object sender, LoadStateEventArgs e);
/// <summary>
/// Represents the method that will handle the <see cref="NavigationHelper.SaveState"/>event
/// </summary>
public delegate void SaveStateEventHandler(object sender, SaveStateEventArgs e);
/// <summary>
/// Class used to hold the event data required when a page attempts to load state.
/// </summary>
public class LoadStateEventArgs : EventArgs
{
/// <summary>
/// The parameter value passed to <see cref="Frame.Navigate(Type, Object)"/>
/// when this page was initially requested.
/// </summary>
public Object NavigationParameter { get; private set; }
/// <summary>
/// A dictionary of state preserved by this page during an earlier
/// session. This will be null the first time a page is visited.
/// </summary>
public Dictionary<string, Object> PageState { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="LoadStateEventArgs"/> class.
/// </summary>
/// <param name="navigationParameter">
/// The parameter value passed to <see cref="Frame.Navigate(Type, Object)"/>
/// when this page was initially requested.
/// </param>
/// <param name="pageState">
/// A dictionary of state preserved by this page during an earlier
/// session. This will be null the first time a page is visited.
/// </param>
public LoadStateEventArgs(Object navigationParameter, Dictionary<string, Object> pageState)
: base()
{
this.NavigationParameter = navigationParameter;
this.PageState = pageState;
}
}
/// <summary>
/// Class used to hold the event data required when a page attempts to save state.
/// </summary>
public class SaveStateEventArgs : EventArgs
{
/// <summary>
/// An empty dictionary to be populated with serializable state.
/// </summary>
public Dictionary<string, Object> PageState { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="SaveStateEventArgs"/> class.
/// </summary>
/// <param name="pageState">An empty dictionary to be populated with serializable state.</param>
public SaveStateEventArgs(Dictionary<string, Object> pageState)
: base()
{
this.PageState = pageState;
}
}
}

View File

@@ -0,0 +1,149 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Windows.Foundation.Collections;
namespace ModernKeePass.Common
{
/// <summary>
/// Implementation of IObservableMap that supports reentrancy for use as a default view
/// model.
/// </summary>
public class ObservableDictionary : IObservableMap<string, object>
{
private class ObservableDictionaryChangedEventArgs : IMapChangedEventArgs<string>
{
public ObservableDictionaryChangedEventArgs(CollectionChange change, string key)
{
this.CollectionChange = change;
this.Key = key;
}
public CollectionChange CollectionChange { get; private set; }
public string Key { get; private set; }
}
private Dictionary<string, object> _dictionary = new Dictionary<string, object>();
public event MapChangedEventHandler<string, object> MapChanged;
private void InvokeMapChanged(CollectionChange change, string key)
{
var eventHandler = MapChanged;
if (eventHandler != null)
{
eventHandler(this, new ObservableDictionaryChangedEventArgs(change, key));
}
}
public void Add(string key, object value)
{
this._dictionary.Add(key, value);
this.InvokeMapChanged(CollectionChange.ItemInserted, key);
}
public void Add(KeyValuePair<string, object> item)
{
this.Add(item.Key, item.Value);
}
public bool Remove(string key)
{
if (this._dictionary.Remove(key))
{
this.InvokeMapChanged(CollectionChange.ItemRemoved, key);
return true;
}
return false;
}
public bool Remove(KeyValuePair<string, object> item)
{
object currentValue;
if (this._dictionary.TryGetValue(item.Key, out currentValue) &&
Object.Equals(item.Value, currentValue) && this._dictionary.Remove(item.Key))
{
this.InvokeMapChanged(CollectionChange.ItemRemoved, item.Key);
return true;
}
return false;
}
public object this[string key]
{
get
{
return this._dictionary[key];
}
set
{
this._dictionary[key] = value;
this.InvokeMapChanged(CollectionChange.ItemChanged, key);
}
}
public void Clear()
{
var priorKeys = this._dictionary.Keys.ToArray();
this._dictionary.Clear();
foreach (var key in priorKeys)
{
this.InvokeMapChanged(CollectionChange.ItemRemoved, key);
}
}
public ICollection<string> Keys
{
get { return this._dictionary.Keys; }
}
public bool ContainsKey(string key)
{
return this._dictionary.ContainsKey(key);
}
public bool TryGetValue(string key, out object value)
{
return this._dictionary.TryGetValue(key, out value);
}
public ICollection<object> Values
{
get { return this._dictionary.Values; }
}
public bool Contains(KeyValuePair<string, object> item)
{
return this._dictionary.Contains(item);
}
public int Count
{
get { return this._dictionary.Count; }
}
public bool IsReadOnly
{
get { return false; }
}
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
{
return this._dictionary.GetEnumerator();
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return this._dictionary.GetEnumerator();
}
public void CopyTo(KeyValuePair<string, object>[] array, int arrayIndex)
{
int arraySize = array.Length;
foreach (var pair in this._dictionary)
{
if (arrayIndex >= arraySize) break;
array[arrayIndex++] = pair;
}
}
}
}

View File

@@ -0,0 +1,86 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace ModernKeePass.Common
{
/// <summary>
/// A command whose sole purpose is to relay its functionality
/// to other objects by invoking delegates.
/// The default return value for the CanExecute method is 'true'.
/// <see cref="RaiseCanExecuteChanged"/> needs to be called whenever
/// <see cref="CanExecute"/> is expected to return a different value.
/// </summary>
public class RelayCommand : ICommand
{
private readonly Action _execute;
private readonly Func<bool> _canExecute;
/// <summary>
/// Raised when RaiseCanExecuteChanged is called.
/// </summary>
public event EventHandler CanExecuteChanged;
/// <summary>
/// Creates a new command that can always execute.
/// </summary>
/// <param name="execute">The execution logic.</param>
public RelayCommand(Action execute)
: this(execute, null)
{
}
/// <summary>
/// Creates a new command.
/// </summary>
/// <param name="execute">The execution logic.</param>
/// <param name="canExecute">The execution status logic.</param>
public RelayCommand(Action execute, Func<bool> canExecute)
{
if (execute == null)
throw new ArgumentNullException("execute");
_execute = execute;
_canExecute = canExecute;
}
/// <summary>
/// Determines whether this <see cref="RelayCommand"/> can execute in its current state.
/// </summary>
/// <param name="parameter">
/// Data used by the command. If the command does not require data to be passed, this object can be set to null.
/// </param>
/// <returns>true if this command can be executed; otherwise, false.</returns>
public bool CanExecute(object parameter)
{
return _canExecute == null ? true : _canExecute();
}
/// <summary>
/// Executes the <see cref="RelayCommand"/> on the current command target.
/// </summary>
/// <param name="parameter">
/// Data used by the command. If the command does not require data to be passed, this object can be set to null.
/// </param>
public void Execute(object parameter)
{
_execute();
}
/// <summary>
/// Method used to raise the <see cref="CanExecuteChanged"/> event
/// to indicate that the return value of the <see cref="CanExecute"/>
/// method has changed.
/// </summary>
public void RaiseCanExecuteChanged()
{
var handler = CanExecuteChanged;
if (handler != null)
{
handler(this, EventArgs.Empty);
}
}
}
}

View File

@@ -0,0 +1,269 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using Windows.ApplicationModel;
using Windows.Storage;
using Windows.Storage.Streams;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace ModernKeePass.Common
{
/// <summary>
/// SuspensionManager captures global session state to simplify process lifetime management
/// for an application. Note that session state will be automatically cleared under a variety
/// of conditions and should only be used to store information that would be convenient to
/// carry across sessions, but that should be discarded when an application crashes or is
/// upgraded.
/// </summary>
internal sealed class SuspensionManager
{
private static Dictionary<string, object> _sessionState = new Dictionary<string, object>();
private static List<Type> _knownTypes = new List<Type>();
private const string sessionStateFilename = "_sessionState.xml";
/// <summary>
/// Provides access to global session state for the current session. This state is
/// serialized by <see cref="SaveAsync"/> and restored by
/// <see cref="RestoreAsync"/>, so values must be serializable by
/// <see cref="DataContractSerializer"/> and should be as compact as possible. Strings
/// and other self-contained data types are strongly recommended.
/// </summary>
public static Dictionary<string, object> SessionState
{
get { return _sessionState; }
}
/// <summary>
/// List of custom types provided to the <see cref="DataContractSerializer"/> when
/// reading and writing session state. Initially empty, additional types may be
/// added to customize the serialization process.
/// </summary>
public static List<Type> KnownTypes
{
get { return _knownTypes; }
}
/// <summary>
/// Save the current <see cref="SessionState"/>. Any <see cref="Frame"/> instances
/// registered with <see cref="RegisterFrame"/> will also preserve their current
/// navigation stack, which in turn gives their active <see cref="Page"/> an opportunity
/// to save its state.
/// </summary>
/// <returns>An asynchronous task that reflects when session state has been saved.</returns>
public static async Task SaveAsync()
{
try
{
// Save the navigation state for all registered frames
foreach (var weakFrameReference in _registeredFrames)
{
Frame frame;
if (weakFrameReference.TryGetTarget(out frame))
{
SaveFrameNavigationState(frame);
}
}
// Serialize the session state synchronously to avoid asynchronous access to shared
// state
MemoryStream sessionData = new MemoryStream();
DataContractSerializer serializer = new DataContractSerializer(typeof(Dictionary<string, object>), _knownTypes);
serializer.WriteObject(sessionData, _sessionState);
// Get an output stream for the SessionState file and write the state asynchronously
StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync(sessionStateFilename, CreationCollisionOption.ReplaceExisting);
using (Stream fileStream = await file.OpenStreamForWriteAsync())
{
sessionData.Seek(0, SeekOrigin.Begin);
await sessionData.CopyToAsync(fileStream);
}
}
catch (Exception e)
{
throw new SuspensionManagerException(e);
}
}
/// <summary>
/// Restores previously saved <see cref="SessionState"/>. Any <see cref="Frame"/> instances
/// registered with <see cref="RegisterFrame"/> will also restore their prior navigation
/// state, which in turn gives their active <see cref="Page"/> an opportunity restore its
/// state.
/// </summary>
/// <param name="sessionBaseKey">An optional key that identifies the type of session.
/// This can be used to distinguish between multiple application launch scenarios.</param>
/// <returns>An asynchronous task that reflects when session state has been read. The
/// content of <see cref="SessionState"/> should not be relied upon until this task
/// completes.</returns>
public static async Task RestoreAsync(String sessionBaseKey = null)
{
_sessionState = new Dictionary<String, Object>();
try
{
// Get the input stream for the SessionState file
StorageFile file = await ApplicationData.Current.LocalFolder.GetFileAsync(sessionStateFilename);
using (IInputStream inStream = await file.OpenSequentialReadAsync())
{
// Deserialize the Session State
DataContractSerializer serializer = new DataContractSerializer(typeof(Dictionary<string, object>), _knownTypes);
_sessionState = (Dictionary<string, object>)serializer.ReadObject(inStream.AsStreamForRead());
}
// Restore any registered frames to their saved state
foreach (var weakFrameReference in _registeredFrames)
{
Frame frame;
if (weakFrameReference.TryGetTarget(out frame) && (string)frame.GetValue(FrameSessionBaseKeyProperty) == sessionBaseKey)
{
frame.ClearValue(FrameSessionStateProperty);
RestoreFrameNavigationState(frame);
}
}
}
catch (Exception e)
{
throw new SuspensionManagerException(e);
}
}
private static DependencyProperty FrameSessionStateKeyProperty =
DependencyProperty.RegisterAttached("_FrameSessionStateKey", typeof(String), typeof(SuspensionManager), null);
private static DependencyProperty FrameSessionBaseKeyProperty =
DependencyProperty.RegisterAttached("_FrameSessionBaseKeyParams", typeof(String), typeof(SuspensionManager), null);
private static DependencyProperty FrameSessionStateProperty =
DependencyProperty.RegisterAttached("_FrameSessionState", typeof(Dictionary<String, Object>), typeof(SuspensionManager), null);
private static List<WeakReference<Frame>> _registeredFrames = new List<WeakReference<Frame>>();
/// <summary>
/// Registers a <see cref="Frame"/> instance to allow its navigation history to be saved to
/// and restored from <see cref="SessionState"/>. Frames should be registered once
/// immediately after creation if they will participate in session state management. Upon
/// registration if state has already been restored for the specified key
/// the navigation history will immediately be restored. Subsequent invocations of
/// <see cref="RestoreAsync"/> will also restore navigation history.
/// </summary>
/// <param name="frame">An instance whose navigation history should be managed by
/// <see cref="SuspensionManager"/></param>
/// <param name="sessionStateKey">A unique key into <see cref="SessionState"/> used to
/// store navigation-related information.</param>
/// <param name="sessionBaseKey">An optional key that identifies the type of session.
/// This can be used to distinguish between multiple application launch scenarios.</param>
public static void RegisterFrame(Frame frame, String sessionStateKey, String sessionBaseKey = null)
{
if (frame.GetValue(FrameSessionStateKeyProperty) != null)
{
throw new InvalidOperationException("Frames can only be registered to one session state key");
}
if (frame.GetValue(FrameSessionStateProperty) != null)
{
throw new InvalidOperationException("Frames must be either be registered before accessing frame session state, or not registered at all");
}
if (!string.IsNullOrEmpty(sessionBaseKey))
{
frame.SetValue(FrameSessionBaseKeyProperty, sessionBaseKey);
sessionStateKey = sessionBaseKey + "_" + sessionStateKey;
}
// Use a dependency property to associate the session key with a frame, and keep a list of frames whose
// navigation state should be managed
frame.SetValue(FrameSessionStateKeyProperty, sessionStateKey);
_registeredFrames.Add(new WeakReference<Frame>(frame));
// Check to see if navigation state can be restored
RestoreFrameNavigationState(frame);
}
/// <summary>
/// Disassociates a <see cref="Frame"/> previously registered by <see cref="RegisterFrame"/>
/// from <see cref="SessionState"/>. Any navigation state previously captured will be
/// removed.
/// </summary>
/// <param name="frame">An instance whose navigation history should no longer be
/// managed.</param>
public static void UnregisterFrame(Frame frame)
{
// Remove session state and remove the frame from the list of frames whose navigation
// state will be saved (along with any weak references that are no longer reachable)
SessionState.Remove((String)frame.GetValue(FrameSessionStateKeyProperty));
_registeredFrames.RemoveAll((weakFrameReference) =>
{
Frame testFrame;
return !weakFrameReference.TryGetTarget(out testFrame) || testFrame == frame;
});
}
/// <summary>
/// Provides storage for session state associated with the specified <see cref="Frame"/>.
/// Frames that have been previously registered with <see cref="RegisterFrame"/> have
/// their session state saved and restored automatically as a part of the global
/// <see cref="SessionState"/>. Frames that are not registered have transient state
/// that can still be useful when restoring pages that have been discarded from the
/// navigation cache.
/// </summary>
/// <remarks>Apps may choose to rely on <see cref="NavigationHelper"/> to manage
/// page-specific state instead of working with frame session state directly.</remarks>
/// <param name="frame">The instance for which session state is desired.</param>
/// <returns>A collection of state subject to the same serialization mechanism as
/// <see cref="SessionState"/>.</returns>
public static Dictionary<String, Object> SessionStateForFrame(Frame frame)
{
var frameState = (Dictionary<String, Object>)frame.GetValue(FrameSessionStateProperty);
if (frameState == null)
{
var frameSessionKey = (String)frame.GetValue(FrameSessionStateKeyProperty);
if (frameSessionKey != null)
{
// Registered frames reflect the corresponding session state
if (!_sessionState.ContainsKey(frameSessionKey))
{
_sessionState[frameSessionKey] = new Dictionary<String, Object>();
}
frameState = (Dictionary<String, Object>)_sessionState[frameSessionKey];
}
else
{
// Frames that aren't registered have transient state
frameState = new Dictionary<String, Object>();
}
frame.SetValue(FrameSessionStateProperty, frameState);
}
return frameState;
}
private static void RestoreFrameNavigationState(Frame frame)
{
var frameState = SessionStateForFrame(frame);
if (frameState.ContainsKey("Navigation"))
{
frame.SetNavigationState((String)frameState["Navigation"]);
}
}
private static void SaveFrameNavigationState(Frame frame)
{
var frameState = SessionStateForFrame(frame);
frameState["Navigation"] = frame.GetNavigationState();
}
}
public class SuspensionManagerException : Exception
{
public SuspensionManagerException()
{
}
public SuspensionManagerException(Exception e)
: base("SuspensionManager failed", e)
{
}
}
}

View File

@@ -8,6 +8,7 @@
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Button Content="Open password database" HorizontalAlignment="Center" VerticalAlignment="Center" Click="Button_Click" />
<TextBlock Name="textBlock" HorizontalAlignment="Center" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Center" Margin="0,100,0,0" />
</Grid>
</Page>

View File

@@ -1,17 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using ModernKeePass.Pages;
using System;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
@@ -26,5 +16,26 @@ namespace ModernKeePass
{
this.InitializeComponent();
}
private async void Button_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
var picker = new Windows.Storage.Pickers.FileOpenPicker();
picker.ViewMode = Windows.Storage.Pickers.PickerViewMode.List;
picker.SuggestedStartLocation =
Windows.Storage.Pickers.PickerLocationId.DocumentsLibrary;
picker.FileTypeFilter.Add(".kdbx");
var file = await picker.PickSingleFileAsync();
if (file != null)
{
// Application now has read/write access to the picked file
textBlock.Text = "Opened database: " + file.Name;
Frame.Navigate(typeof(DatabaseViewPage), file);
}
else
{
textBlock.Text = "Operation cancelled.";
}
}
}
}

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{a0cfc681-769b-405a-8482-0cdee595a91f}</ProjectGuid>
<ProjectGuid>{A0CFC681-769B-405A-8482-0CDEE595A91F}</ProjectGuid>
<OutputType>AppContainerExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ModernKeePass</RootNamespace>
@@ -14,9 +14,9 @@
<MinimumVisualStudioVersion>12</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<PackageCertificateKeyFile>ModernKeePass_TemporaryKey.pfx</PackageCertificateKeyFile>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -103,31 +103,34 @@
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
</ItemGroup>
<ItemGroup>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="Common\NavigationHelper.cs" />
<Compile Include="Common\ObservableDictionary.cs" />
<Compile Include="Common\RelayCommand.cs" />
<Compile Include="Common\SuspensionManager.cs" />
<Compile Include="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\DatabaseViewPage.xaml.cs">
<DependentUpon>DatabaseViewPage.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<None Include="ModernKeePass_TemporaryKey.pfx" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\Logo.scale-100.png" />
<Content Include="Assets\SmallLogo.scale-100.png" />
<Content Include="Assets\SplashScreen.scale-100.png" />
<Content Include="Assets\StoreLogo.scale-100.png" />
<Content Include="Assets\Logo.scale-100.png" />
<Content Include="Assets\SmallLogo.scale-100.png" />
<Content Include="Assets\SplashScreen.scale-100.png" />
<Content Include="Assets\StoreLogo.scale-100.png" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
@@ -138,13 +141,35 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Pages\DatabaseViewPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Reference Include="ModernKeePassLib, Version=2.19.0.27133, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ModernKeePassLib.2.19.0.27133\lib\netstandard1.2\ModernKeePassLib.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\win8\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Folder Include="Interfaces\" />
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '12.0' ">
<VisualStudioVersion>12.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<Import Project="..\packages\NETStandard.Library.2.0.0\build\NETStandard.Library.targets" Condition="Exists('..\packages\NETStandard.Library.2.0.0\build\NETStandard.Library.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\NETStandard.Library.2.0.0\build\NETStandard.Library.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NETStandard.Library.2.0.0\build\NETStandard.Library.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
@@ -152,4 +177,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>

View File

@@ -0,0 +1,127 @@
<Page
x:Name="pageRoot"
x:Class="ModernKeePass.Pages.DatabaseViewPage"
DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ModernKeePass.Pages"
xmlns:common="using:ModernKeePass.Common"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Page.Resources>
<x:String x:Key="ChevronGlyph">&#xE26B;</x:String>
<!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
<x:String x:Key="AppName">My Application</x:String>
</Page.Resources>
<!--
This grid acts as a root panel for the page.
-->
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.ChildrenTransitions>
<TransitionCollection>
<EntranceThemeTransition/>
</TransitionCollection>
</Grid.ChildrenTransitions>
<Hub>
<Hub.Header>
<!-- Back button and page title -->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button x:Name="backButton" Margin="-1,-1,39,0" Command="{Binding NavigationHelper.GoBackCommand, ElementName=pageRoot}"
Style="{StaticResource NavigationBackButtonNormalStyle}"
VerticalAlignment="Top"
AutomationProperties.Name="Back"
AutomationProperties.AutomationId="BackButton"
AutomationProperties.ItemType="Navigation Button"/>
<TextBlock x:Name="pageTitle" Text="{StaticResource AppName}" Style="{StaticResource HeaderTextBlockStyle}" Grid.Column="1"
IsHitTestVisible="false" TextWrapping="NoWrap" VerticalAlignment="Top"/>
</Grid>
</Hub.Header>
<HubSection Width="780" Margin="0,0,80,0">
<HubSection.Background>
<ImageBrush Stretch="UniformToFill" />
</HubSection.Background>
</HubSection>
<HubSection Width="500" Header="Section 1">
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Image Stretch="Fill" Width="420" Height="280"/>
<TextBlock Style="{StaticResource SubheaderTextBlockStyle}" Grid.Row="1" Margin="0,10,0,0" TextWrapping="Wrap"
Text="Lorem ipsum dolor sit nonumy sed consectetuer ising elit, sed diam"/>
<TextBlock Style="{StaticResource TitleTextBlockStyle}" Grid.Row="2" Margin="0,10,0,0"
Text="Description text:"/>
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Grid.Row="3"
Text="Lorem ipsum dolor sit amet, consectetuer ising elit, sed diam nonummy nibh uismod tincidunt ut laoreet suscipit lobortis ni ut wisi quipexerci quis consequat minim veniam, quis nostrud exerci tation ullam corper. Lorem ipsum dolor sit amet, consectetuer ising elit, sed diam nonummy nibh uismod tincidunt ut laoreet suscipit lobortis ni ut wisi quipexerci quis consequat minim veniam, quis nostrud exerci tation ullam corper. "/>
</Grid>
</DataTemplate>
</HubSection>
<HubSection Width="520" Header="Section 2">
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Style="{StaticResource TitleTextBlockStyle}" Margin="0,0,0,10"
Text="Item Title" />
<TextBlock Style="{StaticResource SubheaderTextBlockStyle}" Grid.Row="1"
Text="Quisque in porta lorem dolor amet sed consectetuer ising elit, sed diam non my nibh uis mod wisi quip."/>
<TextBlock Style="{StaticResource SubtitleTextBlockStyle}" Grid.Row="2" Margin="0,20,0,0"
Text="Item Sub Title"/>
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Grid.Row="3"
Text="Lorem ipsum dolor sit amet, consectetuer ising elit, sed diam nonummy nibh uismod tincidunt ut laoreet suscipit lobortis ni ut wisi quipexerci quis consequat minim veniam, quis nostrud exerci tation ullam corper. Lorem ipsum dolor sit amet, consectetuer ising elit, sed diam nonummy nibh uismod tincidunt ut laoreet suscipit lobortis ni ut wisi quipexerci quis consequat minim veniam, quis nostrud exerci tation ullam corper."/>
</Grid>
</DataTemplate>
</HubSection>
<HubSection Header="Section 3">
<DataTemplate>
<!-- width of 400 -->
<StackPanel Orientation="Vertical">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="130"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="130"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="130"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="270"/>
<RowDefinition Height="95"/>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Image Grid.ColumnSpan="5" Stretch="Fill" Margin="0,0,0,10"/>
<Image Grid.Row="1" Stretch="Fill"/>
<Image Grid.Row="1" Grid.Column="2" Stretch="Fill"/>
<Image Grid.Row="1" Grid.Column="4" Stretch="Fill"/>
<TextBlock Style="{StaticResource TitleTextBlockStyle}" Grid.Row="2" Grid.ColumnSpan="5" Margin="0,15,0,0"
Text="Description Text:"/>
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Grid.Row="3" Grid.ColumnSpan="5"
Text="Lorem ipsum dolor sit amet, consectetuer ising elit, sed diam nonummy nibh uismod tincidunt ut laoreet suscipit lobortis ni ut wisi quipexerci quis consequat minim veniam, quis nostrud exerci tation ullam corper. Lorem ipsum dolor sit amet, consectetuer ising elit, sed diam nonummy nibh uismod tincidunt ut laoreet suscipit lobortis ni ut wisi quipexerci quis consequat minim veniam, quis nostrud exerci tation ullam corper."/>
</Grid>
</StackPanel>
</DataTemplate>
</HubSection>
</Hub>
</Grid>
</Page>

View File

@@ -0,0 +1,105 @@
using ModernKeePass.Common;
using ModernKeePassLib;
using ModernKeePassLib.Interfaces;
using ModernKeePassLib.Keys;
using ModernKeePassLib.Serialization;
using Windows.Storage;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
using System.Linq;
using System;
// The Hub Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=321224
namespace ModernKeePass.Pages
{
/// <summary>
/// A page that displays a grouped collection of items.
/// </summary>
public sealed partial class DatabaseViewPage : Page
{
private NavigationHelper navigationHelper;
private ObservableDictionary defaultViewModel = new ObservableDictionary();
private PwDatabase _database = new PwDatabase();
/// <summary>
/// This can be changed to a strongly typed view model.
/// </summary>
public ObservableDictionary DefaultViewModel
{
get { return this.defaultViewModel; }
}
/// <summary>
/// NavigationHelper is used on each page to aid in navigation and
/// process lifetime management
/// </summary>
public NavigationHelper NavigationHelper
{
get { return this.navigationHelper; }
}
public DatabaseViewPage()
{
this.InitializeComponent();
this.navigationHelper = new NavigationHelper(this);
this.navigationHelper.LoadState += navigationHelper_LoadState;
}
/// <summary>
/// Populates the page with content passed during navigation. Any saved state is also
/// provided when recreating a page from a prior session.
/// </summary>
/// <param name="sender">
/// The source of the event; typically <see cref="Common.NavigationHelper"/>
/// </param>
/// <param name="e">Event data that provides both the navigation parameter passed to
/// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
/// a dictionary of state preserved by this page during an earlier
/// session. The state will be null the first time a page is visited.</param>
private void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
{
// TODO: Assign a collection of bindable groups to this.DefaultViewModel["Groups"]
}
#region NavigationHelper registration
/// The methods provided in this section are simply used to allow
/// NavigationHelper to respond to the page's navigation methods.
///
/// Page specific logic should be placed in event handlers for the
/// <see cref="Common.NavigationHelper.LoadState"/>
/// and <see cref="Common.NavigationHelper.SaveState"/>.
/// The navigation parameter is available in the LoadState method
/// in addition to page state preserved during an earlier session.
protected override void OnNavigatedTo(NavigationEventArgs e)
{
navigationHelper.OnNavigatedTo(e);
if (e.Parameter is StorageFile)
{
var file = e.Parameter as StorageFile;
var key = new CompositeKey();
key.AddUserKey(new KcpPassword("test"));
try
{
_database.Open(IOConnectionInfo.FromPath(file.Path), key, new NullStatusLogger());
DefaultViewModel["Groups"] = _database.RootGroup.GetGroups(false).Select(g => g.Name);
}
finally
{
_database.Close();
}
}
}
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
navigationHelper.OnNavigatedFrom(e);
}
#endregion
}
}

View File

@@ -0,0 +1,27 @@

#pragma checksum "C:\Users\GBE\Source\Repos\ModernKeePass\ModernKeePass\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "B68578AE122A4023FCD4890B9ACAD34D"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ModernKeePass
{
partial class App : global::Windows.UI.Xaml.Application, global::Windows.UI.Xaml.Markup.IComponentConnector
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public void Connect(int connectionId, object target)
{
this._contentLoaded = true;
}
}
}

View File

@@ -0,0 +1,36 @@

#pragma checksum "C:\Users\GBE\Source\Repos\ModernKeePass\ModernKeePass\MainPage.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "632E76683B011411C14325DDB80D9E3C"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ModernKeePass
{
partial class MainPage : global::Windows.UI.Xaml.Controls.Page, global::Windows.UI.Xaml.Markup.IComponentConnector
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public void Connect(int connectionId, object target)
{
switch(connectionId)
{
case 1:
#line 11 "..\..\MainPage.xaml"
((global::Windows.UI.Xaml.Controls.Primitives.ButtonBase)(target)).Click += this.Button_Click;
#line default
#line hidden
break;
}
this._contentLoaded = true;
}
}
}

View File

@@ -1,6 +1,6 @@

#pragma checksum "C:\Users\GBE\Source\Repos\ModernKeePass\ModernKeePass\MainPage.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "55D7A50FC62F9EB12C79A3D19681A59A"
#pragma checksum "C:\Users\GBE\Source\Repos\ModernKeePass\ModernKeePass\MainPage.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "632E76683B011411C14325DDB80D9E3C"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
@@ -14,6 +14,8 @@ namespace ModernKeePass
{
partial class MainPage : global::Windows.UI.Xaml.Controls.Page
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
private global::Windows.UI.Xaml.Controls.TextBlock textBlock;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
private bool _contentLoaded;
@@ -27,6 +29,7 @@ namespace ModernKeePass
_contentLoaded = true;
global::Windows.UI.Xaml.Application.LoadComponent(this, new global::System.Uri("ms-appx:///MainPage.xaml"), global::Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
textBlock = (global::Windows.UI.Xaml.Controls.TextBlock)this.FindName("textBlock");
}
}
}

View File

@@ -1,4 +1,7 @@
<XamlCompilerSaveState>
<ReferenceAssemblyList>
<LocalAssembly PathName="c:\users\gbe\source\repos\modernkeepass\modernkeepass\obj\debug\intermediatexaml\modernkeepass.exe" HashGuid="ba913411-8172-a080-2ef8-daa6762bdbba" />
<ReferenceAssembly PathName="c:\users\gbe\source\repos\modernkeepass\packages\modernkeepasslib.2.19.0.27133\lib\netstandard1.2\modernkeepasslib.dll" HashGuid="d08e360b-ca16-7b19-6f2a-08b4fd9e8331" />
<ReferenceAssembly PathName="c:\users\gbe\source\repos\modernkeepass\packages\system.runtime.interopservices.runtimeinformation.4.3.0\lib\win8\system.runtime.interopservices.runtimeinformation.dll" HashGuid="6560d00f-0bb0-0755-5423-c4e1bf779127" />
</ReferenceAssemblyList>
</XamlCompilerSaveState>

View File

@@ -0,0 +1,614 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ModernKeePass
{
public partial class App : global::Windows.UI.Xaml.Markup.IXamlMetadataProvider
{
private global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlTypeInfoProvider _provider;
public global::Windows.UI.Xaml.Markup.IXamlType GetXamlType(global::System.Type type)
{
if(_provider == null)
{
_provider = new global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlTypeInfoProvider();
}
return _provider.GetXamlTypeByType(type);
}
public global::Windows.UI.Xaml.Markup.IXamlType GetXamlType(string fullName)
{
if(_provider == null)
{
_provider = new global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlTypeInfoProvider();
}
return _provider.GetXamlTypeByName(fullName);
}
public global::Windows.UI.Xaml.Markup.XmlnsDefinition[] GetXmlnsDefinitions()
{
return new global::Windows.UI.Xaml.Markup.XmlnsDefinition[0];
}
}
}
namespace ModernKeePass.ModernKeePass_XamlTypeInfo
{
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks", "4.0.0.0")]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
internal partial class XamlTypeInfoProvider
{
public global::Windows.UI.Xaml.Markup.IXamlType GetXamlTypeByType(global::System.Type type)
{
global::Windows.UI.Xaml.Markup.IXamlType xamlType;
if (_xamlTypeCacheByType.TryGetValue(type, out xamlType))
{
return xamlType;
}
int typeIndex = LookupTypeIndexByType(type);
if(typeIndex != -1)
{
xamlType = CreateXamlType(typeIndex);
}
if (xamlType != null)
{
_xamlTypeCacheByName.Add(xamlType.FullName, xamlType);
_xamlTypeCacheByType.Add(xamlType.UnderlyingType, xamlType);
}
return xamlType;
}
public global::Windows.UI.Xaml.Markup.IXamlType GetXamlTypeByName(string typeName)
{
if (string.IsNullOrEmpty(typeName))
{
return null;
}
global::Windows.UI.Xaml.Markup.IXamlType xamlType;
if (_xamlTypeCacheByName.TryGetValue(typeName, out xamlType))
{
return xamlType;
}
int typeIndex = LookupTypeIndexByName(typeName);
if(typeIndex != -1)
{
xamlType = CreateXamlType(typeIndex);
}
if (xamlType != null)
{
_xamlTypeCacheByName.Add(xamlType.FullName, xamlType);
_xamlTypeCacheByType.Add(xamlType.UnderlyingType, xamlType);
}
return xamlType;
}
public global::Windows.UI.Xaml.Markup.IXamlMember GetMemberByLongName(string longMemberName)
{
if (string.IsNullOrEmpty(longMemberName))
{
return null;
}
global::Windows.UI.Xaml.Markup.IXamlMember xamlMember;
if (_xamlMembers.TryGetValue(longMemberName, out xamlMember))
{
return xamlMember;
}
xamlMember = CreateXamlMember(longMemberName);
if (xamlMember != null)
{
_xamlMembers.Add(longMemberName, xamlMember);
}
return xamlMember;
}
global::System.Collections.Generic.Dictionary<string, global::Windows.UI.Xaml.Markup.IXamlType>
_xamlTypeCacheByName = new global::System.Collections.Generic.Dictionary<string, global::Windows.UI.Xaml.Markup.IXamlType>();
global::System.Collections.Generic.Dictionary<global::System.Type, global::Windows.UI.Xaml.Markup.IXamlType>
_xamlTypeCacheByType = new global::System.Collections.Generic.Dictionary<global::System.Type, global::Windows.UI.Xaml.Markup.IXamlType>();
global::System.Collections.Generic.Dictionary<string, global::Windows.UI.Xaml.Markup.IXamlMember>
_xamlMembers = new global::System.Collections.Generic.Dictionary<string, global::Windows.UI.Xaml.Markup.IXamlMember>();
string[] _typeNameTable = null;
global::System.Type[] _typeTable = null;
private void InitTypeTables()
{
_typeNameTable = new string[9];
_typeNameTable[0] = "ModernKeePass.MainPage";
_typeNameTable[1] = "Windows.UI.Xaml.Controls.Page";
_typeNameTable[2] = "Windows.UI.Xaml.Controls.UserControl";
_typeNameTable[3] = "ModernKeePass.Pages.DatabaseViewPage";
_typeNameTable[4] = "ModernKeePass.Common.ObservableDictionary";
_typeNameTable[5] = "Object";
_typeNameTable[6] = "String";
_typeNameTable[7] = "ModernKeePass.Common.NavigationHelper";
_typeNameTable[8] = "Windows.UI.Xaml.DependencyObject";
_typeTable = new global::System.Type[9];
_typeTable[0] = typeof(global::ModernKeePass.MainPage);
_typeTable[1] = typeof(global::Windows.UI.Xaml.Controls.Page);
_typeTable[2] = typeof(global::Windows.UI.Xaml.Controls.UserControl);
_typeTable[3] = typeof(global::ModernKeePass.Pages.DatabaseViewPage);
_typeTable[4] = typeof(global::ModernKeePass.Common.ObservableDictionary);
_typeTable[5] = typeof(global::System.Object);
_typeTable[6] = typeof(global::System.String);
_typeTable[7] = typeof(global::ModernKeePass.Common.NavigationHelper);
_typeTable[8] = typeof(global::Windows.UI.Xaml.DependencyObject);
}
private int LookupTypeIndexByName(string typeName)
{
if (_typeNameTable == null)
{
InitTypeTables();
}
for (int i=0; i<_typeNameTable.Length; i++)
{
if(0 == string.CompareOrdinal(_typeNameTable[i], typeName))
{
return i;
}
}
return -1;
}
private int LookupTypeIndexByType(global::System.Type type)
{
if (_typeTable == null)
{
InitTypeTables();
}
for(int i=0; i<_typeTable.Length; i++)
{
if(type == _typeTable[i])
{
return i;
}
}
return -1;
}
private object Activate_0_MainPage() { return new global::ModernKeePass.MainPage(); }
private object Activate_3_DatabaseViewPage() { return new global::ModernKeePass.Pages.DatabaseViewPage(); }
private object Activate_4_ObservableDictionary() { return new global::ModernKeePass.Common.ObservableDictionary(); }
private void MapAdd_4_ObservableDictionary(object instance, object key, object item)
{
var collection = (global::System.Collections.Generic.IDictionary<global::System.String, global::System.Object>)instance;
var newKey = (global::System.String)key;
var newItem = (global::System.Object)item;
collection.Add(newKey, newItem);
}
private global::Windows.UI.Xaml.Markup.IXamlType CreateXamlType(int typeIndex)
{
global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlSystemBaseType xamlType = null;
global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlUserType userType;
string typeName = _typeNameTable[typeIndex];
global::System.Type type = _typeTable[typeIndex];
switch (typeIndex)
{
case 0: // ModernKeePass.MainPage
userType = new global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlUserType(this, typeName, type, GetXamlTypeByName("Windows.UI.Xaml.Controls.Page"));
userType.Activator = Activate_0_MainPage;
userType.SetIsLocalType();
xamlType = userType;
break;
case 1: // Windows.UI.Xaml.Controls.Page
xamlType = new global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlSystemBaseType(typeName, type);
break;
case 2: // Windows.UI.Xaml.Controls.UserControl
xamlType = new global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlSystemBaseType(typeName, type);
break;
case 3: // ModernKeePass.Pages.DatabaseViewPage
userType = new global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlUserType(this, typeName, type, GetXamlTypeByName("Windows.UI.Xaml.Controls.Page"));
userType.Activator = Activate_3_DatabaseViewPage;
userType.AddMemberName("DefaultViewModel");
userType.AddMemberName("NavigationHelper");
userType.SetIsLocalType();
xamlType = userType;
break;
case 4: // ModernKeePass.Common.ObservableDictionary
userType = new global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlUserType(this, typeName, type, GetXamlTypeByName("Object"));
userType.DictionaryAdd = MapAdd_4_ObservableDictionary;
userType.SetIsReturnTypeStub();
userType.SetIsLocalType();
xamlType = userType;
break;
case 5: // Object
xamlType = new global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlSystemBaseType(typeName, type);
break;
case 6: // String
xamlType = new global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlSystemBaseType(typeName, type);
break;
case 7: // ModernKeePass.Common.NavigationHelper
userType = new global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlUserType(this, typeName, type, GetXamlTypeByName("Windows.UI.Xaml.DependencyObject"));
userType.SetIsReturnTypeStub();
userType.SetIsLocalType();
xamlType = userType;
break;
case 8: // Windows.UI.Xaml.DependencyObject
xamlType = new global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlSystemBaseType(typeName, type);
break;
}
return xamlType;
}
private object get_0_DatabaseViewPage_DefaultViewModel(object instance)
{
var that = (global::ModernKeePass.Pages.DatabaseViewPage)instance;
return that.DefaultViewModel;
}
private object get_1_DatabaseViewPage_NavigationHelper(object instance)
{
var that = (global::ModernKeePass.Pages.DatabaseViewPage)instance;
return that.NavigationHelper;
}
private global::Windows.UI.Xaml.Markup.IXamlMember CreateXamlMember(string longMemberName)
{
global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlMember xamlMember = null;
global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlUserType userType;
switch (longMemberName)
{
case "ModernKeePass.Pages.DatabaseViewPage.DefaultViewModel":
userType = (global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlUserType)GetXamlTypeByName("ModernKeePass.Pages.DatabaseViewPage");
xamlMember = new global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlMember(this, "DefaultViewModel", "ModernKeePass.Common.ObservableDictionary");
xamlMember.Getter = get_0_DatabaseViewPage_DefaultViewModel;
xamlMember.SetIsReadOnly();
break;
case "ModernKeePass.Pages.DatabaseViewPage.NavigationHelper":
userType = (global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlUserType)GetXamlTypeByName("ModernKeePass.Pages.DatabaseViewPage");
xamlMember = new global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlMember(this, "NavigationHelper", "ModernKeePass.Common.NavigationHelper");
xamlMember.Getter = get_1_DatabaseViewPage_NavigationHelper;
xamlMember.SetIsReadOnly();
break;
}
return xamlMember;
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks", "4.0.0.0")]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
internal class XamlSystemBaseType : global::Windows.UI.Xaml.Markup.IXamlType
{
string _fullName;
global::System.Type _underlyingType;
public XamlSystemBaseType(string fullName, global::System.Type underlyingType)
{
_fullName = fullName;
_underlyingType = underlyingType;
}
public string FullName { get { return _fullName; } }
public global::System.Type UnderlyingType
{
get
{
return _underlyingType;
}
}
virtual public global::Windows.UI.Xaml.Markup.IXamlType BaseType { get { throw new global::System.NotImplementedException(); } }
virtual public global::Windows.UI.Xaml.Markup.IXamlMember ContentProperty { get { throw new global::System.NotImplementedException(); } }
virtual public global::Windows.UI.Xaml.Markup.IXamlMember GetMember(string name) { throw new global::System.NotImplementedException(); }
virtual public bool IsArray { get { throw new global::System.NotImplementedException(); } }
virtual public bool IsCollection { get { throw new global::System.NotImplementedException(); } }
virtual public bool IsConstructible { get { throw new global::System.NotImplementedException(); } }
virtual public bool IsDictionary { get { throw new global::System.NotImplementedException(); } }
virtual public bool IsMarkupExtension { get { throw new global::System.NotImplementedException(); } }
virtual public bool IsBindable { get { throw new global::System.NotImplementedException(); } }
virtual public bool IsReturnTypeStub { get { throw new global::System.NotImplementedException(); } }
virtual public bool IsLocalType { get { throw new global::System.NotImplementedException(); } }
virtual public global::Windows.UI.Xaml.Markup.IXamlType ItemType { get { throw new global::System.NotImplementedException(); } }
virtual public global::Windows.UI.Xaml.Markup.IXamlType KeyType { get { throw new global::System.NotImplementedException(); } }
virtual public object ActivateInstance() { throw new global::System.NotImplementedException(); }
virtual public void AddToMap(object instance, object key, object item) { throw new global::System.NotImplementedException(); }
virtual public void AddToVector(object instance, object item) { throw new global::System.NotImplementedException(); }
virtual public void RunInitializer() { throw new global::System.NotImplementedException(); }
virtual public object CreateFromString(string input) { throw new global::System.NotImplementedException(); }
}
internal delegate object Activator();
internal delegate void AddToCollection(object instance, object item);
internal delegate void AddToDictionary(object instance, object key, object item);
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks", "4.0.0.0")]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
internal class XamlUserType : global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlSystemBaseType
{
global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlTypeInfoProvider _provider;
global::Windows.UI.Xaml.Markup.IXamlType _baseType;
bool _isArray;
bool _isMarkupExtension;
bool _isBindable;
bool _isReturnTypeStub;
bool _isLocalType;
string _contentPropertyName;
string _itemTypeName;
string _keyTypeName;
global::System.Collections.Generic.Dictionary<string, string> _memberNames;
global::System.Collections.Generic.Dictionary<string, object> _enumValues;
public XamlUserType(global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlTypeInfoProvider provider, string fullName, global::System.Type fullType, global::Windows.UI.Xaml.Markup.IXamlType baseType)
:base(fullName, fullType)
{
_provider = provider;
_baseType = baseType;
}
// --- Interface methods ----
override public global::Windows.UI.Xaml.Markup.IXamlType BaseType { get { return _baseType; } }
override public bool IsArray { get { return _isArray; } }
override public bool IsCollection { get { return (CollectionAdd != null); } }
override public bool IsConstructible { get { return (Activator != null); } }
override public bool IsDictionary { get { return (DictionaryAdd != null); } }
override public bool IsMarkupExtension { get { return _isMarkupExtension; } }
override public bool IsBindable { get { return _isBindable; } }
override public bool IsReturnTypeStub { get { return _isReturnTypeStub; } }
override public bool IsLocalType { get { return _isLocalType; } }
override public global::Windows.UI.Xaml.Markup.IXamlMember ContentProperty
{
get { return _provider.GetMemberByLongName(_contentPropertyName); }
}
override public global::Windows.UI.Xaml.Markup.IXamlType ItemType
{
get { return _provider.GetXamlTypeByName(_itemTypeName); }
}
override public global::Windows.UI.Xaml.Markup.IXamlType KeyType
{
get { return _provider.GetXamlTypeByName(_keyTypeName); }
}
override public global::Windows.UI.Xaml.Markup.IXamlMember GetMember(string name)
{
if (_memberNames == null)
{
return null;
}
string longName;
if (_memberNames.TryGetValue(name, out longName))
{
return _provider.GetMemberByLongName(longName);
}
return null;
}
override public object ActivateInstance()
{
return Activator();
}
override public void AddToMap(object instance, object key, object item)
{
DictionaryAdd(instance, key, item);
}
override public void AddToVector(object instance, object item)
{
CollectionAdd(instance, item);
}
override public void RunInitializer()
{
System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(UnderlyingType.TypeHandle);
}
override public object CreateFromString(string input)
{
if (_enumValues != null)
{
int value = 0;
string[] valueParts = input.Split(',');
foreach (string valuePart in valueParts)
{
object partValue;
int enumFieldValue = 0;
try
{
if (_enumValues.TryGetValue(valuePart.Trim(), out partValue))
{
enumFieldValue = global::System.Convert.ToInt32(partValue);
}
else
{
try
{
enumFieldValue = global::System.Convert.ToInt32(valuePart.Trim());
}
catch( global::System.FormatException )
{
foreach( string key in _enumValues.Keys )
{
if( string.Compare(valuePart.Trim(), key, global::System.StringComparison.OrdinalIgnoreCase) == 0 )
{
if( _enumValues.TryGetValue(key.Trim(), out partValue) )
{
enumFieldValue = global::System.Convert.ToInt32(partValue);
break;
}
}
}
}
}
value |= enumFieldValue;
}
catch( global::System.FormatException )
{
throw new global::System.ArgumentException(input, FullName);
}
}
return value;
}
throw new global::System.ArgumentException(input, FullName);
}
// --- End of Interface methods
public Activator Activator { get; set; }
public AddToCollection CollectionAdd { get; set; }
public AddToDictionary DictionaryAdd { get; set; }
public void SetContentPropertyName(string contentPropertyName)
{
_contentPropertyName = contentPropertyName;
}
public void SetIsArray()
{
_isArray = true;
}
public void SetIsMarkupExtension()
{
_isMarkupExtension = true;
}
public void SetIsBindable()
{
_isBindable = true;
}
public void SetIsReturnTypeStub()
{
_isReturnTypeStub = true;
}
public void SetIsLocalType()
{
_isLocalType = true;
}
public void SetItemTypeName(string itemTypeName)
{
_itemTypeName = itemTypeName;
}
public void SetKeyTypeName(string keyTypeName)
{
_keyTypeName = keyTypeName;
}
public void AddMemberName(string shortName)
{
if(_memberNames == null)
{
_memberNames = new global::System.Collections.Generic.Dictionary<string,string>();
}
_memberNames.Add(shortName, FullName + "." + shortName);
}
public void AddEnumValue(string name, object value)
{
if (_enumValues == null)
{
_enumValues = new global::System.Collections.Generic.Dictionary<string, object>();
}
_enumValues.Add(name, value);
}
}
internal delegate object Getter(object instance);
internal delegate void Setter(object instance, object value);
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks", "4.0.0.0")]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
internal class XamlMember : global::Windows.UI.Xaml.Markup.IXamlMember
{
global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlTypeInfoProvider _provider;
string _name;
bool _isAttachable;
bool _isDependencyProperty;
bool _isReadOnly;
string _typeName;
string _targetTypeName;
public XamlMember(global::ModernKeePass.ModernKeePass_XamlTypeInfo.XamlTypeInfoProvider provider, string name, string typeName)
{
_name = name;
_typeName = typeName;
_provider = provider;
}
public string Name { get { return _name; } }
public global::Windows.UI.Xaml.Markup.IXamlType Type
{
get { return _provider.GetXamlTypeByName(_typeName); }
}
public void SetTargetTypeName(string targetTypeName)
{
_targetTypeName = targetTypeName;
}
public global::Windows.UI.Xaml.Markup.IXamlType TargetType
{
get { return _provider.GetXamlTypeByName(_targetTypeName); }
}
public void SetIsAttachable() { _isAttachable = true; }
public bool IsAttachable { get { return _isAttachable; } }
public void SetIsDependencyProperty() { _isDependencyProperty = true; }
public bool IsDependencyProperty { get { return _isDependencyProperty; } }
public void SetIsReadOnly() { _isReadOnly = true; }
public bool IsReadOnly { get { return _isReadOnly; } }
public Getter Getter { get; set; }
public object GetValue(object instance)
{
if (Getter != null)
return Getter(instance);
else
throw new global::System.InvalidOperationException("GetValue");
}
public Setter Setter { get; set; }
public void SetValue(object instance, object value)
{
if (Setter != null)
Setter(instance, value);
else
throw new global::System.InvalidOperationException("SetValue");
}
}
}

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="win81" />
<package id="Microsoft.NETCore.Portable.Compatibility" version="1.0.1" targetFramework="win81" />
<package id="ModernKeePassLib" version="2.19.0.27133" targetFramework="win81" />
<package id="NETStandard.Library" version="2.0.0" targetFramework="win81" />
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="win81" />
<package id="System.Runtime.WindowsRuntime" version="4.3.0" targetFramework="win81" />
</packages>

View File

@@ -6,13 +6,12 @@
<title>$title$</title>
<authors>$author$</authors>
<owners>$author$</owners>
<licenseUrl>http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE</licenseUrl>
<projectUrl>http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE</projectUrl>
<iconUrl>http://ICON_URL_HERE_OR_DELETE_THIS_LINE</iconUrl>
<licenseUrl>https://www.gnu.org/licenses/gpl-3.0.en.html</licenseUrl>
<projectUrl>https://github.com/wismna/ModernKeePass</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>$description$</description>
<releaseNotes>Summary of changes made in this release of the package.</releaseNotes>
<copyright>Copyright 2017</copyright>
<tags>Tag1 Tag2</tags>
<releaseNotes>Initial release.</releaseNotes>
<copyright>$copyright$</copyright>
<tags>KeePass KeePassLib NetStandard</tags>
</metadata>
</package>

View File

@@ -20,6 +20,8 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Windows.UI.Xaml.Media.Imaging;
//using System.Drawing;
using ModernKeePassLib.WinRTAdaptors;
@@ -30,8 +32,6 @@ using ModernKeePassLib.Interfaces;
using ModernKeePassLib.Keys;
using ModernKeePassLib.Serialization;
using ModernKeePassLib.Utility;
using Windows.UI.Xaml.Media.Imaging;
using System.Threading.Tasks;
namespace ModernKeePassLib
{

View File

@@ -0,0 +1,31 @@
This Microsoft .NET Library may incorporate components from the projects listed
below. Microsoft licenses these components under the Microsoft .NET Library
software license terms. The original copyright notices and the licenses under
which Microsoft received such components are set forth below for informational
purposes only. Microsoft reserves all rights not expressly granted herein,
whether by implication, estoppel or otherwise.
1. .NET Core (https://github.com/dotnet/core/)
.NET Core
Copyright (c) .NET Foundation and Contributors
The MIT License (MIT)
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.

View File

@@ -0,0 +1,128 @@
MICROSOFT SOFTWARE LICENSE TERMS
MICROSOFT .NET LIBRARY
These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. The terms also apply to any Microsoft
· updates,
· supplements,
· Internet-based services, and
· support services
for this software, unless other terms accompany those items. If so, those terms apply.
BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE.
IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE PERPETUAL RIGHTS BELOW.
1. INSTALLATION AND USE RIGHTS.
a. Installation and Use. You may install and use any number of copies of the software to design, develop and test your programs.
b. Third Party Programs. The software may include third party programs that Microsoft, not the third party, licenses to you under this agreement. Notices, if any, for the third party program are included for your information only.
2. ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS.
a. DISTRIBUTABLE CODE. The software is comprised of Distributable Code. “Distributable Code” is code that you are permitted to distribute in programs you develop if you comply with the terms below.
i. Right to Use and Distribute.
· You may copy and distribute the object code form of the software.
· Third Party Distribution. You may permit distributors of your programs to copy and distribute the Distributable Code as part of those programs.
ii. Distribution Requirements. For any Distributable Code you distribute, you must
· add significant primary functionality to it in your programs;
· require distributors and external end users to agree to terms that protect it at least as much as this agreement;
· display your valid copyright notice on your programs; and
· indemnify, defend, and hold harmless Microsoft from any claims, including attorneys fees, related to the distribution or use of your programs.
iii. Distribution Restrictions. You may not
· alter any copyright, trademark or patent notice in the Distributable Code;
· use Microsofts trademarks in your programs names or in a way that suggests your programs come from or are endorsed by Microsoft;
· include Distributable Code in malicious, deceptive or unlawful programs; or
· modify or distribute the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. An Excluded License is one that requires, as a condition of use, modification or distribution, that
· the code be disclosed or distributed in source code form; or
· others have the right to modify it.
3. SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not
· work around any technical limitations in the software;
· reverse engineer, decompile or disassemble the software, except and only to the extent that applicable law expressly permits, despite this limitation;
· publish the software for others to copy;
· rent, lease or lend the software;
· transfer the software or this agreement to any third party; or
· use the software for commercial software hosting services.
4. BACKUP COPY. You may make one backup copy of the software. You may use it only to reinstall the software.
5. DOCUMENTATION. Any person that has valid access to your computer or internal network may copy and use the documentation for your internal, reference purposes.
6. EXPORT RESTRICTIONS. The software is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see www.microsoft.com/exporting.
7. SUPPORT SERVICES. Because this software is “as is,” we may not provide support services for it.
8. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services.
9. APPLICABLE LAW.
a. United States. If you acquired the software in the United States, Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live govern all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort.
b. Outside the United States. If you acquired the software in any other country, the laws of that country apply.
10. LEGAL EFFECT. This agreement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your country if the laws of your country do not permit it to do so.
11. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS.” YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR CONDITIONS. YOU MAY HAVE ADDITIONAL CONSUMER RIGHTS OR STATUTORY GUARANTEES UNDER YOUR LOCAL LAWS WHICH THIS AGREEMENT CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
FOR AUSTRALIA YOU HAVE STATUTORY GUARANTEES UNDER THE AUSTRALIAN CONSUMER LAW AND NOTHING IN THESE TERMS IS INTENDED TO AFFECT THOSE RIGHTS.
12. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.
This limitation applies to
· anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and
· claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law.
It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.
Please note: As this software is distributed in Quebec, Canada, some of the clauses in this agreement are provided below in French.
Remarque : Ce logiciel étant distribué au Québec, Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en français.
EXONÉRATION DE GARANTIE. Le logiciel visé par une licence est offert « tel quel ». Toute utilisation de ce logiciel est à votre seule risque et péril. Microsoft naccorde aucune autre garantie expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualité marchande, dadéquation à un usage particulier et dabsence de contrefaçon sont exclues.
LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune indemnisation pour les autres dommages, y compris les dommages spéciaux, indirects ou accessoires et pertes de bénéfices.
Cette limitation concerne :
· tout ce qui est relié au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers ; et
· les réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité stricte, de négligence ou dune autre faute dans la limite autorisée par la loi en vigueur.
Elle sapplique également, même si Microsoft connaissait ou devrait connaître léventualité dun tel dommage. Si votre pays nautorise pas lexclusion ou la limitation de responsabilité pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou lexclusion ci-dessus ne sappliquera pas à votre égard.
EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir dautres droits prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre pays si celles-ci ne le permettent pas.

View File

@@ -0,0 +1,406 @@
{
"runtimes": {
"base": {
},
"any": {
"#import": [ "base" ]
},
"win": {
"#import": [ "any" ]
},
"win-x86": {
"#import": [ "win" ]
},
"win-x64": {
"#import": [ "win" ]
},
"win7": {
"#import": [ "win" ]
},
"win7-x86": {
"#import": [ "win7", "win-x86" ]
},
"win7-x64": {
"#import": [ "win7", "win-x64" ]
},
"win8": {
"#import": [ "win7" ]
},
"win8-x86": {
"#import": [ "win8", "win7-x86" ]
},
"win8-x64": {
"#import": [ "win8", "win7-x64" ]
},
"win8-arm": {
"#import": [ "win8" ]
},
"win81": {
"#import": [ "win8" ]
},
"win81-x86": {
"#import": [ "win81", "win8-x86" ]
},
"win81-x64": {
"#import": [ "win81", "win8-x64" ]
},
"win81-arm": {
"#import": [ "win81", "win8-arm" ]
},
"win10": {
"#import": [ "win81" ]
},
"win10-x86": {
"#import": [ "win10", "win81-x86" ]
},
"win10-x64": {
"#import": [ "win10", "win81-x64" ]
},
"win10-arm": {
"#import": [ "win10", "win81-arm" ]
},
"win10-arm64": {
"#import": [ "win10" ]
},
"aot": {
"#import": [ "any" ]
},
"win-aot": {
"#import": [ "win", "aot" ]
},
"win-x86-aot": {
"#import": [ "win-aot", "win-x86" ]
},
"win-x64-aot": {
"#import": [ "win-aot", "win-x64" ]
},
"win7-aot": {
"#import": [ "win-aot", "win7" ]
},
"win7-x86-aot": {
"#import": [ "win7-aot", "win7-x86" ]
},
"win7-x64-aot": {
"#import": [ "win7-aot", "win7-x64" ]
},
"win8-aot": {
"#import": [ "win8", "win7-aot" ]
},
"win8-x86-aot": {
"#import": [ "win8-aot", "win8-x86", "win7-x86-aot" ]
},
"win8-x64-aot": {
"#import": [ "win8-aot", "win8-x64", "win7-x64-aot" ]
},
"win8-arm-aot": {
"#import": [ "win8-aot", "win8-arm" ]
},
"win81-aot": {
"#import": [ "win81", "win8-aot" ]
},
"win81-x86-aot": {
"#import": [ "win81-aot", "win81-x86", "win8-x86-aot" ]
},
"win81-x64-aot": {
"#import": [ "win81-aot", "win81-x64", "win8-x64-aot" ]
},
"win81-arm-aot": {
"#import": [ "win81-aot", "win81-arm", "win8-arm-aot" ]
},
"win10-aot": {
"#import": [ "win10", "win81-aot" ]
},
"win10-x86-aot": {
"#import": [ "win10-aot", "win10-x86", "win81-x86-aot" ]
},
"win10-x64-aot": {
"#import": [ "win10-aot", "win10-x64", "win81-x64-aot" ]
},
"win10-arm-aot": {
"#import": [ "win10-aot", "win10-arm", "win81-arm-aot" ]
},
"win10-arm64-aot": {
"#import": [ "win10-aot", "win10-arm64" ]
},
"unix": {
"#import": [ "any" ]
},
"unix-x64": {
"#import": [ "unix" ]
},
"osx": {
"#import": [ "unix" ]
},
"osx-x64": {
"#import": [ "osx", "unix-x64" ]
},
"osx.10.10": {
"#import": [ "osx" ]
},
"osx.10.10-x64": {
"#import": [ "osx.10.10", "osx-x64" ]
},
"osx.10.11": {
"#import": [ "osx.10.10" ]
},
"osx.10.11-x64": {
"#import": [ "osx.10.11", "osx.10.10-x64" ]
},
"osx.10.12": {
"#import": [ "osx.10.11" ]
},
"osx.10.12-x64": {
"#import": [ "osx.10.12", "osx.10.11-x64" ]
},
"linux": {
"#import": [ "unix" ]
},
"linux-x64": {
"#import": [ "linux", "unix-x64" ]
},
"rhel": {
"#import": [ "linux" ]
},
"rhel-x64": {
"#import": [ "rhel", "linux-x64" ]
},
"rhel.7": {
"#import": [ "rhel" ]
},
"rhel.7-x64": {
"#import": [ "rhel", "rhel-x64" ]
},
"rhel.7.0": {
"#import": [ "rhel.7" ]
},
"rhel.7.0-x64": {
"#import": [ "rhel.7", "rhel.7-x64" ]
},
"rhel.7.1": {
"#import": [ "rhel.7.0" ]
},
"rhel.7.1-x64": {
"#import": [ "rhel.7.0", "rhel.7.0-x64" ]
},
"rhel.7.2": {
"#import": [ "rhel.7.1" ]
},
"rhel.7.2-x64": {
"#import": [ "rhel.7.1", "rhel.7.1-x64" ]
},
"ol": {
"#import": [ "rhel" ]
},
"ol-x64": {
"#import": [ "ol", "rhel-x64" ]
},
"ol.7": {
"#import": [ "ol", "rhel.7" ]
},
"ol.7-x64": {
"#import": [ "ol.7", "ol-x64", "rhel.7-x64" ]
},
"ol.7.0": {
"#import": [ "ol.7", "rhel.7.0" ]
},
"ol.7.0-x64": {
"#import": [ "ol.7", "ol.7-x64", "rhel.7.0-x64" ]
},
"ol.7.1": {
"#import": [ "ol.7.0", "rhel.7.1" ]
},
"ol.7.1-x64": {
"#import": [ "ol.7.0", "ol.7.0-x64", "rhel.7.1-x64" ]
},
"ol.7.2": {
"#import": [ "ol.7.1", "rhel.7.2" ]
},
"ol.7.2-x64": {
"#import": [ "ol.7.1", "ol.7.1-x64", "rhel.7.2-x64" ]
},
"centos": {
"#import": [ "rhel" ]
},
"centos-x64": {
"#import": [ "centos", "rhel-x64" ]
},
"centos.7": {
"#import": [ "centos", "rhel.7" ]
},
"centos.7-x64": {
"#import": [ "centos.7", "centos-x64", "rhel.7-x64" ]
},
"debian": {
"#import": [ "linux" ]
},
"debian-x64": {
"#import": [ "debian", "linux-x64" ]
},
"debian.8": {
"#import": [ "debian" ]
},
"debian.8-x64": {
"#import": [ "debian.8", "debian-x64" ]
},
"ubuntu": {
"#import": [ "debian" ]
},
"ubuntu-x64": {
"#import": [ "ubuntu", "debian-x64" ]
},
"ubuntu.14.04": {
"#import": [ "ubuntu" ]
},
"ubuntu.14.04-x64": {
"#import": [ "ubuntu.14.04", "ubuntu-x64" ]
},
"ubuntu.14.10": {
"#import": [ "ubuntu" ]
},
"ubuntu.14.10-x64": {
"#import": [ "ubuntu.14.10", "ubuntu-x64" ]
},
"ubuntu.15.04": {
"#import": [ "ubuntu" ]
},
"ubuntu.15.04-x64": {
"#import": [ "ubuntu.15.04", "ubuntu-x64" ]
},
"ubuntu.15.10": {
"#import": [ "ubuntu" ]
},
"ubuntu.15.10-x64": {
"#import": [ "ubuntu.15.10", "ubuntu-x64" ]
},
"ubuntu.16.04": {
"#import": [ "ubuntu" ]
},
"ubuntu.16.04-x64": {
"#import": [ "ubuntu.16.04", "ubuntu-x64" ]
},
"ubuntu.16.10": {
"#import": [ "ubuntu" ]
},
"ubuntu.16.10-x64": {
"#import": [ "ubuntu.16.10", "ubuntu-x64" ]
},
"linuxmint.17": {
"#import": [ "ubuntu.14.04" ]
},
"linuxmint.17-x64": {
"#import": [ "linuxmint.17", "ubuntu.14.04-x64" ]
},
"linuxmint.17.1": {
"#import": [ "linuxmint.17" ]
},
"linuxmint.17.1-x64": {
"#import": [ "linuxmint.17.1", "linuxmint.17-x64" ]
},
"linuxmint.17.2": {
"#import": [ "linuxmint.17.1" ]
},
"linuxmint.17.2-x64": {
"#import": [ "linuxmint.17.2", "linuxmint.17.1-x64" ]
},
"linuxmint.17.3": {
"#import": [ "linuxmint.17.2" ]
},
"linuxmint.17.3-x64": {
"#import": [ "linuxmint.17.3", "linuxmint.17.2-x64" ]
},
"linuxmint.18": {
"#import": [ "ubuntu.16.04" ]
},
"linuxmint.18-x64": {
"#import": [ "linuxmint.18", "ubuntu.16.04-x64" ]
},
"fedora": {
"#import": [ "linux" ]
},
"fedora-x64": {
"#import": [ "fedora", "linux-x64" ]
},
"fedora.23": {
"#import": [ "fedora" ]
},
"fedora.23-x64": {
"#import": [ "fedora.23", "fedora-x64" ]
},
"fedora.24": {
"#import": [ "fedora" ]
},
"fedora.24-x64": {
"#import": [ "fedora.24", "fedora-x64" ]
},
"opensuse": {
"#import": [ "linux" ]
},
"opensuse-x64": {
"#import": [ "opensuse", "linux-x64" ]
},
"opensuse.13.2": {
"#import": [ "opensuse" ]
},
"opensuse.13.2-x64": {
"#import": [ "opensuse.13.2", "opensuse-x64" ]
},
"opensuse.42.1": {
"#import": [ "opensuse" ]
},
"opensuse.42.1-x64": {
"#import": [ "opensuse.42.1", "opensuse-x64" ]
}
}
}

View File

@@ -0,0 +1,31 @@
This Microsoft .NET Library may incorporate components from the projects listed
below. Microsoft licenses these components under the Microsoft .NET Library
software license terms. The original copyright notices and the licenses under
which Microsoft received such components are set forth below for informational
purposes only. Microsoft reserves all rights not expressly granted herein,
whether by implication, estoppel or otherwise.
1. .NET Core (https://github.com/dotnet/core/)
.NET Core
Copyright (c) .NET Foundation and Contributors
The MIT License (MIT)
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.

View File

@@ -0,0 +1,128 @@
MICROSOFT SOFTWARE LICENSE TERMS
MICROSOFT .NET LIBRARY
These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. The terms also apply to any Microsoft
· updates,
· supplements,
· Internet-based services, and
· support services
for this software, unless other terms accompany those items. If so, those terms apply.
BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE.
IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE PERPETUAL RIGHTS BELOW.
1. INSTALLATION AND USE RIGHTS.
a. Installation and Use. You may install and use any number of copies of the software to design, develop and test your programs.
b. Third Party Programs. The software may include third party programs that Microsoft, not the third party, licenses to you under this agreement. Notices, if any, for the third party program are included for your information only.
2. ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS.
a. DISTRIBUTABLE CODE. The software is comprised of Distributable Code. “Distributable Code” is code that you are permitted to distribute in programs you develop if you comply with the terms below.
i. Right to Use and Distribute.
· You may copy and distribute the object code form of the software.
· Third Party Distribution. You may permit distributors of your programs to copy and distribute the Distributable Code as part of those programs.
ii. Distribution Requirements. For any Distributable Code you distribute, you must
· add significant primary functionality to it in your programs;
· require distributors and external end users to agree to terms that protect it at least as much as this agreement;
· display your valid copyright notice on your programs; and
· indemnify, defend, and hold harmless Microsoft from any claims, including attorneys fees, related to the distribution or use of your programs.
iii. Distribution Restrictions. You may not
· alter any copyright, trademark or patent notice in the Distributable Code;
· use Microsofts trademarks in your programs names or in a way that suggests your programs come from or are endorsed by Microsoft;
· include Distributable Code in malicious, deceptive or unlawful programs; or
· modify or distribute the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. An Excluded License is one that requires, as a condition of use, modification or distribution, that
· the code be disclosed or distributed in source code form; or
· others have the right to modify it.
3. SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not
· work around any technical limitations in the software;
· reverse engineer, decompile or disassemble the software, except and only to the extent that applicable law expressly permits, despite this limitation;
· publish the software for others to copy;
· rent, lease or lend the software;
· transfer the software or this agreement to any third party; or
· use the software for commercial software hosting services.
4. BACKUP COPY. You may make one backup copy of the software. You may use it only to reinstall the software.
5. DOCUMENTATION. Any person that has valid access to your computer or internal network may copy and use the documentation for your internal, reference purposes.
6. EXPORT RESTRICTIONS. The software is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see www.microsoft.com/exporting.
7. SUPPORT SERVICES. Because this software is “as is,” we may not provide support services for it.
8. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services.
9. APPLICABLE LAW.
a. United States. If you acquired the software in the United States, Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live govern all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort.
b. Outside the United States. If you acquired the software in any other country, the laws of that country apply.
10. LEGAL EFFECT. This agreement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your country if the laws of your country do not permit it to do so.
11. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS.” YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR CONDITIONS. YOU MAY HAVE ADDITIONAL CONSUMER RIGHTS OR STATUTORY GUARANTEES UNDER YOUR LOCAL LAWS WHICH THIS AGREEMENT CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
FOR AUSTRALIA YOU HAVE STATUTORY GUARANTEES UNDER THE AUSTRALIAN CONSUMER LAW AND NOTHING IN THESE TERMS IS INTENDED TO AFFECT THOSE RIGHTS.
12. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.
This limitation applies to
· anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and
· claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law.
It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.
Please note: As this software is distributed in Quebec, Canada, some of the clauses in this agreement are provided below in French.
Remarque : Ce logiciel étant distribué au Québec, Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en français.
EXONÉRATION DE GARANTIE. Le logiciel visé par une licence est offert « tel quel ». Toute utilisation de ce logiciel est à votre seule risque et péril. Microsoft naccorde aucune autre garantie expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualité marchande, dadéquation à un usage particulier et dabsence de contrefaçon sont exclues.
LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune indemnisation pour les autres dommages, y compris les dommages spéciaux, indirects ou accessoires et pertes de bénéfices.
Cette limitation concerne :
· tout ce qui est relié au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers ; et
· les réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité stricte, de négligence ou dune autre faute dans la limite autorisée par la loi en vigueur.
Elle sapplique également, même si Microsoft connaissait ou devrait connaître léventualité dun tel dommage. Si votre pays nautorise pas lexclusion ou la limitation de responsabilité pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou lexclusion ci-dessus ne sappliquera pas à votre égard.
EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir dautres droits prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre pays si celles-ci ne le permettent pas.

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) .NET Foundation and Contributors
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.

View File

@@ -0,0 +1,31 @@
This Microsoft .NET Library may incorporate components from the projects listed
below. Microsoft licenses these components under the Microsoft .NET Library
software license terms. The original copyright notices and the licenses under
which Microsoft received such components are set forth below for informational
purposes only. Microsoft reserves all rights not expressly granted herein,
whether by implication, estoppel or otherwise.
1. .NET Core (https://github.com/dotnet/core/)
.NET Core
Copyright (c) .NET Foundation and Contributors
The MIT License (MIT)
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.

Some files were not shown because too many files have changed in this diff Show More