using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using Microsoft.SqlServer.Server;
using System.IO;
namespace BITKit
{
///
/// 属性接口,用于序列化引用
///
public interface IProperty
{
}
///
/// 属性接口
/// GetOrCreate(√)
/// GetOrAdd(√)
/// TryGet(√)
/// TryRemove(√)
/// TrySet(√)
/// GetProperties(√)
///
public interface IPropertable: IBinarySerialize
{
///
/// 是否拥有属性
///
bool Contains();
///
/// 获取或创建属性
///
T GetOrCreateProperty();
///
/// 获取或通过工厂方法添加属性
///
T GetOrAddProperty(Func addFactory);
///
/// 尝试获取属性
///
bool TryGetProperty(out T value);
///
/// 尝试移除属性
///
bool TryRemoveProperty();
///
/// 尝试设置属性
///
bool TrySetProperty(T value);
///
/// 获取所有属性
///
object[] GetProperties();
///
/// 清除所有属性
///
///
bool ClearProperties();
///
/// 从其他对象复制属性
///
///
///
bool CopyPropertiesFrom(IPropertable propertable);
}
public class Property : IPropertable
{
public Property() { }
public Property(IEnumerable