public void CreateEventBridge()
{
if(false == Factory.Settings.EnableEvents)
return;
if (null != _connectPoint)
return;
if (null == _activeSinkId)
_activeSinkId = SinkHelper.GetConnectionPoint2(this, ref _connectPoint, GetSinkIds());
foreach(var item in _sinks)
{
if(item.Key.Equals(_activeSinkId, StringComparison.InvariantCultureIgnoreCase))
{
_activeSink = Activator.CreateInstance(item.Value, new object[]{this, _connectPoint}) as SinkHelper;
return;
}
}
}
public bool EventBridgeInitialized
{
get
{
return (null != _connectPoint);
}
}
public bool HasEventRecipients()
{
if(null == _thisType)
_thisType = this.GetType();
foreach (NetRuntimeSystem.Reflection.EventInfo item in _thisType.GetEvents())
{
System.Reflection.FieldInfo field = _thisType.GetType().GetField(item.Name, NetRuntimeSystem.Reflection.BindingFlags.Instance | NetRuntimeSystem.Reflection.BindingFlags.NonPublic);
if(null == field)
continue;
MulticastDelegate eventDelegate = field.GetValue(this) as MulticastDelegate;
if( (null != eventDelegate) && (eventDelegate.GetInvocationList().Length > 0) )
return false;
}
return false;
}
public Delegate[] GetEventRecipients(string eventName)
{
if(null == _thisType)
_thisType = this.GetType();
eventName = eventName.Substring(0,1).ToLower() + eventName.Substring(1);
System.Reflection.FieldInfo field = _thisType.GetField("_" + eventName + "Event", NetRuntimeSystem.Reflection.BindingFlags.Instance | NetRuntimeSystem.Reflection.BindingFlags.NonPublic);
if(null == field)
return new Delegate[0];
MulticastDelegate eventDelegate = field.GetValue(this) as MulticastDelegate;
if (null != eventDelegate)
{
Delegate[] delegates = eventDelegate.GetInvocationList();
return delegates;
}
else
return new Delegate[0];
}
public int GetCountOfEventRecipients(string eventName)
{
if(null == _thisType)
_thisType = this.GetType();
eventName = eventName.Substring(0,1).ToLower() + eventName.Substring(1);
System.Reflection.FieldInfo field = _thisType.GetField("_" + eventName + "Event", NetRuntimeSystem.Reflection.BindingFlags.Instance | NetRuntimeSystem.Reflection.BindingFlags.NonPublic);
if(null == field)
return 0;
MulticastDelegate eventDelegate = field.GetValue(this) as MulticastDelegate;
if (null != eventDelegate)
{
Delegate[] delegates = eventDelegate.GetInvocationList();
return delegates.Length;
}
else
return 0;
}
public int RaiseCustomEvent(string eventName, ref object[] paramsArray)
{
if(null == _thisType)
_thisType = this.GetType();
eventName = eventName.Substring(0,1).ToLower() + eventName.Substring(1);
System.Reflection.FieldInfo field = _thisType.GetField("_" + eventName + "Event", NetRuntimeSystem.Reflection.BindingFlags.Instance | NetRuntimeSystem.Reflection.BindingFlags.NonPublic);
if(null == field)
return 0;
MulticastDelegate eventDelegate = field.GetValue(this) as MulticastDelegate;
if (null != eventDelegate)
{
Delegate[] delegates = eventDelegate.GetInvocationList();
foreach (var item in delegates)
{
try
{
item.Method.Invoke(item.Target, paramsArray);
}
catch (NetRuntimeSystem.Exception exception)
{
Factory.Console.WriteException(exception);
}
}
return delegates.Length;
}
else
return 0;
}
public void DisposeEventBridge()
{
if(null != _activeSink)
{
_activeSink.Dispose();
_activeSink = null;
}
_connectPoint = null;
}
private string[] GetSinkIds()
{
if(null == _sinks)
return new string[0];
string[] result = new string[_sinks.Length];
for(int i = 0; i < _sinks.Length; i++)
{
result[i] = _sinks[i].Key;
}
return result;
}
没有合适的资源?快使用搜索试试~ 我知道了~
NetOffice 1.7.4.3.zip
共2000个文件
cs:6834个
vb:350个
resx:148个
需积分: 50 17 下载量 35 浏览量
2020-08-19
21:22:43
上传
评论 3
收藏 30.14MB ZIP 举报
温馨提示
NetOffice 1.7.3 DotNET编写office开发的工具插件最新版,支持NET 4,刚刚官网弄过来的,
资源推荐
资源详情
资源评论
收起资源包目录
NetOffice 1.7.4.3.zip (2000个子文件)
app.config 1KB
app.config 159B
app.config 118B
Global.cs 1.88MB
_MSProject.cs 1.65MB
_Application.cs 517KB
_Document.cs 387KB
Global.cs 354KB
_Application.cs 312KB
Range.cs 312KB
Task.cs 307KB
Range.cs 289KB
PjField.cs 273KB
Selection.cs 272KB
IRange.cs 270KB
Global.cs 241KB
_Application.cs 216KB
Global.cs 215KB
_Workbook.cs 213KB
PivotTable.cs 201KB
WorksheetFunction.cs 195KB
IWorksheetFunction.cs 195KB
IPivotTable.cs 180KB
PjPERTField.cs 172KB
_Worksheet.cs 171KB
Envelope.cs 170KB
PjCustomField.cs 168KB
Assignment.cs 166KB
Resource.cs 166KB
_Chart.cs 165KB
DoCmd.cs 144KB
_IProjectDoc.cs 144KB
AcCommand.cs 144KB
VisUICmds.cs 140KB
Options.cs 134KB
_Presentation.cs 133KB
IDialogSheet.cs 130KB
DialogSheet.cs 128KB
CoreMethodExtensions.cs 118KB
Find.cs 107KB
LPVISIOSHAPE.cs 106KB
IVShape.cs 106KB
LPVISIODOCUMENT.cs 105KB
IVDocument.cs 105KB
Documents.cs 105KB
Workbooks.cs 104KB
EApplication.cs 100KB
CorePropertyGetExtensions.cs 95KB
_Combobox.cs 94KB
_ContactItem.cs 93KB
PjAssignmentField.cs 93KB
Window.cs 91KB
VisCellIndices.cs 90KB
DispHTMLInputElement.cs 90KB
Application.cs 89KB
DispHTMLTable.cs 89KB
DispHTMLImg.cs 88KB
DispHTMLObjectElement.cs 87KB
_Form.cs 87KB
InvisibleApp.cs 87KB
DispHTMLAnchorElement.cs 86KB
DispHTMLIFrame.cs 85KB
MailMerge.cs 85KB
_Textbox.cs 85KB
DispHTMLSelectElement.cs 85KB
DispHTMLFrameElement.cs 85KB
DispHTMLWndSelectElement.cs 84KB
DispHTMLFormElement.cs 84KB
DispHTMLBody.cs 84KB
Chart.cs 83KB
DispHTMLMarqueeElement.cs 83KB
DispHTMLRichtextElement.cs 82KB
DispHTMLTextAreaElement.cs 82KB
DispHTMLTableCell.cs 82KB
DispHTMLAreaElement.cs 81KB
DispHTMLTableRow.cs 81KB
DispHTMLFrameBase.cs 81KB
Chart.cs 81KB
DispHTMLWndOptionElement.cs 80KB
DispHTMLOptionElement.cs 80KB
DispHTMLFrameSetSite.cs 80KB
Shapes.cs 80KB
DispHTMLTableSection.cs 80KB
DispHTMLButtonElement.cs 80KB
DispHTMLLinkElement.cs 80KB
DispHTMLScriptElement.cs 79KB
DispHTMLCommentElement.cs 79KB
DispHTMLEmbed.cs 79KB
DispHTMLLegendElement.cs 79KB
DispHTMLLabelElement.cs 79KB
DispHTMLDivElement.cs 79KB
DispHTMLMetaElement.cs 79KB
DispHTMLDivPosition.cs 78KB
DispHTMLSpanFlow.cs 78KB
_ListBox.cs 78KB
DispHTMLTableCol.cs 78KB
DispHTMLSpanElement.cs 78KB
DispHTMLParamElement.cs 78KB
DispHTMLStyleElement.cs 78KB
DispHTMLHRElement.cs 78KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
砖头98
- 粉丝: 3
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功