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


C# FrameType类代码示例

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


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

示例1: Encode

        public static ByteBuffer Encode(FrameType type, ushort channel, Transfer transfer,
            ByteBuffer payload, int maxFrameSize, out int payloadSize)
        {
            int bufferSize = cmdBufferSize + payload.Length;
            if (bufferSize > maxFrameSize)
            {
                bufferSize = maxFrameSize;
            }

            bool more = false;   // estimate it first
            if (payload.Length > bufferSize - 32)
            {
                transfer.More = more = true;
            }

            ByteBuffer buffer = new ByteBuffer(bufferSize, false);
            EncodeFrame(buffer, type, channel, transfer);

            if (more && payload.Length <= buffer.Size)
            {
                // guessed it wrong. correct it
                transfer.More = false;
                buffer.Reset();
                EncodeFrame(buffer, type, channel, transfer);
            }

            payloadSize = Math.Min(payload.Length, buffer.Size);
            AmqpBitConverter.WriteBytes(buffer, payload.Buffer, payload.Offset, payloadSize);
            payload.Complete(payloadSize);
            AmqpBitConverter.WriteInt(buffer.Buffer, 0, buffer.Length);
            return buffer;
        }
开发者ID:rajeshganesh,项目名称:amqpnetlite,代码行数:32,代码来源:Frame.cs

示例2: Frame

 internal Frame(FrameType frameType)
 {
     Shiny = false;
     EncounterMod = EncounterMod.None;
     Offset = 0;
     FrameType = frameType;
 }
开发者ID:Slashmolder,项目名称:RNGReporter,代码行数:7,代码来源:Frame.cs

示例3: Create

        public static Frame Create (FrameType frameType)
        {
            switch (frameType) {
            case FrameType.Data:
                return new DataFrame ();
            case FrameType.Headers:
                return new HeadersFrame ();
            case FrameType.Priority:
                return new PriorityFrame ();
            case FrameType.RstStream:
                return new RstStreamFrame ();
            case FrameType.Settings:
                return new SettingsFrame ();
            case FrameType.PushPromise:
                return new PushPromiseFrame ();
            case FrameType.Ping:
                return new PingFrame ();
            case FrameType.GoAway:
                return new GoAwayFrame ();
            case FrameType.WindowUpdate:
                return new WindowUpdateFrame ();
            case FrameType.Continuation:
                return new ContinuationFrame ();
            }

            return null;
        }
开发者ID:GlanceTech,项目名称:HttpTwo,代码行数:27,代码来源:Frame.cs

示例4: FrameData

        private static byte[] FrameData(byte[] payload, FrameType frameType)
        {
            using (var memoryStream = new MemoryStream())
            {
                var op = (byte) ((byte) frameType + 128);

                memoryStream.WriteByte(op);

                if (payload.Length > UInt16.MaxValue)
                {
                    memoryStream.WriteByte(127);
                    var lengthBytes = payload.Length.ToBigEndianBytes<ulong>();
                    memoryStream.Write(lengthBytes, 0, lengthBytes.Length);
                }
                else if (payload.Length > 125)
                {
                    memoryStream.WriteByte(126);
                    var lengthBytes = payload.Length.ToBigEndianBytes<ushort>();
                    memoryStream.Write(lengthBytes, 0, lengthBytes.Length);
                }
                else
                {
                    memoryStream.WriteByte((byte) payload.Length);
                }

                memoryStream.Write(payload, 0, payload.Length);

                return memoryStream.ToArray();
            }
        }
开发者ID:ReactiveMarkets,项目名称:Styx,代码行数:30,代码来源:Hybi13Handler.cs

示例5: Frame

 public Frame(FrameType frameType)
 {
     VerifyConstructorCall (this);
     #pragma warning disable 618
     Type = frameType;
     #pragma warning restore 618
 }
开发者ID:antmicro,项目名称:xwt,代码行数:7,代码来源:Frame.cs

示例6: CombSpare

 //Correct spares from GUI input (slashes input as -1)
 public void CombSpare()
 {
     if(scores[1] == -1) {
         scores[1] = 10 - scores[0];
         type = FrameType.spare;
     }
 }
开发者ID:Arkaniad,项目名称:Bowling,代码行数:8,代码来源:Frame.cs

