You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.4 KiB
44 lines
1.4 KiB
// 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{T}">No table for <typeparamref name="T"/> is existing</exception>
|
|
protected GBaseObject(IGBase gBase)
|
|
{
|
|
_gBaseTable = gBase.GetTable<T>();
|
|
if (_gBaseTable == null)
|
|
throw new MissingTableException<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);
|
|
}
|
|
} |