本文整理汇总了C#中ICopyable类的典型用法代码示例。如果您正苦于以下问题:C# ICopyable类的具体用法?C# ICopyable怎么用?C# ICopyable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ICopyable类属于命名空间,在下文中一共展示了ICopyable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendMessage
/// <summary>This methods send some ICopyable data to the remote address.
/// </summary>
/// <param name="remote_addr">Remote Nodes are referenced by their P2P
/// Address, typically of type AHAddress.</param>
/// <param name="data">This is an ICopyable object which contains the data
/// to send.</param>
public void SendMessage(Address remote_addr, ICopyable data) {
// This instantiates a multi-use method to sending to the remote node,
// though we will only use it once. It is VERY similar to UDP.
AHExactSender sender = new AHExactSender(_app_node.Node, remote_addr);
// This is the process of actually sending the data.
sender.Send(new CopyList(HW, data));
}
示例2: Copy
public override object Copy(ICopyable zone)
{
ICopyable tmpZone = zone;
CCSequence ret;
if (tmpZone != null && tmpZone != null)
{
ret = tmpZone as CCSequence;
if (ret == null)
{
return null;
}
base.Copy(tmpZone);
var param1 = m_pActions[0].Copy() as CCFiniteTimeAction;
var param2 = m_pActions[1].Copy() as CCFiniteTimeAction;
if (param1 == null || param2 == null)
{
return null;
}
ret.InitOneTwo(param1, param2);
return ret;
}
else
{
return new CCSequence(this);
}
}
示例3: Copy
public override object Copy(ICopyable zone)
{
if (zone != null)
{
var ret = zone as CCRepeat;
if (ret == null)
{
return null;
}
base.Copy(zone);
var param = m_pInnerAction.Copy() as CCFiniteTimeAction;
if (param == null)
{
return null;
}
ret.InitWithAction(param, m_uTimes);
return ret;
}
else
{
return new CCRepeat(this);
}
}
示例4: Copy
public override object Copy(ICopyable zone)
{
if (zone != null)
{
var ret = zone as CCRepeatForever;
if (ret == null)
{
return null;
}
base.Copy(zone);
var param = m_pInnerAction.Copy() as CCActionInterval;
if (param == null)
{
return null;
}
ret.InitWithAction(param);
return ret;
}
else
{
return new CCRepeatForever(this);
}
}
示例5: Copy
public override object Copy(ICopyable zone)
{
if (zone != null)
{
var ret = zone as CCMoveBy;
if (ret == null)
{
return null;
}
base.Copy(zone);
ret.InitWithDuration(m_fDuration, m_delta);
return ret;
}
else
{
return new CCMoveBy(this);
}
}
示例6: Copy
public override object Copy(ICopyable zone)
{
if (zone != null)
{
var ret = zone as CCSpawn;
if (ret == null)
{
return null;
}
base.Copy(zone);
var param1 = m_pOne.Copy() as CCFiniteTimeAction;
var param2 = m_pTwo.Copy() as CCFiniteTimeAction;
if (param1 == null || param2 == null)
{
return null;
}
ret.InitOneTwo(param1, param2);
return ret;
}
else
{
return new CCSpawn(this);
}
}
示例7: Send
///<summary>Pushes the data to the SecurityAssociation who will send it
///over the underlying edge.</summary>
public override void Send(ICopyable data) {
if(_closed == 1) {
throw new EdgeClosedException("SecureEdge has been closed.");
}
try {
SA.Send(data);
} catch(Exception e) {
throw new EdgeException(_closed == 1, "Unable to send on SE", e);
}
}
示例8: CopyFrom
public override void CopyFrom(ICopyable obj)
{
base.CopyFrom(obj);
if (obj is IStatusCode)
{
IStatusCode sc = (IStatusCode)obj;
Parts = new int[sc.Parts.Length];
sc.Parts.CopyTo(Parts, 0);
}
}
示例9: CopyFrom
public override void CopyFrom(ICopyable obj)
{
base.CopyFrom(obj);
if (obj is IGeographicLocation)
{
IGeographicLocation g = (IGeographicLocation)obj;
Latitude = g.Latitude;
Longitude = g.Longitude;
}
}
示例10: CopyFrom
public override void CopyFrom(ICopyable obj)
{
base.CopyFrom(obj);
IFreeBusyEntry fb = obj as IFreeBusyEntry;
if (fb != null)
{
Status = fb.Status;
}
}
示例11: CopyFrom
public override void CopyFrom(ICopyable obj)
{
base.CopyFrom(obj);
IOrganizer o = obj as IOrganizer;
if (o != null)
{
Value = o.Value;
}
}
示例12: DataPacket
public DataPacket(ICopyable packet) {
_update_icpacket = false;
_update_packet = false;
_icpacket = packet;
_packet = packet as MemBlock;
if(_packet == null) {
_update_packet = true;
}
}
示例13: Send
public void Send(ICopyable Data) {
byte[] data = new byte[Data.Length];
Data.CopyTo(data, 0);
MemBlock mdata = MemBlock.Reference(data);
for(int i = 0; i < _remove_n_ptypes; i++) {
MemBlock payload = mdata;
PType.Parse(mdata, out payload);
mdata = payload;
}
Receiver.HandleData(mdata, ReturnPath, State);
}
示例14: CopyFrom
public override void CopyFrom(ICopyable c)
{
base.CopyFrom(c);
ICalendarParameter p = c as ICalendarParameter;
if (p != null)
{
if (p.Values != null)
_Values = new List<string>(p.Values);
}
}
示例15: Copy
public virtual object Copy(ICopyable zone)
{
if (zone != null)
{
((CCAction) zone).m_nTag = m_nTag;
return zone;
}
else
{
return new CCAction(this);
}
}