IWebPartParameters makes Connection between Web Parts easy
来源:互联网 发布:9.3.5越狱优化 编辑:程序博客网 时间:2024/05/17 01:37
//Within the class, you need to some method and property of the IWebPartParameters:
private PropertyDescriptorCollection _PD;
[ConnectionProvider("Parameters")]
public IWebPartParameters ConnectionInterface()
...{
return this;
}
public void GetParametersData(ParametersCallback callback)
...{
IDictionary dic = new Hashtable();
callback.Invoke(dic);
//callback.BeginInvoke(dic);
}
public PropertyDescriptorCollection Schema
...{
set ...{ _PD = value; }
get ...{ return _PD; }
}
public void SetConsumerSchema(PropertyDescriptorCollection schema)
...{
_PD = schema;
}
Within the class, you need to implement some method and property of the IWebPartParameters:
public IWebPartParameters ConnectionInterface(). The method would be invoked by Consumer, the purpose of the method is to pass the reference of the IWebParameters to the consumer.
public void GetParametersData(ParametersCallback callback). Key method, the remote method within the consumer would be passed in by the ParametersCallback. And you can invoke the peer method by make some callings to the callback, like following.BTW, all parameters was passes by a standard interface’ IDictionary’ .
public PropertyDescriptorCollection Schema. You have to implement the property, even if you don’t like it, ‘cause it’s part of the interface IWebParameters.
public void SetConsumerSchema(PropertyDescriptorCollection schema). The method would be invoked by consumer. Consumer passes the PropertyDescriptorCollection to the provider by calling the method.
Heres' the consumer :
public void GetConnectionInterface(IWebPartParameters providerPart)
...{
PropertyDescriptor[] property = ...{ TypeDescriptor.GetProperties(this)["_sDBAlias"] };
PropertyDescriptorCollection schema = new PropertyDescriptorCollection(property);
providerPart.SetConsumerSchema(schema);
ParametersCallback callback = new ParametersCallback(ReceiveParameters);
providerPart.GetParametersData(callback);
}
public void ReceiveParameters(IDictionary Params)
...{
// Implement all your logic
}
And then, all the stories are the same, put 2 web part into the same web page, make they connect to each other in editable mode.
- IWebPartParameters makes Connection between Web Parts easy
- Jdom makes xml easy
- Web Parts
- java web parts (转载)
- Building Web Parts
- Web Parts(定制)
- What makes a great web developer?
- 给sharepoint页面增加“Add Web Parts”
- Web Parts, Impersonate and Security Policy
- AJAX in Web Parts With MOSS
- Web Parts与自定义控件 建立连接
- Web Parts与自定义控件 双向连接
- .NET Security in Web parts 1
- WSS 3.0和MOSS 中的Web Parts
- 转:Work with filter Web Parts
- The SSH connection between computers without passwords
- 【MongoDB】The connection between two tables
- The connection problem between MySQL and Eclipse
- 不知道多少人存在这个误解:
- Internal .Net Framework Data Provider error 6
- Java标准版的EJB Persistence(一下)
- 在JAVA里面如何调用ORCALE数据库里的存储过程(带输入输出参数)的????
- 中文分词算法
- IWebPartParameters makes Connection between Web Parts easy
- 洋流[Theocean flow]介绍----科普知识
- TranslateMessage
- 计算两个日期之间相差的天数(JS)
- Ajax 顺序图
- “易语言.飞扬”第一个第三方界面库,efgui,作者迷迷66
- 科普知识------地球上的水
- access模糊查询表所有字段
- 小白进化论