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

C# StateFlags类代码示例

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

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



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

示例1: Render

        public override void Render(CellContext context, StateFlags state, double cellWidth, double cellHeight)
        {
            if (BoundObject == null) {
                return;
            }

            if (!(BoundObject is TrackInfo)) {
                throw new InvalidCastException ("ColumnCellAlbum can only bind to AlbumInfo objects");
            }

            TrackInfo track = (TrackInfo)BoundObject;

            context.Layout.Width = (int)((cellWidth - 8) * Pango.Scale.PangoScale);
            context.Layout.Ellipsize = Pango.EllipsizeMode.End;
            context.Layout.FontDescription.Weight = font_weight;
            context.Layout.SetMarkup (String.Format ("<b>{0}</b>\n<small><i>{1}</i></small>",
                GLib.Markup.EscapeText (track.DisplayTrackTitle),
                GLib.Markup.EscapeText (track.DisplayArtistName)));

            int text_width;
            int text_height;
            context.Layout.GetPixelSize (out text_width, out text_height);

            context.Context.MoveTo (4, ((int)cellHeight - text_height) / 2);
            context.Widget.StyleContext.Save ();
            context.Widget.StyleContext.AddClass ("entry");
            Cairo.Color color = CairoExtensions.GdkRGBAToCairoColor (context.Widget.StyleContext.GetColor (StateFlags.Selected));
            context.Widget.StyleContext.Restore ();
            color.A = (!context.Opaque) ? 0.3 : 1.0;
            context.Context.SetSourceColor (color);

            PangoCairoHelper.ShowLayout (context.Context, context.Layout);
        }
开发者ID:dufoli,项目名称:banshee,代码行数:33,代码来源:ColumnCellTrack.cs


示例2: AbstractSocketChannel

        protected AbstractSocketChannel(IChannel parent, Socket socket)
            : base(parent)
        {
            Socket = socket;
            _state = StateFlags.Open;

            try
            {
                Socket.Blocking = false;
            }
            catch (SocketException ex)
            {
                try
                {
                    socket.Close();
                }
                catch (SocketException ex2)
                {
                    if (Logger.IsWarningEnabled)
                    {
                        Logger.Warning("Failed to close a partially initialized socket.", ex2);
                    }
                }

                throw new ChannelException("Failed to enter non-blocking mode.", ex);
            }
        }
开发者ID:helios-io,项目名称:helios,代码行数:27,代码来源:AbstractSocketChannel.cs


示例3: Render

        public override void Render(CellContext context, StateFlags state, double cellWidth, double cellHeight)
        {
            PodcastTrackInfo podcast = PodcastTrackInfo.From (BoundTrack);
            if (podcast != null) {
                if (podcast.Activity == PodcastItemActivity.DownloadPending) {
                    context.Opaque = false;
                }
            }

            base.Render (context, state, cellWidth, cellHeight);
        }
开发者ID:dufoli,项目名称:banshee,代码行数:11,代码来源:ColumnCellPodcastStatusIndicator.cs


