parent
7c2f52a265
commit
b69830fb41
1 changed files with 44 additions and 0 deletions
@ -0,0 +1,44 @@ |
|||||||
|
// Author: Gockner, Simon |
||||||
|
// Created: 2020-09-18 |
||||||
|
// Copyright(c) 2020 SimonG. All Rights Reserved. |
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Linq; |
||||||
|
using GBase.Api; |
||||||
|
using GBase.Exceptions; |
||||||
|
using GBase.Interfaces; |
||||||
|
|
||||||
|
namespace GBase |
||||||
|
{ |
||||||
|
/// <summary> |
||||||
|
/// GBase object that supplies inheriting classes with methods to get data from a <see cref="IGBase"/> |
||||||
|
/// </summary> |
||||||
|
public abstract class GBaseObject<T> : IGBaseObject where T : INotifyGBaseEntryChanged |
||||||
|
{ |
||||||
|
private readonly IGBaseTable _gBaseTable; |
||||||
|
|
||||||
|
/// <summary> |
||||||
|
/// GBase object that allows conversion from <see cref="string"/> |
||||||
|
/// </summary> |
||||||
|
/// <exception cref="MissingTableException">No table for <typeparamref name="T"/> is existing</exception> |
||||||
|
protected GBaseObject(IGBase gBase) |
||||||
|
{ |
||||||
|
_gBaseTable = gBase.GetTable<T>(); |
||||||
|
if (_gBaseTable == null) |
||||||
|
throw new MissingTableException(typeof(T)); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
protected TProperty Get<TProperty>() |
||||||
|
{ |
||||||
|
throw new NotImplementedException(); |
||||||
|
//_gBaseTable.GetEntry<T>() |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary> |
||||||
|
/// Initialize this <see cref="GBaseObject{T}"/> from a given <see cref="string"/> |
||||||
|
/// </summary> |
||||||
|
/// <param name="string">The given <see cref="string"/></param> |
||||||
|
public abstract void InitializeFromString(string @string); |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue