• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# PinState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中PinState的典型用法代码示例。如果您正苦于以下问题:C# PinState类的具体用法?C# PinState怎么用?C# PinState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PinState类属于命名空间,在下文中一共展示了PinState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Relay

 public Relay(IDigitalWriteRead _digitalWriteRead, int gpioPin)
 {
     this._gpioPin           = gpioPin;
     this._digitalWriteRead  = _digitalWriteRead;
     this._state             = PinState.Unknown;
     this.TurnOff();
 }
开发者ID:Tommy00,项目名称:Nusbio.Samples,代码行数:7,代码来源:Relay.cs


示例2: Initialize

		/// <summary>
		/// Initialize this instance with standard settings. 
		/// 9600:N:8:1, handshaking disabled.
		/// </summary>
		/// <param name="index">The port index - 1,2,...</param>
		public void Initialize(int index)
		{
			portName   = "COM" + index.ToString() + ":";
			baudRate   = LineSpeed.Baud_9600;
			txFlowCTS  = false;
			txFlowDSR  = false;
			dtrControl = PinState.Disable;
			rxDSRsense = false;
			txContinue = true;
			txFlowXoff = false;
			rxFlowXoff = false;
			errReplace = false;
			nulDiscard = false;
			rtsControl = PinState.Disable;
			abortOnErr = false;
			xonLimit   = 0;	// 0=OS managed
			xoffLimit  = 0; // 0=OS managed
			dataBits   = ByteSize.Eight;
			parity     = Parity.None;
			stopBits   = StopBits.One;
			xonChar    = (byte) CtrlChar.DC1;
			xoffChar   = (byte) CtrlChar.DC3;
			errChar    = (byte) '?';
			eofChar    = (byte) CtrlChar.SUB;
			evtChar    = (byte) CtrlChar.NULL;
			handshake  = Handshake.None;
			rxQueLen   = 0; // 0=OS managed
			txQueLen   = 0; // 0=OS managed
			txTmoMulti = 0;
			txTmoConst = 0;
			receiveMode = false;
			return;
		}
开发者ID:hydrayu,项目名称:imobile-src,代码行数:38,代码来源:SerialConfig.cs


示例3: Arduino_DigitalPinUpdated

        private void Arduino_DigitalPinUpdated(byte pin, PinState pinValue)
        {
            //Debug.WriteLine("IOConnector.Arduino_DigitalPinUpdated");
            arduinoAlive = true;

            MachineStates state = MachineStates.UNDEFINED;
            switch (pin)
            {
                case STARTUP_PIN:
                    state = MachineStates.STARTUP;
                    break;
                case MANUAL_PIN:
                    state = MachineStates.MANUAL;
                    break;
                case LATCH_PIN:
                    state = MachineStates.LATCH;
                    break;
                case SPLIT_PIN:
                    state = MachineStates.SPLIT;
                    break;
            }
            
            if (pinValue == PinState.HIGH)
                machine.updateState(state, false);
            else
                machine.updateState(state, true);
        }
开发者ID:s114898,项目名称:TSS_program,代码行数:27,代码来源:IOConnector.cs


示例4: setup

        private void setup()
        {
            //Set the initial state of the led.
            ledState = PinState.LOW;

            //Set the pin mode of the led.
            arduino.pinMode(LED_PIN, PinMode.OUTPUT);

            //Set the timer to schedule blink() every one second.
            blinkTimer = new DispatcherTimer();
            blinkTimer.Interval = TimeSpan.FromMilliseconds(1000);
            blinkTimer.Tick += blink;
            blinkTimer.Start();
        }
开发者ID:DFRobot,项目名称:DFRobotWindowsIoTTempelate,代码行数:14,代码来源:MainPage.xaml.cs


示例5: MainPage

        public MainPage()
        {
            this.InitializeComponent();

            arduino = App.Arduino;
            App.Telemetry.TrackEvent( "RemoteBlinky_Windows10_SuccessfullyConnected" );

            App.Arduino.DeviceConnectionLost += Arduino_OnDeviceConnectionLost;

            currentState = PinState.LOW;
            OnButton.IsEnabled = true;
            OffButton.IsEnabled = true;
            BlinkButton.IsEnabled = true;
        }
开发者ID:Robotmad,项目名称:windows-remote-arduino-samples,代码行数:14,代码来源:MainPage.xaml.cs