示例7: CreateTextFrame

        public GuideFrame CreateTextFrame(Mode mode, FrameType type )
        {
            Bounds newBounds = contentBounds.Clone();
            newBounds.top = GetNextTop();
            newBounds.height = 10;

            TextFrame textFrame = page.TextFrames.Add(miss, idLocationOptions.idAtEnd, miss);
            textFrame.GeometricBounds = newBounds.raw;
            textFrame.TextFramePreferences.FirstBaselineOffset = idFirstBaseline.idLeadingOffset;

            if (mode==Mode.TwoColumns)
            {
                textFrame.TextFramePreferences.TextColumnCount = 2;
            }

            //$.global.textFrames.push( myTextFrame );

            GuideFrame frame = new GuideFrame(textFrame, this.guide, this, mode, type);
            frame.bounds = newBounds;

            //currentFrame = frame;
            frames.Add(frame);

            //currentMode = mode;

            return frame;
        }
开发者ID:jonnermut,项目名称:thesarvo,代码行数:27,代码来源:GuidePage.cs

示例8: Name

 public static String Name(FrameType type, CelestialBody selected) {
  switch (type) {
    case FrameType.BODY_CENTRED_NON_ROTATING:
      return selected.name + "-Centred Inertial";
    case FrameType.BARYCENTRIC_ROTATING:
       if (selected.is_root()) {
         throw Log.Fatal("Naming barycentric rotating frame of root body");
       } else {
         return selected.referenceBody.name + "-" + selected.name +
                " Barycentric";
       }
    case FrameType.BODY_CENTRED_PARENT_DIRECTION:
       if (selected.is_root()) {
         throw Log.Fatal(
             "Naming parent-direction rotating frame of root body");
       } else {
         // TODO(egg): find a proper name...
         return selected.name + "-Centred " + selected.referenceBody.name +
                "-Fixed";
       }
    case FrameType.BODY_SURFACE:
      return selected.name + "-Centred " + selected.name + "-Fixed";
    default:
      throw Log.Fatal("Unexpected type " + type.ToString());
  }
 }
开发者ID:pleroy,项目名称:Principia,代码行数:26,代码来源:reference_frame_selector.cs

示例9: ProcessFrame

        public static void ProcessFrame(FrameType frameType, byte[] data, Action<string> onMessage, Fleck2Extensions.Action onClose, Action<byte[]> onBinary)
        {
            switch (frameType)
            {
            case FrameType.Close:
                if (data.Length == 1 || data.Length>125)
                    throw new WebSocketException(WebSocketStatusCodes.ProtocolError);

                if (data.Length >= 2)
                {
                    var closeCode = (ushort) (data.Take(2).ToArray().ToLittleEndianInt());
                    if (!WebSocketStatusCodes.Contains(closeCode) && (closeCode < 3000 || closeCode > 4999))
                        throw new WebSocketException(WebSocketStatusCodes.ProtocolError);
                }

                if (data.Length > 2)
                    ReadUtf8PayloadData(data.Skip(2));

                onClose();
                break;
            case FrameType.Binary:
                onBinary(data);
                break;
            case FrameType.Text:
                onMessage(ReadUtf8PayloadData(data));
                break;
            default:
                FleckLog.Debug("Received unhandled " + frameType);
                break;
            }
        }
开发者ID:peters,项目名称:Fleck2,代码行数:31,代码来源:Hybi13Handler.cs

示例10: _drawFrame

        private static void _drawFrame(int x, int y, int width, int height, FrameType frameType, bool isFilled, string caption, Color captionColor = Color.White, Color captionBackColor = Color.Black)
        {
            var charSet = frameCharSets[(int) _validate(frameType)];

            ZOutput.Print(x, y, charSet[0].ToString().PadRight(width-1, charSet[1]) + charSet[2]);

            var fill = charSet[3].ToString().PadRight(width - 1, ' ') + charSet[4];
            for (var i = 1; i < height-1; i++)
            {
                if (isFilled)
                {
                    ZOutput.Print(x, y+i, fill);
                }
                else
                {
                    ZOutput.Print(x, y+i, charSet[3]);
                    ZOutput.Print(x+width-1, y+i, charSet[4]);
                }
            }

            ZOutput.Print(x, y+height-1, charSet[5].ToString().PadRight(width-1, charSet[6]) + charSet[7]);

            if (!string.IsNullOrEmpty(caption))
            {
                ZOutput.Print(x + 2, y, " " + caption + " ", captionColor, captionBackColor);
            }
        }
开发者ID:ZeroByte1987,项目名称:ConsoleGames,代码行数:27,代码来源:ZFrame.cs

