|
| 1 | +# AppMan entries |
1 | 2 |
|
| 3 | +If you want to add your plugin, theme or extension to AppMan, you need to do a pull request to the appman.xml file adding a new entry inside the FD5 comments. Requirements for the offered plugins, themes or extensions are: |
| 4 | + |
| 5 | +* Code needs to be opensource and reviewable in a public repository |
| 6 | +* The item needs to be packaged into a FDZ file and provide a MD5 checksum for verification |
| 7 | +* The FDZ needs to extract the files to the user app data directory |
| 8 | + |
| 9 | +# Coding style |
| 10 | + |
| 11 | +##### Naming should be in English and clear |
| 12 | + |
| 13 | +``` |
| 14 | +private int memberProperty = 0; |
| 15 | +``` |
| 16 | + |
| 17 | +##### Use camelCase for private members and uppercase for public properties, methods and types: |
| 18 | + |
| 19 | +``` |
| 20 | +private int memberProperty = 0; |
| 21 | +
|
| 22 | +public string MemberName = "MemberName"; |
| 23 | +
|
| 24 | +public bool IsMember() |
| 25 | +{ |
| 26 | + return true; |
| 27 | +} |
| 28 | +``` |
| 29 | + |
| 30 | +##### Use types without explicit path: |
| 31 | + |
| 32 | +``` |
| 33 | +private void OnFormActivate(object sender, /*System.*/EventArgs e) |
| 34 | +{ |
| 35 | + // Do something... |
| 36 | +} |
| 37 | +``` |
| 38 | + |
| 39 | +##### Do not use extensive extra empty lines and keep the code clean, not like: |
| 40 | + |
| 41 | +``` |
| 42 | +// Comment... |
| 43 | +private int memberMethod(int value) |
| 44 | +{ |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + // Comment for something... |
| 49 | + |
| 50 | + |
| 51 | + if (value > 2)) |
| 52 | + { |
| 53 | + |
| 54 | + //this.oldCode = 0; |
| 55 | + |
| 56 | + |
| 57 | + // Random notes here |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + return -1; |
| 62 | + } |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + // Something here too... |
| 67 | + else return value; |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + //Little bit here too... |
| 73 | +} |
| 74 | +``` |
| 75 | + |
| 76 | +##### Use brackets and parenthesis for easier readability: |
| 77 | + |
| 78 | +``` |
| 79 | +if ((val1 > val2) && (val1 > val3)) |
| 80 | +{ |
| 81 | + if (val2 > val3) |
| 82 | + { |
| 83 | + doThing(); |
| 84 | + } |
| 85 | +} |
| 86 | +``` |
| 87 | + |
| 88 | +##### Do not nest expressions without brackets: |
| 89 | + |
| 90 | +``` |
| 91 | +if (val1 > val2 && val1 > val3) |
| 92 | +
|
| 93 | + if (val2 > val3) |
| 94 | + |
| 95 | + doThing(); |
| 96 | +
|
| 97 | +``` |
| 98 | + |
| 99 | +##### Use can use one liners to shorten the code: |
| 100 | + |
| 101 | +``` |
| 102 | +if (val1 > val2 && val1 > val3) |
| 103 | +{ |
| 104 | + if (val2 > val3) doThing(); |
| 105 | +} |
| 106 | +``` |
| 107 | + |
| 108 | +##### Use explicit types: |
| 109 | + |
| 110 | +``` |
| 111 | +Int myValue = 0; |
| 112 | +Point[] myPoints = new Point[] |
| 113 | +{ |
| 114 | + new Point(1, 1), |
| 115 | + new Point(2, 2) |
| 116 | +} |
| 117 | +``` |
| 118 | + |
| 119 | +##### Code example: |
| 120 | + |
| 121 | +``` |
| 122 | +import System; |
| 123 | +
|
| 124 | +namespace MyNameSpace |
| 125 | +{ |
| 126 | + class MyClass |
| 127 | + { |
| 128 | + // Comment here... |
| 129 | + private int memberProperty = 0; |
| 130 | + private int memberProperty2 = 1; |
| 131 | + private int memberProperty3 = 2; |
| 132 | + |
| 133 | + // Comment here... |
| 134 | + public string MemberName = "MemberName"; |
| 135 | + |
| 136 | + // Comment here... |
| 137 | + public static bool IsMemberProperty = false; |
| 138 | + |
| 139 | + // Comment here... |
| 140 | + public const int CONSTANT = 1; |
| 141 | + |
| 142 | + /// <summary> |
| 143 | + /// Comment here... |
| 144 | + /// </summary> |
| 145 | + public bool IsMember() |
| 146 | + { |
| 147 | + return true; |
| 148 | + } |
| 149 | + |
| 150 | + /// <summary> |
| 151 | + /// Comment here... |
| 152 | + /// </summary> |
| 153 | + public void MemberMethod(int value) |
| 154 | + { |
| 155 | + if (value > 2)) |
| 156 | + { |
| 157 | + this.memberProperty2 = 2; |
| 158 | + this.memberProperty3 = 3; |
| 159 | + } |
| 160 | + else this.memberProperty3 = value; |
| 161 | + } |
| 162 | + |
| 163 | + /// <summary> |
| 164 | + /// Comment here... |
| 165 | + /// </summary> |
| 166 | + private int MemberMethodEx(int value) |
| 167 | + { |
| 168 | + this.memberProperty3 = 4; |
| 169 | + switch (value) |
| 170 | + { |
| 171 | + case 1: return 1; |
| 172 | + case 2: |
| 173 | + { |
| 174 | + return -1; |
| 175 | + } |
| 176 | + default: return value; |
| 177 | + } |
| 178 | + } |
| 179 | + |
| 180 | + /// <summary> |
| 181 | + /// Comment here... |
| 182 | + /// </summary> |
| 183 | + private void OnFormActivate(object sender, EventArgs e) |
| 184 | + { |
| 185 | + this.MemberMethod(null, null); |
| 186 | + } |
| 187 | +
|
| 188 | + } |
| 189 | + |
| 190 | +} |
| 191 | +``` |
| 192 | + |
| 193 | +##### More generally, be consistent and keep the code clean! |
0 commit comments