本文整理汇总了C#中PortType类的典型用法代码示例。如果您正苦于以下问题:C# PortType类的具体用法?C# PortType怎么用?C# PortType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PortType类属于命名空间,在下文中一共展示了PortType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Port
public Port(ComponentBase parentFunclet, int x, int y, PortType pType)
{
area = new Rectangle(x, y, Config.PORT_D, Config.PORT_D);
this.pType = pType;
this.parentComponent = parentFunclet;
this.ComponentType = ComponentType.Port;
}
示例2: PortId
public PortId(string owningNode, int portIndex, PortType type)
: this()
{
this.OwningNode = owningNode;
this.PortIndex = portIndex;
this.PortType = type;
}
示例3: PortUtil
public PortUtil(string usbVid, string usbPid, string endpointId)
{
Int32 vid = Int32.Parse(usbVid, NumberStyles.HexNumber);
Int32 pid = Int32.Parse(usbPid, NumberStyles.HexNumber);
_usbFinder = new UsbDeviceFinder(vid, pid);
_endpointId = GetEndpointId(endpointId);
_portType = PortType.USB;
}
示例4: Create
public static IClientPort Create(PortType type)
{
switch (type)
{
case PortType.Serial: return new Implementation.Client.Serial();
default: throw new NotImplementedException();
}
}
示例5: dynPortModel
public dynPortModel(int index, PortType portType, dynNodeModel owner, string name)
{
Index = index;
IsConnected = false;
PortType = portType;
Owner = owner;
PortName = name;
}
示例6: Make
/// <summary>
/// Factory method to create a connector. Checks to make sure that the start and end ports are valid,
/// otherwise returns null.
/// </summary>
/// <param name="start">The port where the connector starts</param>
/// <param name="end">The port where the connector ends</param>
/// <param name="startIndex"></param>
/// <param name="endIndex"></param>
/// <param name="portType"></param>
/// <returns>The valid connector model or null if the connector is invalid</returns>
internal static ConnectorModel Make(WorkspaceModel workspaceModel, NodeModel start, NodeModel end, int startIndex, int endIndex, PortType portType)
{
if (workspaceModel != null && start != null && end != null && start != end && startIndex >= 0
&& endIndex >= 0 && start.OutPorts.Count > startIndex && end.InPorts.Count > endIndex )
{
return new ConnectorModel(workspaceModel, start, end, startIndex, endIndex, portType);
}
return null;
}
示例7: Make
/// <summary>
/// Factory method to create a connector. Checks to make sure that the start and end ports are valid,
/// otherwise returns null.
/// </summary>
/// <param name="start">The port where the connector starts</param>
/// <param name="end">The port where the connector ends</param>
/// <param name="startIndex"></param>
/// <param name="endIndex"></param>
/// <param name="portType"></param>
/// <returns>The valid connector model or null if the connector is invalid</returns>
public static ConnectorModel Make(NodeModel start, NodeModel end, int startIndex, int endIndex, PortType portType)
{
if (start != null && end != null && start != end && startIndex >= 0
&& endIndex >= 0 && start.OutPorts.Count > startIndex && end.InPorts.Count > endIndex )
{
return new ConnectorModel(start, end, startIndex, endIndex, portType);
}
return null;
}
示例8: Port
internal unsafe Port(UnsafeStructs.jack_client_t*jackClient, int index, Direction direction, PortType portType, string nameFormat)
{
if (nameFormat == null) {
nameFormat = "{type}{direction}_{index}";
}
_jackClient = jackClient;
Direction = direction;
Name = CreateName (nameFormat, index, direction, portType);
PortType = portType;
_port = RegisterPort (direction, portType);
}
示例9: ScheminPort
public ScheminPort(Stream stream, PortType type)
{
this.Type = type;
if (type == PortType.InputPort)
{
this.InputStream = new StreamReader(stream, Encoding.UTF8);
}
else
{
this.OutputStream = new StreamWriter(stream, Encoding.UTF8);
}
}
示例10: ConnectorModel
private ConnectorModel(WorkspaceModel workspaceModel, NodeModel start, NodeModel end, int startIndex, int endIndex, PortType portType)
{
this.workspaceModel = workspaceModel;
pStart = start.OutPorts[startIndex];
PortModel endPort = null;
if (portType == PortType.INPUT)
endPort = end.InPorts[endIndex];
pStart.Connect(this);
this.Connect(endPort);
}
示例11: ConnectorModel
private ConnectorModel(NodeModel start, NodeModel end, int startIndex, int endIndex, PortType portType)
{
//Stopwatch sw = new Stopwatch();
//sw.Start();
pStart = start.OutPorts[startIndex];
PortModel endPort = null;
if (portType == PortType.INPUT)
endPort = end.InPorts[endIndex];
pStart.Connect(this);
this.Connect(endPort);
//sw.Stop();
//Debug.WriteLine(string.Format("{0} elapsed for constructing connector.", sw.Elapsed));
}
示例12: BeginConnection
internal void BeginConnection(Guid nodeId, int portIndex, PortType portType)
{
int index = portIndex;
bool isInPort = portType == PortType.INPUT;
NodeModel node = _model.GetModelInternal(nodeId) as NodeModel;
PortModel portModel = isInPort ? node.InPorts[index] : node.OutPorts[index];
// Test if port already has a connection, if so grab it and begin connecting
// to somewhere else (we don't allow the grabbing of the start connector).
if (portModel.Connectors.Count > 0 && portModel.Connectors[0].Start != portModel)
{
// Define the new active connector
var c = new ConnectorViewModel(portModel.Connectors[0].Start);
this.SetActiveConnector(c);
// Disconnect the connector model from its start and end ports
// and remove it from the connectors collection. This will also
// remove the view model.
ConnectorModel connector = portModel.Connectors[0];
if (_model.Connectors.Contains(connector))
{
List<ModelBase> models = new List<ModelBase>();
models.Add(connector);
_model.RecordAndDeleteModels(models);
connector.NotifyConnectedPortsOfDeletion();
}
}
else
{
try
{
// Create a connector view model to begin drawing
var connector = new ConnectorViewModel(portModel);
this.SetActiveConnector(connector);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
}
}
}
示例13: GetPort
public static int GetPort(PortType portType)
{
var port = 0;
switch (portType)
{
case PortType.Level1:
port = 5009;
break;
case PortType.Lookup:
port = 9100;
break;
case PortType.Level2:
port = 9200;
break;
case PortType.Admin:
port = 9300;
break;
}
return port;
}
示例14: dynPort
public dynPort(int index, PortType portType, dynNodeUI owner, string name)
{
InitializeComponent();
Index = index;
this.MouseEnter += delegate { foreach (var c in connectors) c.Highlight(); };
this.MouseLeave += delegate { foreach (var c in connectors) c.Unhighlight(); };
IsConnected = false;
PortType = portType;
Owner = owner;
PortName = name;
portGrid.DataContext = this;
portNameTb.DataContext = this;
toolTipText.DataContext = this;
ellipse1Dot.DataContext = this;
ellipse1.DataContext = Owner;
portGrid.Loaded += new RoutedEventHandler(portGrid_Loaded);
}
示例15: MakeConnectionCommand
public MakeConnectionCommand(Guid nodeId, int portIndex, PortType portType, Mode mode)
{
NodeId = nodeId;
PortIndex = portIndex;
Type = portType;
ConnectionMode = mode;
}