示例6: blink

 private void blink(object sender, object e)
 {
     if (ledState == PinState.HIGH)  //LED state is HIGH.
     {
         //Turn off the LED.
         arduino.digitalWrite(LED_PIN, PinState.LOW);
         //Show the message in the Output dialog.
         Debug.WriteLine("OFF");
         //Set local LED state to Low.
         ledState = PinState.LOW;
     }
     else    //LED state is LOW.
     {
         //Turn on the LED.
         arduino.digitalWrite(LED_PIN, PinState.HIGH);
         //Show the message in the Output dialog.
         Debug.WriteLine("ON");
         //Set local LED state to Low.
         ledState = PinState.HIGH;
     }
 }
开发者ID:DFRobot,项目名称:DFRobotWindowsIoTTempelate,代码行数:21,代码来源:MainPage.xaml.cs


示例7: SetHeatingPin

 static void SetHeatingPin(PinState state)
 {
     GPIOMem heatingPin = new GPIOMem(GPIOPins.GPIO_14);
     heatingPin.PinDirection = GPIODirection.Out;
     heatingPin.Write(state);
 }
开发者ID:jrnijboer,项目名称:ThermAtHome,代码行数:6,代码来源:Program.cs


示例8: SetupOverlappedMultiple

        // Sets up an Overlapped object with with multiple buffers pinned.
        unsafe private void SetupOverlappedMultiple()
        {
            ArraySegment<byte>[] tempList = new ArraySegment<byte>[_bufferList.Count];
            _bufferList.CopyTo(tempList, 0);

            // Number of things to pin is number of buffers.
            // Ensure we have properly sized object array.
            if (_objectsToPin == null || (_objectsToPin.Length != tempList.Length))
            {
                _objectsToPin = new object[tempList.Length];
            }

            // Fill in object array.
            for (int i = 0; i < (tempList.Length); i++)
            {
                _objectsToPin[i] = tempList[i].Array;
            }

            if (_wsaBufferArray == null || _wsaBufferArray.Length != tempList.Length)
            {
                _wsaBufferArray = new WSABuffer[tempList.Length];
            }

            // Pin buffers and fill in WSABuffer descriptor pointers and lengths.
            _preAllocatedOverlapped = new PreAllocatedOverlapped(CompletionPortCallback, this, _objectsToPin);
            if (GlobalLog.IsEnabled)
            {
                GlobalLog.Print(
                    "SocketAsyncEventArgs#" + LoggingHash.HashString(this) + "::SetupOverlappedMultiple: new PreAllocatedOverlapped." +
                    LoggingHash.HashString(_preAllocatedOverlapped));
            }

            for (int i = 0; i < tempList.Length; i++)
            {
                ArraySegment<byte> localCopy = tempList[i];
                RangeValidationHelpers.ValidateSegment(localCopy);
                _wsaBufferArray[i].Pointer = Marshal.UnsafeAddrOfPinnedArrayElement(localCopy.Array, localCopy.Offset);
                _wsaBufferArray[i].Length = localCopy.Count;
            }
            _pinState = PinState.MultipleBuffer;
        }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:42,代码来源:SocketAsyncEventArgs.Windows.cs


示例9: FreeOverlapped

        // Cleans up any existing Overlapped object and related state variables.
        private void FreeOverlapped(bool checkForShutdown)
        {
            if (!checkForShutdown || !Environment.HasShutdownStarted)
            {
                // Free the overlapped object.
                if (_ptrNativeOverlapped != null && !_ptrNativeOverlapped.IsInvalid)
                {
                    _ptrNativeOverlapped.Dispose();
                    _ptrNativeOverlapped = null;
                }

                // Free the preallocated overlapped object. This in turn will unpin
                // any pinned buffers.
                if (_preAllocatedOverlapped != null)
                {
                    _preAllocatedOverlapped.Dispose();
                    _preAllocatedOverlapped = null;

                    _pinState = PinState.None;
                    _pinnedAcceptBuffer = null;
                    _pinnedSingleBuffer = null;
                    _pinnedSingleBufferOffset = 0;
                    _pinnedSingleBufferCount = 0;
                }

                // Free any allocated GCHandles.
                if (_socketAddressGCHandle.IsAllocated)
                {
                    _socketAddressGCHandle.Free();
                    _pinnedSocketAddress = null;
                }

                if (_wsaMessageBufferGCHandle.IsAllocated)
                {
                    _wsaMessageBufferGCHandle.Free();
                    _ptrWSAMessageBuffer = IntPtr.Zero;
                }

                if (_wsaRecvMsgWSABufferArrayGCHandle.IsAllocated)
                {
                    _wsaRecvMsgWSABufferArrayGCHandle.Free();
                    _ptrWSARecvMsgWSABufferArray = IntPtr.Zero;
                }

                if (_controlBufferGCHandle.IsAllocated)
                {
                    _controlBufferGCHandle.Free();
                    _ptrControlBuffer = IntPtr.Zero;
                }
            }
        }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:52,代码来源:SocketAsyncEventArgs.Windows.cs


