mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
WIP open a database
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Binary file not shown.
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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>
|
||||
|
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user