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


C# CheckedListBox.Dispose方法代码示例

本文整理汇总了C#中System.Windows.Forms.CheckedListBox.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# CheckedListBox.Dispose方法的具体用法?C# CheckedListBox.Dispose怎么用?C# CheckedListBox.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.CheckedListBox的用法示例。


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

示例1: EditValue

        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            TrackBarOwnerDrawParts none = TrackBarOwnerDrawParts.None;
            if (!(value is TrackBarOwnerDrawParts) || (provider == null))
                return value;

			IWindowsFormsEditorService service = (IWindowsFormsEditorService) provider.GetService(typeof(IWindowsFormsEditorService));
            if (service == null)
                return value;
            
			CheckedListBox control = new CheckedListBox();
            control.BorderStyle = System.Windows.Forms.BorderStyle.None;
            control.CheckOnClick = true;
            control.Items.Add("Ticks", (((Fusionbird.FusionToolkit.FusionTrackBar.FusionTrackBar) context.Instance).OwnerDrawParts & TrackBarOwnerDrawParts.Ticks) == TrackBarOwnerDrawParts.Ticks);
            control.Items.Add("Thumb", (((Fusionbird.FusionToolkit.FusionTrackBar.FusionTrackBar) context.Instance).OwnerDrawParts & TrackBarOwnerDrawParts.Thumb) == TrackBarOwnerDrawParts.Thumb);
            control.Items.Add("Channel", (((Fusionbird.FusionToolkit.FusionTrackBar.FusionTrackBar) context.Instance).OwnerDrawParts & TrackBarOwnerDrawParts.Channel) == TrackBarOwnerDrawParts.Channel);
            service.DropDownControl(control);
            IEnumerator enumerator = control.CheckedItems.GetEnumerator();
            while (enumerator.MoveNext())
            {
                object objectValue = RuntimeHelpers.GetObjectValue(enumerator.Current);
                none |= (TrackBarOwnerDrawParts) Enum.Parse(typeof(TrackBarOwnerDrawParts), objectValue.ToString());
            }
            control.Dispose();
            service.CloseDropDown();
            return none;
        }
开发者ID:JamesH001,项目名称:SX1231,代码行数:27,代码来源:TrackDrawModeEditor.cs

示例2: EditValue

 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     TrackBarOwnerDrawParts barOwnerDrawParts = TrackBarOwnerDrawParts.None;
     if (!(value is TrackBarOwnerDrawParts) || provider == null)
         return value;
     IWindowsFormsEditorService formsEditorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
     if (formsEditorService == null)
         return value;
     CheckedListBox checkedListBox = new CheckedListBox();
     checkedListBox.BorderStyle = BorderStyle.None;
     checkedListBox.CheckOnClick = true;
     checkedListBox.Items.Add((object)"Ticks", (((FusionTrackBar)context.Instance).OwnerDrawParts & TrackBarOwnerDrawParts.Ticks) == TrackBarOwnerDrawParts.Ticks);
     checkedListBox.Items.Add((object)"Thumb", (((FusionTrackBar)context.Instance).OwnerDrawParts & TrackBarOwnerDrawParts.Thumb) == TrackBarOwnerDrawParts.Thumb);
     checkedListBox.Items.Add((object)"Channel", (((FusionTrackBar)context.Instance).OwnerDrawParts & TrackBarOwnerDrawParts.Channel) == TrackBarOwnerDrawParts.Channel);
     formsEditorService.DropDownControl((Control)checkedListBox);
     foreach (object obj in checkedListBox.CheckedItems)
     {
         object objectValue = RuntimeHelpers.GetObjectValue(obj);
         barOwnerDrawParts |= (TrackBarOwnerDrawParts)Enum.Parse(typeof(TrackBarOwnerDrawParts), objectValue.ToString());
     }
     checkedListBox.Dispose();
     formsEditorService.CloseDropDown();
     return (object)barOwnerDrawParts;
 }
开发者ID:kaaLabs15,项目名称:LoRa,代码行数:24,代码来源:TrackDrawModeEditor.cs

示例3: EditValue

        public override Object EditValue(ITypeDescriptorContext context, IServiceProvider provider, Object value)
        {
            if (value != typeof(Corners) || provider == null)
                return value;

            IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
            if (edSvc != null)
            {
                CheckedListBox lb = new CheckedListBox();
                lb.BorderStyle = BorderStyle.None;
                lb.CheckOnClick = true;

                lb.Items.Add("TopLeft", (((CustomButton)context.Instance).RoundCorners & Corners.TopLeft) == Corners.TopLeft);
                lb.Items.Add("TopRight", (((CustomButton)context.Instance).RoundCorners & Corners.TopRight) == Corners.TopRight);
                lb.Items.Add("BottomLeft", (((CustomButton)context.Instance).RoundCorners & Corners.BottomLeft) == Corners.BottomLeft);
                lb.Items.Add("BottomRight", (((CustomButton)context.Instance).RoundCorners & Corners.BottomRight) == Corners.BottomRight);

                edSvc.DropDownControl(lb);
                Corners cornerFlags = Corners.None;
                foreach (object o in lb.CheckedItems)
                {
                    cornerFlags = cornerFlags | (Corners)Enum.Parse(typeof(Corners), o.ToString());
                }
                lb.Dispose();
                edSvc.CloseDropDown();
                return cornerFlags;
            }
            return value;
        }
开发者ID:hotdiggitydoddo,项目名称:beauty-concept,代码行数:29,代码来源:CustomButton.cs


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