WPF.Clippy 1.0.0

dotnet add package WPF.Clippy --version 1.0.0                
NuGet\Install-Package WPF.Clippy -Version 1.0.0                
此命令预期在 Visual Studio 的包管理器控制台中运行,因为它使用 NuGet 模块的 Install-Package 版本。
<PackageReference Include="WPF.Clippy" Version="1.0.0" />                
对于支持 PackageReference 的项目,将此 XML 节点复制到项目文件中以引用包。
paket add WPF.Clippy --version 1.0.0                
#r "nuget: WPF.Clippy, 1.0.0"                
#r 指令可用于 F# Interactive 和 Polyglot Notebooks。将其复制到交互工具或脚本的源代码中以便引用包。
// Install WPF.Clippy as a Cake Addin
#addin nuget:?package=WPF.Clippy&version=1.0.0

// Install WPF.Clippy as a Cake Tool
#tool nuget:?package=WPF.Clippy&version=1.0.0                

Clippy.WPF

Clippy.WPF 是一个 C# 库,它允许创建和交互 Clippy 角色字符。

特性

  • 创建和动画 Clippy 角色
    • Bonzi
    • Clippy
    • F1
    • Genie
    • Genius
    • 链接
    • Merlin
    • Peedy
    • Rocky
    • Rover
  • 播放支持的任何动画(循环和一次性播放)
  • 显示和隐藏支持(包括动画)
  • 动画完成事件
  • 处理双击事件
  • 说出文本消息
  • 说出自定义 FrameworkElement 消息
  • 获取和设置 Clippy 角色位置

缺少特性

  • 音频
  • 显示/取消显示消息事件
  • 自定义 Clippy 角色

感谢

非常感谢 ClippyJS 库,它为该项目提供了艺术和动画数据。

API

创建、显示和关闭角色

// Create the instance of the character we want
var character = new ClippyCharacter(Character.Clippy);

// Show will present the character as a top most window
character.Show();

// Hides a character, hidden characters can be re-shown by calling Show() again.
character.Hide();

// Dismisses a character, a dismissed character can not be reshown and must be recreated
character.Close();

动画

// Get a list of all supported animations for the character
var animations = character.AnimationNames;

// Loop an animation until a different animation is requested
character.PlayAnimation("Idle", AnimationMode.Loop);

// Play an animation once
// When it completes the previous animation will be resumed
character.PlayAnimation("Wave", AnimationMode.Once);

// Get the name of the currently active looping animation
var activeLoopAnimation = character.GetActiveAnimation(AnimationMode.Loop);

事件

// Subscribe to character double click events
character.OnDoubleClick += HandleDoubleClick;

// Called when a character is double clicked
void HandleDoubleClick(ClippyCharacter character)
{
}

// Subscribe to character location changed events
character.LocationChanged += HandleLocationChanged;

// Called when a characters location has changed
void HandleLocationChanged(ClippyCharacter character, Point location)
{
}

// Subscribe to character animation completed events
character.OnAnimationCompleted += HandleAnimationCompleted;

// Called when a characters animation has completed
void OnCharacterAnimationComplete(ClippyCharacter sender, string animationName, AnimationMode mode)
{
}

语音

// Display a text message, which will be automatically dismissed after 4 seconds
character.Say("Hello!", TimeSpan.FromSeconds(4));

// Show a custom control in a speech bubble.
// If no TimeSpan dismiss timout is specified, the speech bubble will be shown indefinatly
character.Say(new TextBlock 
{ 
	Text = "RAWR", 
	Foreground = Brushes.Red 
});
产品 兼容和附加的计算的目标框架版本。
.NET Framework net48 兼容。 net481 已计算。
兼容目标框架
包含目标框架(在包中)
了解更多关于目标框架.NET Standard的信息。

NuGet软件包

此包未使用任何NuGet软件包。

GitHub仓库

此包未使用任何流行的GitHub仓库。

版本 下载 最后更新
1.0.0 121 6/22/2024

首次公开发布。