C# CheckList by Ted GraHam

C#窗体应用程序之CheckListBox复选列表与ListBox列表框控件 1.CheckListBox复选列表 复选框功能类似的复选列表框 (CheckedListBox),方便用户设置和获取复选列表框中的选项,复选列表框显示的效果与复选框类似,但在选择多个选项时操作比一般的复选框更方便。 新建一个checklisbox 然后点击那个小三角,可以编辑我们的listbox的内容 如图所示,点击确定按钮,转入button的功能实现函数 写入以下代码,可以直接对listbox进行一个循环遍历 string msg = ""; for(int i = 0; i 阅读详情

http://blog.youkuaiyun.com/montaque/archive/2004/08/09/69408.aspx

Ted GraHam 提到了39 条 CheckList, 我觉得还是总结的挺全面.

  • Are exceptions used to indicate error rather than returning status or error codes?
  • 使用异常来只是错误而不是使用状态或者错误代码值
  • Are all classes and public methods commented with .NET style comments?? Note that comments should discuss the "what" of public methods.? Discussion of "how" should be in blocks or in-line with the code in question.
    • 所有类以及 public 方法 都使用.NET 样式的注释, 即 /// summary 格式. 注意 Summary 中说明代码有那些功能,而不是这个功能如何实现的. 可以在 Remarks 块或者代码中说明.
    • Are method arguments validated and rejected with an exception if they are invalid?
    • 所有方法的参数的合法性是否做验证, 对非法的参数是否抛出异常?
    • Are Debug.Asserts used to verify assumptions about the functioning of the code?? Comments like, "j will be positive" should be rewritten as Asserts.?
    • 是否使用 Debug.Asserts 来验证代码中的假设? “ j 应该是正数?“之类的注释应该用 Debug.Asserts 来重写.
    • Do classes that should not be instantiated have a private constructor?
    • 不需要实例化的类有 私有构造函数吗?
    • Are classes declared as value types only infrequently used as method parameters, returned from methods or stored in Collections?
    • 值类型的类用于参数,方法返回值以及存放在集合中?
    • Are classes, methods and events?that are specific to an assembly marked as internal?
    • Assembly 特有的类,方法,事件的访问修饰符是否已经标记为 Internal ?
    • Are singletons that may be accessed by multiple threads instantiated correctly?? See the Enterprise Solution Patterns book, p. 263.
    • 多线程同时访问的单件对象是否正确的初始化?
    • Are methods that must be overriden by derived classes marked as abstract?
    • 必须被衍生类重写的方法申明为 Abstract 了吗?
    • Are classes that should not be overriden marked as sealed?
    • 不能重写的类是否标记为 Sealed?
    • Is "as" used for possibly incorrect downcasts??
    • 可能失败的转换是否使用了 AS 运算符?
    • Do classes override ToString?instead of defining a Dump method for outputting the object's state?
    • 输出对象的状态的时候应该重写 ToString 方法而不是加一个类似 Dump 之类的方法.
    • Are log messages sent to the logging component instead of Console?
    • 所有log 的消息都有 log 组建处理,而不是仅仅输出到 控制台.
    • Are finally blocks used for code that must execute following a try??
    • finnally 代码块用于try 后必须执行的代码
    • Is foreach used in preference to the for(int i...) construct?
    • 尽可能的采用 foreach 而不是 for(int i...)
    • Are properties used instead of implementing getter and setter methods?
    • 是否属性没有实现getter 和 setter 方法
    • Are readonly variables used in preference to?properties without setters?
    • 只读的属性应该没有 setter 方法
    • Is the override keyword used on all methods that are overriden by derived classes?
    • 衍生类重写的方法是否都使用了 override 关键字
    • Are interface classes used in preference to abstract classes?
    • 正确的使用interface 和抽象类.
    • Is code written against an interface rather than an implementing class?
    • 接口实现和抽象类继承
    • Do all objects that represent "real-world" or expensive resources implement the IDisposable pattern?
    • 操作系统资源的类是否实现了 IDisposable 接口?
    • Are all objects that implement IDisposable instantiated in a using block?
    • 是否所有实现IDisposable 的类初始化的时候使用了 Using 语句?
    • Is the lock keyword used in preference to the Monitor.Enter?construct?
    • 使用lock 语句而不是 monitor.enter
    • Are threads awakened from wait states by events or the Pulse construct, rather than "active" waiting such as Sleep()?
    • 线程使用事件或者pulse 唤醒, 而不是使用 sleep 主动的唤醒.
    • If equals is overridden, is it done correctly?? The rules for overriding equals are complex, see Richter p153-160 for details.
    • 是否正确的重写了 equals
    • If == and != are overridden, so they redirect to Equals?
    • == 和 != 操作符号被重写
    • Do all objects that?override Equals also provide an overloaded version of GetHashCode that?provides the same semantics as Equals?? Note that overrides to GetHashCode should?take advantage of the object's member variables, and must?return an unchanging hash code.
    • Do all exception classes?have a constructor that takes a string and and another constructor that takes a string and an exception?
    • Do all exception classes derive from the base Matrix exceptions and fit correctly into the exception hierarchy?
    • Are all classes that will be marshaled or remoted marked with the Serializable attribute?
    • Do all classes marked with the?Serializable attribute have a default constructor?? This includes Exception and?EventArgs?classes.
    • Do all classes that explicitly implement ISerializable provide both the required GetObjectData and the implied constructor that takes a SerializationInfo?and a?StreamingContext?
    • When doing floating point calculations,?are all constants doubles rather than integers?
    • Do all delegates have a void return type and avoid using output or ref parameters?
    • Do?all delegates send the sender (publisher) as the first argument?? This allows the subscriber to tell which publisher fired the event.?
    • Are all members of derived EventArg classes read-only?? This prevents one subscriber from modifying the EventArgs, which would affect the other subscribers.
    • Are delegates published as events?? This prevents the subscribers from firing the event, see Lowy, p. 102?for details.
    • Is common setup and teardown nUnit code isolated in?Setup and Teardown methods that are marked with the appropriate attribute?
    • Do negative nUnit tests use the ExpectedException attribute to indicate that an exception must be thrown?
