haikechuang
2015-02-15 00:40
采纳率: 50%
浏览 1.6k
已采纳

C#程序麻烦高手解释一下,小弟先谢谢了

using System;
using System.Threading;

namespace Example_L2_Basic_Device_Access
{
[System.AddIn.AddIn("S", Version = "4", Publisher = "aaa", Description = "Provides examples on how to communicate with devices. Such as how to call methods of a Standard Resource or read Standard Names.")]
public partial class ISTARSServices : STARS.InternalInterfaces.VSTAItf.ISTARSServices
{
private MyAddin m_MyAddin;

    private void ISTARSServices_Startup(object sender, EventArgs e)
    {
        m_MyAddin = new MyAddin();
        m_MyAddin.Run(this);           
    }

    private void ISTARSServices_Shutdown(object sender, EventArgs e)
    {
        IDisposable dis = m_MyAddin as IDisposable;
        if (dis != null)
            dis.Dispose();
    }

    #region VSTA generated code
    private void InternalStartup()
    {
        this.Startup += new System.EventHandler(ISTARSServices_Startup);
        this.Shutdown += new System.EventHandler(ISTARSServices_Shutdown);
    }
    #endregion
}

}

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

4条回答 默认 最新

  • blownewbee 2015-02-15 04:29
    已采纳

    不知道“STARS”是什么。但是从字面理解,service startup是启动服务运行的逻辑。addin说明这是一个插件。

    点赞 评论
  • haikechuang 2015-02-15 00:43

    using System;
    using System.Collections.Generic;
    using System.Text;
    using STARS;
    namespace Example_L2_Basic_Device_Access
    {
    public class MyAddin : ApplicationAddIn
    {
    protected override void Initialize()
    {
    base.Initialize();
    STARSApplication.MainForm.Show(new STARSMainForm(this));
    }
    }
    }

    点赞 评论
  • haikechuang 2015-02-15 00:49

    请各位大哥指教一下以上程序大致是干啥的。尤其是以下几句代码,请指教
    private void ISTARSServices_Startup(object sender, EventArgs e)
    {
    m_MyAddin = new MyAddin();
    m_MyAddin.Run(this);

    }
    base.Initialize();
    STARSApplication.MainForm.Show(new STARSMainForm(this));

    点赞 评论
  • blownewbee 2015-02-15 05:30

    自己写的程序别人无法知道它的接口规范,除非有文档、或者例子。
    给excel编写插件倒是容易,在code.msdn.microsoft.com codeproject.com上有很多例子,用 google 搜索下。

    点赞 评论

相关推荐 更多相似问题