49 lines
1.9 KiB
C#
49 lines
1.9 KiB
C#
using BS.Shared.Interface;
|
|
using DevExpress.DataAccess.DataFederation;
|
|
using DevExpress.Xpf.Bars.Native;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Security.Cryptography.X509Certificates;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BS.Shared.Extensions.CustomInterfaces
|
|
{
|
|
public static class IAiPromptbausteinTreeExtension
|
|
{
|
|
public static bool IsExecutable(this IAiPromptbaustein aiPromptbaustein)
|
|
=> aiPromptbaustein.IsPrompt() || aiPromptbaustein.IsKette();
|
|
|
|
|
|
public static bool IsOrdner(this IAiPromptbaustein aiPromptbaustein)
|
|
=> aiPromptbaustein.hasPrompttype(AiPromptbausteinType.Ordner);
|
|
|
|
public static bool IsKette(this IAiPromptbaustein aiPromptbaustein)
|
|
=> aiPromptbaustein.hasPrompttype(AiPromptbausteinType.Kette);
|
|
|
|
public static bool IsPrompt(this IAiPromptbaustein aiPromptbaustein)
|
|
=> aiPromptbaustein.hasPrompttype(AiPromptbausteinType.Prompt);
|
|
|
|
|
|
public static bool IsPredefinedNode(this IAiPromptbaustein aiPromptbaustein)
|
|
=> aiPromptbaustein.isObject() && aiPromptbaustein.Oid < 0;
|
|
|
|
public static bool IsNoPredefinedNode(this IAiPromptbaustein aiPromptbaustein)
|
|
=> aiPromptbaustein.isObject() && aiPromptbaustein.Oid >= 0;
|
|
|
|
public static bool IsAddablePredefinedNode(this IAiPromptbaustein aiPromptbaustein)
|
|
=> aiPromptbaustein.IsPredefinedNode() && !aiPromptbaustein.IsNoAddablePredefinedNode();
|
|
|
|
public static bool IsNoAddablePredefinedNode(this IAiPromptbaustein aiPromptbaustein)
|
|
=> aiPromptbaustein.IsPredefinedNode() && aiPromptbaustein.AiActionType == AiActionType.ServiceRecord;
|
|
|
|
private static bool hasPrompttype(this IAiPromptbaustein aiPromptbaustein, AiPromptbausteinType aiPromptbausteinType)
|
|
=> aiPromptbaustein.isObject() && aiPromptbaustein.PromptbausteinType == aiPromptbausteinType;
|
|
|
|
private static bool isObject(this IAiPromptbaustein aiPromptbaustein)
|
|
=> aiPromptbaustein != null;
|
|
|
|
}
|
|
}
|