本文整理汇总了C#中PortType类的典型用法代码示例。如果您正苦于以下问题:C# PortType类的具体用法?C# PortType怎么用?C# PortType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PortType类属于命名空间,在下文中一共展示了PortType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:huutruongqnvn,项目名称:vnecoo01,代码行数:7,代码来源:Port.cs
示例2: PortId
public PortId(string owningNode, int portIndex, PortType type)
: this()
{
this.OwningNode = owningNode;
this.PortIndex = portIndex;
this.PortType = type;
}
开发者ID:TheChosen0ne,项目名称:Dynamo,代码行数:7,代码来源:Migration.cs
示例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;
}
开发者ID:hpbaotho,项目名称:top4ever-pos,代码行数:8,代码来源:PortUtil.cs
示例4: Create
public static IClientPort Create(PortType type)
{
switch (type)
{
case PortType.Serial: return new Implementation.Client.Serial();
default: throw new NotImplementedException();
}
}
开发者ID:yobisoft,项目名称:yobisoft,代码行数:8,代码来源:ClientPort.cs
示例5: dynPortModel
public dynPortModel(int index, PortType portType, dynNodeModel owner, string name)
{
Index = index;
IsConnected = false;
PortType = portType;
Owner = owner;
PortName = name;
}
开发者ID:epeter61,项目名称:Dynamo,代码行数:8,代码来源:dynPortModel.cs
示例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;
}
开发者ID:whztt07,项目名称:Dynamo,代码行数:20,代码来源:ConnectorModel.cs
示例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;
}
开发者ID:algobasket,项目名称:Dynamo,代码行数:20,代码来源:ConnectorModel.cs
示例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);
}
开发者ID:residuum,项目名称:JackSharp,代码行数:11,代码来源:Port.cs
示例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);
}
}
开发者ID:imphasing,项目名称:schemin,代码行数:12,代码来源:ScheminPort.cs
示例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);
}
开发者ID:whztt07,项目名称:Dynamo,代码行数:14,代码来源:ConnectorModel.cs
示例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));
}
开发者ID:algobasket,项目名称:Dynamo,代码行数:16,代码来源:ConnectorModel.cs
示例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);
}
}
}
开发者ID:riteshchandawar,项目名称:Dynamo,代码行数:42,代码来源:StateMachine.cs
示例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;
}
开发者ID:AlexCatarino,项目名称:Lean,代码行数:20,代码来源:IQSocket.cs
示例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);
}
开发者ID:hippo811028,项目名称:Dynamo,代码行数:23,代码来源:dynPort.xaml.cs
示例15: MakeConnectionCommand
public MakeConnectionCommand(Guid nodeId, int portIndex, PortType portType, Mode mode)
{
NodeId = nodeId;
PortIndex = portIndex;
Type = portType;
ConnectionMode = mode;
}
开发者ID:heegwon,项目名称:Dynamo,代码行数:7,代码来源:RecordableCommands.cs
示例16: EndConnection
void EndConnection(Guid nodeId, int portIndex, PortType portType)
{
bool isInPort = portType == PortType.Input;
var node = CurrentWorkspace.GetModelInternal(nodeId) as NodeModel;
if (node == null)
return;
PortModel portModel = isInPort ? node.InPorts[portIndex] : node.OutPorts[portIndex];
ConnectorModel connectorToRemove = null;
// Remove connector if one already exists
if (portModel.Connectors.Count > 0 && portModel.PortType == PortType.Input)
{
connectorToRemove = portModel.Connectors[0];
connectorToRemove.Delete();
}
// We could either connect from an input port to an output port, or
// another way around (in which case we swap first and second ports).
PortModel firstPort, second;
if (portModel.PortType != PortType.Input)
{
firstPort = portModel;
second = activeStartPort;
}
else
{
// Create the new connector model
firstPort = activeStartPort;
second = portModel;
}
ConnectorModel newConnectorModel = ConnectorModel.Make(
firstPort.Owner,
second.Owner,
firstPort.Index,
second.Index);
// Record the creation of connector in the undo recorder.
var models = new Dictionary<ModelBase, UndoRedoRecorder.UserAction>();
if (connectorToRemove != null)
models.Add(connectorToRemove, UndoRedoRecorder.UserAction.Deletion);
models.Add(newConnectorModel, UndoRedoRecorder.UserAction.Creation);
WorkspaceModel.RecordModelsForUndo(models, CurrentWorkspace.UndoRecorder);
activeStartPort = null;
}
开发者ID:ivantcp,项目名称:Dynamo,代码行数:47,代码来源:DynamoModelCommands.cs
示例17: BeginConnection
void BeginConnection(Guid nodeId, int portIndex, PortType portType)
{
bool isInPort = portType == PortType.Input;
activeStartPort = null;
var node = CurrentWorkspace.GetModelInternal(nodeId) as NodeModel;
if (node == null)
return;
PortModel portModel = isInPort ? node.InPorts[portIndex] : node.OutPorts[portIndex];
// 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)
{
activeStartPort = portModel.Connectors[0].Start;
// 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 (CurrentWorkspace.Connectors.Contains(connector))
{
var models = new List<ModelBase> { connector };
CurrentWorkspace.RecordAndDeleteModels(models);
connector.Delete();
}
}
else
{
activeStartPort = portModel;
}
}
开发者ID:ivantcp,项目名称:Dynamo,代码行数:31,代码来源:DynamoModelCommands.cs
示例18: AddPort
/// <summary>
/// Add a port to this node. If the port already exists, return that port.
/// </summary>
/// <param name="portType"></param>
/// <param name="data"></param>
/// <param name="index"></param>
/// <returns></returns>
public PortModel AddPort(PortType portType, PortData data, int index)
{
PortModel p;
switch (portType)
{
case PortType.INPUT:
if (inPorts.Count > index)
{
p = inPorts[index];
//update the name on the node
//e.x. when the node is being re-registered during a custom
//node save
p.PortName = data.NickName;
if (data.HasDefaultValue)
{
p.UsingDefaultValue = true;
p.DefaultValueEnabled = true;
}
return p;
}
p = new PortModel(index, portType, this, data.NickName)
{
UsingDefaultValue = data.HasDefaultValue,
DefaultValueEnabled = data.HasDefaultValue
};
p.PropertyChanged += delegate(object sender, PropertyChangedEventArgs args)
{
if (args.PropertyName == "UsingDefaultValue")
RequiresRecalc = true;
};
InPorts.Add(p);
//register listeners on the port
p.PortConnected += p_PortConnected;
p.PortDisconnected += p_PortDisconnected;
return p;
case PortType.OUTPUT:
if (outPorts.Count > index)
{
p = outPorts[index];
p.PortName = data.NickName;
return p;
}
p = new PortModel(index, portType, this, data.NickName)
{
UsingDefaultValue = false
};
OutPorts.Add(p);
//register listeners on the port
p.PortConnected += p_PortConnected;
p.PortDisconnected += p_PortDisconnected;
return p;
}
return null;
}
开发者ID:riteshchandawar,项目名称:Dynamo,代码行数:74,代码来源:NodeModel.cs
示例19: GetPortIndex
internal int GetPortIndex(PortModel portModel, out PortType portType)
{
int index = this.inPorts.IndexOf(portModel);
if (-1 != index)
{
portType = PortType.INPUT;
return index;
}
index = this.outPorts.IndexOf(portModel);
if (-1 != index)
{
portType = PortType.OUTPUT;
return index;
}
portType = PortType.INPUT;
return -1; // No port found.
}
开发者ID:riteshchandawar,项目名称:Dynamo,代码行数:19,代码来源:NodeModel.cs
示例20: OperationCollection
internal OperationCollection (PortType portType)
: base (portType)
{
}
开发者ID:nobled,项目名称:mono,代码行数:4,代码来源:OperationCollection.cs
注:本文中的PortType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论