mirror of
https://github.com/maker-community/ElectronBot.DotNet.git
synced 2026-10-23 17:58:39 +08:00
update nuget version
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Microsoft.Graph;
|
||||
using Microsoft.Graph.Models;
|
||||
|
||||
namespace Verdure.Braincase.Core.Contracts.Services;
|
||||
/// <summary>
|
||||
|
||||
@@ -7,16 +7,16 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Graph" Version="4.45.0" />
|
||||
<PackageReference Include="Microsoft.Identity.Client.Broker" Version="4.53.0" />
|
||||
<PackageReference Include="Microsoft.Identity.Client.Extensions.Msal" Version="2.29.0" />
|
||||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
|
||||
<PackageReference Include="Google.Protobuf" Version="3.26.1" />
|
||||
<PackageReference Include="Grpc.Net.Client" Version="2.62.0" />
|
||||
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.62.0" />
|
||||
<PackageReference Include="Microsoft.Graph" Version="5.61.0" />
|
||||
<PackageReference Include="Microsoft.Identity.Client.Broker" Version="4.66.1" />
|
||||
<PackageReference Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.66.1" />
|
||||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.1" />
|
||||
<PackageReference Include="Google.Protobuf" Version="3.28.3" />
|
||||
<PackageReference Include="Grpc.Net.Client" Version="2.66.0" />
|
||||
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.66.0" />
|
||||
<PackageReference Include="System.IO.Ports" Version="8.0.0" />
|
||||
<PackageReference Include="SharpZipLib" Version="1.4.2" />
|
||||
<PackageReference Include="Grpc.Tools" Version="2.63.0">
|
||||
<PackageReference Include="Grpc.Tools" Version="2.67.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
||||
@@ -259,7 +259,7 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AI.MachineLearning" Version="1.19.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
|
||||
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.2.0" />
|
||||
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.3.0" />
|
||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240923002" />
|
||||
<PackageReference Include="Sdcb.SparkDesk" Version="3.1.0" />
|
||||
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="8.0.1" />
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:graph="using:Microsoft.Graph"
|
||||
xmlns:graph="using:Microsoft.Graph.Models"
|
||||
xmlns:local="using:Hw75Views"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Loaded="UserControl_Loaded"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Net.Http.Headers;
|
||||
using Verdure.Braincase.Core.Contracts.Services;
|
||||
using Verdure.Braincase.Core.Helpers;
|
||||
using Azure.Identity;
|
||||
using Microsoft.Graph;
|
||||
using Microsoft.Graph.Models;
|
||||
using Verdure.Braincase.Core.Contracts.Services;
|
||||
|
||||
namespace ElectronBot.Braincase.Services;
|
||||
|
||||
@@ -21,25 +21,20 @@ public class MicrosoftGraphService : IMicrosoftGraphService
|
||||
public MicrosoftGraphService(IdentityService identityService)
|
||||
{
|
||||
_identityService = identityService;
|
||||
_graphServiceClient = new GraphServiceClient(_graphAPIEndpoint,
|
||||
new DelegateAuthenticationProvider(async (requestMessage) =>
|
||||
{
|
||||
var accessToken = await _identityService.GetAccessTokenForGraphAsync();
|
||||
|
||||
requestMessage.Headers.Authorization = new AuthenticationHeaderValue("bearer", accessToken);
|
||||
}));
|
||||
var credential = new ClientSecretCredential("TenantId", "ClientId", "ClientSecret");
|
||||
_graphServiceClient = new GraphServiceClient(credential);
|
||||
}
|
||||
|
||||
public Task PrepareGraphAsync()
|
||||
{
|
||||
|
||||
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task<User> GetUserInfoAsync()
|
||||
{
|
||||
var graphUser = await _graphServiceClient.Me.Request().GetAsync();
|
||||
var graphUser = await _graphServiceClient.Me.GetAsync();
|
||||
|
||||
return graphUser;
|
||||
}
|
||||
@@ -47,17 +42,18 @@ public class MicrosoftGraphService : IMicrosoftGraphService
|
||||
public async Task<string> GetUserPhotoAsync()
|
||||
{
|
||||
var stream = await _graphServiceClient.Me.Photo.Content
|
||||
.Request()
|
||||
.GetAsync();
|
||||
return stream.ToBase64String();
|
||||
}
|
||||
|
||||
public async Task<IList<TodoTaskList>> GetTodoTaskListAsync()
|
||||
{
|
||||
return await _graphServiceClient.Me.Todo.Lists.Request().GetAsync();
|
||||
var todoTaskLists = await _graphServiceClient.Me.Todo.Lists.GetAsync();
|
||||
return todoTaskLists?.Value ?? new List<TodoTaskList>();
|
||||
}
|
||||
public async Task<IList<TodoTask>> GetTodoTaskListByTaskIdAsync(string id)
|
||||
{
|
||||
return await _graphServiceClient.Me.Todo.Lists[id].Tasks.Request().GetAsync();
|
||||
var tasksResponse = await _graphServiceClient.Me.Todo.Lists[id].Tasks.GetAsync();
|
||||
return tasksResponse?.Value ?? new List<TodoTask>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Text;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using ElectronBot.Braincase.Services;
|
||||
using Microsoft.Graph;
|
||||
using Microsoft.Graph.Models;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Verdure.Braincase.Core.Contracts.Services;
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ using Verdure.Braincase.Core.Services;
|
||||
using Microsoft.Graph;
|
||||
using Controls.CompactOverlay;
|
||||
using Microsoft.UI.Windowing;
|
||||
using Microsoft.Graph.Models;
|
||||
|
||||
namespace ElectronBot.Braincase.ViewModels;
|
||||
|
||||
|
||||
@@ -1,58 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text;
|
||||
using Windows.ApplicationModel;
|
||||
using System.Diagnostics;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Controls.CompactOverlay;
|
||||
using ElectronBot.Braincase;
|
||||
using ElectronBot.Braincase.Helpers;
|
||||
using ElectronBot.Braincase.Services;
|
||||
using HelixToolkit.SharpDX.Core;
|
||||
using HelixToolkit.WinUI;
|
||||
using Microsoft.UI.Windowing;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Models;
|
||||
using SharpDX;
|
||||
using Assimp;
|
||||
using HelixToolkit.SharpDX.Core.Assimp;
|
||||
using HelixToolkit.SharpDX.Core.Model.Scene;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using BoundingBox = SharpDX.BoundingBox;
|
||||
using Camera = HelixToolkit.WinUI.Camera;
|
||||
using Matrix = SharpDX.Matrix;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using ElectronBot.Braincase.Services;
|
||||
using Services;
|
||||
using System.Diagnostics;
|
||||
using System.Numerics;
|
||||
using Windows.Foundation;
|
||||
using Windows.Graphics.Imaging;
|
||||
using HelixToolkit.WinUI;
|
||||
using Mediapipe.Net.Solutions;
|
||||
using Microsoft.UI;
|
||||
using Constants = ElectronBot.Braincase.Constants;
|
||||
using Microsoft.Graphics.Canvas.UI.Xaml;
|
||||
using Microsoft.Graphics.Canvas;
|
||||
using Windows.Media.Playback;
|
||||
using ElectronBot.Braincase.Extensions;
|
||||
using Vector3 = SharpDX.Vector3;
|
||||
using Verdure.Braincase.Core.Models;
|
||||
using Microsoft.UI.Xaml.Media.Imaging;
|
||||
using Windows.Media.FaceAnalysis;
|
||||
using Windows.Media;
|
||||
using Windows.Graphics.Capture;
|
||||
using WinRT.Interop;
|
||||
using Microsoft.Graph.CallRecords;
|
||||
using Microsoft.Graphics.Canvas.UI.Composition;
|
||||
using Windows.Graphics;
|
||||
using Microsoft.Graphics.DirectX;
|
||||
using Microsoft.UI;
|
||||
using Microsoft.UI.Composition;
|
||||
using Microsoft.UI.Xaml.Hosting;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Services;
|
||||
using SharpDX;
|
||||
using Windows.ApplicationModel;
|
||||
using Windows.Foundation;
|
||||
using Windows.Graphics;
|
||||
using Windows.Graphics.Capture;
|
||||
using Windows.Graphics.Imaging;
|
||||
using Windows.Media;
|
||||
using Windows.Media.FaceAnalysis;
|
||||
using Windows.Storage.Streams;
|
||||
using System.Runtime.InteropServices;
|
||||
using Mediapipe.Net.Framework.Format;
|
||||
using Mediapipe.Net.Framework.Protobuf;
|
||||
using WinRT.Interop;
|
||||
using BoundingBox = SharpDX.BoundingBox;
|
||||
using Camera = HelixToolkit.WinUI.Camera;
|
||||
using Color = SharpDX.Color;
|
||||
using Matrix = SharpDX.Matrix;
|
||||
using Vector3 = SharpDX.Vector3;
|
||||
|
||||
namespace ElectronBot.Braincase.ViewModels;
|
||||
|
||||
@@ -999,8 +977,8 @@ public partial class MovieViewModel : ObservableRecipient
|
||||
using var inputFrame = VideoFrame.CreateWithSoftwareBitmap(softwareBitmap);
|
||||
|
||||
|
||||
using var tmp = new VideoFrame(softwareBitmap.BitmapPixelFormat, (int)(faceBox.Width + faceBox.Width % 2) - 2,
|
||||
(int)(faceBox.Height + faceBox.Height % 2) - 2);
|
||||
using var tmp = new VideoFrame(softwareBitmap.BitmapPixelFormat, (int)(faceBox.Width + faceBox.Width % 2) - 2,
|
||||
(int)(faceBox.Height + faceBox.Height % 2) - 2);
|
||||
|
||||
await inputFrame.CopyToAsync(tmp, new BitmapBounds(faceBox.X - 20, faceBox.Y - 20, faceBox.Width + 40, faceBox.Height + 40), null);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
xmlns:ic="using:Microsoft.Xaml.Interactions.Core"
|
||||
xmlns:local="using:ElectronBot.Braincase.Views"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:model="using:Microsoft.Graph"
|
||||
xmlns:model="using:Microsoft.Graph.Models"
|
||||
mc:Ignorable="d">
|
||||
<i:Interaction.Behaviors>
|
||||
<ic:EventTriggerBehavior EventName="Loaded">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Google.Protobuf" Version="3.26.1" />
|
||||
<PackageReference Include="Google.Protobuf" Version="3.28.3" />
|
||||
<PackageReference Include="Grpc.Tools" Version="2.63.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="Google.Protobuf" Version="3.27.3" />
|
||||
<PackageReference Include="Google.Protobuf" Version="3.28.3" />
|
||||
<PackageReference Include="Mediapipe.Net.Framework.Protobuf" Version="0.9.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user