- dsgrapheditdemo.zip
- DaggerLib.dll
- DaggerLib.DSGraphEdit.dll
- DaggerLib.UI.Windows.dll
- DirectShowLib-2005.dll
- DSGraphEdit.exe
- MediaFoundation.dll
- WeifenLuo.WinFormsUI.Docking.dll
- dsgrapheditsrc.zip
- DaggerLib.DSGraphEdit
- DaggerLib.UI.Windows
- DaggerLib
- DSGraphEdit.sln
- DSGraphEdit
|
using System;
using System.Collections.Generic;
using System.Text;
using DaggerLib.UI;
using System.Runtime.Serialization;
namespace DaggerLib.Core
{
[Serializable]
public class DaggerTypeConstantNode : DaggerNode, ISerializable
{
public DaggerInputPin inpin;
public DaggerOutputPin outpin;
public Type DataType = typeof(object);
public DaggerTypeConstantNode(Type constantType)
{
inpin = new DaggerInputPin();
inpin.DataType = constantType;
inpin.Name = "Constant Input";
InputPins.Add(inpin);
outpin = new DaggerOutputPin();
outpin.DataType = constantType;
OutputPins.Add(outpin);
AssociatedUINode = typeof(TypeConstantNodeUI);
DoProcessing += new ProcessHandler(DaggerTypeConstantNode_DoProcessing);
}
/// <summary>
/// Deserialization Constructor
/// </summary>
/// <param name="info"></param>
/// <param name="ctxt"></param>
protected DaggerTypeConstantNode(SerializationInfo info, StreamingContext ctxt)
: base(info, ctxt)
{
if (info == null)
throw new System.ArgumentNullException("info");
DataType = (Type)info.GetValue("DataType", typeof(Type));
inpin = (DaggerInputPin)info.GetValue("InPin", typeof(DaggerInputPin));
InputPins.Add(inpin);
outpin = (DaggerOutputPin)info.GetValue("OutPin", typeof(DaggerOutputPin));
OutputPins.Add(outpin);
AssociatedUINode = typeof(TypeConstantNodeUI);
DoProcessing += new ProcessHandler(DaggerTypeConstantNode_DoProcessing);
}
void DaggerTypeConstantNode_DoProcessing(object sender)
{
if (inpin.Data != null)
{
outpin.Data = inpin.Data;
//if we have a UI node assigned, set the GenericValueEditor to the incomming value
if (UINode != null)
{
(UINode as TypeConstantNodeUI).genericValueEditor.Value = inpin.Data;
}
}
}
#region ISerializable
//Serialization
public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
{
info.AddValue("DataType", DataType);
//Serialize our two pins
info.AddValue("InPin", inpin);
info.AddValue("OutPin", outpin);
//Do the base's Serialization
base.GetObjectData(info, ctxt);
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
AKA Rich Insley.
I have over 25 years experience in programming, and I'm completely self taught. (Except for one year at California State University Fresno where I had to learn the God awful language Miranda (http://miranda.org.uk/). I've spent 10 years as a Paratrooper in the US Army during the Clinton Administration.