Codereview 代码审查工具(国人开发) 软件介绍: 一、软件特色 功能丰富:实现文件内容、度量、命名、注释、类图、Halstead等审查。 简单易用:无需安装,直接使用,直接删除;所有操作点击完成。 直观可视:分析结果与源代码在同一界面显示对照,快速定位。 语言多样:支持Visual Basic .NET、Java编程语言的代码审查。 自定义规范:通过自定义变更命名规范、注释规范完成代码审查。 二、功能列表 Info(内容):获取文件内容; Measure(度量):度量代码基本要素; Naming(命名):审查变量命名情况; Comment(注释):审查文件、类、函数等的注释情况; Diagram(类图):显示类图; Halstead(复杂度):计算Halstead复杂度. 三、官方网站 http://www.codereview.com.cn 立即下载

相关推荐

code_review工具简介及安装

code_review工具简介及安装code_review工具简介及安装code_review工具简介及安装code_review工具简介及安装code_review工具简介及安装

C# checkboxlist的使用

C# checkboxlist的使用 最近做项目,需要用到checklistbox这一控件,由于对这一控件并不是很熟悉,导致在此浪费了一点时间。 http://www.cnblogs.com/hongfei/archive/2012/12/21/2828408.html 复制代码 for (int i = 0; i < checkedListBox1.Items.Count; i++) { if (checkedListBox1.GetItemChecked(i)) { MessageBox.Show

Justinme1369的博客 2257

实现 PDF 添加水印的五种方式

PDF(Portable Document Format,便携式文档格式)是一种流行的文件格式,它可以在多个操作系统和应用程序中进行查看和打印。在某些情况下,我们需要对 PDF 文件添加水印,以使其更具有辨识度或者保护其版权。本文将介绍如何使用 Spring Boot 来实现 PDF 添加水印的方式。

逸轩 6474

C# code review

Magic number

tecancy的专栏 977

YOLOv8_obb的C++工程部署实战:从模型转换到实时视频推理

本文详细介绍了YOLOv8_obb模型在C++环境下的完整工程部署流程,涵盖从PyTorch模型到ONNX格式的转换、基于ONNX Runtime的C++推理引擎搭建、旋转框后处理解析,以及实时视频流处理与性能优化。文章重点解析了模型转换的关键参数、环境配置的常见问题、核心推理代码的实现,并提供了实用的避坑指南,旨在帮助开发者高效完成YOLOv8_obb的C++工程部署。

