simplecomponent.cs
来自「C#高级编程第6版随书源代码 值得下载」· CS 代码 · 共 36 行
CS
36 行
using System.EnterpriseServices;
using System.Runtime.InteropServices;
[assembly: ApplicationName("Wrox EnterpriseDemo")]
[assembly: Description("Wrox Sample Application for Professional C#")]
[assembly: ApplicationActivation(ActivationOption.Server)]
[assembly: ApplicationAccessControl(false)]
namespace Wrox.ProCSharp.EnterpriseServices
{
[ComVisible(true)]
public interface IGreeting
{
string Welcome(string name);
}
[EventTrackingEnabled(true)]
[ComVisible(true)]
[Description("Simple Serviced Component Sample")]
public class SimpleComponent : ServicedComponent, IGreeting
{
public SimpleComponent()
{
}
public string Welcome(string name)
{
// simulate some processing time
System.Threading.Thread.Sleep(1000);
return "Hello, " + name;
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?