NetDocsForLLM/Models/DocumentationModel.cs

238 lines
6.4 KiB
C#

using CommunityToolkit.Mvvm.ComponentModel;
using System.Collections.ObjectModel;
namespace NetDocsForLLM.Models
{
public class DocumentationModel : ObservableObject
{
private ObservableCollection<NamespaceDocumentation> _namespaces;
public ObservableCollection<NamespaceDocumentation> Namespaces
{
get => _namespaces;
set => SetProperty(ref _namespaces, value);
}
public DocumentationModel()
{
_namespaces = new ObservableCollection<NamespaceDocumentation>();
}
}
public class NamespaceDocumentation : ObservableObject
{
private string _name;
private string _description;
private ObservableCollection<TypeDocumentation> _types;
public string Name
{
get => _name;
set => SetProperty(ref _name, value);
}
public string Description
{
get => _description;
set => SetProperty(ref _description, value);
}
public ObservableCollection<TypeDocumentation> Types
{
get => _types;
set => SetProperty(ref _types, value);
}
public NamespaceDocumentation()
{
_name = string.Empty;
_description = string.Empty;
_types = new ObservableCollection<TypeDocumentation>();
}
}
public class TypeDocumentation : ObservableObject
{
private string _name;
private string _fullName;
private string _description;
private string _typeKind; // Class, Interface, Enum, etc.
private ObservableCollection<MemberDocumentation> _members;
private ObservableCollection<string> _baseTypes;
private ObservableCollection<string> _interfaces;
public string Name
{
get => _name;
set => SetProperty(ref _name, value);
}
public string FullName
{
get => _fullName;
set => SetProperty(ref _fullName, value);
}
public string Description
{
get => _description;
set => SetProperty(ref _description, value);
}
public string TypeKind
{
get => _typeKind;
set => SetProperty(ref _typeKind, value);
}
public ObservableCollection<MemberDocumentation> Members
{
get => _members;
set => SetProperty(ref _members, value);
}
public ObservableCollection<string> BaseTypes
{
get => _baseTypes;
set => SetProperty(ref _baseTypes, value);
}
public ObservableCollection<string> Interfaces
{
get => _interfaces;
set => SetProperty(ref _interfaces, value);
}
public TypeDocumentation()
{
_name = string.Empty;
_fullName = string.Empty;
_description = string.Empty;
_typeKind = string.Empty;
_members = new ObservableCollection<MemberDocumentation>();
_baseTypes = new ObservableCollection<string>();
_interfaces = new ObservableCollection<string>();
}
}
public class MemberDocumentation : ObservableObject
{
private string _name;
private string _description;
private string _memberType; // Method, Property, Field, etc.
private string _signature;
private ObservableCollection<ParameterDocumentation> _parameters;
private string _returnType;
private string _returnDescription;
private ObservableCollection<string> _examples;
public string Name
{
get => _name;
set => SetProperty(ref _name, value);
}
public string Description
{
get => _description;
set => SetProperty(ref _description, value);
}
public string MemberType
{
get => _memberType;
set => SetProperty(ref _memberType, value);
}
public string Signature
{
get => _signature;
set => SetProperty(ref _signature, value);
}
public ObservableCollection<ParameterDocumentation> Parameters
{
get => _parameters;
set => SetProperty(ref _parameters, value);
}
public string ReturnType
{
get => _returnType;
set => SetProperty(ref _returnType, value);
}
public string ReturnDescription
{
get => _returnDescription;
set => SetProperty(ref _returnDescription, value);
}
public ObservableCollection<string> Examples
{
get => _examples;
set => SetProperty(ref _examples, value);
}
public MemberDocumentation()
{
_name = string.Empty;
_description = string.Empty;
_memberType = string.Empty;
_signature = string.Empty;
_parameters = new ObservableCollection<ParameterDocumentation>();
_returnType = string.Empty;
_returnDescription = string.Empty;
_examples = new ObservableCollection<string>();
}
}
public class ParameterDocumentation : ObservableObject
{
private string _name;
private string _type;
private string _description;
private bool _isOptional;
private string _defaultValue;
public string Name
{
get => _name;
set => SetProperty(ref _name, value);
}
public string Type
{
get => _type;
set => SetProperty(ref _type, value);
}
public string Description
{
get => _description;
set => SetProperty(ref _description, value);
}
public bool IsOptional
{
get => _isOptional;
set => SetProperty(ref _isOptional, value);
}
public string DefaultValue
{
get => _defaultValue;
set => SetProperty(ref _defaultValue, value);
}
public ParameterDocumentation()
{
_name = string.Empty;
_type = string.Empty;
_description = string.Empty;
_isOptional = false;
_defaultValue = string.Empty;
}
}
}