weixin_29100927的博客 46

基于SpringBoot 3 + Vue 3的全栈民宿预约管理系统设计与实现

文章将详细阐述系统的需求分析、架构设计、数据库设计、核心功能模块的实现(包括用户认证、房源管理、订单流程、支付集成等),并提供关键代码片段,最后对系统进行总结与展望。.requestMatchers("/api/admin/**").hasRole("ADMIN") // 管理员接口。.requestMatchers("/api/auth/**").permitAll() // 认证接口公开。.requestMatchers("/api/public/**").permitAll() // 公开资源。

2201_76125393的博客 272

C#拿怎么做Codereview?

   要生猛的面对生活 //<![CDATA[Sys.WebForms.PageRequestManager._initialize(AjaxHolder$scriptmanager1, document.getElementById(Form1));Sys.WebForms.PageRequestManager.getInstance()._

Simplicity is more complicated than you think 3991

STM32步进电机控制三大方案:GPIO/定时器/PWM深度对比

步进电机控制是嵌入式运动控制的基础技术,其核心在于精确生成脉冲(PUL)、方向(DIR)和使能(EN)三路数字信号。原理上,脉冲频率决定转速,脉冲数量决定位置,方向电平决定转向,而使能时序保障驱动器可靠启停。该技术具有高定位精度、开环稳定性与低成本优势,广泛应用于3D打印机、CNC设备、自动化产线等场景。在STM32平台实现时,需兼顾硬件隔离设计(如6N137光耦)、HAL库抽象封装及实时性约束。本文围绕GPIO模拟、定时器中断与PWM比较输出三种主流方法,系统剖析其时序机制、CPU开销、抗干扰能力与工业适

weixin_35755640的博客 88

C# Code Review Checklist

Ted GraHam 提到了39 条 CheckList, 我觉得还是总结的挺全面.Are exceptions used to indicate error rather than returning status or error codes? 使用异常来只是错误而不是使用状态或者错误代码值 Are all classes and public methods commente

Montaque & DotNet 4872

(五)C++自制植物大战僵尸游戏LoadingScene的实现讲解

游戏启动后就会立即切换到游戏加载场景中。只有游戏资源文件加载完成后,才能进入游戏。Loadingscene类继承Cocos2d-x中的Scene父类,表明Loadingscene是一个场景类。切换到LoadingScene场景中,首先会创建该场景,会调用函数,在该函数中调用自己定义的方法实现指定功能。代码文件的位置如下图所示。

尔灵尔亿的博客 2006

5.1 直流无刷电机(BLDC):基本控制概念

本文系统介绍了直流无刷电机(BLDC)控制系统的核心概念与技术。主要内容包括:控制系统的分层结构设计,开环与闭环控制的原理及特点,PWM调速技术及其调制方式,PID控制算法及其数字化实现方法,以及控制系统的性能评估指标。同时探讨了现代BLDC控制器硬件实现方案,并介绍了磁场定向控制(FOC)、直接转矩控制(DTC)等先进控制策略。文章全面阐述了BLDC电机控制从基本原理到前沿技术的知识体系,为相关应用提供了理论指导和技术参考。

技术工作者 491

C#中的CheckedListBox控件

在上述示例中,我们创建了一个名为 “MainForm” 的窗体应用程序,并放置了一个。事件,弹出相应的消息框。点击按钮时,可以获取当前选中的项,或者添加新的选项到。在 Visual Studio 的窗体设计器中,从工具箱中拖动并放置一个。控件和两个按钮和一个文本框。在窗体的加载事件中,我们初始化了。如果你有任何进一步的问题,请随时提问!当项的选中状态发生改变时,会触发。希望这个示例能帮助你理解和使用。下面是一个示例,演示如何使用。

xiaogongzhu001的博客 2711

一文读懂AUTOSAR CAN通信

在AUTOSAR的分层和模块化架构中,使用PduR(Protocal Data Unit Router)将总线或者网络数据进行抽象,使得上层应用不用关心信号的来源。本文从PduR下层的CAN Interface、CAN Driver和CAN Transceiver Driver模块介绍CAN总线在AUTOSAR架构中的工作机制以及信号的收发等功能。PduR以及COM等上层模块的介绍可以参考公众号内发布的历史文章。

酒无忧的博客 2495

