- 积分
- 58764
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-21
- 最后登录
- 1970-1-1
|
发表于 2012-12-19 11:36:22
|
显示全部楼层
本帖最后由 MeteoInfo 于 2012-12-19 11:40 编辑
luckycomcn 发表于 2012-12-19 10:56
关于写MeteoInfo插件的资料论坛上有吗?我好像没找到。
最近在尝试写个插件多支持一些其他格式的数据。
MeteoInfo类库里的插件机制还在非常初级的阶段,之前的帖子有个简单的例子(并没有和桌面软件交互):http://bbs.06climate.com/forum.php?mod=viewthread&tid=5339
你如果愿意,可以在开发插件的过程中根据需要我们一起来完善MeteoInfo的插件机制。
还有一个简单的和桌面交互的例子:
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using MeteoInfoC.Plugin;
- namespace PluginSample
- {
- public class Class1:IPlugin
- {
- #region IPlugin Members
- private IApplication _Application = null;
- public IApplication Application
- {
- get
- {
- return _Application;
- }
- set
- {
- _Application = value;
- //_Application.Register(this);
- }
- }
- private string _PluginName = "PluginSample";
- public string PluginName
- {
- get { return _PluginName; }
- set { _PluginName = value; }
- }
- public void Loaded()
- {
- int layerNum = _Application.MapView.LayerSet.LayerNum;
- MessageBox.Show(_PluginName + " plugin has been loaded!" + Environment.NewLine + "Layer number: " + layerNum.ToString());
- }
- #endregion
- }
- }
复制代码
|
|