| 136 | } |
| 137 | |
| 138 | private static _deserializeOne(serializedOne: string, strict: boolean): ContextKeyExpression { |
| 139 | serializedOne = serializedOne.trim(); |
| 140 | |
| 141 | if (serializedOne.indexOf('!=') >= 0) { |
| 142 | let pieces = serializedOne.split('!='); |
| 143 | return ContextKeyNotEqualsExpr.create(pieces[0].trim(), this._deserializeValue(pieces[1], strict)); |
| 144 | } |
| 145 | |
| 146 | if (serializedOne.indexOf('==') >= 0) { |
| 147 | let pieces = serializedOne.split('=='); |
| 148 | return ContextKeyEqualsExpr.create(pieces[0].trim(), this._deserializeValue(pieces[1], strict)); |
| 149 | } |
| 150 | |
| 151 | if (serializedOne.indexOf('=~') >= 0) { |
| 152 | let pieces = serializedOne.split('=~'); |
| 153 | return ContextKeyRegexExpr.create(pieces[0].trim(), this._deserializeRegexValue(pieces[1], strict)); |
| 154 | } |
| 155 | |
| 156 | |
| 157 | |
| 158 | if (serializedOne.indexOf('>=') >= 0) { |
| 159 | let pieces = serializedOne.split('>='); |
| 160 | return ContextKeyGreaterOrEqualsExpr.create(pieces[0].trim(), this._deserializeValue(pieces[1], strict)); |
| 161 | } |
| 162 | |
| 163 | if (serializedOne.indexOf('<=') >= 0) { |
| 164 | let pieces = serializedOne.split('<='); |
| 165 | return ContextKeyLessOrEqualsExpr.create(pieces[0].trim(), this._deserializeValue(pieces[1], strict)); |
| 166 | } |
| 167 | |
| 168 | if (serializedOne.indexOf('>') >= 0) { |
| 169 | let pieces = serializedOne.split('>'); |
| 170 | return ContextKeyGreaterExpr.create(pieces[0].trim(), this._deserializeValue(pieces[1], strict)); |
| 171 | } |
| 172 | |
| 173 | if (serializedOne.indexOf('<') >= 0) { |
| 174 | let pieces = serializedOne.split('<'); |
| 175 | return ContextKeyLessExpr.create(pieces[0].trim(), this._deserializeValue(pieces[1], strict)); |
| 176 | } |
| 177 | |
| 178 | if (/^\!\s*/.test(serializedOne)) { |
| 179 | return ContextKeyNotExpr.create(serializedOne.substr(1).trim()); |
| 180 | } |
| 181 | |
| 182 | return ContextKeyDefinedExpr.create(serializedOne); |
| 183 | } |
| 184 | |
| 185 | private static _deserializeValue(serializedValue: string, strict: boolean): any { |
| 186 | serializedValue = serializedValue.trim(); |