示例4: ContextAwareResult

 internal ContextAwareResult(bool captureIdentity, bool forceCaptureContext, bool threadSafeContextCopy, object myObject, object myState, AsyncCallback myCallBack) : base(myObject, myState, myCallBack)
 {
     if (forceCaptureContext)
     {
         this._Flags = StateFlags.CaptureContext;
     }
     if (captureIdentity)
     {
         this._Flags |= StateFlags.CaptureIdentity;
     }
     if (threadSafeContextCopy)
     {
         this._Flags |= StateFlags.ThreadSafeContextCopy;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:ContextAwareResult.cs


示例5: Deserialize

        public override bool Deserialize()
        {
            var result = base.Deserialize();

            _unknown = Data.ReadInt32(); // Not always zero, looks like flags or mask?

            ProbeMask = Data.ReadInt32();
            IgnoreMask = Data.ReadInt64();

            LabelTableOffset = Data.ReadInt16();

            // This can't be processed here unless the bytecode is also processed for virtual address space
            /*if (LabelTableOffset >= 0)
            {
                LabelTable = new List<LabelTableEntry>();
                var tableReader = new ObjectReader(ByteScript);
                tableReader.ReadRawData(LabelTableOffset);

                var NameRef = tableReader.ReadNameRef();
                var Offset = tableReader.ReadUInt32();
                while (Offset != 0x0000FFFF)
                {
                    var entry = new LabelTableEntry();
                    entry.NameRef = NameRef;
                    entry.Name = PCC.GetName(NameRef);
                    entry.Offset = Offset;
                    LabelTable.Add(entry);

                    NameRef = tableReader.ReadNameRef();
                    Offset = tableReader.ReadUInt32();
                }
            }*/

            StateFlags = (StateFlags)Data.ReadInt32();

            FunctionMapCount = Data.ReadInt32();
            for (int i = 0; i < FunctionMapCount; i++)
            {
                var funcEntry = new FunctionMapEntry();
                funcEntry.NameRef.Index = Data.ReadInt32();
                funcEntry.NameRef.ModNumber = Data.ReadInt32();
                funcEntry.FunctionObjectIndex = Data.ReadInt32();
                _FunctionMap.Add(funcEntry);
            }

            return result;
        }
开发者ID:Mgamerz,项目名称:ME3Libs,代码行数:47,代码来源:ME3State.cs


示例6: IS_CPP

 public IS_CPP(byte[] data) {
     Size = data[0];
     Type = (PacketType)data[1];
     ReqI = data[2];
     Zero = data[3];
     Pos1 = BitConverter.ToInt32(data, 4);
     Pos2 = BitConverter.ToInt32(data, 8);
     Pos3 = BitConverter.ToInt32(data, 12);
     H = BitConverter.ToUInt16(data, 16);
     P = BitConverter.ToUInt16(data, 18);
     R = BitConverter.ToUInt16(data, 20);
     ViewPLID = data[22];
     InGameCam = (CameraViews)data[23];
     FOV = BitConverter.ToSingle(data, 24);
     Time = BitConverter.ToUInt16(data, 28);
     Flags = (StateFlags)BitConverter.ToUInt16(data, 30);
 }
开发者ID:alexmcbride,项目名称:insimsniffer,代码行数:17,代码来源:IS_CPP.cs


示例7: RegistryKey

        /// <summary>
        /// Creates a RegistryKey.
        /// This key is bound to hkey, if writable is <b>false</b> then no write operations
        /// will be allowed. If systemkey is set then the hkey won't be released
        /// when the object is GC'ed.
        /// The remoteKey flag when set to true indicates that we are dealing with registry entries
        /// on a remote machine and requires the program making these calls to have full trust.
        /// </summary>
        private RegistryKey(SafeRegistryHandle hkey, bool writable, bool systemkey, bool remoteKey, bool isPerfData, RegistryView view)
        {
            ValidateKeyView(view);

            _hkey = hkey;
            _keyName = "";
            _remoteKey = remoteKey;
            _regView = view;

            if (systemkey)
            {
                _state |= StateFlags.SystemKey;
            }
            if (writable)
            {
                _state |= StateFlags.WriteAccess;
            }
            if (isPerfData)
            {
                _state |= StateFlags.PerfData;
            }
        }
开发者ID:Corillian,项目名称:corefx,代码行数:30,代码来源:RegistryKey.cs


示例8: FinishPostingAsyncOp

 internal bool FinishPostingAsyncOp(ref CallbackClosure closure)
 {
     ExecutionContext context;
     if ((this._Flags & (StateFlags.PostBlockFinished | StateFlags.PostBlockStarted)) != StateFlags.PostBlockStarted)
     {
         return false;
     }
     this._Flags |= StateFlags.PostBlockFinished;
     CallbackClosure closure2 = closure;
     if (closure2 == null)
     {
         context = null;
     }
     else if (!closure2.IsCompatible(base.AsyncCallback))
     {
         closure = null;
         context = null;
     }
     else
     {
         base.AsyncCallback = closure2.AsyncCallback;
         context = closure2.Context;
     }
     bool flag = this.CaptureOrComplete(ref context, true);
     if (((closure == null) && (base.AsyncCallback != null)) && (context != null))
     {
         closure = new CallbackClosure(context, base.AsyncCallback);
     }
     return flag;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:30,代码来源:ContextAwareResult.cs


示例9: IsCLSCompliant

		//
		// Returns member CLS compliance based on full member hierarchy
		//
		public bool IsCLSCompliant ()
		{
			if ((state & StateFlags.CLSCompliant_Undetected) != 0) {
				state &= ~StateFlags.CLSCompliant_Undetected;

				if (IsNotCLSCompliant ())
					return false;

				bool compliant;
				if (DeclaringType != null) {
					compliant = DeclaringType.IsCLSCompliant ();
				} else {
					// TODO: NEED AssemblySpec
					if (MemberDefinition.IsImported) {
						var attr = MemberDefinition.Assembly.GetCustomAttributes (typeof (CLSCompliantAttribute), false);
						compliant = attr.Length > 0 && ((CLSCompliantAttribute) attr[0]).IsCompliant;
					} else {
						compliant = CodeGen.Assembly.IsClsCompliant;
					}
				}

				if (compliant)
					state |= StateFlags.CLSCompliant;
			}

			return (state & StateFlags.CLSCompliant) != 0;
		}
开发者ID:alisci01,项目名称:mono,代码行数:30,代码来源:decl.cs


示例10: Connect

        async void Connect(IChannelHandlerContext context)
        {

            var connectPacket = new ConnectPacket
            {
                ClientId = this.deviceId,
                HasUsername = true,
                Username = this.iotHubHostName + "/" + this.deviceId,
                HasPassword = true,
                Password = this.password,
                KeepAliveInSeconds = this.mqttTransportSettings.KeepAliveInSeconds,
                CleanSession = this.mqttTransportSettings.CleanSession,
                HasWill = this.mqttTransportSettings.HasWill
            };
            if (connectPacket.HasWill)
            {
                Message message = this.willMessage.Message;
                QualityOfService publishToServerQoS = this.mqttTransportSettings.PublishToServerQoS;
                string topicName = string.Format(TelemetryTopicFormat, this.deviceId);
                PublishPacket will = await Util.ComposePublishPacketAsync(context, message, publishToServerQoS, topicName);

                connectPacket.WillMessage = will.Payload;
                connectPacket.WillQualityOfService = this.willMessage.QoS;
                connectPacket.WillRetain = false;
                connectPacket.WillTopicName = will.TopicName;
            }
            this.stateFlags = StateFlags.Connecting;

            await Util.WriteMessageAsync(context, connectPacket, ShutdownOnWriteErrorHandler);
            this.lastChannelActivityTime = DateTime.UtcNow;
            this.ScheduleKeepConnectionAlive(context);

            this.ScheduleCheckConnectTimeout(context);
        }
开发者ID:tomconte,项目名称:azure-iot-sdks,代码行数:34,代码来源:MqttIotHubAdapter.cs


示例11: IsCLSCompliant

		//
		// Returns member CLS compliance based on full member hierarchy
		//
		public bool IsCLSCompliant ()
		{
			if ((state & StateFlags.CLSCompliant_Undetected) != 0) {
				state &= ~StateFlags.CLSCompliant_Undetected;

				bool compliant;
				if (IsNotCLSCompliant (out compliant))
					return false;

				if (!compliant) {
					if (DeclaringType != null) {
						compliant = DeclaringType.IsCLSCompliant ();
					} else {
						compliant = ((ITypeDefinition) MemberDefinition).DeclaringAssembly.IsCLSCompliant;
					}
				}

				if (compliant)
					state |= StateFlags.CLSCompliant;
			}

			return (state & StateFlags.CLSCompliant) != 0;
		}
开发者ID:constructor-igor,项目名称:cudafy,代码行数:26,代码来源:decl.cs


示例12: SubscribeAsync

        async Task SubscribeAsync(IChannelHandlerContext context)
        {
            if (this.IsInState(StateFlags.Receiving) || this.IsInState(StateFlags.Subscribing))
            {
                return;
            }

            this.stateFlags |= StateFlags.Subscribing;

            this.subscribeCompletion = new TaskCompletionSource();

            string topicFilter = CommandTopicFilterFormat.FormatInvariant(this.deviceId);

            var subscribePacket = new SubscribePacket(Util.GetNextPacketId(), new SubscriptionRequest(topicFilter, this.mqttTransportSettings.ReceivingQoS));

            await Util.WriteMessageAsync(context, subscribePacket, ShutdownOnWriteErrorHandler);

            await this.subscribeCompletion.Task;
        }
开发者ID:tomconte,项目名称:azure-iot-sdks,代码行数:19,代码来源:MqttIotHubAdapter.cs


示例13: ChannelActive

        public override void ChannelActive(IChannelHandlerContext context)
        {
            this.stateFlags = StateFlags.NotConnected;

            this.Connect(context);

            base.ChannelActive(context);
        }
开发者ID:tomconte,项目名称:azure-iot-sdks,代码行数:8,代码来源:MqttIotHubAdapter.cs


示例14: GetAttributeObsolete

		public virtual ObsoleteAttribute GetAttributeObsolete ()
		{
			if ((state & (StateFlags.Obsolete | StateFlags.Obsolete_Undetected)) == 0)
				return null;

			state &= ~StateFlags.Obsolete_Undetected;

			var oa = definition.GetAttributeObsolete ();
			if (oa != null)
				state |= StateFlags.Obsolete;

			return oa;
		}
开发者ID:constructor-igor,项目名称:cudafy,代码行数:13,代码来源:decl.cs


示例15: IsInState

 bool IsInState(StateFlags stateFlagsToCheck)
 {
     return (this.stateFlags & stateFlagsToCheck) == stateFlagsToCheck;
 }
开发者ID:tomconte,项目名称:azure-iot-sdks,代码行数:4,代码来源:MqttIotHubAdapter.cs


示例16: Shutdown

        async void Shutdown(IChannelHandlerContext context)
        {
            if (this.IsInState(StateFlags.Closed))
            {
                return;
            }

            try
            {
                this.stateFlags |= StateFlags.Closed; // "or" not to interfere with ongoing logic which has to honor Closed state when it's right time to do (case by case)

                this.CloseIotHubConnection();
                await context.CloseAsync();
            }
            catch
            {
                // ignored
            }
        }
开发者ID:tomconte,项目名称:azure-iot-sdks,代码行数:19,代码来源:MqttIotHubAdapter.cs


示例17: ProcessSubAck

 void ProcessSubAck()
 {
     this.stateFlags &= ~StateFlags.Subscribing;
     this.stateFlags |= StateFlags.Receiving;
     this.subscribeCompletion.TryComplete();
 }
开发者ID:tomconte,项目名称:azure-iot-sdks,代码行数:6,代码来源:MqttIotHubAdapter.cs


示例18: StartPostingAsyncOp

 internal object StartPostingAsyncOp(bool lockCapture)
 {
     this._Lock = lockCapture ? new object() : null;
     this._Flags |= StateFlags.PostBlockStarted;
     return this._Lock;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:6,代码来源:ContextAwareResult.cs


示例19: Render

        public override void Render(CellContext context, StateFlags state, double cellWidth, double cellHeight)
        {
            context.Context.Translate (0, 0.5);
            int draw_x = 0;

            foreach (int i in AttributesForBoundObject) {
                Gdk.Pixbuf render_pixbuf = pixbufs[i];

                if (render_pixbuf != null) {
                    Cairo.Rectangle pixbuf_area = new Cairo.Rectangle (draw_x,
                        (cellHeight - render_pixbuf.Height) / 2, render_pixbuf.Width, render_pixbuf.Height);

                    if (!context.Opaque) {
                        context.Context.Save ();
                    }

                    Gdk.CairoHelper.SetSourcePixbuf (context.Context, render_pixbuf, pixbuf_area.X, pixbuf_area.Y);
                    context.Context.Rectangle (pixbuf_area);

                    if (!context.Opaque) {
                        context.Context.Clip ();
                        context.Context.PaintWithAlpha (0.5);
                        context.Context.Restore ();
                    } else {
                        context.Context.Fill ();
                    }
                }

                draw_x += ICON_SIZE;
            }
        }
开发者ID:dufoli,项目名称:banshee,代码行数:31,代码来源:ColumnCellCreativeCommons.cs


示例20: OnEnterNotifyEvent

        protected override bool OnEnterNotifyEvent(Gdk.EventCrossing evnt)
        {
            if (!CanActivate) {
                return base.OnEnterNotifyEvent (evnt);
            }

            pending_state = StateFlags;
            SetStateFlags (StateFlags.Prelight, true);

            return base.OnEnterNotifyEvent (evnt);
        }
开发者ID:stsundermann,项目名称:cubano,代码行数:11,代码来源:ActionLabel.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# StateID类代码示例发布时间:2022-05-24
下一篇:
C# StateEnum类代码示例发布时间: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