diff --git a/BeWo/AI/View/AiTranskriptionView.xaml.cs b/BeWo/AI/View/AiTranskriptionView.xaml.cs index 9cd82b623..803c2e361 100644 --- a/BeWo/AI/View/AiTranskriptionView.xaml.cs +++ b/BeWo/AI/View/AiTranskriptionView.xaml.cs @@ -21,8 +21,6 @@ using BeWo.ViewModel.View.AI; using BS.Shared; using BS.Shared.Core; using BS.Shared.DataContracts; -using BS.Shared.DataContracts.Feature.AI; -using BS.Shared.DataContracts.Feature.AI.Functions.ServiceRecords; using BS.Shared.Extensions; using BS.Shared.Translation; using DevExpress.Mvvm; diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj index f829adc74..d533cb7ce 100644 --- a/BeWo/BeWo.csproj +++ b/BeWo/BeWo.csproj @@ -119,7 +119,9 @@ + + AbsenceTimesCreationView.xaml @@ -147,6 +149,8 @@ DataTemplates.xaml + + @@ -165,17 +169,21 @@ + + + + - - AiConversationButton.xaml + + AiChatButton.xaml - - AiPromptbausteinButton.xaml + + AiPromptbausteinLibraryControl.xaml AiPromptbausteinActionResultView.xaml @@ -205,9 +213,15 @@ AiConfigView.xaml + + AiPromptbausteinRoutineView.xaml + DatenbereinigungView.xaml + + DeveloperView.xaml + TeamFolderRightView.xaml @@ -216,6 +230,7 @@ + AnimatedBeWoWindow.xaml @@ -287,11 +302,15 @@ MSBuild:Compile Designer - + Designer MSBuild:Compile - + + Designer + MSBuild:Compile + + Designer MSBuild:Compile @@ -343,10 +362,18 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + MSBuild:Compile Designer + + Designer + MSBuild:Compile + MSBuild:Compile Designer diff --git a/BeWo/BeWoApp.xaml.cs b/BeWo/BeWoApp.xaml.cs index 569532340..bf48c71a8 100644 --- a/BeWo/BeWoApp.xaml.cs +++ b/BeWo/BeWoApp.xaml.cs @@ -37,6 +37,7 @@ using DevExpress.XtraScheduler; using System.ServiceModel; using BeWo.View.Windows; using System.Diagnostics; +using BeWo.Services; namespace BeWo { @@ -81,6 +82,8 @@ namespace BeWo public static bool IsInDesignMode = DesignerProperties.GetIsInDesignMode(new DependencyObject()); + internal static IBeWoWindowService WindowService { get; set; } + public static EmployeeDC LoggedOnEmployee { get => _LoggedOnEmployee; @@ -784,10 +787,20 @@ namespace BeWo //{ // url += "/service45"; //} - if (url.IndexOf("/service") < 0) + if (BeWoAppInfo.IsInAiMode) { - url += "/service"; + if (url.IndexOf("/service_ai") < 0) + { + url += "/service_ai"; + } } + else + { + if (url.IndexOf("/service") < 0) + { + url += "/service"; + } + } return new Uri(String.Format("https://{0}", url)); } @@ -1073,16 +1086,11 @@ namespace BeWo FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag))); - BeWoAppInfo.BeWoAppVersion.TryActiveDeveloperMode(e.Args); + var controlFactory = new BeWoControlFactory(); + var windowFactory = new BeWoWindowFactory(); + WindowService = new BeWoWindowService(windowFactory, controlFactory); - //if(e.Args.LastOrDefault(x => x.StartsWith("/timeout:") || x.StartsWith("--timeout:")) is string str) - //{ - // var valuePart = str.Substring(str.IndexOf(':') + 1); - // if(int.TryParse(valuePart, out int parsedTimeout)) - // { - // AiTimeout = parsedTimeout; - // } - //} + BeWoAppInfo.BeWoAppVersion.TryActiveDeveloperMode(e.Args); } public static void ShowInfoMessage(string message) diff --git a/BeWo/BeWoAppInfo.cs b/BeWo/BeWoAppInfo.cs index f67e545ca..c17699825 100644 --- a/BeWo/BeWoAppInfo.cs +++ b/BeWo/BeWoAppInfo.cs @@ -15,12 +15,12 @@ namespace BeWo { var baseVersion = new Version(BeWoApp.ShortVersion); var stage = BeWoClientReleaseStage.Sandbox; - var stageVersion = new Version("4.5"); + var stageVersion = new Version("5.1.5"); var feature = BeWoClientFeature.AI; #if !DEBUG - stage = BeWoClientReleaseStage.Release; - feature = BeWoClientFeature.None; + //stage = BeWoClientReleaseStage.Release; + //feature = BeWoClientFeature.None; #endif BeWoAppVersion = new BeWoAppVersion(baseVersion, stage, stageVersion, feature); diff --git a/BeWo/Converter/CollectionCountToBoolConverter.cs b/BeWo/Converter/CollectionCountToBoolConverter.cs index 9c164d3f2..8bccca2b4 100644 --- a/BeWo/Converter/CollectionCountToBoolConverter.cs +++ b/BeWo/Converter/CollectionCountToBoolConverter.cs @@ -1,5 +1,8 @@ using System; +using System.Collections; using System.Globalization; +using System.Linq; +using System.Windows; using System.Windows.Data; namespace BeWo.Converter @@ -10,8 +13,29 @@ namespace BeWo.Converter { try { - var count = (int) value; - return count > 0; + int count; + + switch (value) + { + case int i: + count = i; + break; + case ICollection collection: + count = collection.Count; + break; + case IEnumerable enumerable: + count = enumerable.Cast().Count(); + break; + default: + return false; + } + + if (parameter is string s && s == "reverse") + { + return !(count > 0); + } + + return count > 0; } catch (Exception) { diff --git a/BeWo/Converter/CollectionCountToVisibilityConverter.cs b/BeWo/Converter/CollectionCountToVisibilityConverter.cs index 46a25386c..88f082c19 100644 --- a/BeWo/Converter/CollectionCountToVisibilityConverter.cs +++ b/BeWo/Converter/CollectionCountToVisibilityConverter.cs @@ -1,5 +1,7 @@ using System; +using System.Collections; using System.Globalization; +using System.Linq; using System.Windows; using System.Windows.Data; @@ -11,8 +13,29 @@ namespace BeWo.Converter { try { - var count = (int)value; - return count > 0 ? Visibility.Visible : Visibility.Collapsed; + int count; + + switch (value) + { + case int i: + count = i; + break; + case ICollection collection: + count = collection.Count; + break; + case IEnumerable enumerable: + count = enumerable.Cast().Count(); + break; + default: + return Visibility.Collapsed; + } + + if (parameter is string s && s == "reverse") + { + return count > 0 ? Visibility.Collapsed : Visibility.Visible; + } + + return count > 0 ? Visibility.Visible : Visibility.Collapsed; } catch (Exception) { diff --git a/BeWo/Converter/TestDebugConverter.cs b/BeWo/Converter/TestDebugConverter.cs index d428f40b1..a44afd236 100644 --- a/BeWo/Converter/TestDebugConverter.cs +++ b/BeWo/Converter/TestDebugConverter.cs @@ -1,4 +1,5 @@ using BeWo.ViewModel; +using DevExpress.Mvvm; using System; using System.Globalization; using System.Windows.Data; @@ -12,6 +13,8 @@ namespace BeWo.Converter if (value is null) return null; + var t = ((DelegateCommand)value).CanExecute(null); + return value; } diff --git a/BeWo/Core/BeWoUserUtils.cs b/BeWo/Core/BeWoUserUtils.cs new file mode 100644 index 000000000..989d86f10 --- /dev/null +++ b/BeWo/Core/BeWoUserUtils.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BeWo.Core +{ + public static class BeWoUserUtils + { + + } +} diff --git a/BeWo/Core/EventArg/TextAcceptedEventArgs.cs b/BeWo/Core/EventArg/TextAcceptedEventArgs.cs new file mode 100644 index 000000000..920254c48 --- /dev/null +++ b/BeWo/Core/EventArg/TextAcceptedEventArgs.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BeWo.Core.EventArg +{ + public class TextAcceptedEventArgs : EventArgs + { + public string Text { get; } + + public TextAcceptedEventArgs(string text) + { + Text = text; + } + } +} diff --git a/BeWo/DebugConfig.cs b/BeWo/DebugConfig.cs index 4b82cedc8..4bd0935f8 100644 --- a/BeWo/DebugConfig.cs +++ b/BeWo/DebugConfig.cs @@ -53,6 +53,8 @@ namespace BeWo public bool EnableAutoRemoteDebugging { get; set; } public bool EnableAllUserRightsInDebug { get; set; } = false; + public bool EnableDeveloperView { get; set; } = false; + public static DebugConfig SimpleAutoLogin => new DebugConfig() { DebugConfigMode = DebugConfigMode.SimpleAutoLogin, @@ -152,7 +154,8 @@ namespace BeWo //DefaultLoginUsername = "m1", //DefaultLoginPassword = "bewobewo", //DefaultProfilename = "5000000000", - EnableAutoRemoteDebugging = true + EnableAutoRemoteDebugging = true, + EnableDeveloperView = true }); name2config.Add("FeatureXRechnung", diff --git a/BeWo/MainControl.xaml.cs b/BeWo/MainControl.xaml.cs index 62539f6d8..51863271c 100644 --- a/BeWo/MainControl.xaml.cs +++ b/BeWo/MainControl.xaml.cs @@ -192,11 +192,16 @@ namespace BeWo UpdateMandator(); - var controlFactory = new BeWoControlFactory(); - var windowFactory = new BeWoWindowFactory(); - WindowService = new BeWoWindowService(windowFactory, controlFactory); +#if DEBUG + if (DebugConfig.CurrentConfig is DebugConfig config && config.EnableDeveloperView) + { + WindowService.ShowDeveloper(); + } +#endif } + public IBeWoWindowService WindowService => BeWoApp.WindowService; + private AnimatedBeWoWindow _CurrentAnimatedBeWoWindow; public AnimatedBeWoWindow CurrentAnimatedBeWoWindow { @@ -217,8 +222,6 @@ namespace BeWo } } - internal IBeWoWindowService WindowService { get; set; } - public List OpenedModalViewWindows { get; set; } internal Dictionary Views diff --git a/BeWo/ServiceProxy/GeneratedAiEnhancedService.cs b/BeWo/ServiceProxy/GeneratedAiEnhancedService.cs index c90adc2e7..491630257 100644 --- a/BeWo/ServiceProxy/GeneratedAiEnhancedService.cs +++ b/BeWo/ServiceProxy/GeneratedAiEnhancedService.cs @@ -31,16 +31,78 @@ namespace BeWo.ServiceProxy [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/GetAiConversations", ReplyAction="http://tempuri.org/IAiEnhancedService/GetAiConversationsResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/GetAiConversationsBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")] - System.Collections.Generic.List GetAiConversations(BS.Shared.AiContextType uicontext, System.Nullable oid); + System.Collections.Generic.List GetAiConversations(BS.Shared.AiActionType actionType, System.Nullable oid); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/CreateAiConversation", ReplyAction="http://tempuri.org/IAiEnhancedService/CreateAiConversationResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/CreateAiConversationBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")] - BS.Shared.DataContracts.Feature.AI.AiConversationDC CreateAiConversation(BS.Shared.DataContracts.Feature.AI.AiConversationDC conversation, long modell_oid); + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.BeWoDataContract))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiConfigDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiModelDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiConversationDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiConversationMessageDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinFolderDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinPromptDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineStepDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiUserSettingDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Compact.CompactEmployeeDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary>))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.Core.BeWoFault))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.Core.BeWoFaultType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiDataContextType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiModelSource))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiActionType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.TableID))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiConversationMessageRole))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.ActivationTypeId))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.ValueListEntryType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiRoutineType))] + BS.Shared.DataContracts.Feature.AI.AiConversationDC CreateAiConversation(BS.Shared.DataContracts.Feature.AI.AiConversationDC conversation, BS.Shared.DataContracts.Feature.AI.AiViewContextDC view_context); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/CreateAiConversationWithMessage", ReplyAction="http://tempuri.org/IAiEnhancedService/CreateAiConversationWithMessageResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/CreateAiConversationWithMessageBeWoFaultFau" + "lt", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")] - BS.Shared.DataContracts.Feature.AI.AiConversationDC CreateAiConversationWithMessage(BS.Shared.DataContracts.Feature.AI.AiConversationDC conversation, long modell_oid, string message); + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.BeWoDataContract))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiConfigDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiModelDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiConversationDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiConversationMessageDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinFolderDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinPromptDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineStepDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiUserSettingDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Compact.CompactEmployeeDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary>))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.Core.BeWoFault))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.Core.BeWoFaultType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiDataContextType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiModelSource))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiActionType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.TableID))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiConversationMessageRole))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.ActivationTypeId))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.ValueListEntryType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiRoutineType))] + BS.Shared.DataContracts.Feature.AI.AiConversationDC CreateAiConversationWithMessage(BS.Shared.DataContracts.Feature.AI.AiConversationDC conversation, BS.Shared.DataContracts.Feature.AI.AiViewContextDC view_context, string message); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/CloneAiConversation", ReplyAction="http://tempuri.org/IAiEnhancedService/CloneAiConversationResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/CloneAiConversationBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")] @@ -59,9 +121,112 @@ namespace BeWo.ServiceProxy [System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/SendNewMessageBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")] System.Collections.Generic.List SendNewMessage(long conversation, string message); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/ExecuteAiConversationWithPrompt", ReplyAction="http://tempuri.org/IAiEnhancedService/ExecuteAiConversationWithPromptResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/ExecuteAiConversationWithPromptBeWoFaultFau" + + "lt", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.BeWoDataContract))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiConfigDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiModelDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiConversationDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiConversationMessageDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinFolderDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinPromptDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineStepDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiUserSettingDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Compact.CompactEmployeeDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary>))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.Core.BeWoFault))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.Core.BeWoFaultType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiDataContextType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiModelSource))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiActionType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.TableID))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiConversationMessageRole))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.ActivationTypeId))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.ValueListEntryType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiRoutineType))] + System.Collections.Generic.List ExecuteAiConversationWithPrompt(long conversation, BS.Shared.DataContracts.Feature.AI.AiViewContextDC view_context, long prompt_oid); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/ExecuteAiConversationWithRoutine", ReplyAction="http://tempuri.org/IAiEnhancedService/ExecuteAiConversationWithRoutineResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/ExecuteAiConversationWithRoutineBeWoFaultFa" + + "ult", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.BeWoDataContract))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiConfigDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiModelDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiConversationDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiConversationMessageDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinFolderDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinPromptDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineStepDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiUserSettingDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Compact.CompactEmployeeDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary>))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.Core.BeWoFault))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.Core.BeWoFaultType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiDataContextType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiModelSource))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiActionType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.TableID))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiConversationMessageRole))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.ActivationTypeId))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.ValueListEntryType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiRoutineType))] + System.Collections.Generic.List ExecuteAiConversationWithRoutine(long conversation, BS.Shared.DataContracts.Feature.AI.AiViewContextDC view_context, long routine, int step); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/CheckContextSize", ReplyAction="http://tempuri.org/IAiEnhancedService/CheckContextSizeResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/CheckContextSizeBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")] - bool CheckContextSize(BS.Shared.AiContextType aiContextType, System.Collections.Generic.Dictionary> context, System.Nullable modell_oid); + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.BeWoDataContract))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiConfigDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiModelDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiConversationDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiConversationMessageDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinFolderDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinPromptDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineStepDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Feature.AI.AiUserSettingDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Compact.CompactEmployeeDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary>))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.Core.BeWoFault))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.Core.BeWoFaultType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiDataContextType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiModelSource))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiActionType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.TableID))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiConversationMessageRole))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.ActivationTypeId))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.ValueListEntryType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.AiRoutineType))] + bool CheckContextSize(BS.Shared.AiActionType actionType, BS.Shared.DataContracts.Feature.AI.AiViewContextDC view_context); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/GetAiPromptbausteinFolder", ReplyAction="http://tempuri.org/IAiEnhancedService/GetAiPromptbausteinFolderResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/GetAiPromptbausteinFolderBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")] @@ -69,34 +234,42 @@ namespace BeWo.ServiceProxy [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/InsertAiPromptbausteinFolder", ReplyAction="http://tempuri.org/IAiEnhancedService/InsertAiPromptbausteinFolderResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/InsertAiPromptbausteinFolderBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")] - System.Collections.Generic.List InsertAiPromptbausteinFolder(System.Collections.Generic.List folders); + BS.Shared.DataContracts.Feature.AI.AiPromptbausteinFolderDC InsertAiPromptbausteinFolder(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinFolderDC folders); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/InsertAiPromptbausteinPrompt", ReplyAction="http://tempuri.org/IAiEnhancedService/InsertAiPromptbausteinPromptResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/InsertAiPromptbausteinPromptBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")] - System.Collections.Generic.List InsertAiPromptbausteinPrompt(System.Collections.Generic.List prompts); + BS.Shared.DataContracts.Feature.AI.AiPromptbausteinPromptDC InsertAiPromptbausteinPrompt(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinPromptDC prompts); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/InsertAiPromptbausteinRoutine", ReplyAction="http://tempuri.org/IAiEnhancedService/InsertAiPromptbausteinRoutineResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/InsertAiPromptbausteinRoutineBeWoFaultFault" + + "", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")] + BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC InsertAiPromptbausteinRoutine(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC routine); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/UpdateAiPromptbausteinFolder", ReplyAction="http://tempuri.org/IAiEnhancedService/UpdateAiPromptbausteinFolderResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/UpdateAiPromptbausteinFolderBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")] - System.Collections.Generic.List UpdateAiPromptbausteinFolder(System.Collections.Generic.List folders); + BS.Shared.DataContracts.Feature.AI.AiPromptbausteinFolderDC UpdateAiPromptbausteinFolder(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinFolderDC folders); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/UpdateAiPromptbausteinPrompt", ReplyAction="http://tempuri.org/IAiEnhancedService/UpdateAiPromptbausteinPromptResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/UpdateAiPromptbausteinPromptBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")] - System.Collections.Generic.List UpdateAiPromptbausteinPrompt(System.Collections.Generic.List prompts); + BS.Shared.DataContracts.Feature.AI.AiPromptbausteinPromptDC UpdateAiPromptbausteinPrompt(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinPromptDC prompts); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/UpdateAiPromptbausteinRoutine", ReplyAction="http://tempuri.org/IAiEnhancedService/UpdateAiPromptbausteinRoutineResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/UpdateAiPromptbausteinRoutineBeWoFaultFault" + + "", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")] + BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC UpdateAiPromptbausteinRoutine(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC routine); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/DeleteAiPromptbausteinFolder", ReplyAction="http://tempuri.org/IAiEnhancedService/DeleteAiPromptbausteinFolderResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/DeleteAiPromptbausteinFolderBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")] - void DeleteAiPromptbausteinFolder(System.Collections.Generic.Dictionary oid2version); + void DeleteAiPromptbausteinFolder(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinFolderDC folder); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/DeleteAiPromptbausteinPrompt", ReplyAction="http://tempuri.org/IAiEnhancedService/DeleteAiPromptbausteinPromptResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/DeleteAiPromptbausteinPromptBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")] - void DeleteAiPromptbausteinPrompt(System.Collections.Generic.Dictionary oid2version); + void DeleteAiPromptbausteinPrompt(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinPromptDC prompt); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/ExecuteAiFunctionServiceRecordDocumentation" + - "", ReplyAction="http://tempuri.org/IAiEnhancedService/ExecuteAiFunctionServiceRecordDocumentation" + - "Response")] - [System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/ExecuteAiFunctionServiceRecordDocumentation" + - "BeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")] - BS.Shared.DataContracts.Feature.AI.Functions.ServiceRecords.AiFunctionDocResponse ExecuteAiFunctionServiceRecordDocumentation(BS.Shared.DataContracts.Feature.AI.Functions.ServiceRecords.AiFunctionDocRequest request); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/DeleteAiPromptbausteinRoutine", ReplyAction="http://tempuri.org/IAiEnhancedService/DeleteAiPromptbausteinRoutineResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/DeleteAiPromptbausteinRoutineBeWoFaultFault" + + "", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")] + void DeleteAiPromptbausteinRoutine(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC routine); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/GetUserSetting", ReplyAction="http://tempuri.org/IAiEnhancedService/GetUserSettingResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/GetUserSettingBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")] @@ -156,19 +329,19 @@ namespace BeWo.ServiceProxy return base.Channel.GetAiModels(); } - public System.Collections.Generic.List GetAiConversations(BS.Shared.AiContextType uicontext, System.Nullable oid) + public System.Collections.Generic.List GetAiConversations(BS.Shared.AiActionType actionType, System.Nullable oid) { - return base.Channel.GetAiConversations(uicontext, oid); + return base.Channel.GetAiConversations(actionType, oid); } - public BS.Shared.DataContracts.Feature.AI.AiConversationDC CreateAiConversation(BS.Shared.DataContracts.Feature.AI.AiConversationDC conversation, long modell_oid) + public BS.Shared.DataContracts.Feature.AI.AiConversationDC CreateAiConversation(BS.Shared.DataContracts.Feature.AI.AiConversationDC conversation, BS.Shared.DataContracts.Feature.AI.AiViewContextDC view_context) { - return base.Channel.CreateAiConversation(conversation, modell_oid); + return base.Channel.CreateAiConversation(conversation, view_context); } - public BS.Shared.DataContracts.Feature.AI.AiConversationDC CreateAiConversationWithMessage(BS.Shared.DataContracts.Feature.AI.AiConversationDC conversation, long modell_oid, string message) + public BS.Shared.DataContracts.Feature.AI.AiConversationDC CreateAiConversationWithMessage(BS.Shared.DataContracts.Feature.AI.AiConversationDC conversation, BS.Shared.DataContracts.Feature.AI.AiViewContextDC view_context, string message) { - return base.Channel.CreateAiConversationWithMessage(conversation, modell_oid, message); + return base.Channel.CreateAiConversationWithMessage(conversation, view_context, message); } public BS.Shared.DataContracts.Feature.AI.AiConversationDC CloneAiConversation(long conversation_oid, System.Nullable message_oid) @@ -191,9 +364,19 @@ namespace BeWo.ServiceProxy return base.Channel.SendNewMessage(conversation, message); } - public bool CheckContextSize(BS.Shared.AiContextType aiContextType, System.Collections.Generic.Dictionary> context, System.Nullable modell_oid) + public System.Collections.Generic.List ExecuteAiConversationWithPrompt(long conversation, BS.Shared.DataContracts.Feature.AI.AiViewContextDC view_context, long prompt_oid) { - return base.Channel.CheckContextSize(aiContextType, context, modell_oid); + return base.Channel.ExecuteAiConversationWithPrompt(conversation, view_context, prompt_oid); + } + + public System.Collections.Generic.List ExecuteAiConversationWithRoutine(long conversation, BS.Shared.DataContracts.Feature.AI.AiViewContextDC view_context, long routine, int step) + { + return base.Channel.ExecuteAiConversationWithRoutine(conversation, view_context, routine, step); + } + + public bool CheckContextSize(BS.Shared.AiActionType actionType, BS.Shared.DataContracts.Feature.AI.AiViewContextDC view_context) + { + return base.Channel.CheckContextSize(actionType, view_context); } public System.Collections.Generic.List GetAiPromptbausteinFolder(BS.Shared.AiActionType aiActionType) @@ -201,39 +384,49 @@ namespace BeWo.ServiceProxy return base.Channel.GetAiPromptbausteinFolder(aiActionType); } - public System.Collections.Generic.List InsertAiPromptbausteinFolder(System.Collections.Generic.List folders) + public BS.Shared.DataContracts.Feature.AI.AiPromptbausteinFolderDC InsertAiPromptbausteinFolder(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinFolderDC folders) { return base.Channel.InsertAiPromptbausteinFolder(folders); } - public System.Collections.Generic.List InsertAiPromptbausteinPrompt(System.Collections.Generic.List prompts) + public BS.Shared.DataContracts.Feature.AI.AiPromptbausteinPromptDC InsertAiPromptbausteinPrompt(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinPromptDC prompts) { return base.Channel.InsertAiPromptbausteinPrompt(prompts); } - public System.Collections.Generic.List UpdateAiPromptbausteinFolder(System.Collections.Generic.List folders) + public BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC InsertAiPromptbausteinRoutine(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC routine) + { + return base.Channel.InsertAiPromptbausteinRoutine(routine); + } + + public BS.Shared.DataContracts.Feature.AI.AiPromptbausteinFolderDC UpdateAiPromptbausteinFolder(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinFolderDC folders) { return base.Channel.UpdateAiPromptbausteinFolder(folders); } - public System.Collections.Generic.List UpdateAiPromptbausteinPrompt(System.Collections.Generic.List prompts) + public BS.Shared.DataContracts.Feature.AI.AiPromptbausteinPromptDC UpdateAiPromptbausteinPrompt(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinPromptDC prompts) { return base.Channel.UpdateAiPromptbausteinPrompt(prompts); } - public void DeleteAiPromptbausteinFolder(System.Collections.Generic.Dictionary oid2version) + public BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC UpdateAiPromptbausteinRoutine(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC routine) { - base.Channel.DeleteAiPromptbausteinFolder(oid2version); + return base.Channel.UpdateAiPromptbausteinRoutine(routine); } - public void DeleteAiPromptbausteinPrompt(System.Collections.Generic.Dictionary oid2version) + public void DeleteAiPromptbausteinFolder(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinFolderDC folder) { - base.Channel.DeleteAiPromptbausteinPrompt(oid2version); + base.Channel.DeleteAiPromptbausteinFolder(folder); } - public BS.Shared.DataContracts.Feature.AI.Functions.ServiceRecords.AiFunctionDocResponse ExecuteAiFunctionServiceRecordDocumentation(BS.Shared.DataContracts.Feature.AI.Functions.ServiceRecords.AiFunctionDocRequest request) + public void DeleteAiPromptbausteinPrompt(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinPromptDC prompt) { - return base.Channel.ExecuteAiFunctionServiceRecordDocumentation(request); + base.Channel.DeleteAiPromptbausteinPrompt(prompt); + } + + public void DeleteAiPromptbausteinRoutine(BS.Shared.DataContracts.Feature.AI.AiPromptbausteinRoutineDC routine) + { + base.Channel.DeleteAiPromptbausteinRoutine(routine); } public BS.Shared.DataContracts.Feature.AI.AiUserSettingDC GetUserSetting() diff --git a/BeWo/ServiceProxy/ServiceFacade.cs b/BeWo/ServiceProxy/ServiceFacade.cs index 434c9a8d6..47b811f95 100644 --- a/BeWo/ServiceProxy/ServiceFacade.cs +++ b/BeWo/ServiceProxy/ServiceFacade.cs @@ -1028,6 +1028,7 @@ namespace BeWo.ServiceProxy private static void StartWaiting() { Monitor.Enter(_Lock); + if ((++_RunningAsyncs) == 1 && BeWoApp.MainControl != null) { if (BeWoApp.MainControl.CurrentAnimatedBeWoWindow is null) @@ -1042,6 +1043,7 @@ namespace BeWo.ServiceProxy private static void EndWaiting() { Monitor.Enter(_Lock); + if ((--_RunningAsyncs) == 0 && BeWoApp.MainControl != null) { BeWoApp.MainControl.CurrentAnimatedBeWoWindow?.EndWaiting(); @@ -1056,6 +1058,22 @@ namespace BeWo.ServiceProxy return _RunningAsyncs != 0; } + public static void StartManuelWaiting() + { + if (_RunningAsyncs != 0) + throw new InvalidOperationException("_RunningAsyncs != 0"); + + _RunningAsyncs++; + } + + public static void EndManuelWaiting() + { + if (_RunningAsyncs != 1) + throw new InvalidOperationException("_RunningAsyncs != 1"); + + _RunningAsyncs--; + } + //public static void WaitUntilAsyncIsFinished(Action callback = null) //{ // if (!IsWaiting()) diff --git a/BeWo/Services/BeWoControlFactory.cs b/BeWo/Services/BeWoControlFactory.cs index d0a1791a6..7abf386d0 100644 --- a/BeWo/Services/BeWoControlFactory.cs +++ b/BeWo/Services/BeWoControlFactory.cs @@ -19,7 +19,7 @@ namespace BeWo.Services { public Control GetAiConversationControl(AiConversationChatViewModel vm) { - var styleString = getStyleString(vm.AiContext); + var styleString = getStyleString(vm.ActionType); var control = styleString is object ? new AiConversationChatView(vm, styleString) : new AiConversationChatView(vm); @@ -52,18 +52,21 @@ namespace BeWo.Services return control; } - private string getStyleString(AiContextType uIContext) { - switch (uIContext) + private string getStyleString(AiActionType actionType) { + switch (actionType) { - case AiContextType.SupportConceptNavigation: return "ModuleAiControlSupportConceptStyle"; - case AiContextType.CustomerNavigation: return "ModuleAiControlCustomerStyle"; - case AiContextType.PersonNavigation: return "ModuleAiControlPersonStyle"; - case AiContextType.EmployeeNavigation: return "ModuleAiControlEmployeeStyle"; - case AiContextType.OrganisationNavigation: return "ModuleAiControlOrganisationStyle"; - case AiContextType.ServiceRecord: return "ModuleAiControlZeiterfassungStyle"; - case AiContextType.CustomerDetail: return "ModuleAiControlCustomerStyle"; - case AiContextType.PersonDetail: return "ModuleAiControlPersonStyle"; - case AiContextType.EmployeeDetail: return "ModuleAiControlEmployeeStyle"; + case AiActionType.ServiceRecordConversation: return "ModuleAiControlZeiterfassungStyle"; + case AiActionType.ServiceRecordDocumentation: return "ModuleAiControlZeiterfassungStyle"; + + //case AiContextType.SupportConceptNavigation: return "ModuleAiControlSupportConceptStyle"; + //case AiContextType.CustomerNavigation: return "ModuleAiControlCustomerStyle"; + //case AiContextType.PersonNavigation: return "ModuleAiControlPersonStyle"; + //case AiContextType.EmployeeNavigation: return "ModuleAiControlEmployeeStyle"; + //case AiContextType.OrganisationNavigation: return "ModuleAiControlOrganisationStyle"; + //case AiContextType.ServiceRecord: return "ModuleAiControlZeiterfassungStyle"; + //case AiContextType.CustomerDetail: return "ModuleAiControlCustomerStyle"; + //case AiContextType.PersonDetail: return "ModuleAiControlPersonStyle"; + //case AiContextType.EmployeeDetail: return "ModuleAiControlEmployeeStyle"; } return null; diff --git a/BeWo/Services/BeWoWindowFactory.cs b/BeWo/Services/BeWoWindowFactory.cs index 7b648a29e..cbed91849 100644 --- a/BeWo/Services/BeWoWindowFactory.cs +++ b/BeWo/Services/BeWoWindowFactory.cs @@ -17,15 +17,10 @@ namespace BeWo.Services { public class BeWoWindowFactory { - private Dictionary _UIContext2Header = new Dictionary() + private Dictionary _UIContext2Header = new Dictionary() { - {AiContextType.ServiceRecord, "KI Chat: Zeiterfassung" }, - {AiContextType.CustomerNavigation, "KI Chat: Klienten Übersicht" }, - {AiContextType.PersonNavigation, "KI Chat: Personen Übersicht" }, - {AiContextType.EmployeeNavigation, "KI Chat: Mitarbeiter Übersicht" }, - {AiContextType.OrganisationNavigation, "KI Chat: Organisation Übersicht" }, - {AiContextType.SupportConceptNavigation, "KI Chat: Hilfeplan Übersicht" }, - {AiContextType.CustomerDetail, "KI Chat: Klient" }, + {AiActionType.ServiceRecordConversation, "KI Chat: Zeiterfassung" }, + {AiActionType.ServiceRecordDocumentation, "KI Doku: Zeiterfassung" } }; public Control GetModalViewWindow(string title, Control control, double height = 600, double width = 1200) @@ -69,9 +64,9 @@ namespace BeWo.Services return "GKV-Abrechnung Nr. " + vm.Oid; } - public string GetAiTitle(AiContextType aiContextType) + public string GetAiTitle(AiActionType actionType) { - if (_UIContext2Header.TryGetValue(aiContextType, out string str)) + if (_UIContext2Header.TryGetValue(actionType, out string str)) return str; return "default"; diff --git a/BeWo/Services/BeWoWindowService.cs b/BeWo/Services/BeWoWindowService.cs index 978aff5d1..39ae5d51f 100644 --- a/BeWo/Services/BeWoWindowService.cs +++ b/BeWo/Services/BeWoWindowService.cs @@ -23,6 +23,10 @@ using System.Windows.Controls.Primitives; using static DevExpress.XtraPrinting.Native.ExportOptionsPropertiesNames; using DevExpress.Mvvm.Native; using BeWo.ViewModel.View.Gkv; +using BeWo.ViewModel.View.Developer; +using BeWo.View.Developer; +using System.Windows.Forms; +using static DevExpress.Mvvm.Native.Either; namespace BeWo.Services { @@ -68,16 +72,20 @@ namespace BeWo.Services { ShowAiPromptbausteinSelectionComplexWindow(viewModel6); } + else if (windowViewModel is AiPromptbausteinRoutineViewModel viewModel7) + { + ShowAiPromptbausteinRoutineWindow(viewModel7); + } else { throw new NotImplementedException($"type not implemented: {typeof(T)}"); } } - public void ShowAiConversationWindow(AiConversationChatViewModel viewModel) + private void ShowAiConversationWindow(AiConversationChatViewModel viewModel) { var control = _controlFactory.GetAiConversationControl(viewModel); - var title = _windowFactory.GetAiTitle(viewModel.AiContext); + var title = _windowFactory.GetAiTitle(viewModel.ActionType); var options = new BeWoWindowOptions() { Height = 600, @@ -85,7 +93,7 @@ namespace BeWo.Services }; Show(title, control, viewModel, options); } - public void ShowAiPromptbausteinFolderWindow(AiPromptbausteinFolderViewModel viewModel) + private void ShowAiPromptbausteinFolderWindow(AiPromptbausteinFolderViewModel viewModel) { var control = new AiPromptbausteinFolderView(viewModel); var options = new BeWoWindowOptions() @@ -95,7 +103,7 @@ namespace BeWo.Services }; Show("KI Promptbaustein Ordner", control, viewModel, options); } - public void ShowAiPromptbausteinPromptWindow(AiPromptbausteinPromptViewModel viewModel) + private void ShowAiPromptbausteinPromptWindow(AiPromptbausteinPromptViewModel viewModel) { var control = new AiPromptbausteinPromptView(viewModel); var options = new BeWoWindowOptions() @@ -105,7 +113,17 @@ namespace BeWo.Services }; Show("KI Promptbaustein Prompt", control, viewModel, options); } - public void ShowAiPromptbausteinActionResultWindow(AiPromptbausteinActionResultViewModel viewModel) + private void ShowAiPromptbausteinRoutineWindow(AiPromptbausteinRoutineViewModel viewModel) + { + var control = new AiPromptbausteinRoutineView(viewModel); + var options = new BeWoWindowOptions() + { + Height = 600, + Width = 600 + }; + Show("KI Promptbaustein Routine", control, viewModel, options); + } + private void ShowAiPromptbausteinActionResultWindow(AiPromptbausteinActionResultViewModel viewModel) { var control = new AiPromptbausteinActionResultView(viewModel); var options = new BeWoWindowOptions() @@ -116,17 +134,55 @@ namespace BeWo.Services Show("KI Promptbaustein Ergebnis", control, viewModel, options); } - public void ShowAiPromptbausteinSelectionComplexWindow(AiPromptbausteinSelectionComplexViewModel viewModel) + private void ShowAiPromptbausteinSelectionComplexWindow(AiPromptbausteinSelectionComplexViewModel viewModel) { var control = new AiPromptbausteinComplexSelectionView(viewModel); var options = new BeWoWindowOptions() { - Height = 400, - Width = 600 + Height = 600, + Width = 900 }; Show("KI Promptbaustein Auswahl", control, viewModel, options); } - + +#if DEBUG + public void ShowDeveloper(DeveloperViewModel viewModel = null) + { + if(viewModel == null) + viewModel = new DeveloperViewModel(); + + var control = new DeveloperView(viewModel); + + var window = new Window(); + + window.Title = "Developer Informations"; + window.Content = control; + window.Height = 600; + window.Width = 800; + window.WindowStartupLocation = WindowStartupLocation.CenterOwner; + window.Topmost = true; + window.Deactivated += (s, e) => + { + //window.Topmost = false; // set topmost false first + //window.Topmost = true; // then set topmost true again. + }; + + var screens = Screen.AllScreens; + var firstSecondary = screens.OrderBy(x => x.Bounds.X).LastOrDefault(s => s.Primary == false); + if (firstSecondary != null) + { + window.WindowStartupLocation = WindowStartupLocation.Manual; + // Ensure Window is minimized on creation + window.WindowState = WindowState.Minimized; + // Define Position on Secondary screen, for "Normal" window-mode + // ( Here Top/Left-Position ) + window.Left = firstSecondary.Bounds.Left; + window.Top = firstSecondary.Bounds.Top; + } + + window.Show(); + } +#endif public void ShowGkvAbrechnungDetailWindow(GkvAbrechnungDialogViewModel vm) { @@ -165,8 +221,8 @@ namespace BeWo.Services Show(title, control, null, pOptions); } - private void Show(string title, Control control, WindowViewModel windowViewModel, BeWoWindowOptions options) - { + private void Show(string title, System.Windows.Controls.Control control, WindowViewModel windowViewModel, BeWoWindowOptions options) + { if (options.ShowAsModal) { var modal = _windowFactory.GetModalViewWindow(title, control, options.Height, options.Width); @@ -181,7 +237,7 @@ namespace BeWo.Services if (windowViewModel is DialogViewModel dialogViewModel) { - dialogViewModel.RequestClose += (s, e) => window.Close(); + dialogViewModel.RequestCloseFinal += (s, e) => window.Close(); } if (options.ShowAsDialog) diff --git a/BeWo/Services/IBeWoWindowService.cs b/BeWo/Services/IBeWoWindowService.cs index b64ea2caa..6338cd40a 100644 --- a/BeWo/Services/IBeWoWindowService.cs +++ b/BeWo/Services/IBeWoWindowService.cs @@ -1,8 +1,10 @@ -using BeWo.ViewModel; +using BeWo.View.Developer; +using BeWo.ViewModel; using BeWo.ViewModel.Light; using BeWo.ViewModel.View; using BeWo.ViewModel.View.Administration; using BeWo.ViewModel.View.AI; +using BeWo.ViewModel.View.Developer; using BeWo.ViewModel.View.Gkv; using BS.Shared; using System; @@ -20,7 +22,6 @@ namespace BeWo.Services public interface IBeWoWindowService { #region special - void ShowAiConversationWindow(AiConversationChatViewModel viewModel); void ShowGkvAbrechnungDetailWindow(GkvAbrechnungDialogViewModel vm); #endregion @@ -34,5 +35,9 @@ namespace BeWo.Services #endregion void Show(T windowViewModel) where T : WindowViewModel; + +#if DEBUG + void ShowDeveloper(DeveloperViewModel windowViewModel = null); +#endif } } diff --git a/BeWo/Styles/ControlStyles/ButtonStyles.xaml b/BeWo/Styles/ControlStyles/ButtonStyles.xaml index acd87e235..8b60d1bf0 100644 --- a/BeWo/Styles/ControlStyles/ButtonStyles.xaml +++ b/BeWo/Styles/ControlStyles/ButtonStyles.xaml @@ -2,6 +2,7 @@ + + + + \ No newline at end of file diff --git a/BeWo/Styles/ControlStyles/LabelStyles.xaml b/BeWo/Styles/ControlStyles/LabelStyles.xaml index 0e839e401..a685285c7 100644 --- a/BeWo/Styles/ControlStyles/LabelStyles.xaml +++ b/BeWo/Styles/ControlStyles/LabelStyles.xaml @@ -46,4 +46,18 @@ + + \ No newline at end of file diff --git a/BeWo/Styles/ControlStyles/RadioButtonStyles.xaml b/BeWo/Styles/ControlStyles/RadioButtonStyles.xaml index 70e0a0711..0f01ea6e9 100644 --- a/BeWo/Styles/ControlStyles/RadioButtonStyles.xaml +++ b/BeWo/Styles/ControlStyles/RadioButtonStyles.xaml @@ -4,4 +4,13 @@ + + \ No newline at end of file diff --git a/BeWo/Styles/ControlStyles/TextBoxStyles.xaml b/BeWo/Styles/ControlStyles/TextBoxStyles.xaml index 65b641174..1e864a17d 100644 --- a/BeWo/Styles/ControlStyles/TextBoxStyles.xaml +++ b/BeWo/Styles/ControlStyles/TextBoxStyles.xaml @@ -5,6 +5,7 @@ + + + + + + + + + @@ -174,7 +196,7 @@ BorderBrush="Black" BorderThickness="0" CornerRadius="0, 10, 10, 10"> - + @@ -183,10 +205,11 @@ + - + @@ -238,8 +261,8 @@ Grid.ColumnSpan="2" Margin="0,4,0,0" Padding="-3" + VerticalAlignment="Center" Style="{StaticResource MessageTextBoxStyle}" /> - @@ -249,7 +272,7 @@ + + diff --git a/BeWo/View/BeWoFileView.xaml b/BeWo/View/BeWoFileView.xaml index 4b06691b2..4f19b2d73 100644 --- a/BeWo/View/BeWoFileView.xaml +++ b/BeWo/View/BeWoFileView.xaml @@ -37,7 +37,10 @@ - + @@ -54,7 +57,6 @@ Height="20" Source="..\Ressources\Icons\Folder.png" Stretch="Fill" /> - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/BeWo/View/Controls/AI/AiChatButton.xaml b/BeWo/View/Controls/AI/AiChatButton.xaml new file mode 100644 index 000000000..8c9696793 --- /dev/null +++ b/BeWo/View/Controls/AI/AiChatButton.xaml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (i) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Hier sind noch keine Prompts/Routinen angelegt. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Hier sind noch keine Prompts angelegt. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Hier sind noch keine Routinen angelegt. + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BeWo/View/Controls/AI/AiPromptbausteinLibraryControl.xaml.cs b/BeWo/View/Controls/AI/AiPromptbausteinLibraryControl.xaml.cs new file mode 100644 index 000000000..bb3acdc29 --- /dev/null +++ b/BeWo/View/Controls/AI/AiPromptbausteinLibraryControl.xaml.cs @@ -0,0 +1,274 @@ +using BeWo.ViewModel; +using DevExpress.Xpf.Editors; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; +using System.Windows.Media; + +namespace BeWo.View.Controls.AI +{ + /// + /// Gemeinsame Promptbaustein-Bibliothek (TreeView + GridSplitter + TabControl), + /// genutzt von AiPromptbausteinComplexTreeView und AiPromptbausteinComplexSelectionView. + /// Der DataContext wird vom Host geerbt und muss IAiPromptbausteinComplexViewModel implementieren. + /// + public partial class AiPromptbausteinLibraryControl : UserControl + { + public AiPromptbausteinLibraryControl() + { + InitializeComponent(); + } + + private IAiPromptbausteinComplexViewModel ViewModel => DataContext as IAiPromptbausteinComplexViewModel; + + public static readonly DependencyProperty PromptActivatedCommandProperty = + DependencyProperty.Register("PromptActivatedCommand", typeof(ICommand), + typeof(AiPromptbausteinLibraryControl), new PropertyMetadata(null)); + + public static readonly DependencyProperty RoutineActivatedCommandProperty = + DependencyProperty.Register("RoutineActivatedCommand", typeof(ICommand), + typeof(AiPromptbausteinLibraryControl), new PropertyMetadata(null)); + + /// + /// Wird bei Doppelklick auf einen Prompt ausgeführt (Verwaltung: Bearbeiten, Auswahl: Senden). + /// + public ICommand PromptActivatedCommand + { + get { return (ICommand)GetValue(PromptActivatedCommandProperty); } + set { SetValue(PromptActivatedCommandProperty, value); } + } + + /// + /// Wird bei Doppelklick auf eine Routine ausgeführt (Verwaltung: Bearbeiten, Auswahl: Senden). + /// + public ICommand RoutineActivatedCommand + { + get { return (ICommand)GetValue(RoutineActivatedCommandProperty); } + set { SetValue(RoutineActivatedCommandProperty, value); } + } + + public static readonly DependencyProperty IsEditModeProperty = + DependencyProperty.Register("IsEditMode", typeof(bool), + typeof(AiPromptbausteinLibraryControl), new PropertyMetadata(true, OnIsEditModeChanged)); + + /// + /// Schaltet den Bearbeitungsmodus (Kontextmenüs, Edit-Shortcuts, Anlegen-Buttons, + /// Ordner-Doppelklick-Bearbeiten). Default: eingeschaltet. + /// + public bool IsEditMode + { + get { return (bool)GetValue(IsEditModeProperty); } + set { SetValue(IsEditModeProperty, value); } + } + + static void OnIsEditModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var control = (AiPromptbausteinLibraryControl)d; + control.UpdateEditMode((bool)e.NewValue); + } + + private Dictionary _DisabledInputBindings; + + void UpdateEditMode(bool isEditMode) + { + if (!isEditMode) + { + if (_DisabledInputBindings != null) + return; + + _DisabledInputBindings = new Dictionary(); + + foreach (var element in new FrameworkElement[] { treeView, tabItemAlle, tabItemPrompts, tabItemRoutinen }) + { + _DisabledInputBindings[element] = element.InputBindings.Cast().ToArray(); + element.InputBindings.Clear(); + } + } + else + { + if (_DisabledInputBindings == null) + return; + + foreach (var entry in _DisabledInputBindings) + foreach (var binding in entry.Value) + entry.Key.InputBindings.Add(binding); + + _DisabledInputBindings = null; + } + } + + /// + /// Setzt die initiale Selektion: "Eigene" (zweites TreeViewItem, Index 1) wird vorausgewählt. + /// Greift nur, wenn der Container bereits erzeugt ist – andernfalls übernimmt die + /// IsSelected-Bindung aus ReloadVMList/UpdateVMList die Vorauswahl. + /// + public void ResetInitialSelection() + { + if (treeView.ItemContainerGenerator.ContainerFromIndex(1) is TreeViewItem item) + item.IsSelected = true; + + listBoxEdit1.UnSelectAll(); + } + + private void OnPreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e) + { + TreeViewItem treeViewItem = VisualUpwardSearch(e.OriginalSource as DependencyObject); + + if (treeViewItem != null) + { + treeViewItem.Focus(); + e.Handled = true; + } + else + { + e.Handled = true; + + if (ViewModel?.SelectedFolder == null) + return; + + _LastTreeViewItem.IsSelected = false; + + treeView.Focus(); + } + } + + static T VisualUpwardSearch(DependencyObject source) where T : DependencyObject + { + while (source != null && !(source is T)) + source = VisualTreeHelper.GetParent(source); + + return source as T; + } + + private void treeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs e) + { + if (ViewModel is null) + return; + + ViewModel.SelectedFolder = treeView.SelectedValue as AiPromptbausteinFolderVM; + } + + private void Grid_PreviewMouseDown(object sender, MouseButtonEventArgs e) + { + // Klicks auf die Scrollbar (z.B. horizontaler Scrollbalken) nicht abfangen, + // sonst lässt sich der Scrollbalken nicht bedienen. + if (VisualUpwardSearch(e.OriginalSource as DependencyObject) != null) + return; + + TreeViewItem treeViewItem = VisualUpwardSearch(e.OriginalSource as DependencyObject); + + if (treeViewItem is null) + { + treeView.Focus(); + e.Handled = true; + return; + } + + if (e.ClickCount == 2) + { + if (!IsEditMode) + return; + + if (!ViewModel.OpenEditFolderDialogCommand.CanExecute(null)) + return; + + ViewModel.OpenEditFolderDialogCommand.Execute(null); + e.Handled = true; + } + } + + private TreeViewItem _LastTreeViewItem; + private void treeView_Selected(object sender, RoutedEventArgs e) + { + _LastTreeViewItem = e.OriginalSource as TreeViewItem; + } + + private void treeView_ContextMenuOpening(object sender, ContextMenuEventArgs e) + { + if (!IsEditMode) + { + e.Handled = true; + return; + } + + ViewModel?.UpdateFolderCommands(); + } + + private void ListBox_ContextMenuOpening(object sender, ContextMenuEventArgs e) + { + if (!IsEditMode) + { + e.Handled = true; + return; + } + + ViewModel?.UpdatePromptCommands(); + } + + private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) + { + Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); + e.Handled = true; + } + + private void Grid_PreviewMouseDown_1(object sender, MouseButtonEventArgs e) + { + var cmd = PromptActivatedCommand; + + if (cmd == null || !cmd.CanExecute(null)) + return; + + if (e.ClickCount == 2) + { + cmd.Execute(null); + e.Handled = true; + } + } + + private void Grid_PreviewMouseDown_2(object sender, MouseButtonEventArgs e) + { + var cmd = RoutineActivatedCommand; + + if (cmd == null || !cmd.CanExecute(null)) + return; + + if (e.ClickCount == 2) + { + cmd.Execute(null); + e.Handled = true; + } + } + + private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + if (e.OriginalSource is TabControl) + { + listBoxEdit1.UnSelectAll(); + listBoxEdit2.UnSelectAll(); + listBoxEdit3.UnSelectAll(); + } + } + + private void listBoxEdit3_PreviewMouseDown(object sender, MouseButtonEventArgs e) + { + return; + + if (!(e.OriginalSource is UIElement)) + { + return; + } + + ListBoxItem listBoxItem = VisualUpwardSearch(e.OriginalSource as DependencyObject); + + if (listBoxItem is null) + { + ((ListBoxEdit)sender).Focus(); + e.Handled = true; + return; + } + } + } +} diff --git a/BeWo/View/Controls/Utils/HelpInfoControl.xaml b/BeWo/View/Controls/Utils/HelpInfoControl.xaml index ddd46e2a3..2df512506 100644 --- a/BeWo/View/Controls/Utils/HelpInfoControl.xaml +++ b/BeWo/View/Controls/Utils/HelpInfoControl.xaml @@ -5,8 +5,8 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Name="root" - d:DesignWidth="28" d:DesignHeight="28" + d:DesignWidth="28" mc:Ignorable="d"> diff --git a/BeWo/View/Detail/AI/AiConfigView.xaml b/BeWo/View/Detail/AI/AiConfigView.xaml index 671ff81fc..914503726 100644 --- a/BeWo/View/Detail/AI/AiConfigView.xaml +++ b/BeWo/View/Detail/AI/AiConfigView.xaml @@ -26,8 +26,8 @@ diff --git a/BeWo/View/Detail/AI/AiConversationChatView.xaml b/BeWo/View/Detail/AI/AiConversationChatView.xaml index 2bfd55d6f..a516d3b58 100644 --- a/BeWo/View/Detail/AI/AiConversationChatView.xaml +++ b/BeWo/View/Detail/AI/AiConversationChatView.xaml @@ -284,6 +284,7 @@ ItemsSource="{Binding ListVM.SelectedVM.Messages.VMList, UpdateSourceTrigger=PropertyChanged}" ScrollViewer.CanContentScroll="False" ScrollViewer.HorizontalScrollBarVisibility="Disabled" + Tag="{Binding DataContext, ElementName=root}" Visibility="{Binding IsNewConversationVisible, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=Reverse}"> + TargetType="ListBoxItem" /> + + + + + + + + + + + + + + + + + + + + + + + + (i) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -33,7 +307,6 @@ - - - - - - - - - - - - - - - - - - - - - - - (i) - - - - - - + + + + + + + + + + + + + + Keine Favoriten vorhanden. + + + + + + + + + + + + + Keine Prompt-Favoriten vorhanden. + + + + + + + + + + + + + Keine Routinen-Favoriten vorhanden. + + + + - - - - - diff --git a/BeWo/View/Detail/AI/AiPromptbausteinComplexSelectionFavoritenView.xaml.cs b/BeWo/View/Detail/AI/AiPromptbausteinComplexSelectionFavoritenView.xaml.cs index b5ffdf6ef..6ecdc58d3 100644 --- a/BeWo/View/Detail/AI/AiPromptbausteinComplexSelectionFavoritenView.xaml.cs +++ b/BeWo/View/Detail/AI/AiPromptbausteinComplexSelectionFavoritenView.xaml.cs @@ -1,25 +1,15 @@ -using BeWo.ViewModel.View.AI; using BeWo.ViewModel; -using System; -using System.Collections.Generic; +using BeWo.ViewModel.View.AI; using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; namespace BeWo.View.Detail.AI { /// - /// Interaktionslogik für AiPromptbausteinComplexSelectionView.xaml + /// Interaktionslogik für AiPromptbausteinComplexSelectionFavoritenView.xaml + /// Reine Auswahl-Ansicht der Favoriten (keine Bearbeitung) — ein Klick auf einen Eintrag sendet sofort. /// public partial class AiPromptbausteinComplexSelectionFavoritenView : UserControl { @@ -36,17 +26,27 @@ namespace BeWo.View.Detail.AI ViewModel.InitVMList(); listBoxEdit1.UnSelectAll(); + listBoxEdit2.UnSelectAll(); + listBoxEdit3.UnSelectAll(); }; } - private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) + private void Item_MouseUp(object sender, MouseButtonEventArgs e) { - Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); - e.Handled = true; - } + if (e.ChangedButton != MouseButton.Left) + return; + + // Klick auf den (i)-Hyperlink soll nur den Link öffnen, nicht senden + if ((e.OriginalSource as FrameworkElement)?.Name == "infobox") + return; + + var vm = (sender as FrameworkElement)?.DataContext as AbstractBaseVM; + + if (vm is null) + return; + + ViewModel.SelectedItem = vm; - private void Grid_MouseUp(object sender, MouseButtonEventArgs e) - { if (!ViewModel.SendCommand.CanExecute(null)) return; @@ -54,19 +54,20 @@ namespace BeWo.View.Detail.AI e.Handled = true; } - private void Grid_MouseEnter(object sender, MouseEventArgs e) + private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e) { - var grid = sender as Grid; + if (e.OriginalSource is TabControl) + { + listBoxEdit1.UnSelectAll(); + listBoxEdit2.UnSelectAll(); + listBoxEdit3.UnSelectAll(); + } + } - if (grid is null) - return; - - var vm = grid.DataContext as AiPromptbausteinPromptVM; - - if (vm is null) - return; - - ViewModel.SelectedPrompt = vm; - } - } + private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) + { + Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); + e.Handled = true; + } + } } diff --git a/BeWo/View/Detail/AI/AiPromptbausteinComplexSelectionView.xaml b/BeWo/View/Detail/AI/AiPromptbausteinComplexSelectionView.xaml index a11947ac0..4ae0005cb 100644 --- a/BeWo/View/Detail/AI/AiPromptbausteinComplexSelectionView.xaml +++ b/BeWo/View/Detail/AI/AiPromptbausteinComplexSelectionView.xaml @@ -1,310 +1,48 @@ - - + - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (i) - - - - - - - - - + + Content="{Binding AcceptButtonText}" + Style="{StaticResource PrimaryButton}" /> - - + diff --git a/BeWo/View/Detail/AI/AiPromptbausteinComplexSelectionView.xaml.cs b/BeWo/View/Detail/AI/AiPromptbausteinComplexSelectionView.xaml.cs index bcd584813..424715565 100644 --- a/BeWo/View/Detail/AI/AiPromptbausteinComplexSelectionView.xaml.cs +++ b/BeWo/View/Detail/AI/AiPromptbausteinComplexSelectionView.xaml.cs @@ -1,27 +1,12 @@ -using BeWo.ViewModel.View.AI; -using BeWo.ViewModel; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; +using BeWo.ViewModel.View.AI; using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Diagnostics; namespace BeWo.View.Detail.AI { /// /// Interaktionslogik für AiPromptbausteinComplexSelectionView.xaml /// - public partial class AiPromptbausteinComplexSelectionView : UserControl + public partial class AiPromptbausteinComplexSelectionView : BeWoView { public AiPromptbausteinSelectionComplexViewModel ViewModel { get; set; } @@ -35,100 +20,8 @@ namespace BeWo.View.Detail.AI { ViewModel.InitVMList(); - TreeViewItem item = treeView.ItemContainerGenerator.ContainerFromIndex(0) as TreeViewItem; - if (item != null) - { - item.IsSelected = true; - item.IsSelected = false; - } - listBoxEdit1.UnSelectAll(); + libraryControl.ResetInitialSelection(); }; } - - private void treeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs e) - { - if (ViewModel is null) - return; - - ViewModel.SelectedFolder = treeView.SelectedValue as AiPromptbausteinFolderVM; - } - - private void OnPreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e) - { - TreeViewItem treeViewItem = VisualUpwardSearch(e.OriginalSource as DependencyObject); - - if (treeViewItem != null) - { - treeViewItem.Focus(); - e.Handled = true; - } - else - { - e.Handled = true; - - if (ViewModel.SelectedFolder == null) - return; - - _LastTreeViewItem.IsSelected = false; - treeView.Focus(); - } - } - - static TreeViewItem VisualUpwardSearch(DependencyObject source) - { - while (source != null && !(source is TreeViewItem)) - source = VisualTreeHelper.GetParent(source); - - return source as TreeViewItem; - } - - private void Grid_PreviewMouseDown(object sender, MouseButtonEventArgs e) - { - TreeViewItem treeViewItem = VisualUpwardSearch(e.OriginalSource as DependencyObject); - - if (treeViewItem is null) - return; - - if (e.ClickCount == 2) - { - ViewModel.OpenEditFolderDialogCommand.Execute(null); - e.Handled = true; - } - } - - private TreeViewItem _LastTreeViewItem; - private void treeView_Selected(object sender, RoutedEventArgs e) - { - _LastTreeViewItem = e.OriginalSource as TreeViewItem; - } - - private void treeView_ContextMenuOpening(object sender, ContextMenuEventArgs e) - { - ViewModel.UpdateFolderCommands(); - } - - private void ListBox_ContextMenuOpening(object sender, ContextMenuEventArgs e) - { - ViewModel.UpdatePromptCommands(); - favorite.Header = (ViewModel.SelectedPrompt?.IsFavorite ?? false) ? "Favorit entfernen" : "Favorit hinzufügen"; - } - - private void Grid_PreviewMouseDown_1(object sender, MouseButtonEventArgs e) - { - if (!ViewModel.SendCommand.CanExecute(null)) - return; - - if (e.ClickCount == 2) - { - ViewModel.SendCommand.Execute(null); - e.Handled = true; - } - } - - private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) - { - Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); - e.Handled = true; - } } } diff --git a/BeWo/View/Detail/AI/AiPromptbausteinComplexTreeView.xaml b/BeWo/View/Detail/AI/AiPromptbausteinComplexTreeView.xaml index daa1cbe06..f0dfb2b82 100644 --- a/BeWo/View/Detail/AI/AiPromptbausteinComplexTreeView.xaml +++ b/BeWo/View/Detail/AI/AiPromptbausteinComplexTreeView.xaml @@ -1,18 +1,15 @@ - @@ -21,235 +18,14 @@ - Aktuell definierte KI-Prompts - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (i) - - - - - - - - + diff --git a/BeWo/View/Detail/AI/AiPromptbausteinComplexTreeView.xaml.cs b/BeWo/View/Detail/AI/AiPromptbausteinComplexTreeView.xaml.cs index abdd2fc31..ef032701d 100644 --- a/BeWo/View/Detail/AI/AiPromptbausteinComplexTreeView.xaml.cs +++ b/BeWo/View/Detail/AI/AiPromptbausteinComplexTreeView.xaml.cs @@ -1,44 +1,18 @@ -using BeWo.Core; -using BeWo.ViewModel; using BeWo.ViewModel.View.Administration; -using DevExpress.Mvvm; -using DevExpress.Xpf.Accordion; -using DevExpress.Xpf.Core.Native; -using DevExpress.Xpf.Editors; -using DevExpress.XtraEditors.TextEditController.Win32; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; -using System.Linq; -using System.Runtime.Remoting.Messaging; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; namespace BeWo.View.Detail.AI { /// - /// Interaktionslogik für AiPromptbausteinTreeView.xaml + /// Interaktionslogik für AiPromptbausteinComplexTreeView.xaml /// public partial class AiPromptbausteinComplexTreeView : BeWoView { - public bool IsDragging = false; - public AiPromptbausteinComplexTreeView(AiPromptbausteinComplexTreeViewModel viewModel = null) { InitializeComponent(); - if (viewModel == null ) - viewModel = new AiPromptbausteinComplexTreeViewModel(BeWoApp.MainControl.WindowService, BS.Shared.AiActionType.ServiceRecordConversation); + if (viewModel == null) + viewModel = new AiPromptbausteinComplexTreeViewModel(BeWoApp.WindowService, BS.Shared.AiActionType.ServiceRecordConversation); DataContext = ViewModel = viewModel; @@ -48,124 +22,5 @@ namespace BeWo.View.Detail.AI public AiPromptbausteinComplexTreeViewModel ViewModel { get; set; } public override bool IsDirty => ViewModel is object && ViewModel.IsDirty; - - protected override void Save() => ViewModel.SaveVMList(); - - private void OnPreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e) - { - TreeViewItem treeViewItem = VisualUpwardSearch(e.OriginalSource as DependencyObject); - - if (treeViewItem != null) - { - treeViewItem.Focus(); - e.Handled = true; - } - else - { - e.Handled = true; - - if (ViewModel.SelectedFolder == null) - return; - - - _LastTreeViewItem.IsSelected = false; - - treeView.Focus(); - } - } - - static TreeViewItem VisualUpwardSearch(DependencyObject source) - { - while (source != null && !(source is TreeViewItem)) - source = VisualTreeHelper.GetParent(source); - - return source as TreeViewItem; - } - - private void treeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs e) - { - if (ViewModel is null) - return; - - ViewModel.SelectedFolder = treeView.SelectedValue as AiPromptbausteinFolderVM; - } - - private void Grid_PreviewMouseDown(object sender, MouseButtonEventArgs e) - { - TreeViewItem treeViewItem = VisualUpwardSearch(e.OriginalSource as DependencyObject); - - if (treeViewItem is null) - return; - - if (e.ClickCount == 2) - { - ViewModel.OpenEditFolderDialogCommand.Execute(null); - e.Handled = true; - } - } - - private TreeViewItem _LastTreeViewItem; - private void treeView_Selected(object sender, RoutedEventArgs e) - { - _LastTreeViewItem = e.OriginalSource as TreeViewItem; - } - - private void treeView_ContextMenuOpening(object sender, ContextMenuEventArgs e) - { - ViewModel.UpdateFolderCommands(); - } - - private void ListBox_ContextMenuOpening(object sender, ContextMenuEventArgs e) - { - ViewModel.UpdatePromptCommands(); - favorite.Header = (ViewModel.SelectedPrompt?.IsFavorite ?? false) ? "Favorit entfernen" : "Favorit hinzufügen"; - } - - //private void listBox_Prompts_PreviewMouseUp(object sender, MouseButtonEventArgs e) - //{ - // IsDragging = false; - //} - - //private void listBox_Prompts_Drop(object sender, DragEventArgs e) - //{ - // HitTestResult hitTest = VisualTreeHelper.HitTest(listBoxEdit1, e.GetPosition(listBoxEdit1)); - // ListBoxEditItem item = LayoutHelper.FindParentObject((DependencyObject)hitTest.VisualHit); - // int insertIndex = ViewModel.SelectedFolder.SubPrompts.VMList.IndexOf((AiPromptbausteinPromptVM)item.Content); - // ViewModel.SelectedFolder.SubPrompts.VMList.Remove((AiPromptbausteinPromptVM)e.Data.GetData(typeof(AiPromptbausteinPromptVM))); - // if (listBoxEdit1.SelectedIndex > insertIndex) - // insertIndex++; - // ViewModel.SelectedFolder.SubPrompts.VMList.Insert(insertIndex, (AiPromptbausteinPromptVM)e.Data.GetData(typeof(AiPromptbausteinPromptVM))); - //} - - //private void listBox_Prompts_DragOver(object sender, DragEventArgs e) - //{ - // e.Effects = DragDropEffects.Move; - //} - - //private void listBox_Prompts_MouseMove(object sender, MouseEventArgs e) - //{ - // if (IsDragging && listBoxEdit1.SelectedItem != null) - // { - // DragDrop.DoDragDrop(listBoxEdit1, listBoxEdit1.SelectedItem, DragDropEffects.Move); - // } - //} - - private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) - { - Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); - e.Handled = true; - } - - private void Grid_PreviewMouseDown_1(object sender, MouseButtonEventArgs e) - { - if (!ViewModel.OpenEditPromptDialogCommand.CanExecute(null)) - return; - - if (e.ClickCount == 2) - { - ViewModel.OpenEditPromptDialogCommand.Execute(null); - e.Handled = true; - } - } } } diff --git a/BeWo/View/Detail/AI/AiPromptbausteinFolderView.xaml b/BeWo/View/Detail/AI/AiPromptbausteinFolderView.xaml index 62f9479b2..f803b8d93 100644 --- a/BeWo/View/Detail/AI/AiPromptbausteinFolderView.xaml +++ b/BeWo/View/Detail/AI/AiPromptbausteinFolderView.xaml @@ -1,4 +1,4 @@ - - + + + + + + + + + + + + + + + +