摘要: 1.可存在同名对象 class A: def __init__(self): print('this is class.') def A(): print('this is method.') a = A() # this is method. 由于python是边编译边执行的语言,所以只会使用最近 阅读全文
posted @ 2022-10-14 17:07 Bridgebug 阅读(141) 评论(0) 推荐(0)
摘要: 一、创建类 class People: pass p = People() 二、构造函数 __init__()方法是一种特殊的方法,被称为类的构造函数或初始化方法,当创建了这个类的实例时就会调用该方法。 python中一个类只能有一个构造函数,即只能有一个 __init__ 方法(有多个时,最后一个 阅读全文
posted @ 2022-10-14 16:52 Bridgebug 阅读(75) 评论(0) 推荐(0)
摘要: 由于个人不喜欢定义那么多变量,而在wpf的vm中需触发更新的变量都要定义一个字段和属性。 例如: private string _name; public string Name { get { return _name; } set { _name = value; RaisePropertyCh 阅读全文
posted @ 2022-09-13 11:38 Bridgebug 阅读(92) 评论(0) 推荐(0)
摘要: 通常情况下,是将C#代码共享到python脚本中,可以通过脚本调用C#的各个对象。 一、IronPythonRunner 创建IronPython运行器,可通过该运行器运行python脚本。 using System; using System.Collections.Generic; using 阅读全文
posted @ 2022-08-24 15:09 Bridgebug 阅读(314) 评论(0) 推荐(0)
摘要: 假如有脚本 test1.py def get(): return 'this is test1' 在脚本 test2.py 中调用 test1.py 的 get 方法 1.用全名访问 import test1 print(test1.get()) 2.用别名访问 import test1 as t1 阅读全文
posted @ 2022-07-28 15:31 Bridgebug 阅读(129) 评论(0) 推荐(0)
摘要: 创建SyncingClass类,继承与ContextBoundObject,并标记Synchronization特性; 需实现上下文同步的实例必须继承ContextBoundObject和标记Synchronization特性; using System; using System.Threadin 阅读全文
posted @ 2022-06-22 10:32 Bridgebug 阅读(162) 评论(0) 推荐(0)
摘要: FOR FOR %%variable IN (set) DO command [command-parameters] %variable 指定一个单一字母可替换的参数。 (set) 指定一个或一组文件。可以使用通配符。 command 指定对每个文件执行的命令。 command-parameter 阅读全文
posted @ 2022-04-16 01:16 Bridgebug 阅读(562) 评论(0) 推荐(0)
摘要: 批处理是一种简化的脚本语言,也称作宏。它应用于DOS和Windows系统中,它是由DOS或者Windows系统内嵌的命令解释器(通常是COMMAND. COM或者CMD.EXE)解释运行。类似于Unix中的Shell脚本。批处理文件具有.bat或者.cmd的扩展名。批处理语法中是不区分大小写。 RE 阅读全文
posted @ 2022-04-13 22:17 Bridgebug 阅读(237) 评论(0) 推荐(0)
摘要: 1.附加属性 附加属性是可用于多个控件但在另一个类中定义的属性。在WPF中,附加属性常用于控件布局。 每个控件都有各自的固有属性,当在容器中放置控件时,根据容器的类型控件会获得额外的特征(例如,如果在网格中放置一个文本框,需要选择文本框放在网格控件中的哪个单元格中)。使用附加属性设置这些附加的细节。 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(223) 评论(0) 推荐(1)
摘要: <Window x:Class="WpfApp1.Window1" Title="Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft. 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(165) 评论(0) 推荐(0)
摘要: using System; using System.Collections.Generic; using System.ComponentModel; /// <summary> /// 提供支持数据绑定的泛型集合 /// </summary> /// <typeparam name="T"></ 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(271) 评论(0) 推荐(0)
摘要: private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { using (SolidBrush b = new SolidBrush(this.dataGridView1. 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(748) 评论(0) 推荐(0)
摘要: XAML能不能像HTML一样可以对元素应用多个样式呢???默认的情况下是不可以的,下面将讲述两种通过其他方法实现同时应用多个样式的例子。 1.BasedOn 通过继承相当于拥有两种样式。 <Window x:Class="WpfAppLearn2.MainWindow" xmlns="http:// 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(51) 评论(0) 推荐(0)
摘要: 占位符 格式化 结果 描述 string.Format("{0,4}", 0) 0 不满足指定位数的情况下,在前置插入空格 string.Format("{0,-4}", 0) 0 不满足指定位数的情况下,在后置插入空格 数字格式化 格式化 结果 格式符 描述 string.Format("{0:0 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(244) 评论(0) 推荐(0)
摘要: 一、效果Gif 二、Mark块 public partial class Block : UserControl { public Block() { this.Size = new Size(60, 60); MinFontSize = 4; MaxFontSize = 40; } /// <su 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(348) 评论(0) 推荐(0)
摘要: 一、窗体 绿色边框框住的区域:屏幕橙色边框框住的区域:窗体黄色边框框住的区域:窗体工作区 1.边框 窗体的FormBorderStyle可以设置以下的值,每个值导致窗体的边框的宽度不一样,但是可以发现的是左、右、下边框的宽度是一样的: // // 摘要: // 指定窗体的边框样式。 [ComVisi 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(2401) 评论(0) 推荐(2)
摘要: using System; using System.ComponentModel; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; namespace WindowsFo 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(465) 评论(0) 推荐(0)
摘要: 一、数据模型 Database First (数据库优先):先创建数据库表,然后自动生成EDM文件,EDM文件生成模型类 Model First (模型优先):先创建Edm文件,Edm文件自动生成模型类和数据库;Code First(代码优先):自己写模型类,然后生成数据库,没有EDM。 这里我们现 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(132) 评论(0) 推荐(0)
摘要: using System; using System.Collections.Generic; using System.Diagnostics; using System.Drawing; using Spire.Pdf; using Spire.Pdf.AutomaticFields; usin 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(694) 评论(0) 推荐(0)
摘要: using System; using System.ComponentModel; using System.Reflection; namespace PropertyGridUse { public class PropertyAttribute<T> { /// <summary> /// 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(659) 评论(1) 推荐(0)
摘要: 1、效果图 2、导入导出 using System; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Text; using System.Windows.Forms; 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(1462) 评论(0) 推荐(0)
摘要: 一、比特币 比特币(Bitcoin)的概念最初由中本聪在2008年11月1日提出,并于2009年1月3日正式诞生 。根据中本聪的思路设计发布的开源软件以及建构其上的P2P网络。比特币是一种P2P形式的虚拟的加密数字货币。点对点的传输意味着一个去中心化的支付系统。 与所有的货币不同,比特币不依靠特定货 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(733) 评论(0) 推荐(0)
摘要: 摘要: C#中的自定义控件中的属性(Property)、事件(Event)及一些相关特性(Attribute)的总结 今天学习了下C#用户控件开发添加自定义属性的事件,主要参考了MSDN,总结并实验了一些用于开发自定义属性和事件的特性(Attribute)。 在这里先说一下我的环境: 操作系统:Wi 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(1470) 评论(0) 推荐(0)
摘要: exec('select * from [Table] where [Name]= ''GG'''); 注意:这里GG是以两个单引号括起来的,不是双引号 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(230) 评论(0) 推荐(0)
摘要: 一、抽象(abstract) 只有类(class)才可以抽象,结构体(struct)不能 ,抽象类不能实例化 class Program { abstract class People { } static void Main(string[] args) { People people = new 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(266) 评论(0) 推荐(0)