From 0732cfc7e6fa78d102c467224d82cd2fb598f898 Mon Sep 17 00:00:00 2001 From: Zhang Chiyuan Date: Wed, 10 Sep 2008 11:56:57 +0000 Subject: [PATCH] added csharp, sql snippets from users --- snippets/text-mode/cc-mode/csharp-mode/attrib | 7 +++++++ .../text-mode/cc-mode/csharp-mode/attrib.1 | 21 +++++++++++++++++++ .../text-mode/cc-mode/csharp-mode/attrib.2 | 21 +++++++++++++++++++ snippets/text-mode/cc-mode/csharp-mode/class | 21 +++++++++++++++++++ .../text-mode/cc-mode/csharp-mode/comment | 6 ++++++ .../text-mode/cc-mode/csharp-mode/comment.1 | 4 ++++ .../text-mode/cc-mode/csharp-mode/comment.2 | 4 ++++ .../text-mode/cc-mode/csharp-mode/comment.3 | 4 ++++ snippets/text-mode/cc-mode/csharp-mode/method | 10 +++++++++ .../text-mode/cc-mode/csharp-mode/namespace | 7 +++++++ snippets/text-mode/cc-mode/csharp-mode/prop | 16 ++++++++++++++ snippets/text-mode/cc-mode/csharp-mode/region | 6 ++++++ snippets/text-mode/cc-mode/csharp-mode/using | 4 ++++ .../text-mode/cc-mode/csharp-mode/using.1 | 4 ++++ .../text-mode/cc-mode/csharp-mode/using.2 | 4 ++++ snippets/text-mode/sql-mode/column | 4 ++++ snippets/text-mode/sql-mode/constraint | 4 ++++ snippets/text-mode/sql-mode/constraint.1 | 4 ++++ snippets/text-mode/sql-mode/create | 10 +++++++++ snippets/text-mode/sql-mode/create.1 | 12 +++++++++++ snippets/text-mode/sql-mode/references | 4 ++++ 21 files changed, 177 insertions(+) create mode 100644 snippets/text-mode/cc-mode/csharp-mode/attrib create mode 100644 snippets/text-mode/cc-mode/csharp-mode/attrib.1 create mode 100644 snippets/text-mode/cc-mode/csharp-mode/attrib.2 create mode 100644 snippets/text-mode/cc-mode/csharp-mode/class create mode 100644 snippets/text-mode/cc-mode/csharp-mode/comment create mode 100644 snippets/text-mode/cc-mode/csharp-mode/comment.1 create mode 100644 snippets/text-mode/cc-mode/csharp-mode/comment.2 create mode 100644 snippets/text-mode/cc-mode/csharp-mode/comment.3 create mode 100644 snippets/text-mode/cc-mode/csharp-mode/method create mode 100644 snippets/text-mode/cc-mode/csharp-mode/namespace create mode 100644 snippets/text-mode/cc-mode/csharp-mode/prop create mode 100644 snippets/text-mode/cc-mode/csharp-mode/region create mode 100644 snippets/text-mode/cc-mode/csharp-mode/using create mode 100644 snippets/text-mode/cc-mode/csharp-mode/using.1 create mode 100644 snippets/text-mode/cc-mode/csharp-mode/using.2 create mode 100644 snippets/text-mode/sql-mode/column create mode 100644 snippets/text-mode/sql-mode/constraint create mode 100644 snippets/text-mode/sql-mode/constraint.1 create mode 100644 snippets/text-mode/sql-mode/create create mode 100644 snippets/text-mode/sql-mode/create.1 create mode 100644 snippets/text-mode/sql-mode/references diff --git a/snippets/text-mode/cc-mode/csharp-mode/attrib b/snippets/text-mode/cc-mode/csharp-mode/attrib new file mode 100644 index 0000000..9e14e22 --- /dev/null +++ b/snippets/text-mode/cc-mode/csharp-mode/attrib @@ -0,0 +1,7 @@ +#contributor : Alejandro Espinoza Esparza +#name : private attribute ....; +# -- +/// +/// $3 +/// +private $1 $2; diff --git a/snippets/text-mode/cc-mode/csharp-mode/attrib.1 b/snippets/text-mode/cc-mode/csharp-mode/attrib.1 new file mode 100644 index 0000000..099cc7b --- /dev/null +++ b/snippets/text-mode/cc-mode/csharp-mode/attrib.1 @@ -0,0 +1,21 @@ +#contributor : Alejandro Espinoza Esparza +#name : private attribute ....; public property ... ... { ... } +# -- +/// +/// $3 +/// +private $1 $2; + +/// +/// $4 +/// +/// $5 +public $1 $2 +{ + get { + return this.$2; + } + set { + this.$2 = value; + } +} diff --git a/snippets/text-mode/cc-mode/csharp-mode/attrib.2 b/snippets/text-mode/cc-mode/csharp-mode/attrib.2 new file mode 100644 index 0000000..566eacf --- /dev/null +++ b/snippets/text-mode/cc-mode/csharp-mode/attrib.2 @@ -0,0 +1,21 @@ +#contributor : Alejandro Espinoza Esparza +#name : private _attribute ....; public Property ... ... { ... } +# -- +/// +/// $3 +/// +private $1 ${2:$(if (> (length text) 0) (format "_%s%s" (downcase (substring text 0 1)) (substring text 1 (length text))) "")}; + +/// +/// ${3:Description} +/// +/// $1 +public ${1:Type} ${2:Name} +{ + get { + return this.${2:$(if (> (length text) 0) (format "_%s%s" (downcase (substring text 0 1)) (substring text 1 (length text))) "")}; + } + set { + this.${2:$(if (> (length text) 0) (format "_%s%s" (downcase (substring text 0 1)) (substring text 1 (length text))) "")} = value; + } +} diff --git a/snippets/text-mode/cc-mode/csharp-mode/class b/snippets/text-mode/cc-mode/csharp-mode/class new file mode 100644 index 0000000..1cce2e8 --- /dev/null +++ b/snippets/text-mode/cc-mode/csharp-mode/class @@ -0,0 +1,21 @@ +#contributor : Alejandro Espinoza Esparza +#name : class ... { ... } +# -- +${5:public} class ${1:Name} +{ + #region Ctor & Destructor + /// + /// ${3:Standard Constructor} + /// + public $1($2) + { + } + + /// + /// ${4:Default Destructor} + /// + public ~$1() + { + } + #endregion +} diff --git a/snippets/text-mode/cc-mode/csharp-mode/comment b/snippets/text-mode/cc-mode/csharp-mode/comment new file mode 100644 index 0000000..3bd20d3 --- /dev/null +++ b/snippets/text-mode/cc-mode/csharp-mode/comment @@ -0,0 +1,6 @@ +#contributor : Alejandro Espinoza Esparza +#name : /// ... +# -- +/// +/// $1 +/// diff --git a/snippets/text-mode/cc-mode/csharp-mode/comment.1 b/snippets/text-mode/cc-mode/csharp-mode/comment.1 new file mode 100644 index 0000000..3c14ad9 --- /dev/null +++ b/snippets/text-mode/cc-mode/csharp-mode/comment.1 @@ -0,0 +1,4 @@ +#contributor : Alejandro Espinoza Esparza +#name : /// ... +# -- +/// $2 diff --git a/snippets/text-mode/cc-mode/csharp-mode/comment.2 b/snippets/text-mode/cc-mode/csharp-mode/comment.2 new file mode 100644 index 0000000..63a6a20 --- /dev/null +++ b/snippets/text-mode/cc-mode/csharp-mode/comment.2 @@ -0,0 +1,4 @@ +#contributor : Alejandro Espinoza Esparza +#name : /// ... +# -- +/// $1 diff --git a/snippets/text-mode/cc-mode/csharp-mode/comment.3 b/snippets/text-mode/cc-mode/csharp-mode/comment.3 new file mode 100644 index 0000000..394c323 --- /dev/null +++ b/snippets/text-mode/cc-mode/csharp-mode/comment.3 @@ -0,0 +1,4 @@ +#contributor : Alejandro Espinoza Esparza +#name : /// ... +# -- +/// $2 diff --git a/snippets/text-mode/cc-mode/csharp-mode/method b/snippets/text-mode/cc-mode/csharp-mode/method new file mode 100644 index 0000000..e9a5906 --- /dev/null +++ b/snippets/text-mode/cc-mode/csharp-mode/method @@ -0,0 +1,10 @@ +#contributor : Alejandro Espinoza Esparza +#name : public void Method { ... } +# -- +/// +/// ${5:Description} +/// ${2:$(if (string= (upcase text) "VOID") "" (format "%s%s%s" "\n/// " text ""))} +${1:public} ${2:void} ${3:MethodName}($4) +{ +$0 +} diff --git a/snippets/text-mode/cc-mode/csharp-mode/namespace b/snippets/text-mode/cc-mode/csharp-mode/namespace new file mode 100644 index 0000000..af7c928 --- /dev/null +++ b/snippets/text-mode/cc-mode/csharp-mode/namespace @@ -0,0 +1,7 @@ +#contributor : Alejandro Espinoza Esparza +#name : namespace .. { ... } +# -- +namespace $1 +{ +$0 +} diff --git a/snippets/text-mode/cc-mode/csharp-mode/prop b/snippets/text-mode/cc-mode/csharp-mode/prop new file mode 100644 index 0000000..df9df91 --- /dev/null +++ b/snippets/text-mode/cc-mode/csharp-mode/prop @@ -0,0 +1,16 @@ +#contributor : Alejandro Espinoza Esparza +#name : property ... ... { ... } +# -- +/// +/// $5 +/// +/// $6 +$1 $2 $3 +{ + get { + return this.$4; + } + set { + this.$4 = value; + } +} diff --git a/snippets/text-mode/cc-mode/csharp-mode/region b/snippets/text-mode/cc-mode/csharp-mode/region new file mode 100644 index 0000000..83f9a24 --- /dev/null +++ b/snippets/text-mode/cc-mode/csharp-mode/region @@ -0,0 +1,6 @@ +#contributor : Alejandro Espinoza Esparza +#name : #region ... #endregion +# -- +#region $1 +$0 +#endregion diff --git a/snippets/text-mode/cc-mode/csharp-mode/using b/snippets/text-mode/cc-mode/csharp-mode/using new file mode 100644 index 0000000..704637e --- /dev/null +++ b/snippets/text-mode/cc-mode/csharp-mode/using @@ -0,0 +1,4 @@ +#contributor : Alejandro Espinoza Esparza +#name : using ...; +# -- +using $1; diff --git a/snippets/text-mode/cc-mode/csharp-mode/using.1 b/snippets/text-mode/cc-mode/csharp-mode/using.1 new file mode 100644 index 0000000..e9f0bb0 --- /dev/null +++ b/snippets/text-mode/cc-mode/csharp-mode/using.1 @@ -0,0 +1,4 @@ +#contributor : Alejandro Espinoza Esparza +#name : using System; +# -- +using System; diff --git a/snippets/text-mode/cc-mode/csharp-mode/using.2 b/snippets/text-mode/cc-mode/csharp-mode/using.2 new file mode 100644 index 0000000..0a3c07d --- /dev/null +++ b/snippets/text-mode/cc-mode/csharp-mode/using.2 @@ -0,0 +1,4 @@ +#contributor : Alejandro Espinoza Esparza +#name : using System....; +# -- +using System.$1; diff --git a/snippets/text-mode/sql-mode/column b/snippets/text-mode/sql-mode/column new file mode 100644 index 0000000..90e4963 --- /dev/null +++ b/snippets/text-mode/sql-mode/column @@ -0,0 +1,4 @@ +#contributor : Alejandro Espinoza Esparza +#name : , ColumnName ColumnType NOT NULL... +# -- + , ${1:Name} ${2:Type} ${3:NOT NULL} diff --git a/snippets/text-mode/sql-mode/constraint b/snippets/text-mode/sql-mode/constraint new file mode 100644 index 0000000..989e508 --- /dev/null +++ b/snippets/text-mode/sql-mode/constraint @@ -0,0 +1,4 @@ +#contributor : Alejandro Espinoza Esparza +#name : CONSTRAINT [..] PRIMARY KEY ... +# -- +CONSTRAINT [${1:PK_Name}] PRIMARY KEY ${2:CLUSTERED} ([${3:ColumnName}]) diff --git a/snippets/text-mode/sql-mode/constraint.1 b/snippets/text-mode/sql-mode/constraint.1 new file mode 100644 index 0000000..98d89f0 --- /dev/null +++ b/snippets/text-mode/sql-mode/constraint.1 @@ -0,0 +1,4 @@ +#contributor : Alejandro Espinoza Esparza +#name : CONSTRAINT [..] FOREIGN KEY ... +# -- +CONSTRAINT [${1:FK_Name}] FOREIGN KEY ${2:CLUSTERED} ([${3:ColumnName}]) diff --git a/snippets/text-mode/sql-mode/create b/snippets/text-mode/sql-mode/create new file mode 100644 index 0000000..a34624d --- /dev/null +++ b/snippets/text-mode/sql-mode/create @@ -0,0 +1,10 @@ +#contributor : Alejandro Espinoza Esparza +#name : create table ... +# -- +CREATE TABLE [${1:dbo}].[${2:TableName}] +( + ${3:Id} ${4:INT IDENTITY(1,1)} ${5:NOT NULL} +$0 + CONSTRAINT [${6:PK_}] PRIMARY KEY ${7:CLUSTERED} ([$3]) +) +GO diff --git a/snippets/text-mode/sql-mode/create.1 b/snippets/text-mode/sql-mode/create.1 new file mode 100644 index 0000000..1323daf --- /dev/null +++ b/snippets/text-mode/sql-mode/create.1 @@ -0,0 +1,12 @@ +#contributor : Alejandro Espinoza Esparza +#name : create procedure ... +# -- +CREATE PROCEDURE [${1:dbo}].[${2:Name}] +( + $3 $4 = ${5:NULL} ${6:OUTPUT} +) +AS +BEGIN +$0 +END +GO diff --git a/snippets/text-mode/sql-mode/references b/snippets/text-mode/sql-mode/references new file mode 100644 index 0000000..f2e4eab --- /dev/null +++ b/snippets/text-mode/sql-mode/references @@ -0,0 +1,4 @@ +#contributor : Alejandro Espinoza Esparza +#name : REFERENCES ... +# -- +REFERENCES ${1:TableName}([${2:ColumnName}])