当前位置: 首页>>代码示例>>C#>>正文


C# PortType类代码示例

本文整理汇总了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;
 }
开发者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


注:本文中的PortType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。