mirror of
https://github.com/Kopano-dev/kopano-ol-extension.git
synced 2023-10-10 13:37:40 +02:00
[KOE-117] Improved layout of reminders query trace logging
This commit is contained in:
parent
8110fab096
commit
86b2144e22
@ -42,40 +42,50 @@ namespace Acacia
|
|||||||
|
|
||||||
private void Indent()
|
private void Indent()
|
||||||
{
|
{
|
||||||
_builder.Append(new String(' ', _indent));
|
_builder.Append(new String(' ', _indent * 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Encode(SearchQuery.And part)
|
public void Encode(SearchQuery.And part)
|
||||||
{
|
{
|
||||||
EncodeMulti("AND", part.Operands);
|
EncodeMulti("AND", false, part.Operands);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Encode(SearchQuery.Or part)
|
public void Encode(SearchQuery.Or part)
|
||||||
{
|
{
|
||||||
EncodeMulti("OR", part.Operands);
|
EncodeMulti("OR", false, part.Operands);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Encode(SearchQuery.Not part)
|
public void Encode(SearchQuery.Not part)
|
||||||
{
|
{
|
||||||
EncodeMulti("NOT", new[] { part.Operand });
|
EncodeMulti("NOT", true, new[] { part.Operand });
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EncodeMulti(string oper, IEnumerable<SearchQuery> parts)
|
private void EncodeMulti(string oper, bool prefix, IEnumerable<SearchQuery> parts)
|
||||||
{
|
{
|
||||||
Indent();
|
Indent();
|
||||||
_builder.Append(oper).Append("\n");
|
_builder.Append("(\n");
|
||||||
Indent();
|
|
||||||
_builder.Append("{\n");
|
|
||||||
|
|
||||||
++_indent;
|
++_indent;
|
||||||
|
|
||||||
|
bool first = !prefix;
|
||||||
foreach (SearchQuery operand in parts)
|
foreach (SearchQuery operand in parts)
|
||||||
|
{
|
||||||
|
if (first)
|
||||||
|
first = false;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
--_indent;
|
||||||
|
Indent();
|
||||||
|
_builder.Append(oper).Append("\n");
|
||||||
|
++_indent;
|
||||||
|
}
|
||||||
operand.Encode(this);
|
operand.Encode(this);
|
||||||
|
}
|
||||||
|
|
||||||
--_indent;
|
--_indent;
|
||||||
|
|
||||||
Indent();
|
Indent();
|
||||||
_builder.Append("}\n");
|
_builder.Append(")\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Encode(SearchQuery.PropertyBitMask part)
|
public void Encode(SearchQuery.PropertyBitMask part)
|
||||||
|
Loading…
Reference in New Issue
Block a user