示例11: packetBase

 public packetBase(int frameNumber, FrameType type, int length, byte checksum, DateTime recTime)
 {
     this.frameNumber = frameNumber;
     this.length = length;
     this.checksum = checksum;
     this.recTime = recTime;
     this.type = type;
 }
开发者ID:Skye07,项目名称:XBeeP,代码行数:8,代码来源:packetBase.cs

示例12: Encode

 public static void Encode(ByteBuffer buffer, FrameType type, ushort channel, DescribedList command)
 {
     buffer.Append(FixedWidth.UInt);
     AmqpBitConverter.WriteUByte(buffer, DOF);
     AmqpBitConverter.WriteUByte(buffer, (byte)type);
     AmqpBitConverter.WriteUShort(buffer, channel);
     Codec.Encode(command, buffer);
     AmqpBitConverter.WriteInt(buffer.Buffer, buffer.Offset, buffer.Length);
 }
开发者ID:kornys,项目名称:amqpnetlite,代码行数:9,代码来源:Frame.cs

示例13: Frame

        public Frame(FrameDirection direction, FrameType type, byte id, byte seq, byte[] data)
        {
            this.Direction = direction;
            this.Type = type;
            this.Id = id;
            this.Seq = seq;

            this.Data = data;
        }
开发者ID:kendemu,项目名称:ardrone3-pcap,代码行数:9,代码来源:Frame.cs

示例14: EggParents

        public EggParents(FrameType frameType, EncounterType encounterType, uint seed)
        {
            InitializeComponent();

            this.seed = seed;
            this.encounterType = encounterType;
            this.frameType = frameType;

            if (frameType == FrameType.BWBred || frameType == FrameType.BWBredInternational)
            {
                Text = "Display Parent IVs";
                buttonRetrieveIVs.Text = "Get IVs from IVRNG (Frame 8)";
            }
            else if (frameType == FrameType.DPPtBred ||
                     frameType == FrameType.HGSSBred ||
                     frameType == FrameType.Bred ||
                     frameType == FrameType.BredSplit ||
                     frameType == FrameType.BredAlternate)
            {
                labelParentA.Text = "Parent A";
                labelParentB.Text = "Parent B";

                labelParentA.Location = new Point(39, 40);
                labelParentB.Location = new Point(39, 66);

                labelIVRNG.Visible = false;
                maskedTextBoxHP_IVRNG.Visible = false;
                maskedTextBoxAtk_IVRNG.Visible = false;
                maskedTextBoxDef_IVRNG.Visible = false;
                maskedTextBoxSpA_IVRNG.Visible = false;
                maskedTextBoxSpD_IVRNG.Visible = false;
                maskedTextBoxSpe_IVRNG.Visible = false;
            }
            else
            {
                maskedTextBoxHP_ParentA.Enabled = false;
                maskedTextBoxAtk_ParentA.Enabled = false;
                maskedTextBoxDef_ParentA.Enabled = false;
                maskedTextBoxSpA_ParentA.Enabled = false;
                maskedTextBoxSpD_ParentA.Enabled = false;
                maskedTextBoxSpe_ParentA.Enabled = false;

                maskedTextBoxHP_ParentB.Enabled = false;
                maskedTextBoxAtk_ParentB.Enabled = false;
                maskedTextBoxDef_ParentB.Enabled = false;
                maskedTextBoxSpA_ParentB.Enabled = false;
                maskedTextBoxSpD_ParentB.Enabled = false;
                maskedTextBoxSpe_ParentB.Enabled = false;

                Text = "Display Characteristics in List";
                buttonRetrieveIVs.Text = encounterType == EncounterType.LarvestaEgg
                                             ? "Get IVs from IVRNG (Frame 2)"
                                             : "Get IVs from IVRNG (Frame 1)";
            }
        }
开发者ID:Slashmolder,项目名称:RNGReporter,代码行数:55,代码来源:EggParents.cs

示例15: Reset

 public void Reset(NavigationFrameParameters parameters) {
   frame_type = (FrameType)parameters.extension;
   switch (frame_type) {
     case FrameType.BODY_CENTRED_NON_ROTATING:
       selected_celestial_ = FlightGlobals.Bodies[parameters.centre_index];
       break;
     case FrameType.BARYCENTRIC_ROTATING:
       selected_celestial_ = FlightGlobals.Bodies[parameters.secondary_index];
       break;
   }
 }
开发者ID:ThomasKerman,项目名称:Principia,代码行数:11,代码来源:reference_frame_selector.cs


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