示例10: GpioFile

		/// <summary>
		/// Initializes a new instance of the <see cref="CyrusBuilt.MonoPi.IO.GpioFile"/>
		/// class with the Rev1 pin to access, the I/O direction, and the initial value.
		/// </summary>
		/// <param name="pin">
		/// The pin on the board to access.
		/// </param>
		/// <param name="mode">
		/// The I/0 mode of the pin.
		/// </param>
		/// <param name="initialValue">
		/// The pin's initial value.
		/// </param>
		public GpioFile(GpioPins pin, PinMode mode, PinState initialValue)
			: base(pin, mode, initialValue) {
		}
开发者ID:cyrusbuilt,项目名称:MonoPi,代码行数:16,代码来源:GpioFile.cs


示例11: Write

		/// <summary>
		/// Writes the specified value to the specified GPIO pin.
		/// </summary>
		/// <param name="pin">
		/// The pin to write the value to.
		/// </param>
		/// <param name="value">
		/// The value to write to the pin.
		/// </param>
		public static void Write(GpioPins pin, PinState value) {
			String num = GetGpioPinNumber(pin);
			String name = Enum.GetName(typeof(GpioPins), pin);
			internal_Write((Int32)pin, value, num, name);
		}
开发者ID:cyrusbuilt,项目名称:MonoPi,代码行数:14,代码来源:GpioFile.cs


示例12: Write

 /// <summary>
 /// Write a value to the pin
 /// </summary>
 /// <param name="value">The value to write to the pin</param>
 public void Write(PinState value)
 {
     Write(value == PinState.High);
 }
开发者ID:JohnRuddy,项目名称:RaspberryPi.Net,代码行数:8,代码来源:GPIOFile.cs