[C#]C#学习笔记:CheckedListBox控件的用法

该属性指示列表将是单选还是多选,这里的“选”表示选中而不是“勾选”,选中后条目会高亮,但条目左边的小方框不会勾选。使用CheckedBox和CheckedListBox实现如下图所示的功能:点击勾选坐标的复选框,游边的CheckedLIstBox中就会添加一个条目,并且条目是多列显示。SelectedItem属性作用是获取选中的条目,而SelectedItems属性是一个数组,保存着被选中的条目的集合,可通过下标来获取条目。设置第i项条目是否被选中,参数有两个,第一个是索引,第二个是布尔值。

FL1768317420的博客 2630

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

全面介绍 C#Checklistbox用法

本文从6各方面对c#checklistbox用法做详细介绍,他们分别是c#checklistbox的用法的添加项、判断第0项是否选中、设置第0项是否选中、设置全选、得到全部选中的值、数据绑定。1、c#checklistbox用法之添加项:checkedListBox1.Items.Add("蓝色");  checkedListBox1.Items.Add("红色

5043

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

c#学习笔记:CheckedListBox控件的用法

(1)、CheckOnClick属性是的值,如果为True,那么单击条目就能将条目勾选;如果为false,则要双击条目才能将其勾选。2)ColumnWitdh属性是整型数据,表示多列条目各列的列宽。该属性只有在MultiColumn属性(允许多列显示)设置为true时才有意义。(3)MultiColumn属性是布尔类型的值,指示是否开启多列显示条目。该属性是配合ColumnWidth属性一起使用。(4)

4013

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

C#学习笔记:CheckedListBox控件的用法

一、常用属性、方法和事件 1.常用属性 (1)CheckOnClick属性 CheckOnClick属性是布尔类型的值,如果为True,那么单击条目就能将条目勾选;如果为false,则要双击条目才能将其勾选。 (2)ColumnWidth属性 ColumnWitdh属性是整型数据,表示多列条目各列的列宽。该属性只有在MultiColumn属性(允许多列显示)设置为true时才有意义。

qq_28249373的博客 7万+

c# checkedlistbox用法总结

/true改为false为没有选中。添加一个名为select_all的checkbox控件,由其控制checkedListBox是全选还是全不选。4.设置CheckedListBox中第i项的Checked状态。2.判断第i项是否选中,选中为true,否则为false。//如果checkedListBox1的第i项被选中,//则显示checkedListBox1对应的值。5.被选中则显示对应的值。1.设置第i项是否选中。

qq_44763415的博客 1911

C# checklistbox控件用法总结(怎样得到多选的值,以及动态加载数据)

一般认为:foreach (object obj in checkedListBox1.SelectedItems)即可遍历选中的值。 其实这里遍历的只是高亮的值并不是打勾的值。遍历打勾的值要用下面的代码: for (int i = 0; i {     if (checkedListBox1.GetItemChecked(i))     {         MessageBox.S

张水源的博客 1万+

浅学C#(17)——Winform程序设计之ListBox、CheckListBox、ComboBox、ListView、ImageList、TabControl、PictureBox...

ListBox 常用属性 SelectedIndex 表示选中选项的基于0的索引,若选中多项,则是第一项的索引 ColumnWidth 在包含多个列的列表框中指定列的宽度 Items 包含列表框中的所有选项 MultiColumn 获取和设置列表框中列的数目 SelectedIndices 列表框中选中的多项基于0的索引集合 SelectedItem 指选中的选项。若 选中多项,则指第一项 Sel...

衡与墨的博客 1874

C# WinForm —— 14 CheckedListBox 复选列表框介绍

类似 ListBox,提供项的列表,区别就是 CheckedListBox 每一个项前面有个复选框。

ChanMon的博客 2984

第6章第4节:自定义分词器

本节详解Elasticsearch自定义分词器,解析analyzer三段式结构(char_filter→tokenizer→filter),掌握常用组件如ik_max_word、synonym_graph、ngram等。通过_analyze API调试分词效果,实现“索引时扩展同义词、搜索时不带”的生产级方案,提升中文搜索与智能提示体验。

啊渊的专栏 782
上一篇: Thinking in Delphi:语言的变革
下一篇: SQL Server注意事项
fsb2001
博客等级 码龄25年 1粉丝 19原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值