示例13: SetupOverlappedMultiple

 private void SetupOverlappedMultiple()
 {
     this.m_Overlapped = new Overlapped();
     ArraySegment<byte>[] array = new ArraySegment<byte>[this.m_BufferList.Count];
     this.m_BufferList.CopyTo(array, 0);
     if ((this.m_ObjectsToPin == null) || (this.m_ObjectsToPin.Length != array.Length))
     {
         this.m_ObjectsToPin = new object[array.Length];
     }
     for (int i = 0; i < array.Length; i++)
     {
         this.m_ObjectsToPin[i] = array[i].Array;
     }
     if ((this.m_WSABufferArray == null) || (this.m_WSABufferArray.Length != array.Length))
     {
         this.m_WSABufferArray = new WSABuffer[array.Length];
     }
     this.m_PtrNativeOverlapped = new SafeNativeOverlapped(this.m_Overlapped.UnsafePack(new IOCompletionCallback(this.CompletionPortCallback), this.m_ObjectsToPin));
     for (int j = 0; j < array.Length; j++)
     {
         ArraySegment<byte> segment = array[j];
         ValidationHelper.ValidateSegment(segment);
         this.m_WSABufferArray[j].Pointer = Marshal.UnsafeAddrOfPinnedArrayElement(segment.Array, segment.Offset);
         this.m_WSABufferArray[j].Length = segment.Count;
     }
     this.m_PinState = PinState.MultipleBuffer;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:SocketAsyncEventArgs.cs


示例14: FreeOverlapped

 private void FreeOverlapped(bool checkForShutdown)
 {
     if (!checkForShutdown || !NclUtilities.HasShutdownStarted)
     {
         if ((this.m_PtrNativeOverlapped != null) && !this.m_PtrNativeOverlapped.IsInvalid)
         {
             this.m_PtrNativeOverlapped.Dispose();
             this.m_PtrNativeOverlapped = null;
             this.m_Overlapped = null;
             this.m_PinState = PinState.None;
             this.m_PinnedAcceptBuffer = null;
             this.m_PinnedSingleBuffer = null;
             this.m_PinnedSingleBufferOffset = 0;
             this.m_PinnedSingleBufferCount = 0;
         }
         if (this.m_SocketAddressGCHandle.IsAllocated)
         {
             this.m_SocketAddressGCHandle.Free();
         }
         if (this.m_WSAMessageBufferGCHandle.IsAllocated)
         {
             this.m_WSAMessageBufferGCHandle.Free();
         }
         if (this.m_WSARecvMsgWSABufferArrayGCHandle.IsAllocated)
         {
             this.m_WSARecvMsgWSABufferArrayGCHandle.Free();
         }
         if (this.m_ControlBufferGCHandle.IsAllocated)
         {
             this.m_ControlBufferGCHandle.Free();
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:33,代码来源:SocketAsyncEventArgs.cs


示例15: Arduino_OnDigitalPinUpdated

 /// <summary>
 /// This function is called when the Windows Remote Arduino library reports that an input value has changed for a digital pin.
 /// </summary>
 /// <param name="pin">The pin whose value has changed</param>
 /// <param name="state">the new state of the pin, either HIGH or LOW</param>
 private void Arduino_OnDigitalPinUpdated( byte pin, PinState state )
 {
     //we must dispatch the change to the UI thread to change the indicator image
     var action = Dispatcher.RunAsync( Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler( () =>
     {
         UpdateDigitalPinIndicators( pin );
     } ) );
 }
开发者ID:turkycat,项目名称:remote-wiring-experience,代码行数:13,代码来源:MainPage.xaml.cs


示例16: SetupOverlappedSendPackets

        // Method to setup an Overlapped object for SendPacketsAsync.        
        unsafe private void SetupOverlappedSendPackets() {

            int index;

            // Alloc new Overlapped.
            m_Overlapped = new Overlapped();

            // Alloc native descriptor.
            m_SendPacketsDescriptor = 
                new UnsafeNclNativeMethods.OSSOCK.TransmitPacketsElement[m_SendPacketsElementsFileCount + m_SendPacketsElementsBufferCount];

            // Number of things to pin is number of buffers + 1 (native descriptor).
            // Ensure we have properly sized object array.
            if(m_ObjectsToPin == null || (m_ObjectsToPin.Length != m_SendPacketsElementsBufferCount + 1)) {
                m_ObjectsToPin = new object[m_SendPacketsElementsBufferCount + 1];
            }

            // Fill in objects to pin array. Native descriptor buffer first and then user specified buffers.
            m_ObjectsToPin[0] = m_SendPacketsDescriptor;
            index = 1;
            foreach(SendPacketsElement spe in m_SendPacketsElementsInternal) {                
                if(spe != null && spe.m_Buffer != null && spe.m_Count > 0) {
                    m_ObjectsToPin[index] = spe.m_Buffer;
                    index++;
                }
            }

            // Pin buffers
#if SOCKETTHREADPOOL
            m_Overlapped.AsyncResult = new DummyAsyncResult(CompletionPortCallback);
            m_PtrNativeOverlapped = new SafeNativeOverlapped(m_Overlapped.UnsafePack(null, m_ObjectsToPin));
#else
            m_PtrNativeOverlapped = new SafeNativeOverlapped(m_Overlapped.UnsafePack(CompletionPortCallback, m_ObjectsToPin));
#endif

            // Get pointer to native descriptor.
            m_PtrSendPacketsDescriptor = Marshal.UnsafeAddrOfPinnedArrayElement(m_SendPacketsDescriptor, 0);
            
            // Fill in native descriptor.
            int descriptorIndex = 0;
            int fileIndex = 0;
            foreach(SendPacketsElement spe in m_SendPacketsElementsInternal) {
                if (spe != null) {
                    if(spe.m_Buffer != null && spe.m_Count > 0) {
                        // a buffer
                        m_SendPacketsDescriptor[descriptorIndex].buffer = Marshal.UnsafeAddrOfPinnedArrayElement(spe.m_Buffer, spe.m_Offset);
                        m_SendPacketsDescriptor[descriptorIndex].length = (uint)spe.m_Count;
                        m_SendPacketsDescriptor[descriptorIndex].flags = spe.m_Flags;
                        descriptorIndex++;
                    } else if (spe.m_FilePath != null) {
                        // a file
                        m_SendPacketsDescriptor[descriptorIndex].fileHandle = m_SendPacketsFileHandles[fileIndex].DangerousGetHandle();
                        m_SendPacketsDescriptor[descriptorIndex].fileOffset = spe.m_Offset;
                        m_SendPacketsDescriptor[descriptorIndex].length = (uint)spe.m_Count;
                        m_SendPacketsDescriptor[descriptorIndex].flags = spe.m_Flags;
                        fileIndex++;
                        descriptorIndex++;
                    }
                }
            }

            m_PinState = PinState.SendPackets;
        }
开发者ID:REALTOBIZ,项目名称:mono,代码行数:64,代码来源:Socket.cs


示例17: SetPinState

		/// <summary>
		/// Sets the state of the specified pin.
		/// </summary>
		/// <param name="pin">
		/// The pin to alter.
		/// </param>
		/// <param name="state">
		/// The state of the pin to set.
		/// </param>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="pin"/> cannot be null.
		/// </exception>
		/// <exception cref="ObjectDisposedException">
		/// This instance has been disposed and can no longer be used.
		/// </exception>
		/// <exception cref="ArgumentException">
		/// The specified pin does not exist in the pin cache.
		/// </exception>
		/// <exception cref="System.IO.IOException">
		/// Failed to write the new state to the device.
		/// </exception>
		public void SetPinState(IPCF8574Pin pin, PinState state) {
			if (pin == null) {
				throw new ArgumentNullException("pin");
			}

			if (this._isDisposed) {
				throw new ObjectDisposedException("CyrusBuilt.MonoPi.IO.PCF.PCF8574GpioProvider");
			}

			if (!this._pinCache.Contains(pin)) {
				throw new ArgumentException("Cannot set the state of a pin that does not exist in the pin cache.", "pin");
			}

			// We only do this if the state is actually changing.
			PinState cstate = this._pinCache[this._pinCache.IndexOf(pin)].State;
			if (cstate != state) {
				Byte stateVal = this._currentStates.Empty ? (Byte)0 : this._currentStates.ToByteArray()[0];
				this._currentStates.Set(pin.Address, (state == PinState.High));
				this._device.WriteByte(this._busAddress, stateVal);
				this.OnPinStateChanged(new PinStateChangeEventArgs(pin.Address, cstate, state));
			}
		}
开发者ID:cyrusbuilt,项目名称:MonoPi,代码行数:43,代码来源:PCF8574GpioProvider.cs


示例18: SetupOverlappedSendPackets

 private void SetupOverlappedSendPackets()
 {
     this.m_Overlapped = new Overlapped();
     this.m_SendPacketsDescriptor = new UnsafeNclNativeMethods.OSSOCK.TransmitPacketsElement[this.m_SendPacketsElementsFileCount + this.m_SendPacketsElementsBufferCount];
     if ((this.m_ObjectsToPin == null) || (this.m_ObjectsToPin.Length != (this.m_SendPacketsElementsBufferCount + 1)))
     {
         this.m_ObjectsToPin = new object[this.m_SendPacketsElementsBufferCount + 1];
     }
     this.m_ObjectsToPin[0] = this.m_SendPacketsDescriptor;
     int index = 1;
     foreach (SendPacketsElement element in this.m_SendPacketsElementsInternal)
     {
         if ((element.m_Buffer != null) && (element.m_Count > 0))
         {
             this.m_ObjectsToPin[index] = element.m_Buffer;
             index++;
         }
     }
     this.m_PtrNativeOverlapped = new SafeNativeOverlapped(this.m_Overlapped.UnsafePack(new IOCompletionCallback(this.CompletionPortCallback), this.m_ObjectsToPin));
     this.m_PtrSendPacketsDescriptor = Marshal.UnsafeAddrOfPinnedArrayElement(this.m_SendPacketsDescriptor, 0);
     int num2 = 0;
     int num3 = 0;
     foreach (SendPacketsElement element2 in this.m_SendPacketsElementsInternal)
     {
         if (element2 != null)
         {
             if ((element2.m_Buffer != null) && (element2.m_Count > 0))
             {
                 this.m_SendPacketsDescriptor[num2].buffer = Marshal.UnsafeAddrOfPinnedArrayElement(element2.m_Buffer, element2.m_Offset);
                 this.m_SendPacketsDescriptor[num2].length = (uint) element2.m_Count;
                 this.m_SendPacketsDescriptor[num2].flags = element2.m_Flags;
                 num2++;
             }
             else if ((element2.m_FilePath != null) && (element2.m_FilePath.Length != 0))
             {
                 this.m_SendPacketsDescriptor[num2].fileHandle = this.m_SendPacketsFileHandles[num3].DangerousGetHandle();
                 this.m_SendPacketsDescriptor[num2].fileOffset = element2.m_Offset;
                 this.m_SendPacketsDescriptor[num2].length = (uint) element2.m_Count;
                 this.m_SendPacketsDescriptor[num2].flags = element2.m_Flags;
                 num3++;
                 num2++;
             }
         }
     }
     this.m_PinState = PinState.SendPackets;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:46,代码来源:SocketAsyncEventArgs.cs


示例19: internal_Write

		/// <summary>
		/// Writes the specified value to the specified GPIO pin.
		/// </summary>
		/// <param name="pin">
		/// The pin to write the value to.
		/// </param>
		/// <param name="value">
		/// The value to write to the pin.
		/// </param>
		/// <param name="gpionum">
		/// The GPIO number associated with the pin.
		/// </param>
		/// <param name="pinname">
		/// The name of the pin.
		/// </param>
		private static void internal_Write(Int32 pin, PinState value, String gpionum, String pinname) {
			// GPIO_NONE is the same value for both Rev1 and Rev2 boards.
			if (pin == (Int32)GpioPins.GPIO_NONE) {
				return;
			}

			internal_ExportPin(pin, PinMode.OUT, gpionum, pinname);
			String val = ((Int32)value).ToString();
			String path = GPIO_PATH + "gpio" + gpionum + "/value";

			File.WriteAllText(path, val);
			Debug.WriteLine("Output to pin " + pinname + "/gpio" + pin.ToString() + ", value was " + val);
		}
开发者ID:cyrusbuilt,项目名称:MonoPi,代码行数:28,代码来源:GpioFile.cs


示例20: SetupOverlappedSingle

 private void SetupOverlappedSingle(bool pinSingleBuffer)
 {
     this.m_Overlapped = new Overlapped();
     if (pinSingleBuffer)
     {
         if (this.m_Buffer != null)
         {
             this.m_PtrNativeOverlapped = new SafeNativeOverlapped(this.m_Overlapped.UnsafePack(new IOCompletionCallback(this.CompletionPortCallback), this.m_Buffer));
             this.m_PinnedSingleBuffer = this.m_Buffer;
             this.m_PinnedSingleBufferOffset = this.m_Offset;
             this.m_PinnedSingleBufferCount = this.m_Count;
             this.m_PtrSingleBuffer = Marshal.UnsafeAddrOfPinnedArrayElement(this.m_Buffer, this.m_Offset);
             this.m_PtrAcceptBuffer = IntPtr.Zero;
             this.m_WSABuffer.Pointer = this.m_PtrSingleBuffer;
             this.m_WSABuffer.Length = this.m_Count;
             this.m_PinState = PinState.SingleBuffer;
         }
         else
         {
             this.m_PtrNativeOverlapped = new SafeNativeOverlapped(this.m_Overlapped.UnsafePack(new IOCompletionCallback(this.CompletionPortCallback), null));
             this.m_PinnedSingleBuffer = null;
             this.m_PinnedSingleBufferOffset = 0;
             this.m_PinnedSingleBufferCount = 0;
             this.m_PtrSingleBuffer = IntPtr.Zero;
             this.m_PtrAcceptBuffer = IntPtr.Zero;
             this.m_WSABuffer.Pointer = this.m_PtrSingleBuffer;
             this.m_WSABuffer.Length = this.m_Count;
             this.m_PinState = PinState.NoBuffer;
         }
     }
     else
     {
         this.m_PtrNativeOverlapped = new SafeNativeOverlapped(this.m_Overlapped.UnsafePack(new IOCompletionCallback(this.CompletionPortCallback), this.m_AcceptBuffer));
         this.m_PinnedAcceptBuffer = this.m_AcceptBuffer;
         this.m_PtrAcceptBuffer = Marshal.UnsafeAddrOfPinnedArrayElement(this.m_AcceptBuffer, 0);
         this.m_PtrSingleBuffer = IntPtr.Zero;
         this.m_PinState = PinState.SingleAcceptBuffer;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:39,代码来源:SocketAsyncEventArgs.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Ping类代码示例发布时间:2022-05-24
下一篇:
C# Pin类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap