1
0
mirror of https://github.com/ONLYOFFICE/XMPPServer.git synced 2025-04-18 14:44:10 +03:00
This commit is contained in:
Alexey Golubev 2022-05-26 11:25:33 +03:00
parent 9deeb55c1b
commit 1f5ffc0fec
268 changed files with 4965 additions and 5064 deletions

View File

@ -89,6 +89,9 @@
<Reference Include="ASC.Common">
<HintPath>..\redistributable\ASC.Common.dll</HintPath>
</Reference>
<Reference Include="ASC.Core.Common">
<HintPath>..\redistributable\ASC.Core.Common.dll</HintPath>
</Reference>
<Reference Include="System">
<Name>System</Name>
</Reference>

View File

@ -81,8 +81,8 @@ namespace ASC.Xmpp.Core.IO.Compression.Checksums
uint s1 = checksum & 0xFFFF;
uint s2 = checksum >> 16;
s1 = (s1 + ((uint) bval & 0xFF))%BASE;
s2 = (s1 + s2)%BASE;
s1 = (s1 + ((uint)bval & 0xFF)) % BASE;
s2 = (s1 + s2) % BASE;
checksum = (s2 << 16) + s1;
}
@ -132,7 +132,7 @@ namespace ASC.Xmpp.Core.IO.Compression.Checksums
len -= n;
while (--n >= 0)
{
s1 = s1 + (uint) (buf[off++] & 0xFF);
s1 = s1 + (uint)(buf[off++] & 0xFF);
s2 = s2 + s1;
}

View File

@ -47,11 +47,11 @@ namespace ASC.Xmpp.Core.IO.Compression
/// <summary>
/// </summary>
private static int BUSY_STATE = 0x10;
private static readonly int BUSY_STATE = 0x10;
/// <summary>
/// </summary>
private static int CLOSED_STATE = 0x7f;
private static readonly int CLOSED_STATE = 0x7f;
/// <summary>
/// The default compression level.
@ -65,15 +65,15 @@ namespace ASC.Xmpp.Core.IO.Compression
/// <summary>
/// </summary>
private static int FINISHED_STATE = 0x1e;
private static readonly int FINISHED_STATE = 0x1e;
/// <summary>
/// </summary>
private static int FINISHING_STATE = 0x1c;
private static readonly int FINISHING_STATE = 0x1c;
/// <summary>
/// </summary>
private static int FLUSHING_STATE = 0x14;
private static readonly int FLUSHING_STATE = 0x14;
/*
* The Deflater can do the following state transitions:
@ -112,19 +112,19 @@ namespace ASC.Xmpp.Core.IO.Compression
/// <summary>
/// </summary>
private static int INIT_STATE = 0;
private static readonly int INIT_STATE = 0;
/// <summary>
/// </summary>
private static int IS_FINISHING = 0x08;
private static readonly int IS_FINISHING = 0x08;
/// <summary>
/// </summary>
private static int IS_FLUSHING = 0x04;
private static readonly int IS_FLUSHING = 0x04;
/// <summary>
/// </summary>
private static int IS_SETDICT = 0x01;
private static readonly int IS_SETDICT = 0x01;
/// <summary>
/// This level won't compress at all but output uncompressed blocks.
@ -133,7 +133,7 @@ namespace ASC.Xmpp.Core.IO.Compression
/// <summary>
/// </summary>
private static int SETDICT_STATE = 0x01;
private static readonly int SETDICT_STATE = 0x01;
/// <summary>
/// The deflater engine.
@ -400,7 +400,7 @@ namespace ASC.Xmpp.Core.IO.Compression
header |= DeflaterConstants.PRESET_DICT;
}
header += 31 - (header%31);
header += 31 - (header % 31);
pending.WriteShortMSB(header);
if ((state & IS_SETDICT) != 0)
@ -414,7 +414,7 @@ namespace ASC.Xmpp.Core.IO.Compression
state = BUSY_STATE | (state & (IS_FLUSHING | IS_FINISHING));
}
for (;;)
for (; ; )
{
int count = pending.Flush(output, offset, length);
offset += count;

View File

@ -73,7 +73,7 @@ namespace ASC.Xmpp.Core.IO.Compression
/// <summary>
/// Internal compression engine constant
/// </summary>
public const int HASH_SHIFT = (HASH_BITS + MIN_MATCH - 1)/MIN_MATCH;
public const int HASH_SHIFT = (HASH_BITS + MIN_MATCH - 1) / MIN_MATCH;
/// <summary>
/// Internal compression engine constant
@ -142,12 +142,12 @@ namespace ASC.Xmpp.Core.IO.Compression
/// <summary>
/// Internal compression engine constant
/// </summary>
public static int[] COMPR_FUNC = {0, 1, 1, 1, 1, 2, 2, 2, 2, 2};
public static int[] COMPR_FUNC = { 0, 1, 1, 1, 1, 2, 2, 2, 2, 2 };
/// <summary>
/// Internal compression engine constant
/// </summary>
public static int[] GOOD_LENGTH = {0, 4, 4, 4, 4, 8, 8, 8, 32, 32};
public static int[] GOOD_LENGTH = { 0, 4, 4, 4, 4, 8, 8, 8, 32, 32 };
/// <summary>
/// Internal compression engine constant
@ -157,17 +157,17 @@ namespace ASC.Xmpp.Core.IO.Compression
/// <summary>
/// Internal compression engine constant
/// </summary>
public static int[] MAX_CHAIN = {0, 4, 8, 32, 16, 32, 128, 256, 1024, 4096};
public static int[] MAX_CHAIN = { 0, 4, 8, 32, 16, 32, 128, 256, 1024, 4096 };
/// <summary>
/// Internal compression engine constant
/// </summary>
public static int[] MAX_LAZY = {0, 4, 5, 6, 4, 16, 16, 32, 128, 258};
public static int[] MAX_LAZY = { 0, 4, 5, 6, 4, 16, 16, 32, 128, 258 };
/// <summary>
/// Internal compression engine constant
/// </summary>
public static int[] NICE_LENGTH = {0, 8, 16, 32, 16, 32, 128, 128, 258, 258};
public static int[] NICE_LENGTH = { 0, 8, 16, 32, 16, 32, 128, 128, 258, 258 };
#endregion
}

View File

@ -20,6 +20,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
using System;
using ASC.Xmpp.Core.IO.Compression.Checksums;
namespace ASC.Xmpp.Core.IO.Compression
@ -69,7 +70,7 @@ namespace ASC.Xmpp.Core.IO.Compression
/// <summary>
/// </summary>
private static int TOO_FAR = 4096;
private static readonly int TOO_FAR = 4096;
/// <summary>
/// The adler checksum
@ -189,7 +190,7 @@ namespace ASC.Xmpp.Core.IO.Compression
huffman = new DeflaterHuffman(pending);
adler = new Adler32();
window = new byte[2*WSIZE];
window = new byte[2 * WSIZE];
head = new short[HASH_SIZE];
prev = new short[WSIZE];
@ -207,7 +208,7 @@ namespace ASC.Xmpp.Core.IO.Compression
/// </summary>
public int Adler
{
get { return (int) adler.Value; }
get { return (int)adler.Value; }
}
/// <summary>
@ -341,7 +342,7 @@ namespace ASC.Xmpp.Core.IO.Compression
*/
while (lookahead < MIN_LOOKAHEAD && inputOff < inputEnd)
{
int more = 2*WSIZE - lookahead - strstart;
int more = 2 * WSIZE - lookahead - strstart;
if (more > inputEnd - inputOff)
{
@ -514,7 +515,7 @@ namespace ASC.Xmpp.Core.IO.Compression
}
*/
prev[strstart & WMASK] = match = head[hash];
head[hash] = (short) strstart;
head[hash] = (short)strstart;
ins_h = hash;
return match & 0xffff;
}
@ -534,14 +535,14 @@ namespace ASC.Xmpp.Core.IO.Compression
for (int i = 0; i < HASH_SIZE; ++i)
{
int m = head[i] & 0xffff;
head[i] = (short) (m >= WSIZE ? (m - WSIZE) : 0);
head[i] = (short)(m >= WSIZE ? (m - WSIZE) : 0);
}
/* Slide the prev table. */
for (int i = 0; i < WSIZE; i++)
{
int m = prev[i] & 0xffff;
prev[i] = (short) (m >= WSIZE ? (m - WSIZE) : 0);
prev[i] = (short)(m >= WSIZE ? (m - WSIZE) : 0);
}
}
@ -700,7 +701,7 @@ namespace ASC.Xmpp.Core.IO.Compression
return false;
}
if (strstart > 2*WSIZE - MIN_LOOKAHEAD)
if (strstart > 2 * WSIZE - MIN_LOOKAHEAD)
{
/* slide window, as findLongestMatch needs this.
* This should only happen when flushing and the window
@ -809,7 +810,7 @@ namespace ASC.Xmpp.Core.IO.Compression
return false;
}
if (strstart >= 2*WSIZE - MIN_LOOKAHEAD)
if (strstart >= 2 * WSIZE - MIN_LOOKAHEAD)
{
/* slide window, as findLongestMatch need this.
* This should only happen when flushing and the window
@ -860,7 +861,7 @@ namespace ASC.Xmpp.Core.IO.Compression
InsertString();
}
} while (--prevLen > 0);
strstart ++;
strstart++;
lookahead--;
prevAvailable = false;
matchLen = MIN_MATCH - 1;

View File

@ -37,43 +37,43 @@ namespace ASC.Xmpp.Core.IO.Compression
/// <summary>
/// </summary>
private static readonly byte[] bit4Reverse = {0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15};
private static readonly byte[] bit4Reverse = { 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15 };
/// <summary>
/// </summary>
private static int BITLEN_NUM = 19;
private static readonly int BITLEN_NUM = 19;
/// <summary>
/// </summary>
private static readonly int[] BL_ORDER = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
private static readonly int[] BL_ORDER = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 };
/// <summary>
/// </summary>
private static int BUFSIZE = 1 << (DeflaterConstants.DEFAULT_MEM_LEVEL + 6);
private static readonly int BUFSIZE = 1 << (DeflaterConstants.DEFAULT_MEM_LEVEL + 6);
/// <summary>
/// </summary>
private static int DIST_NUM = 30;
private static readonly int DIST_NUM = 30;
/// <summary>
/// </summary>
private static int EOF_SYMBOL = 256;
private static readonly int EOF_SYMBOL = 256;
/// <summary>
/// </summary>
private static int LITERAL_NUM = 286;
private static readonly int LITERAL_NUM = 286;
/// <summary>
/// </summary>
private static int REP_11_138 = 18;
private static readonly int REP_11_138 = 18;
/// <summary>
/// </summary>
private static int REP_3_10 = 17;
private static readonly int REP_3_10 = 17;
/// <summary>
/// </summary>
private static int REP_3_6 = 16;
private static readonly int REP_3_6 = 16;
/// <summary>
/// </summary>
@ -258,7 +258,7 @@ namespace ASC.Xmpp.Core.IO.Compression
int lc = Lcode(litlen);
literalTree.WriteSymbol(lc);
int bits = (lc - 261)/4;
int bits = (lc - 261) / 4;
if (bits > 0 && bits <= 5)
{
pending.WriteBits(litlen & ((1 << bits) - 1), bits);
@ -267,7 +267,7 @@ namespace ASC.Xmpp.Core.IO.Compression
int dc = Dcode(dist);
distTree.WriteSymbol(dc);
bits = dc/2 - 1;
bits = dc / 2 - 1;
if (bits > 0)
{
pending.WriteBits(dist & ((1 << bits) - 1), bits);
@ -348,18 +348,18 @@ namespace ASC.Xmpp.Core.IO.Compression
}
}
int opt_len = 14 + blTreeCodes*3 + blTree.GetEncodedLength() + literalTree.GetEncodedLength() +
int opt_len = 14 + blTreeCodes * 3 + blTree.GetEncodedLength() + literalTree.GetEncodedLength() +
distTree.GetEncodedLength() + extra_bits;
int static_len = extra_bits;
for (int i = 0; i < LITERAL_NUM; i++)
{
static_len += literalTree.freqs[i]*staticLLength[i];
static_len += literalTree.freqs[i] * staticLLength[i];
}
for (int i = 0; i < DIST_NUM; i++)
{
static_len += distTree.freqs[i]*staticDLength[i];
static_len += distTree.freqs[i] * staticDLength[i];
}
if (opt_len >= static_len)
@ -420,7 +420,7 @@ namespace ASC.Xmpp.Core.IO.Compression
// }
// }
d_buf[last_lit] = 0;
l_buf[last_lit++] = (byte) lit;
l_buf[last_lit++] = (byte)lit;
literalTree.freqs[lit]++;
return IsFull();
}
@ -436,21 +436,21 @@ namespace ASC.Xmpp.Core.IO.Compression
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("["+dist+","+len+"]");
// }
d_buf[last_lit] = (short) dist;
l_buf[last_lit++] = (byte) (len - 3);
d_buf[last_lit] = (short)dist;
l_buf[last_lit++] = (byte)(len - 3);
int lc = Lcode(len - 3);
literalTree.freqs[lc]++;
if (lc >= 265 && lc < 285)
{
extra_bits += (lc - 261)/4;
extra_bits += (lc - 261) / 4;
}
int dc = Dcode(dist - 1);
distTree.freqs[dc]++;
if (dc >= 4)
{
extra_bits += dc/2 - 1;
extra_bits += dc / 2 - 1;
}
return IsFull();
@ -695,7 +695,7 @@ namespace ASC.Xmpp.Core.IO.Compression
/* Insert n into heap */
int pos = heapLen++;
int ppos;
while (pos > 0 && freqs[heap[ppos = (pos - 1)/2]] > freq)
while (pos > 0 && freqs[heap[ppos = (pos - 1) / 2]] > freq)
{
heap[pos] = heap[ppos];
pos = ppos;
@ -721,14 +721,14 @@ namespace ASC.Xmpp.Core.IO.Compression
numCodes = Math.Max(maxCode + 1, minNumCodes);
int numLeafs = heapLen;
var childs = new int[4*heapLen - 2];
var values = new int[2*heapLen - 1];
var childs = new int[4 * heapLen - 2];
var values = new int[2 * heapLen - 1];
int numNodes = numLeafs;
for (int i = 0; i < heapLen; i++)
{
int node = heap[i];
childs[2*i] = node;
childs[2*i + 1] = -1;
childs[2 * i] = node;
childs[2 * i + 1] = -1;
values[i] = freqs[node] << 8;
heap[i] = i;
}
@ -754,14 +754,14 @@ namespace ASC.Xmpp.Core.IO.Compression
heap[ppos] = heap[path];
ppos = path;
path = path*2 + 1;
path = path * 2 + 1;
}
/* Now propagate the last element down along path. Normally
* it shouldn't go too deep.
*/
int lastVal = values[last];
while ((path = ppos) > 0 && values[heap[ppos = (path - 1)/2]] > lastVal)
while ((path = ppos) > 0 && values[heap[ppos = (path - 1) / 2]] > lastVal)
{
heap[path] = heap[ppos];
}
@ -772,8 +772,8 @@ namespace ASC.Xmpp.Core.IO.Compression
/* Create a new node father of first and second */
last = numNodes++;
childs[2*last] = first;
childs[2*last + 1] = second;
childs[2 * last] = first;
childs[2 * last + 1] = second;
int mindepth = Math.Min(values[first] & 0xff, values[second] & 0xff);
values[last] = lastVal = values[first] + values[second] - mindepth + 1;
@ -790,11 +790,11 @@ namespace ASC.Xmpp.Core.IO.Compression
heap[ppos] = heap[path];
ppos = path;
path = ppos*2 + 1;
path = ppos * 2 + 1;
}
/* Now propagate the new element down along path */
while ((path = ppos) > 0 && values[heap[ppos = (path - 1)/2]] > lastVal)
while ((path = ppos) > 0 && values[heap[ppos = (path - 1) / 2]] > lastVal)
{
heap[path] = heap[ppos];
}
@ -802,7 +802,7 @@ namespace ASC.Xmpp.Core.IO.Compression
heap[path] = last;
} while (heapLen > 1);
if (heap[0] != childs.Length/2 - 1)
if (heap[0] != childs.Length / 2 - 1)
{
throw new SharpZipBaseException("Heap invariant violated");
}
@ -819,7 +819,7 @@ namespace ASC.Xmpp.Core.IO.Compression
int len = 0;
for (int i = 0; i < freqs.Length; i++)
{
len += freqs[i]*length[i];
len += freqs[i] * length[i];
}
return len;
@ -871,7 +871,7 @@ namespace ASC.Xmpp.Core.IO.Compression
if (count < min_count)
{
blTree.freqs[curlen] += (short) count;
blTree.freqs[curlen] += (short)count;
}
else if (curlen != 0)
{
@ -967,8 +967,8 @@ namespace ASC.Xmpp.Core.IO.Compression
private void BuildLength(int[] childs)
{
length = new byte[freqs.Length];
int numNodes = childs.Length/2;
int numLeafs = (numNodes + 1)/2;
int numNodes = childs.Length / 2;
int numLeafs = (numNodes + 1) / 2;
int overflow = 0;
for (int i = 0; i < maxLength; i++)
@ -982,7 +982,7 @@ namespace ASC.Xmpp.Core.IO.Compression
for (int i = numNodes - 1; i >= 0; i--)
{
if (childs[2*i + 1] != -1)
if (childs[2 * i + 1] != -1)
{
int bitLength = lengths[i] + 1;
if (bitLength > maxLength)
@ -991,14 +991,14 @@ namespace ASC.Xmpp.Core.IO.Compression
overflow++;
}
lengths[childs[2*i]] = lengths[childs[2*i + 1]] = bitLength;
lengths[childs[2 * i]] = lengths[childs[2 * i + 1]] = bitLength;
}
else
{
/* A leaf node */
int bitLength = lengths[i];
bl_counts[bitLength - 1]++;
length[childs[2*i]] = (byte) lengths[i];
length[childs[2 * i]] = (byte)lengths[i];
}
}
@ -1048,17 +1048,17 @@ namespace ASC.Xmpp.Core.IO.Compression
* The nodes were inserted with decreasing frequency into the childs
* array.
*/
int nodePtr = 2*numLeafs;
int nodePtr = 2 * numLeafs;
for (int bits = maxLength; bits != 0; bits--)
{
int n = bl_counts[bits - 1];
while (n > 0)
{
int childPtr = 2*childs[nodePtr++];
int childPtr = 2 * childs[nodePtr++];
if (childs[childPtr + 1] == -1)
{
/* We found another leaf */
length[childs[childPtr]] = (byte) bits;
length[childs[childPtr]] = (byte)bits;
n--;
}
}

View File

@ -20,6 +20,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
using System;
using ASC.Xmpp.Core.IO.Compression.Checksums;
using ASC.Xmpp.Core.IO.Compression.Streams;
@ -258,7 +259,7 @@ namespace ASC.Xmpp.Core.IO.Compression
/* The header is written in "wrong" byte order */
header = ((header << 8) | (header >> 8)) & 0xffff;
if (header%31 != 0)
if (header % 31 != 0)
{
throw new SharpZipBaseException("Header checksum illegal");
}
@ -446,9 +447,9 @@ namespace ASC.Xmpp.Core.IO.Compression
neededBits -= 8;
}
if ((int) adler.Value != readAdler)
if ((int)adler.Value != readAdler)
{
throw new SharpZipBaseException("Adler chksum doesn't match: " + (int) adler.Value + " vs. " +
throw new SharpZipBaseException("Adler chksum doesn't match: " + (int)adler.Value + " vs. " +
readAdler);
}
@ -524,50 +525,50 @@ namespace ASC.Xmpp.Core.IO.Compression
return true;
case DECODE_STORED_LEN1:
{
if ((uncomprLen = input.PeekBits(16)) < 0)
{
if ((uncomprLen = input.PeekBits(16)) < 0)
{
return false;
}
input.DropBits(16);
mode = DECODE_STORED_LEN2;
return false;
}
goto case DECODE_STORED_LEN2; /* fall through */
input.DropBits(16);
mode = DECODE_STORED_LEN2;
}
goto case DECODE_STORED_LEN2; /* fall through */
case DECODE_STORED_LEN2:
{
int nlen = input.PeekBits(16);
if (nlen < 0)
{
int nlen = input.PeekBits(16);
if (nlen < 0)
{
return false;
}
input.DropBits(16);
if (nlen != (uncomprLen ^ 0xffff))
{
throw new SharpZipBaseException("broken uncompressed block");
}
mode = DECODE_STORED;
return false;
}
goto case DECODE_STORED; /* fall through */
input.DropBits(16);
if (nlen != (uncomprLen ^ 0xffff))
{
throw new SharpZipBaseException("broken uncompressed block");
}
mode = DECODE_STORED;
}
goto case DECODE_STORED; /* fall through */
case DECODE_STORED:
{
int more = outputWindow.CopyStored(input, uncomprLen);
uncomprLen -= more;
if (uncomprLen == 0)
{
int more = outputWindow.CopyStored(input, uncomprLen);
uncomprLen -= more;
if (uncomprLen == 0)
{
mode = DECODE_BLOCKS;
return true;
}
return !input.IsNeedingInput;
mode = DECODE_BLOCKS;
return true;
}
return !input.IsNeedingInput;
}
case DECODE_DYN_HEADER:
if (!dynHeader.Decode(input))
{
@ -618,7 +619,7 @@ namespace ASC.Xmpp.Core.IO.Compression
}
adler.Update(buffer, offset, len);
if ((int) adler.Value != readAdler)
if ((int)adler.Value != readAdler)
{
throw new SharpZipBaseException("Wrong adler checksum");
}
@ -756,7 +757,7 @@ namespace ASC.Xmpp.Core.IO.Compression
/// <returns> the adler checksum. </returns>
public int Adler
{
get { return IsNeedingDictionary ? readAdler : (int) adler.Value; }
get { return IsNeedingDictionary ? readAdler : (int)adler.Value; }
}
/// <summary>

View File

@ -22,6 +22,7 @@
#region using
using System;
using ASC.Xmpp.Core.IO.Compression.Streams;
#endregion
@ -76,11 +77,11 @@ namespace ASC.Xmpp.Core.IO.Compression
/// <summary>
/// </summary>
private static readonly int[] repBits = {2, 3, 7};
private static readonly int[] repBits = { 2, 3, 7 };
/// <summary>
/// </summary>
private static readonly int[] repMin = {3, 3, 11};
private static readonly int[] repMin = { 3, 3, 11 };
/// <summary>
/// </summary>
@ -137,8 +138,8 @@ namespace ASC.Xmpp.Core.IO.Compression
/// <exception cref="SharpZipBaseException"></exception>
public bool Decode(StreamManipulator input)
{
decode_loop:
for (;;)
decode_loop:
for (; ; )
{
switch (mode)
{
@ -197,7 +198,7 @@ namespace ASC.Xmpp.Core.IO.Compression
input.DropBits(3);
// System.err.println("blLens["+BL_ORDER[ptr]+"]: "+len);
blLens[BL_ORDER[ptr]] = (byte) len;
blLens[BL_ORDER[ptr]] = (byte)len;
ptr++;
}
@ -207,70 +208,14 @@ namespace ASC.Xmpp.Core.IO.Compression
mode = LENS;
goto case LENS; // fall through
case LENS:
{
int symbol;
while (((symbol = blTree.GetSymbol(input)) & ~15) == 0)
{
int symbol;
while (((symbol = blTree.GetSymbol(input)) & ~15) == 0)
{
/* Normal case: symbol in [0..15] */
/* Normal case: symbol in [0..15] */
// System.err.println("litdistLens["+ptr+"]: "+symbol);
litdistLens[ptr++] = lastLen = (byte) symbol;
if (ptr == num)
{
/* Finished */
return true;
}
}
/* need more input ? */
if (symbol < 0)
{
return false;
}
/* otherwise repeat code */
if (symbol >= 17)
{
/* repeat zero */
// System.err.println("repeating zero");
lastLen = 0;
}
else
{
if (ptr == 0)
{
throw new SharpZipBaseException();
}
}
repSymbol = symbol - 16;
}
mode = REPS;
goto case REPS; // fall through
case REPS:
{
int bits = repBits[repSymbol];
int count = input.PeekBits(bits);
if (count < 0)
{
return false;
}
input.DropBits(bits);
count += repMin[repSymbol];
// System.err.println("litdistLens repeated: "+count);
if (ptr + count > num)
{
throw new SharpZipBaseException();
}
while (count-- > 0)
{
litdistLens[ptr++] = lastLen;
}
// System.err.println("litdistLens["+ptr+"]: "+symbol);
litdistLens[ptr++] = lastLen = (byte)symbol;
if (ptr == num)
{
@ -279,8 +224,64 @@ namespace ASC.Xmpp.Core.IO.Compression
}
}
mode = LENS;
goto decode_loop;
/* need more input ? */
if (symbol < 0)
{
return false;
}
/* otherwise repeat code */
if (symbol >= 17)
{
/* repeat zero */
// System.err.println("repeating zero");
lastLen = 0;
}
else
{
if (ptr == 0)
{
throw new SharpZipBaseException();
}
}
repSymbol = symbol - 16;
}
mode = REPS;
goto case REPS; // fall through
case REPS:
{
int bits = repBits[repSymbol];
int count = input.PeekBits(bits);
if (count < 0)
{
return false;
}
input.DropBits(bits);
count += repMin[repSymbol];
// System.err.println("litdistLens repeated: "+count);
if (ptr + count > num)
{
throw new SharpZipBaseException();
}
while (count-- > 0)
{
litdistLens[ptr++] = lastLen;
}
if (ptr == num)
{
/* Finished */
return true;
}
}
mode = LENS;
goto decode_loop;
}
}
}

View File

@ -20,6 +20,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
using System;
using ASC.Xmpp.Core.IO.Compression.Streams;
namespace ASC.Xmpp.Core.IO.Compression
@ -48,7 +49,7 @@ namespace ASC.Xmpp.Core.IO.Compression
/// <summary>
/// </summary>
private static int MAX_BITLEN = 15;
private static readonly int MAX_BITLEN = 15;
/// <summary>
/// </summary>
@ -228,7 +229,7 @@ namespace ASC.Xmpp.Core.IO.Compression
int start = code & 0x1ff80;
for (int i = start; i < end; i += 1 << 7)
{
tree[DeflaterHuffman.BitReverse(i)] = (short) ((-treePtr << 4) | bits);
tree[DeflaterHuffman.BitReverse(i)] = (short)((-treePtr << 4) | bits);
treePtr += 1 << (bits - 9);
}
}
@ -247,7 +248,7 @@ namespace ASC.Xmpp.Core.IO.Compression
{
do
{
tree[revcode] = (short) ((i << 4) | bits);
tree[revcode] = (short)((i << 4) | bits);
revcode += 1 << bits;
} while (revcode < 512);
}
@ -258,7 +259,7 @@ namespace ASC.Xmpp.Core.IO.Compression
subTree = -(subTree >> 4);
do
{
tree[subTree | (revcode >> 9)] = (short) ((i << 4) | bits);
tree[subTree | (revcode >> 9)] = (short)((i << 4) | bits);
revcode += 1 << bits;
} while (revcode < treeLen);
}

View File

@ -109,7 +109,7 @@ namespace ASC.Xmpp.Core.IO.Compression
/// <param name="b"> value to write </param>
public void WriteByte(int b)
{
buf[end++] = (byte) b;
buf[end++] = (byte)b;
}
/// <summary>
@ -118,8 +118,8 @@ namespace ASC.Xmpp.Core.IO.Compression
/// <param name="s"> value to write </param>
public void WriteShort(int s)
{
buf[end++] = (byte) s;
buf[end++] = (byte) (s >> 8);
buf[end++] = (byte)s;
buf[end++] = (byte)(s >> 8);
}
/// <summary>
@ -128,10 +128,10 @@ namespace ASC.Xmpp.Core.IO.Compression
/// <param name="s"> value to write </param>
public void WriteInt(int s)
{
buf[end++] = (byte) s;
buf[end++] = (byte) (s >> 8);
buf[end++] = (byte) (s >> 16);
buf[end++] = (byte) (s >> 24);
buf[end++] = (byte)s;
buf[end++] = (byte)(s >> 8);
buf[end++] = (byte)(s >> 16);
buf[end++] = (byte)(s >> 24);
}
/// <summary>
@ -153,10 +153,10 @@ namespace ASC.Xmpp.Core.IO.Compression
{
if (bitCount > 0)
{
buf[end++] = (byte) bits;
buf[end++] = (byte)bits;
if (bitCount > 8)
{
buf[end++] = (byte) (bits >> 8);
buf[end++] = (byte)(bits >> 8);
}
}
@ -174,12 +174,12 @@ namespace ASC.Xmpp.Core.IO.Compression
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("writeBits("+b+","+count+")");
// }
bits |= (uint) (b << bitCount);
bits |= (uint)(b << bitCount);
bitCount += count;
if (bitCount >= 16)
{
buf[end++] = (byte) bits;
buf[end++] = (byte) (bits >> 8);
buf[end++] = (byte)bits;
buf[end++] = (byte)(bits >> 8);
bits >>= 16;
bitCount -= 16;
}
@ -191,8 +191,8 @@ namespace ASC.Xmpp.Core.IO.Compression
/// <param name="s"> value to write </param>
public void WriteShortMSB(int s)
{
buf[end++] = (byte) (s >> 8);
buf[end++] = (byte) s;
buf[end++] = (byte)(s >> 8);
buf[end++] = (byte)s;
}
/// <summary>
@ -207,7 +207,7 @@ namespace ASC.Xmpp.Core.IO.Compression
{
if (bitCount >= 8)
{
buf[end++] = (byte) bits;
buf[end++] = (byte)bits;
bits >>= 8;
bitCount -= 8;
}

View File

@ -41,7 +41,7 @@ namespace ASC.Xmpp.Core.IO.Compression.Streams
/// <summary>
/// </summary>
private static int WINDOW_SIZE = 1 << 15;
private static readonly int WINDOW_SIZE = 1 << 15;
/// <summary>
/// </summary>
@ -71,7 +71,7 @@ namespace ASC.Xmpp.Core.IO.Compression.Streams
throw new InvalidOperationException("Window full");
}
window[windowEnd++] = (byte) abyte;
window[windowEnd++] = (byte)abyte;
windowEnd &= WINDOW_MASK;
}

View File

@ -109,7 +109,7 @@ namespace ASC.Xmpp.Core.IO.Compression.Streams
bits_in_buffer += 16;
}
return (int) (buffer & ((1 << n) - 1));
return (int)(buffer & ((1 << n) - 1));
}
/// <summary>
@ -172,7 +172,7 @@ namespace ASC.Xmpp.Core.IO.Compression.Streams
int count = 0;
while (bits_in_buffer > 0 && length > 0)
{
output[offset++] = (byte) buffer;
output[offset++] = (byte)buffer;
buffer >>= 8;
bits_in_buffer -= 8;
length--;
@ -196,7 +196,7 @@ namespace ASC.Xmpp.Core.IO.Compression.Streams
if (((window_start - window_end) & 1) != 0)
{
/* We always want an even number of bytes in input, see peekBits */
buffer = (uint) (window[window_start++] & 0xff);
buffer = (uint)(window[window_start++] & 0xff);
bits_in_buffer = 8;
}
@ -208,7 +208,7 @@ namespace ASC.Xmpp.Core.IO.Compression.Streams
/// </summary>
public void Reset()
{
buffer = (uint) (window_start = window_end = bits_in_buffer = 0);
buffer = (uint)(window_start = window_end = bits_in_buffer = 0);
}
/// <summary>
@ -237,7 +237,7 @@ namespace ASC.Xmpp.Core.IO.Compression.Streams
if ((len & 1) != 0)
{
/* We always want an even number of bytes in input, see peekBits */
buffer |= (uint) ((buf[off++] & 0xff) << bits_in_buffer);
buffer |= (uint)((buf[off++] & 0xff) << bits_in_buffer);
bits_in_buffer += 8;
}

View File

@ -2,42 +2,6 @@
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.8.6.0" newVersion="1.8.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="StackExchange.Redis.Extensions.Core" publicKeyToken="d7d863643bcd13ef" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.5.0.0" newVersion="5.5.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.1" newVersion="4.0.2.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Channels" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@ -158,11 +158,11 @@ namespace ASC.Xmpp.Core.authorization.DigestMD5
#endregion
public override void Init()
{
{
}
public override void Parse(utils.Xml.Dom.Node e)
{
{
}
#region Utility methods

View File

@ -24,6 +24,7 @@
using System;
using System.Security.Cryptography;
using System.Text;
using ASC.Xmpp.Core.utils;
#endregion

View File

@ -48,8 +48,10 @@ namespace ASC.Xmpp.Core.authorization
/// <summary>
/// </summary>
public string Username { // lower case that until i implement our c# port of libIDN
get; set; }
public string Username
{ // lower case that until i implement our c# port of libIDN
get; set;
}
//public XmppClientConnection XmppClientConnection { get; set; }

View File

@ -23,6 +23,7 @@
using System;
using System.Text;
using ASC.Xmpp.Core.utils.Xml.Dom;
#endregion
@ -81,9 +82,9 @@ namespace ASC.Xmpp.Core.authorization.Plain
// sb.Append( (char) 0 );
// sb.Append(this.m_XmppClient.MyJID.Bare);
sb.Append((char) 0);
sb.Append((char)0);
sb.Append(Username);
sb.Append((char) 0);
sb.Append((char)0);
sb.Append(Password);
byte[] msg = Encoding.UTF8.GetBytes(sb.ToString());

View File

@ -20,6 +20,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
using System;
using ASC.Xmpp.Core.utils.Xml.Dom;
namespace ASC.Xmpp.Core.protocol.Base

View File

@ -19,9 +19,10 @@
* http://www.ag-software.de *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
using ASC.Xmpp.Core.utils.Xml.Dom;
using System;
using ASC.Xmpp.Core.utils.Xml.Dom;
namespace ASC.Xmpp.Core.protocol.Base
{

View File

@ -21,6 +21,9 @@
#region using
using System;
using System.Collections.Generic;
using ASC.Xmpp.Core.protocol.Base;
using ASC.Xmpp.Core.protocol.component;
using ASC.Xmpp.Core.protocol.extensions.amp;
@ -76,8 +79,7 @@ using ASC.Xmpp.Core.protocol.x.rosterx;
using ASC.Xmpp.Core.protocol.x.tm.history;
using ASC.Xmpp.Core.protocol.x.vcard_update;
using ASC.Xmpp.Core.utils.Xml.Dom;
using System;
using System.Collections.Generic;
using Active = ASC.Xmpp.Core.protocol.iq.privacy.Active;
using Address = ASC.Xmpp.Core.protocol.extensions.multicast.Address;
using Affiliation = ASC.Xmpp.Core.protocol.extensions.pubsub.Affiliation;
@ -85,7 +87,6 @@ using Auth = ASC.Xmpp.Core.protocol.iq.auth.Auth;
using Avatar = ASC.Xmpp.Core.protocol.iq.avatar.Avatar;
using Conference = ASC.Xmpp.Core.protocol.x.Conference;
using Configure = ASC.Xmpp.Core.protocol.extensions.pubsub.owner.Configure;
using Data = ASC.Xmpp.Core.protocol.x.data.Data;
using Delete = ASC.Xmpp.Core.protocol.extensions.pubsub.owner.Delete;
using Event = ASC.Xmpp.Core.protocol.x.Event;
using Failure = ASC.Xmpp.Core.protocol.tls.Failure;
@ -131,122 +132,122 @@ namespace ASC.Xmpp.Core.protocol
/// </summary>
static ElementFactory()
{
AddElementType("iq", Uri.CLIENT, typeof (IQ));
AddElementType("message", Uri.CLIENT, typeof (Message));
AddElementType("presence", Uri.CLIENT, typeof (Presence));
AddElementType("error", Uri.CLIENT, typeof (client.Error));
AddElementType("iq", Uri.CLIENT, typeof(IQ));
AddElementType("message", Uri.CLIENT, typeof(Message));
AddElementType("presence", Uri.CLIENT, typeof(Presence));
AddElementType("error", Uri.CLIENT, typeof(client.Error));
AddElementType("agent", Uri.IQ_AGENTS, typeof (Agent));
AddElementType("agent", Uri.IQ_AGENTS, typeof(Agent));
AddElementType("item", Uri.IQ_ROSTER, typeof (RosterItem));
AddElementType("group", Uri.IQ_ROSTER, typeof (Group));
AddElementType("group", Uri.X_ROSTERX, typeof (Group));
AddElementType("item", Uri.IQ_ROSTER, typeof(RosterItem));
AddElementType("group", Uri.IQ_ROSTER, typeof(Group));
AddElementType("group", Uri.X_ROSTERX, typeof(Group));
AddElementType("item", Uri.IQ_SEARCH, typeof (SearchItem));
AddElementType("item", Uri.IQ_SEARCH, typeof(SearchItem));
// Stream stuff
AddElementType("stream", Uri.STREAM, typeof (Stream));
AddElementType("error", Uri.STREAM, typeof (Error));
AddElementType("stream", Uri.STREAM, typeof(Stream));
AddElementType("error", Uri.STREAM, typeof(Error));
AddElementType("server", Uri.IQ_GOOGLE_JINGLE, typeof (Server));
AddElementType("stun", Uri.IQ_GOOGLE_JINGLE, typeof (Stun));
AddElementType("query", Uri.IQ_GOOGLE_JINGLE, typeof (GoogleJingle));
AddElementType("server", Uri.IQ_GOOGLE_JINGLE, typeof(Server));
AddElementType("stun", Uri.IQ_GOOGLE_JINGLE, typeof(Stun));
AddElementType("query", Uri.IQ_GOOGLE_JINGLE, typeof(GoogleJingle));
AddElementType("query", Uri.IQ_AUTH, typeof (Auth));
AddElementType("query", Uri.IQ_AGENTS, typeof (Agents));
AddElementType("query", Uri.IQ_ROSTER, typeof (Roster));
AddElementType("query", Uri.IQ_LAST, typeof (Last));
AddElementType("query", Uri.IQ_VERSION, typeof (Version));
AddElementType("query", Uri.IQ_TIME, typeof (Time));
AddElementType("query", Uri.IQ_OOB, typeof (Oob));
AddElementType("query", Uri.IQ_SEARCH, typeof (Search));
AddElementType("query", Uri.IQ_BROWSE, typeof (Browse));
AddElementType("query", Uri.IQ_AVATAR, typeof (Avatar));
AddElementType("query", Uri.IQ_REGISTER, typeof (Register));
AddElementType("query", Uri.IQ_PRIVATE, typeof (Private));
AddElementType("query", Uri.IQ_AUTH, typeof(Auth));
AddElementType("query", Uri.IQ_AGENTS, typeof(Agents));
AddElementType("query", Uri.IQ_ROSTER, typeof(Roster));
AddElementType("query", Uri.IQ_LAST, typeof(Last));
AddElementType("query", Uri.IQ_VERSION, typeof(Version));
AddElementType("query", Uri.IQ_TIME, typeof(Time));
AddElementType("query", Uri.IQ_OOB, typeof(Oob));
AddElementType("query", Uri.IQ_SEARCH, typeof(Search));
AddElementType("query", Uri.IQ_BROWSE, typeof(Browse));
AddElementType("query", Uri.IQ_AVATAR, typeof(Avatar));
AddElementType("query", Uri.IQ_REGISTER, typeof(Register));
AddElementType("query", Uri.IQ_PRIVATE, typeof(Private));
AddElementType("blocklist", Uri.IQ_BLOCKLIST, typeof (Blocklist));
AddElementType("block", Uri.IQ_BLOCKLIST, typeof (Block));
AddElementType("unblock", Uri.IQ_BLOCKLIST, typeof (Unblock));
AddElementType("blocklist", Uri.IQ_BLOCKLIST, typeof(Blocklist));
AddElementType("block", Uri.IQ_BLOCKLIST, typeof(Block));
AddElementType("unblock", Uri.IQ_BLOCKLIST, typeof(Unblock));
// Privacy Lists
AddElementType("query", Uri.IQ_PRIVACY, typeof (Privacy));
AddElementType("item", Uri.IQ_PRIVACY, typeof (Item));
AddElementType("list", Uri.IQ_PRIVACY, typeof (List));
AddElementType("active", Uri.IQ_PRIVACY, typeof (Active));
AddElementType("default", Uri.IQ_PRIVACY, typeof (Default));
AddElementType("query", Uri.IQ_PRIVACY, typeof(Privacy));
AddElementType("item", Uri.IQ_PRIVACY, typeof(Item));
AddElementType("list", Uri.IQ_PRIVACY, typeof(List));
AddElementType("active", Uri.IQ_PRIVACY, typeof(Active));
AddElementType("default", Uri.IQ_PRIVACY, typeof(Default));
// Browse
AddElementType("service", Uri.IQ_BROWSE, typeof (Service));
AddElementType("item", Uri.IQ_BROWSE, typeof (BrowseItem));
AddElementType("service", Uri.IQ_BROWSE, typeof(Service));
AddElementType("item", Uri.IQ_BROWSE, typeof(BrowseItem));
// Service Discovery
AddElementType("query", Uri.DISCO_ITEMS, typeof (DiscoItems));
AddElementType("query", Uri.DISCO_INFO, typeof (DiscoInfo));
AddElementType("feature", Uri.DISCO_INFO, typeof (DiscoFeature));
AddElementType("identity", Uri.DISCO_INFO, typeof (DiscoIdentity));
AddElementType("item", Uri.DISCO_ITEMS, typeof (DiscoItem));
AddElementType("query", Uri.DISCO_ITEMS, typeof(DiscoItems));
AddElementType("query", Uri.DISCO_INFO, typeof(DiscoInfo));
AddElementType("feature", Uri.DISCO_INFO, typeof(DiscoFeature));
AddElementType("identity", Uri.DISCO_INFO, typeof(DiscoIdentity));
AddElementType("item", Uri.DISCO_ITEMS, typeof(DiscoItem));
AddElementType("x", Uri.X_DELAY, typeof (Delay));
AddElementType("x", Uri.X_AVATAR, typeof (x.Avatar));
AddElementType("x", Uri.X_CONFERENCE, typeof (Conference));
AddElementType("x", Uri.X_EVENT, typeof (Event));
AddElementType("x", Uri.X_DELAY, typeof(Delay));
AddElementType("x", Uri.X_AVATAR, typeof(x.Avatar));
AddElementType("x", Uri.X_CONFERENCE, typeof(Conference));
AddElementType("x", Uri.X_EVENT, typeof(Event));
// AddElementType("x", Uri.STORAGE_AVATAR, typeof(agsXMPP.protocol.storage.Avatar));
AddElementType("query", Uri.STORAGE_AVATAR, typeof (storage.Avatar));
AddElementType("query", Uri.STORAGE_AVATAR, typeof(storage.Avatar));
// XData Stuff
AddElementType("x", Uri.X_DATA, typeof (x.data.Data));
AddElementType("field", Uri.X_DATA, typeof (Field));
AddElementType("option", Uri.X_DATA, typeof (Option));
AddElementType("value", Uri.X_DATA, typeof (Value));
AddElementType("reported", Uri.X_DATA, typeof (Reported));
AddElementType("item", Uri.X_DATA, typeof (x.data.Item));
AddElementType("x", Uri.X_DATA, typeof(x.data.Data));
AddElementType("field", Uri.X_DATA, typeof(Field));
AddElementType("option", Uri.X_DATA, typeof(Option));
AddElementType("value", Uri.X_DATA, typeof(Value));
AddElementType("reported", Uri.X_DATA, typeof(Reported));
AddElementType("item", Uri.X_DATA, typeof(x.data.Item));
AddElementType("features", Uri.STREAM, typeof (Features));
AddElementType("features", Uri.STREAM, typeof(Features));
AddElementType("register", Uri.FEATURE_IQ_REGISTER, typeof (stream.feature.Register));
AddElementType("compression", Uri.FEATURE_COMPRESS, typeof (Compression));
AddElementType("method", Uri.FEATURE_COMPRESS, typeof (Method));
AddElementType("register", Uri.FEATURE_IQ_REGISTER, typeof(stream.feature.Register));
AddElementType("compression", Uri.FEATURE_COMPRESS, typeof(Compression));
AddElementType("method", Uri.FEATURE_COMPRESS, typeof(Method));
AddElementType("jingle", Uri.IQ_JINGLE1, typeof (Jingle));
AddElementType("jingle", Uri.IQ_JINGLE0, typeof (Jingle));
AddElementType("bind", Uri.BIND, typeof (Bind));
AddElementType("unbind", Uri.BIND, typeof (Bind));
AddElementType("session", Uri.SESSION, typeof (Session));
AddElementType("jingle", Uri.IQ_JINGLE1, typeof(Jingle));
AddElementType("jingle", Uri.IQ_JINGLE0, typeof(Jingle));
AddElementType("bind", Uri.BIND, typeof(Bind));
AddElementType("unbind", Uri.BIND, typeof(Bind));
AddElementType("session", Uri.SESSION, typeof(Session));
// TLS stuff
AddElementType("failure", Uri.TLS, typeof (Failure));
AddElementType("proceed", Uri.TLS, typeof (Proceed));
AddElementType("starttls", Uri.TLS, typeof (StartTls));
AddElementType("failure", Uri.TLS, typeof(Failure));
AddElementType("proceed", Uri.TLS, typeof(Proceed));
AddElementType("starttls", Uri.TLS, typeof(StartTls));
// SASL stuff
AddElementType("mechanisms", Uri.SASL, typeof (Mechanisms));
AddElementType("mechanism", Uri.SASL, typeof (Mechanism));
AddElementType("auth", Uri.SASL, typeof (sasl.Auth));
AddElementType("x-tmtoken", Uri.SASL, typeof (TMToken)); //TeamLab token
AddElementType("response", Uri.SASL, typeof (Response));
AddElementType("challenge", Uri.SASL, typeof (Challenge));
AddElementType("mechanisms", Uri.SASL, typeof(Mechanisms));
AddElementType("mechanism", Uri.SASL, typeof(Mechanism));
AddElementType("auth", Uri.SASL, typeof(sasl.Auth));
AddElementType("x-tmtoken", Uri.SASL, typeof(TMToken)); //TeamLab token
AddElementType("response", Uri.SASL, typeof(Response));
AddElementType("challenge", Uri.SASL, typeof(Challenge));
// TODO, this is a dirty hacks for the buggy BOSH Proxy
// BEGIN
AddElementType("challenge", Uri.CLIENT, typeof (Challenge));
AddElementType("success", Uri.CLIENT, typeof (Success));
AddElementType("challenge", Uri.CLIENT, typeof(Challenge));
AddElementType("success", Uri.CLIENT, typeof(Success));
// END
AddElementType("failure", Uri.SASL, typeof (sasl.Failure));
AddElementType("abort", Uri.SASL, typeof (Abort));
AddElementType("success", Uri.SASL, typeof (Success));
AddElementType("failure", Uri.SASL, typeof(sasl.Failure));
AddElementType("abort", Uri.SASL, typeof(Abort));
AddElementType("success", Uri.SASL, typeof(Success));
// Vcard stuff
AddElementType("vCard", Uri.VCARD, typeof (Vcard));
AddElementType("TEL", Uri.VCARD, typeof (Telephone));
AddElementType("ORG", Uri.VCARD, typeof (Organization));
AddElementType("N", Uri.VCARD, typeof (Name));
AddElementType("EMAIL", Uri.VCARD, typeof (Email));
AddElementType("ADR", Uri.VCARD, typeof (Address));
AddElementType("vCard", Uri.VCARD, typeof(Vcard));
AddElementType("TEL", Uri.VCARD, typeof(Telephone));
AddElementType("ORG", Uri.VCARD, typeof(Organization));
AddElementType("N", Uri.VCARD, typeof(Name));
AddElementType("EMAIL", Uri.VCARD, typeof(Email));
AddElementType("ADR", Uri.VCARD, typeof(Address));
#if !CF
AddElementType("PHOTO", Uri.VCARD, typeof (Photo));
AddElementType("PHOTO", Uri.VCARD, typeof(Photo));
#endif
// Server stuff
@ -254,176 +255,176 @@ namespace ASC.Xmpp.Core.protocol
// AddElementType("message", Uri.SERVER, typeof(agsXMPP.protocol.server.Message));
// Component stuff
AddElementType("handshake", Uri.ACCEPT, typeof (Handshake));
AddElementType("log", Uri.ACCEPT, typeof (Log));
AddElementType("route", Uri.ACCEPT, typeof (Route));
AddElementType("iq", Uri.ACCEPT, typeof (component.IQ));
AddElementType("message", Uri.ACCEPT, typeof (component.Message));
AddElementType("presence", Uri.ACCEPT, typeof (component.Presence));
AddElementType("error", Uri.ACCEPT, typeof (component.Error));
AddElementType("handshake", Uri.ACCEPT, typeof(Handshake));
AddElementType("log", Uri.ACCEPT, typeof(Log));
AddElementType("route", Uri.ACCEPT, typeof(Route));
AddElementType("iq", Uri.ACCEPT, typeof(component.IQ));
AddElementType("message", Uri.ACCEPT, typeof(component.Message));
AddElementType("presence", Uri.ACCEPT, typeof(component.Presence));
AddElementType("error", Uri.ACCEPT, typeof(component.Error));
// Extensions (JEPS)
AddElementType("headers", Uri.SHIM, typeof (Header));
AddElementType("header", Uri.SHIM, typeof (Headers));
AddElementType("roster", Uri.ROSTER_DELIMITER, typeof (Delimiter));
AddElementType("p", Uri.PRIMARY, typeof (Primary));
AddElementType("nick", Uri.NICK, typeof (Nickname));
AddElementType("headers", Uri.SHIM, typeof(Header));
AddElementType("header", Uri.SHIM, typeof(Headers));
AddElementType("roster", Uri.ROSTER_DELIMITER, typeof(Delimiter));
AddElementType("p", Uri.PRIMARY, typeof(Primary));
AddElementType("nick", Uri.NICK, typeof(Nickname));
AddElementType("item", Uri.X_ROSTERX, typeof (x.rosterx.RosterItem));
AddElementType("x", Uri.X_ROSTERX, typeof (RosterX));
AddElementType("item", Uri.X_ROSTERX, typeof(x.rosterx.RosterItem));
AddElementType("x", Uri.X_ROSTERX, typeof(RosterX));
// Filetransfer stuff
AddElementType("file", Uri.SI_FILE_TRANSFER, typeof (File));
AddElementType("range", Uri.SI_FILE_TRANSFER, typeof (Range));
AddElementType("file", Uri.SI_FILE_TRANSFER, typeof(File));
AddElementType("range", Uri.SI_FILE_TRANSFER, typeof(Range));
// FeatureNeg
AddElementType("feature", Uri.FEATURE_NEG, typeof (FeatureNeg));
AddElementType("feature", Uri.FEATURE_NEG, typeof(FeatureNeg));
// Bytestreams
AddElementType("query", Uri.BYTESTREAMS, typeof (ByteStream));
AddElementType("streamhost", Uri.BYTESTREAMS, typeof (StreamHost));
AddElementType("streamhost-used", Uri.BYTESTREAMS, typeof (StreamHostUsed));
AddElementType("activate", Uri.BYTESTREAMS, typeof (Activate));
AddElementType("udpsuccess", Uri.BYTESTREAMS, typeof (UdpSuccess));
AddElementType("query", Uri.BYTESTREAMS, typeof(ByteStream));
AddElementType("streamhost", Uri.BYTESTREAMS, typeof(StreamHost));
AddElementType("streamhost-used", Uri.BYTESTREAMS, typeof(StreamHostUsed));
AddElementType("activate", Uri.BYTESTREAMS, typeof(Activate));
AddElementType("udpsuccess", Uri.BYTESTREAMS, typeof(UdpSuccess));
AddElementType("si", Uri.SI, typeof (SI));
AddElementType("si", Uri.SI, typeof(SI));
AddElementType("html", Uri.XHTML_IM, typeof (Html));
AddElementType("body", Uri.XHTML, typeof (Body));
AddElementType("html", Uri.XHTML_IM, typeof(Html));
AddElementType("body", Uri.XHTML, typeof(Body));
AddElementType("compressed", Uri.COMPRESS, typeof (Compressed));
AddElementType("compress", Uri.COMPRESS, typeof (Compress));
AddElementType("failure", Uri.COMPRESS, typeof (extensions.compression.Failure));
AddElementType("compressed", Uri.COMPRESS, typeof(Compressed));
AddElementType("compress", Uri.COMPRESS, typeof(Compress));
AddElementType("failure", Uri.COMPRESS, typeof(extensions.compression.Failure));
// MUC (JEP-0045 Multi User Chat)
AddElementType("x", Uri.MUC, typeof (Muc));
AddElementType("x", Uri.MUC_USER, typeof (User));
AddElementType("item", Uri.MUC_USER, typeof (x.muc.Item));
AddElementType("status", Uri.MUC_USER, typeof (Status));
AddElementType("invite", Uri.MUC_USER, typeof (Invite));
AddElementType("decline", Uri.MUC_USER, typeof (Decline));
AddElementType("actor", Uri.MUC_USER, typeof (Actor));
AddElementType("history", Uri.MUC, typeof (History));
AddElementType("query", Uri.MUC_ADMIN, typeof (Admin));
AddElementType("item", Uri.MUC_ADMIN, typeof (x.muc.iq.admin.Item));
AddElementType("query", Uri.MUC_OWNER, typeof (Owner));
AddElementType("destroy", Uri.MUC_OWNER, typeof (Destroy));
AddElementType("unique", Uri.MUC_UNIQUE, typeof (Unique));
AddElementType("x", Uri.MUC, typeof(Muc));
AddElementType("x", Uri.MUC_USER, typeof(User));
AddElementType("item", Uri.MUC_USER, typeof(x.muc.Item));
AddElementType("status", Uri.MUC_USER, typeof(Status));
AddElementType("invite", Uri.MUC_USER, typeof(Invite));
AddElementType("decline", Uri.MUC_USER, typeof(Decline));
AddElementType("actor", Uri.MUC_USER, typeof(Actor));
AddElementType("history", Uri.MUC, typeof(History));
AddElementType("query", Uri.MUC_ADMIN, typeof(Admin));
AddElementType("item", Uri.MUC_ADMIN, typeof(x.muc.iq.admin.Item));
AddElementType("query", Uri.MUC_OWNER, typeof(Owner));
AddElementType("destroy", Uri.MUC_OWNER, typeof(Destroy));
AddElementType("unique", Uri.MUC_UNIQUE, typeof(Unique));
//Jabber xep-003 Addressing
AddElementType("addresses", Uri.ADDRESS, typeof (Addresses));
AddElementType("address", Uri.ADDRESS, typeof (Address));
AddElementType("addresses", Uri.ADDRESS, typeof(Addresses));
AddElementType("address", Uri.ADDRESS, typeof(Address));
// Jabber RPC JEP 0009
AddElementType("query", Uri.IQ_RPC, typeof (Rpc));
AddElementType("methodCall", Uri.IQ_RPC, typeof (MethodCall));
AddElementType("methodResponse", Uri.IQ_RPC, typeof (MethodResponse));
AddElementType("query", Uri.IQ_RPC, typeof(Rpc));
AddElementType("methodCall", Uri.IQ_RPC, typeof(MethodCall));
AddElementType("methodResponse", Uri.IQ_RPC, typeof(MethodResponse));
// Chatstates Jep-0085
AddElementType("active", Uri.CHATSTATES, typeof (extensions.chatstates.Active));
AddElementType("inactive", Uri.CHATSTATES, typeof (Inactive));
AddElementType("composing", Uri.CHATSTATES, typeof (Composing));
AddElementType("paused", Uri.CHATSTATES, typeof (Paused));
AddElementType("gone", Uri.CHATSTATES, typeof (Gone));
AddElementType("active", Uri.CHATSTATES, typeof(extensions.chatstates.Active));
AddElementType("inactive", Uri.CHATSTATES, typeof(Inactive));
AddElementType("composing", Uri.CHATSTATES, typeof(Composing));
AddElementType("paused", Uri.CHATSTATES, typeof(Paused));
AddElementType("gone", Uri.CHATSTATES, typeof(Gone));
// Jivesoftware Extenstions
AddElementType("phone-event", Uri.JIVESOFTWARE_PHONE, typeof (PhoneEvent));
AddElementType("phone-action", Uri.JIVESOFTWARE_PHONE, typeof (PhoneAction));
AddElementType("phone-status", Uri.JIVESOFTWARE_PHONE, typeof (PhoneStatus));
AddElementType("phone-event", Uri.JIVESOFTWARE_PHONE, typeof(PhoneEvent));
AddElementType("phone-action", Uri.JIVESOFTWARE_PHONE, typeof(PhoneAction));
AddElementType("phone-status", Uri.JIVESOFTWARE_PHONE, typeof(PhoneStatus));
// Jingle stuff is in heavy development, we commit this once the most changes on the Jeps are done
// AddElementType("jingle", Uri.JINGLE, typeof(agsXMPP.protocol.extensions.jingle.Jingle));
// AddElementType("candidate", Uri.JINGLE, typeof(agsXMPP.protocol.extensions.jingle.Candidate));
AddElementType("c", Uri.CAPS, typeof (Capabilities));
AddElementType("c", Uri.CAPS, typeof(Capabilities));
AddElementType("geoloc", Uri.GEOLOC, typeof (GeoLoc));
AddElementType("geoloc", Uri.GEOLOC, typeof(GeoLoc));
// Xmpp Ping
AddElementType("ping", Uri.PING, typeof (Ping));
AddElementType("ping", Uri.PING, typeof(Ping));
// Ad-Hock Commands
AddElementType("command", Uri.COMMANDS, typeof (Command));
AddElementType("actions", Uri.COMMANDS, typeof (Actions));
AddElementType("note", Uri.COMMANDS, typeof (Note));
AddElementType("command", Uri.COMMANDS, typeof(Command));
AddElementType("actions", Uri.COMMANDS, typeof(Actions));
AddElementType("note", Uri.COMMANDS, typeof(Note));
// **********
// * PubSub *
// **********
// Owner namespace
AddElementType("affiliate", Uri.PUBSUB_OWNER, typeof (Affiliate));
AddElementType("affiliates", Uri.PUBSUB_OWNER, typeof (Affiliates));
AddElementType("configure", Uri.PUBSUB_OWNER, typeof (Configure));
AddElementType("delete", Uri.PUBSUB_OWNER, typeof (Delete));
AddElementType("pending", Uri.PUBSUB_OWNER, typeof (Pending));
AddElementType("pubsub", Uri.PUBSUB_OWNER, typeof (PubSub));
AddElementType("purge", Uri.PUBSUB_OWNER, typeof (Purge));
AddElementType("subscriber", Uri.PUBSUB_OWNER, typeof (Subscriber));
AddElementType("subscribers", Uri.PUBSUB_OWNER, typeof (Subscribers));
AddElementType("affiliate", Uri.PUBSUB_OWNER, typeof(Affiliate));
AddElementType("affiliates", Uri.PUBSUB_OWNER, typeof(Affiliates));
AddElementType("configure", Uri.PUBSUB_OWNER, typeof(Configure));
AddElementType("delete", Uri.PUBSUB_OWNER, typeof(Delete));
AddElementType("pending", Uri.PUBSUB_OWNER, typeof(Pending));
AddElementType("pubsub", Uri.PUBSUB_OWNER, typeof(PubSub));
AddElementType("purge", Uri.PUBSUB_OWNER, typeof(Purge));
AddElementType("subscriber", Uri.PUBSUB_OWNER, typeof(Subscriber));
AddElementType("subscribers", Uri.PUBSUB_OWNER, typeof(Subscribers));
// Event namespace
AddElementType("delete", Uri.PUBSUB_EVENT, typeof (extensions.pubsub.@event.Delete));
AddElementType("event", Uri.PUBSUB_EVENT, typeof (extensions.pubsub.@event.Event));
AddElementType("item", Uri.PUBSUB_EVENT, typeof (extensions.pubsub.@event.Item));
AddElementType("items", Uri.PUBSUB_EVENT, typeof (Items));
AddElementType("purge", Uri.PUBSUB_EVENT, typeof (extensions.pubsub.@event.Purge));
AddElementType("delete", Uri.PUBSUB_EVENT, typeof(extensions.pubsub.@event.Delete));
AddElementType("event", Uri.PUBSUB_EVENT, typeof(extensions.pubsub.@event.Event));
AddElementType("item", Uri.PUBSUB_EVENT, typeof(extensions.pubsub.@event.Item));
AddElementType("items", Uri.PUBSUB_EVENT, typeof(Items));
AddElementType("purge", Uri.PUBSUB_EVENT, typeof(extensions.pubsub.@event.Purge));
// Main Pubsub namespace
AddElementType("affiliation", Uri.PUBSUB, typeof (Affiliation));
AddElementType("affiliations", Uri.PUBSUB, typeof (Affiliations));
AddElementType("configure", Uri.PUBSUB, typeof (extensions.pubsub.Configure));
AddElementType("create", Uri.PUBSUB, typeof (Create));
AddElementType("configure", Uri.PUBSUB, typeof (extensions.pubsub.Configure));
AddElementType("item", Uri.PUBSUB, typeof (extensions.pubsub.Item));
AddElementType("items", Uri.PUBSUB, typeof (extensions.pubsub.Items));
AddElementType("options", Uri.PUBSUB, typeof (Options));
AddElementType("publish", Uri.PUBSUB, typeof (Publish));
AddElementType("pubsub", Uri.PUBSUB, typeof (extensions.pubsub.PubSub));
AddElementType("retract", Uri.PUBSUB, typeof (Retract));
AddElementType("subscribe", Uri.PUBSUB, typeof (Subscribe));
AddElementType("subscribe-options", Uri.PUBSUB, typeof (SubscribeOptions));
AddElementType("subscription", Uri.PUBSUB, typeof (Subscription));
AddElementType("subscriptions", Uri.PUBSUB, typeof (Subscriptions));
AddElementType("unsubscribe", Uri.PUBSUB, typeof (Unsubscribe));
AddElementType("affiliation", Uri.PUBSUB, typeof(Affiliation));
AddElementType("affiliations", Uri.PUBSUB, typeof(Affiliations));
AddElementType("configure", Uri.PUBSUB, typeof(extensions.pubsub.Configure));
AddElementType("create", Uri.PUBSUB, typeof(Create));
AddElementType("configure", Uri.PUBSUB, typeof(extensions.pubsub.Configure));
AddElementType("item", Uri.PUBSUB, typeof(extensions.pubsub.Item));
AddElementType("items", Uri.PUBSUB, typeof(extensions.pubsub.Items));
AddElementType("options", Uri.PUBSUB, typeof(Options));
AddElementType("publish", Uri.PUBSUB, typeof(Publish));
AddElementType("pubsub", Uri.PUBSUB, typeof(extensions.pubsub.PubSub));
AddElementType("retract", Uri.PUBSUB, typeof(Retract));
AddElementType("subscribe", Uri.PUBSUB, typeof(Subscribe));
AddElementType("subscribe-options", Uri.PUBSUB, typeof(SubscribeOptions));
AddElementType("subscription", Uri.PUBSUB, typeof(Subscription));
AddElementType("subscriptions", Uri.PUBSUB, typeof(Subscriptions));
AddElementType("unsubscribe", Uri.PUBSUB, typeof(Unsubscribe));
// HTTP Binding XEP-0124
AddElementType("body", Uri.HTTP_BIND, typeof (extensions.bosh.Body));
AddElementType("body", Uri.HTTP_BIND, typeof(extensions.bosh.Body));
// Message receipts XEP-0184
AddElementType("received", Uri.MSG_RECEIPT, typeof (Received));
AddElementType("request", Uri.MSG_RECEIPT, typeof (Request));
AddElementType("received", Uri.MSG_RECEIPT, typeof(Received));
AddElementType("request", Uri.MSG_RECEIPT, typeof(Request));
// Bookmark storage XEP-0048
AddElementType("storage", Uri.STORAGE_BOOKMARKS, typeof (Storage));
AddElementType("url", Uri.STORAGE_BOOKMARKS, typeof (Url));
AddElementType("storage", Uri.STORAGE_BOOKMARKS, typeof(Storage));
AddElementType("url", Uri.STORAGE_BOOKMARKS, typeof(Url));
AddElementType("conference",
Uri.STORAGE_BOOKMARKS,
typeof (extensions.bookmarks.Conference));
typeof(extensions.bookmarks.Conference));
// XEP-0047: In-Band Bytestreams (IBB)
AddElementType("open", Uri.IBB, typeof (Open));
AddElementType("data", Uri.IBB, typeof (extensions.ibb.Data));
AddElementType("close", Uri.IBB, typeof (Close));
AddElementType("open", Uri.IBB, typeof(Open));
AddElementType("data", Uri.IBB, typeof(extensions.ibb.Data));
AddElementType("close", Uri.IBB, typeof(Close));
// XEP-0153: vCard-Based Avatars
AddElementType("x", Uri.VCARD_UPDATE, typeof (VcardUpdate));
AddElementType("x", Uri.VCARD_UPDATE, typeof(VcardUpdate));
// AMP
AddElementType("amp", Uri.AMP, typeof (Amp));
AddElementType("rule", Uri.AMP, typeof (Rule));
AddElementType("amp", Uri.AMP, typeof(Amp));
AddElementType("rule", Uri.AMP, typeof(Rule));
// XEP-0202: Entity Time
AddElementType("time", Uri.ENTITY_TIME, typeof (EntityTime));
AddElementType("time", Uri.ENTITY_TIME, typeof(EntityTime));
//Team lab
AddElementType("query", Uri.X_TM_IQ_HISTORY, typeof (x.tm.history.History));
AddElementType("item", Uri.X_TM_IQ_HISTORY, typeof (HistoryItem));
AddElementType("query", Uri.X_TM_IQ_HISTORY, typeof(x.tm.history.History));
AddElementType("item", Uri.X_TM_IQ_HISTORY, typeof(HistoryItem));
AddElementType("query", Uri.MSG_CHAT_MARKERS, typeof(Chatmarkers));
AddElementType("item", Uri.MSG_CHAT_MARKERS, typeof(Chatmarkers));
AddElementType("query", Uri.X_TM_IQ_PRIVATELOG, typeof (PrivateLog));
AddElementType("item", Uri.X_TM_IQ_PRIVATELOG, typeof (PrivateLogItem));
AddElementType("query", Uri.X_TM_IQ_PRIVATELOG, typeof(PrivateLog));
AddElementType("item", Uri.X_TM_IQ_PRIVATELOG, typeof(PrivateLogItem));
}
#endregion
@ -467,7 +468,7 @@ namespace ASC.Xmpp.Core.protocol
Element ret;
if (m_table.ContainsKey(key))
{
ret = (Element) Activator.CreateInstance(m_table[key]);
ret = (Element)Activator.CreateInstance(m_table[key]);
}
else
{
@ -490,7 +491,7 @@ namespace ASC.Xmpp.Core.protocol
{
if (entry.Value == type)
{
var name = (string) entry.Key;
var name = (string)entry.Key;
return name.Contains(":") ? name.Substring(0, name.LastIndexOf(":")) : null;
}
}

View File

@ -24,6 +24,7 @@
using System;
using System.Collections;
using System.Text;
using ASC.Xmpp.Core.utils.Collections;
using ASC.Xmpp.Core.utils.Idn;

View File

@ -221,7 +221,7 @@ namespace ASC.Xmpp.Core.protocol.client
public Error(ErrorCode code) : this()
{
SetAttribute("code", (int) code);
SetAttribute("code", (int)code);
}
public Error(ErrorType type) : this()
@ -256,13 +256,13 @@ namespace ASC.Xmpp.Core.protocol.client
public ErrorCode Code
{
get { return (ErrorCode) GetAttributeInt("code"); }
set { SetAttribute("code", (int) value); }
get { return (ErrorCode)GetAttributeInt("code"); }
set { SetAttribute("code", (int)value); }
}
public ErrorType Type
{
get { return (ErrorType) GetAttributeEnum("type", typeof (ErrorType)); }
get { return (ErrorType)GetAttributeEnum("type", typeof(ErrorType)); }
set { SetAttribute("type", value.ToString()); }
}

View File

@ -111,11 +111,11 @@ namespace ASC.Xmpp.Core.protocol.client
/// </summary>
public virtual Bind Bind
{
get { return SelectSingleElement(typeof (Bind)) as Bind; }
get { return SelectSingleElement(typeof(Bind)) as Bind; }
set
{
RemoveTag(typeof (Bind));
RemoveTag(typeof(Bind));
if (value != null)
{
AddChild(value);
@ -125,11 +125,11 @@ namespace ASC.Xmpp.Core.protocol.client
public virtual Blocklist Blocklist
{
get { return SelectSingleElement(typeof (Blocklist)) as Blocklist; }
get { return SelectSingleElement(typeof(Blocklist)) as Blocklist; }
set
{
RemoveTag(typeof (Blocklist));
RemoveTag(typeof(Blocklist));
if (value != null)
{
AddChild(value);
@ -139,11 +139,11 @@ namespace ASC.Xmpp.Core.protocol.client
public virtual Jingle Jingle
{
get { return SelectSingleElement(typeof (Jingle)) as Jingle; }
get { return SelectSingleElement(typeof(Jingle)) as Jingle; }
set
{
RemoveTag(typeof (Jingle));
RemoveTag(typeof(Jingle));
if (value != null)
{
AddChild(value);
@ -156,13 +156,13 @@ namespace ASC.Xmpp.Core.protocol.client
/// </summary>
public Error Error
{
get { return SelectSingleElement(typeof (Error)) as Error; }
get { return SelectSingleElement(typeof(Error)) as Error; }
set
{
if (HasTag(typeof (Error)))
if (HasTag(typeof(Error)))
{
RemoveTag(typeof (Error));
RemoveTag(typeof(Error));
}
if (value != null)
@ -197,11 +197,11 @@ namespace ASC.Xmpp.Core.protocol.client
/// </summary>
public virtual Session Session
{
get { return SelectSingleElement(typeof (Session)) as Session; }
get { return SelectSingleElement(typeof(Session)) as Session; }
set
{
RemoveTag(typeof (Session));
RemoveTag(typeof(Session));
if (value != null)
{
AddChild(value);
@ -213,7 +213,7 @@ namespace ASC.Xmpp.Core.protocol.client
/// </summary>
public IqType Type
{
get { return (IqType) GetAttributeEnum("type", typeof (IqType)); }
get { return (IqType)GetAttributeEnum("type", typeof(IqType)); }
set { SetAttribute("type", value.ToString()); }
}

View File

@ -20,6 +20,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
using System;
using ASC.Xmpp.Core.protocol.Base;
using ASC.Xmpp.Core.protocol.extensions.chatstates;
using ASC.Xmpp.Core.protocol.extensions.html;
@ -352,7 +353,7 @@ namespace ASC.Xmpp.Core.protocol.client
/// </summary>
public MessageType Type
{
get { return (MessageType) GetAttributeEnum("type", typeof (MessageType)); }
get { return (MessageType)GetAttributeEnum("type", typeof(MessageType)); }
set
{
@ -372,13 +373,13 @@ namespace ASC.Xmpp.Core.protocol.client
/// </summary>
public Error Error
{
get { return SelectSingleElement(typeof (Error)) as Error; }
get { return SelectSingleElement(typeof(Error)) as Error; }
set
{
if (HasTag(typeof (Error)))
if (HasTag(typeof(Error)))
{
RemoveTag(typeof (Error));
RemoveTag(typeof(Error));
}
if (value != null)
@ -393,11 +394,11 @@ namespace ASC.Xmpp.Core.protocol.client
/// </summary>
public Html Html
{
get { return (Html) SelectSingleElement(typeof (Html)); }
get { return (Html)SelectSingleElement(typeof(Html)); }
set
{
RemoveTag(typeof (Html));
RemoveTag(typeof(Html));
if (value != null)
{
AddChild(value);
@ -410,13 +411,13 @@ namespace ASC.Xmpp.Core.protocol.client
/// </summary>
public Event XEvent
{
get { return SelectSingleElement(typeof (Event)) as Event; }
get { return SelectSingleElement(typeof(Event)) as Event; }
set
{
if (HasTag(typeof (Event)))
if (HasTag(typeof(Event)))
{
RemoveTag(typeof (Event));
RemoveTag(typeof(Event));
}
if (value != null)
@ -431,13 +432,13 @@ namespace ASC.Xmpp.Core.protocol.client
/// </summary>
public Delay XDelay
{
get { return SelectSingleElement(typeof (Delay)) as Delay; }
get { return SelectSingleElement(typeof(Delay)) as Delay; }
set
{
if (HasTag(typeof (Delay)))
if (HasTag(typeof(Delay)))
{
RemoveTag(typeof (Delay));
RemoveTag(typeof(Delay));
}
if (value != null)
@ -452,13 +453,13 @@ namespace ASC.Xmpp.Core.protocol.client
/// </summary>
public Headers Headers
{
get { return SelectSingleElement(typeof (Headers)) as Headers; }
get { return SelectSingleElement(typeof(Headers)) as Headers; }
set
{
if (HasTag(typeof (Headers)))
if (HasTag(typeof(Headers)))
{
RemoveTag(typeof (Headers));
RemoveTag(typeof(Headers));
}
if (value != null)
@ -473,13 +474,13 @@ namespace ASC.Xmpp.Core.protocol.client
/// </summary>
public Nickname Nickname
{
get { return SelectSingleElement(typeof (Nickname)) as Nickname; }
get { return SelectSingleElement(typeof(Nickname)) as Nickname; }
set
{
if (HasTag(typeof (Nickname)))
if (HasTag(typeof(Nickname)))
{
RemoveTag(typeof (Nickname));
RemoveTag(typeof(Nickname));
}
if (value != null)
@ -497,23 +498,23 @@ namespace ASC.Xmpp.Core.protocol.client
{
get
{
if (HasTag(typeof (Active)))
if (HasTag(typeof(Active)))
{
return Chatstate.active;
}
else if (HasTag(typeof (Inactive)))
else if (HasTag(typeof(Inactive)))
{
return Chatstate.inactive;
}
else if (HasTag(typeof (Composing)))
else if (HasTag(typeof(Composing)))
{
return Chatstate.composing;
}
else if (HasTag(typeof (Paused)))
else if (HasTag(typeof(Paused)))
{
return Chatstate.paused;
}
else if (HasTag(typeof (Gone)))
else if (HasTag(typeof(Gone)))
{
return Chatstate.gone;
}
@ -551,11 +552,11 @@ namespace ASC.Xmpp.Core.protocol.client
/// </summary>
private void RemoveChatstate()
{
RemoveTag(typeof (Active));
RemoveTag(typeof (Inactive));
RemoveTag(typeof (Composing));
RemoveTag(typeof (Paused));
RemoveTag(typeof (Gone));
RemoveTag(typeof(Active));
RemoveTag(typeof(Inactive));
RemoveTag(typeof(Composing));
RemoveTag(typeof(Paused));
RemoveTag(typeof(Gone));
}
#endregion

View File

@ -78,13 +78,13 @@ namespace ASC.Xmpp.Core.protocol.client
/// </summary>
public Error Error
{
get { return SelectSingleElement(typeof (Error)) as Error; }
get { return SelectSingleElement(typeof(Error)) as Error; }
set
{
if (HasTag(typeof (Error)))
if (HasTag(typeof(Error)))
{
RemoveTag(typeof (Error));
RemoveTag(typeof(Error));
}
if (value != null)
@ -98,17 +98,17 @@ namespace ASC.Xmpp.Core.protocol.client
/// </summary>
public bool IsPrimary
{
get { return GetTag(typeof (Primary)) == null ? false : true; }
get { return GetTag(typeof(Primary)) == null ? false : true; }
set
{
if (value)
{
SetTag(typeof (Primary));
SetTag(typeof(Primary));
}
else
{
RemoveTag(typeof (Primary));
RemoveTag(typeof(Primary));
}
}
}
@ -117,13 +117,13 @@ namespace ASC.Xmpp.Core.protocol.client
/// </summary>
public User MucUser
{
get { return SelectSingleElement(typeof (User)) as User; }
get { return SelectSingleElement(typeof(User)) as User; }
set
{
if (HasTag(typeof (User)))
if (HasTag(typeof(User)))
{
RemoveTag(typeof (User));
RemoveTag(typeof(User));
}
if (value != null)
@ -138,13 +138,13 @@ namespace ASC.Xmpp.Core.protocol.client
/// </summary>
public Nickname Nickname
{
get { return SelectSingleElement(typeof (Nickname)) as Nickname; }
get { return SelectSingleElement(typeof(Nickname)) as Nickname; }
set
{
if (HasTag(typeof (Nickname)))
if (HasTag(typeof(Nickname)))
{
RemoveTag(typeof (Nickname));
RemoveTag(typeof(Nickname));
}
if (value != null)
@ -184,7 +184,7 @@ namespace ASC.Xmpp.Core.protocol.client
/// </summary>
public ShowType Show
{
get { return (ShowType) GetTagEnum("show", typeof (ShowType)); }
get { return (ShowType)GetTagEnum("show", typeof(ShowType)); }
set
{
@ -214,7 +214,7 @@ namespace ASC.Xmpp.Core.protocol.client
/// </summary>
public PresenceType Type
{
get { return (PresenceType) GetAttributeEnum("type", typeof (PresenceType)); }
get { return (PresenceType)GetAttributeEnum("type", typeof(PresenceType)); }
set
{
@ -234,13 +234,13 @@ namespace ASC.Xmpp.Core.protocol.client
/// </summary>
public Delay XDelay
{
get { return SelectSingleElement(typeof (Delay)) as Delay; }
get { return SelectSingleElement(typeof(Delay)) as Delay; }
set
{
if (HasTag(typeof (Delay)))
if (HasTag(typeof(Delay)))
{
RemoveTag(typeof (Delay));
RemoveTag(typeof(Delay));
}
if (value != null)

View File

@ -61,11 +61,11 @@ namespace ASC.Xmpp.Core.protocol.component
/// </summary>
public new Error Error
{
get { return SelectSingleElement(typeof (Error)) as Error; }
get { return SelectSingleElement(typeof(Error)) as Error; }
set
{
if (HasTag(typeof (Error)))
RemoveTag(typeof (Error));
if (HasTag(typeof(Error)))
RemoveTag(typeof(Error));
if (value != null)
AddChild(value);

View File

@ -59,7 +59,7 @@ namespace ASC.Xmpp.Core.protocol.component
/// </summary>
public LogType Type
{
get { return (LogType) GetAttributeEnum("type", typeof (LogType)); }
get { return (LogType)GetAttributeEnum("type", typeof(LogType)); }
set
{
if (value == LogType.NONE)

View File

@ -142,7 +142,7 @@ namespace ASC.Xmpp.Core.protocol.component
}
public Message(Jid to, Jid from, MessageType type, string body)
: base(to, from,type, body)
: base(to, from, type, body)
{
Namespace = Uri.ACCEPT;
}
@ -166,11 +166,11 @@ namespace ASC.Xmpp.Core.protocol.component
/// </summary>
public new Error Error
{
get { return SelectSingleElement(typeof (Error)) as Error; }
get { return SelectSingleElement(typeof(Error)) as Error; }
set
{
if (HasTag(typeof (Error)))
RemoveTag(typeof (Error));
if (HasTag(typeof(Error)))
RemoveTag(typeof(Error));
if (value != null)
AddChild(value);

View File

@ -57,11 +57,11 @@ namespace ASC.Xmpp.Core.protocol.component
/// </summary>
public new Error Error
{
get { return SelectSingleElement(typeof (Error)) as Error; }
get { return SelectSingleElement(typeof(Error)) as Error; }
set
{
if (HasTag(typeof (Error)))
RemoveTag(typeof (Error));
if (HasTag(typeof(Error)))
RemoveTag(typeof(Error));
if (value != null)
AddChild(value);

View File

@ -67,7 +67,7 @@ namespace ASC.Xmpp.Core.protocol.component
/// </summary>
public RouteType Type
{
get { return (RouteType) GetAttributeEnum("type", typeof (RouteType)); }
get { return (RouteType)GetAttributeEnum("type", typeof(RouteType)); }
set
{
if (value == RouteType.NONE)

View File

@ -51,7 +51,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.amp
/// </summary>
public Action Status
{
get { return (Action) GetAttributeEnum("status", typeof (Action)); }
get { return (Action)GetAttributeEnum("status", typeof(Action)); }
set
{
if (value == Action.Unknown)
@ -89,12 +89,12 @@ namespace ASC.Xmpp.Core.protocol.extensions.amp
/// <returns> </returns>
public Rule[] GetRules()
{
ElementList nl = SelectElements(typeof (Rule));
ElementList nl = SelectElements(typeof(Rule));
var items = new Rule[nl.Count];
int i = 0;
foreach (Element e in nl)
{
items[i] = (Rule) e;
items[i] = (Rule)e;
i++;
}
return items;

View File

@ -53,7 +53,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.amp
/// </summary>
public Action Action
{
get { return (Action) GetAttributeEnum("action", typeof (Action)); }
get { return (Action)GetAttributeEnum("action", typeof(Action)); }
set
{
if (value == Action.Unknown)

View File

@ -126,12 +126,12 @@ namespace ASC.Xmpp.Core.protocol.extensions.bookmarks
/// <returns> </returns>
public Conference[] GetConferences()
{
ElementList nl = SelectElements(typeof (Conference));
ElementList nl = SelectElements(typeof(Conference));
var items = new Conference[nl.Count];
int i = 0;
foreach (Element e in nl)
{
items[i] = (Conference) e;
items[i] = (Conference)e;
i++;
}
return items;
@ -171,12 +171,12 @@ namespace ASC.Xmpp.Core.protocol.extensions.bookmarks
/// <returns> </returns>
public Url[] GetUrls()
{
ElementList nl = SelectElements(typeof (Url));
ElementList nl = SelectElements(typeof(Url));
var items = new Url[nl.Count];
int i = 0;
foreach (Element e in nl)
{
items[i] = (Url) e;
items[i] = (Url)e;
i++;
}
return items;

View File

@ -184,7 +184,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.bosh
public BoshType Type
{
get { return (BoshType) GetAttributeEnum("type", typeof (BoshType)); }
get { return (BoshType)GetAttributeEnum("type", typeof(BoshType)); }
set
{
if (value == BoshType.NONE)

View File

@ -73,7 +73,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.bytestreams
public Mode Mode
{
get { return (Mode) GetAttributeEnum("mode", typeof (Mode)); }
get { return (Mode)GetAttributeEnum("mode", typeof(Mode)); }
set
{
if (value != Mode.NONE)
@ -88,11 +88,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.bytestreams
/// </summary>
public Activate Activate
{
get { return SelectSingleElement(typeof (Activate)) as Activate; }
get { return SelectSingleElement(typeof(Activate)) as Activate; }
set
{
if (HasTag(typeof (Activate)))
RemoveTag(typeof (Activate));
if (HasTag(typeof(Activate)))
RemoveTag(typeof(Activate));
if (value != null)
AddChild(value);
@ -101,11 +101,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.bytestreams
public StreamHostUsed StreamHostUsed
{
get { return SelectSingleElement(typeof (StreamHostUsed)) as StreamHostUsed; }
get { return SelectSingleElement(typeof(StreamHostUsed)) as StreamHostUsed; }
set
{
if (HasTag(typeof (StreamHostUsed)))
RemoveTag(typeof (StreamHostUsed));
if (HasTag(typeof(StreamHostUsed)))
RemoveTag(typeof(StreamHostUsed));
if (value != null)
AddChild(value);
@ -182,12 +182,12 @@ namespace ASC.Xmpp.Core.protocol.extensions.bytestreams
/// <returns> </returns>
public StreamHost[] GetStreamHosts()
{
ElementList nl = SelectElements(typeof (StreamHost));
ElementList nl = SelectElements(typeof(StreamHost));
var hosts = new StreamHost[nl.Count];
int i = 0;
foreach (Element e in nl)
{
hosts[i] = (StreamHost) e;
hosts[i] = (StreamHost)e;
i++;
}
return hosts;

View File

@ -24,6 +24,7 @@
using System;
using System.Collections;
using System.Text;
using ASC.Xmpp.Core.protocol.iq.disco;
using ASC.Xmpp.Core.utils;
using ASC.Xmpp.Core.utils.Xml.Dom;

View File

@ -62,7 +62,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.commands
/// </summary>
public Action Execute
{
get { return (Action) GetAttributeEnum("execute", typeof (Action)); }
get { return (Action)GetAttributeEnum("execute", typeof(Action)); }
set
{
if (value == Action.NONE)

View File

@ -19,7 +19,6 @@
* http://www.ag-software.de *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
using ASC.Xmpp.Core.protocol.x.data;
using ASC.Xmpp.Core.utils.Xml.Dom;
namespace ASC.Xmpp.Core.protocol.extensions.commands
@ -73,7 +72,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.commands
public Action Action
{
get { return (Action) GetAttributeEnum("action", typeof (Action)); }
get { return (Action)GetAttributeEnum("action", typeof(Action)); }
set
{
if (value == Action.NONE)
@ -85,7 +84,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.commands
public Status Status
{
get { return (Status) GetAttributeEnum("status", typeof (Status)); }
get { return (Status)GetAttributeEnum("status", typeof(Status)); }
set
{
if (value == Status.NONE)
@ -119,11 +118,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.commands
/// </summary>
public x.data.Data Data
{
get { return SelectSingleElement(typeof (x.data.Data)) as x.data.Data; }
get { return SelectSingleElement(typeof(x.data.Data)) as x.data.Data; }
set
{
if (HasTag(typeof (x.data.Data)))
RemoveTag(typeof (x.data.Data));
if (HasTag(typeof(x.data.Data)))
RemoveTag(typeof(x.data.Data));
if (value != null)
AddChild(value);
@ -132,11 +131,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.commands
public Note Note
{
get { return SelectSingleElement(typeof (Note)) as Note; }
get { return SelectSingleElement(typeof(Note)) as Note; }
set
{
if (HasTag(typeof (Note)))
RemoveTag(typeof (Note));
if (HasTag(typeof(Note)))
RemoveTag(typeof(Note));
if (value != null)
AddChild(value);
@ -145,11 +144,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.commands
public Actions Actions
{
get { return SelectSingleElement(typeof (Actions)) as Actions; }
get { return SelectSingleElement(typeof(Actions)) as Actions; }
set
{
if (HasTag(typeof (Actions)))
RemoveTag(typeof (Actions));
if (HasTag(typeof(Actions)))
RemoveTag(typeof(Actions));
if (value != null)
AddChild(value);

View File

@ -75,7 +75,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.commands
public NoteType Type
{
get { return (NoteType) GetAttributeEnum("type", typeof (NoteType)); }
get { return (NoteType)GetAttributeEnum("type", typeof(NoteType)); }
set { SetAttribute("type", value.ToString()); }
}
}

View File

@ -58,7 +58,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.compression
if (value != CompressionMethod.Unknown)
SetTag("method", value.ToString());
}
get { return (CompressionMethod) GetTagEnum("method", typeof (CompressionMethod)); }
get { return (CompressionMethod)GetTagEnum("method", typeof(CompressionMethod)); }
}
}
}

View File

@ -19,7 +19,6 @@
* http://www.ag-software.de *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
using ASC.Xmpp.Core.protocol.x.data;
using ASC.Xmpp.Core.utils.Xml.Dom;
namespace ASC.Xmpp.Core.protocol.extensions.featureneg
@ -65,7 +64,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.featureneg
{
get
{
Element data = SelectSingleElement(typeof (x.data.Data));
Element data = SelectSingleElement(typeof(x.data.Data));
if (data != null)
return data as x.data.Data;
else
@ -73,8 +72,8 @@ namespace ASC.Xmpp.Core.protocol.extensions.featureneg
}
set
{
if (HasTag(typeof (x.data.Data)))
RemoveTag(typeof (x.data.Data));
if (HasTag(typeof(x.data.Data)))
RemoveTag(typeof(x.data.Data));
AddChild(value);
}

View File

@ -20,6 +20,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
using System;
using ASC.Xmpp.Core.utils;
using ASC.Xmpp.Core.utils.Xml.Dom;
@ -126,7 +127,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.filetransfer
{
get
{
Element range = SelectSingleElement(typeof (Range));
Element range = SelectSingleElement(typeof(Range));
if (range != null)
return range as Range;
else
@ -134,7 +135,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.filetransfer
}
set
{
RemoveTag(typeof (Range));
RemoveTag(typeof(Range));
AddChild(value);
}
}

View File

@ -20,6 +20,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
using System;
using ASC.Xmpp.Core.utils;
using ASC.Xmpp.Core.utils.Xml.Dom;

View File

@ -47,11 +47,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.html
/// </summary>
public Body Body
{
get { return SelectSingleElement(typeof (Body)) as Body; }
get { return SelectSingleElement(typeof(Body)) as Body; }
set
{
if (HasTag(typeof (Body)))
RemoveTag(typeof (Body));
if (HasTag(typeof(Body)))
RemoveTag(typeof(Body));
if (value != null)
AddChild(value);

View File

@ -81,7 +81,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.jivesoftware.phone
public ActionType Type
{
set { SetAttribute("type", value.ToString()); }
get { return (ActionType) GetAttributeEnum("type", typeof (ActionType)); }
get { return (ActionType)GetAttributeEnum("type", typeof(ActionType)); }
}
public string Extension

View File

@ -84,7 +84,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.jivesoftware.phone
public PhoneStatusType Type
{
set { SetAttribute("type", value.ToString()); }
get { return (PhoneStatusType) GetAttributeEnum("type", typeof (PhoneStatusType)); }
get { return (PhoneStatusType)GetAttributeEnum("type", typeof(PhoneStatusType)); }
}
public string CallerId

View File

@ -42,7 +42,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.jivesoftware.phone
public PhoneStatusType Status
{
set { SetAttribute("status", value.ToString()); }
get { return (PhoneStatusType) GetAttributeEnum("status", typeof (PhoneStatusType)); }
get { return (PhoneStatusType)GetAttributeEnum("status", typeof(PhoneStatusType)); }
}
}
}

View File

@ -33,7 +33,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.multicast
public AddressType Type
{
get { return (AddressType) GetAttributeEnum("type", typeof (AddressType)); }
get { return (AddressType)GetAttributeEnum("type", typeof(AddressType)); }
set { SetAttribute("type", value.ToString()); }
}

View File

@ -45,7 +45,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.multicast
int i = 0;
foreach (Element e in nl)
{
addresses[i] = ((Address) e).Jid;
addresses[i] = ((Address)e).Jid;
i++;
}
return addresses;
@ -70,7 +70,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.multicast
int i = 0;
foreach (Element e in nl)
{
addresses[i] = (Address) e;
addresses[i] = (Address)e;
i++;
}
return addresses;

View File

@ -74,7 +74,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub
public AffiliationType AffiliationType
{
get { return (AffiliationType) GetAttributeEnum("affiliation", typeof (AffiliationType)); }
get { return (AffiliationType)GetAttributeEnum("affiliation", typeof(AffiliationType)); }
set { SetAttribute("affiliation", value.ToString()); }
}
}

View File

@ -67,12 +67,12 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub
public Affiliation[] GetAffiliations()
{
ElementList nl = SelectElements(typeof (Affiliation));
ElementList nl = SelectElements(typeof(Affiliation));
var items = new Affiliation[nl.Count];
int i = 0;
foreach (Element e in nl)
{
items[i] = (Affiliation) e;
items[i] = (Affiliation)e;
i++;
}
return items;

View File

@ -21,7 +21,6 @@
#region using
using ASC.Xmpp.Core.protocol.x.data;
#endregion
@ -55,7 +54,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub
public Access Access
{
get { return (Access) GetAttributeEnum("access", typeof (Access)); }
get { return (Access)GetAttributeEnum("access", typeof(Access)); }
set
{
if (value == Access.NONE)
@ -70,11 +69,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub
/// </summary>
public x.data.Data Data
{
get { return SelectSingleElement(typeof (x.data.Data)) as x.data.Data; }
get { return SelectSingleElement(typeof(x.data.Data)) as x.data.Data; }
set
{
if (HasTag(typeof (x.data.Data)))
RemoveTag(typeof (x.data.Data));
if (HasTag(typeof(x.data.Data)))
RemoveTag(typeof(x.data.Data));
if (value != null)
AddChild(value);

View File

@ -19,7 +19,6 @@
* http://www.ag-software.de *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
using ASC.Xmpp.Core.protocol.x.data;
using ASC.Xmpp.Core.utils.Xml.Dom;
namespace ASC.Xmpp.Core.protocol.extensions.pubsub
@ -106,11 +105,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub
/// </summary>
public x.data.Data Data
{
get { return SelectSingleElement(typeof (x.data.Data)) as x.data.Data; }
get { return SelectSingleElement(typeof(x.data.Data)) as x.data.Data; }
set
{
if (HasTag(typeof (x.data.Data)))
RemoveTag(typeof (x.data.Data));
if (HasTag(typeof(x.data.Data)))
RemoveTag(typeof(x.data.Data));
if (value != null)
AddChild(value);

View File

@ -36,11 +36,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub
/// </summary>
public Create Create
{
get { return SelectSingleElement(typeof (Create)) as Create; }
get { return SelectSingleElement(typeof(Create)) as Create; }
set
{
if (HasTag(typeof (Create)))
RemoveTag(typeof (Create));
if (HasTag(typeof(Create)))
RemoveTag(typeof(Create));
if (value != null)
AddChild(value);
@ -49,11 +49,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub
public Publish Publish
{
get { return SelectSingleElement(typeof (Publish)) as Publish; }
get { return SelectSingleElement(typeof(Publish)) as Publish; }
set
{
if (HasTag(typeof (Publish)))
RemoveTag(typeof (Publish));
if (HasTag(typeof(Publish)))
RemoveTag(typeof(Publish));
if (value != null)
AddChild(value);
@ -62,11 +62,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub
public Retract Retract
{
get { return SelectSingleElement(typeof (Retract)) as Retract; }
get { return SelectSingleElement(typeof(Retract)) as Retract; }
set
{
if (HasTag(typeof (Retract)))
RemoveTag(typeof (Retract));
if (HasTag(typeof(Retract)))
RemoveTag(typeof(Retract));
if (value != null)
AddChild(value);
@ -75,11 +75,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub
public Subscribe Subscribe
{
get { return SelectSingleElement(typeof (Subscribe)) as Subscribe; }
get { return SelectSingleElement(typeof(Subscribe)) as Subscribe; }
set
{
if (HasTag(typeof (Subscribe)))
RemoveTag(typeof (Subscribe));
if (HasTag(typeof(Subscribe)))
RemoveTag(typeof(Subscribe));
if (value != null)
AddChild(value);
@ -88,11 +88,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub
public Unsubscribe Unsubscribe
{
get { return SelectSingleElement(typeof (Unsubscribe)) as Unsubscribe; }
get { return SelectSingleElement(typeof(Unsubscribe)) as Unsubscribe; }
set
{
if (HasTag(typeof (Unsubscribe)))
RemoveTag(typeof (Unsubscribe));
if (HasTag(typeof(Unsubscribe)))
RemoveTag(typeof(Unsubscribe));
if (value != null)
AddChild(value);
@ -101,11 +101,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub
public Subscriptions Subscriptions
{
get { return SelectSingleElement(typeof (Subscriptions)) as Subscriptions; }
get { return SelectSingleElement(typeof(Subscriptions)) as Subscriptions; }
set
{
if (HasTag(typeof (Subscriptions)))
RemoveTag(typeof (Subscriptions));
if (HasTag(typeof(Subscriptions)))
RemoveTag(typeof(Subscriptions));
if (value != null)
AddChild(value);
@ -114,11 +114,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub
public Affiliations Affiliations
{
get { return SelectSingleElement(typeof (Affiliations)) as Affiliations; }
get { return SelectSingleElement(typeof(Affiliations)) as Affiliations; }
set
{
if (HasTag(typeof (Affiliations)))
RemoveTag(typeof (Affiliations));
if (HasTag(typeof(Affiliations)))
RemoveTag(typeof(Affiliations));
if (value != null)
AddChild(value);
@ -127,11 +127,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub
public Options Options
{
get { return SelectSingleElement(typeof (Options)) as Options; }
get { return SelectSingleElement(typeof(Options)) as Options; }
set
{
if (HasTag(typeof (Options)))
RemoveTag(typeof (Options));
if (HasTag(typeof(Options)))
RemoveTag(typeof(Options));
if (value != null)
AddChild(value);
@ -140,11 +140,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub
public Items Items
{
get { return SelectSingleElement(typeof (Items)) as Items; }
get { return SelectSingleElement(typeof(Items)) as Items; }
set
{
if (HasTag(typeof (Items)))
RemoveTag(typeof (Items));
if (HasTag(typeof(Items)))
RemoveTag(typeof(Items));
if (value != null)
AddChild(value);
@ -156,11 +156,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub
/// </summary>
public Configure Configure
{
get { return SelectSingleElement(typeof (Configure)) as Configure; }
get { return SelectSingleElement(typeof(Configure)) as Configure; }
set
{
if (HasTag(typeof (Configure)))
RemoveTag(typeof (Configure));
if (HasTag(typeof(Configure)))
RemoveTag(typeof(Configure));
if (value != null)
AddChild(value);

View File

@ -38,7 +38,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub
public Type Type
{
get { return (Type) GetAttributeEnum("type", typeof (Type)); }
get { return (Type)GetAttributeEnum("type", typeof(Type)); }
set
{
if (value == Type.NONE)

View File

@ -107,12 +107,12 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub
/// <returns> returns an Array of Items </returns>
public Item[] GetItems()
{
ElementList nl = SelectElements(typeof (Item));
ElementList nl = SelectElements(typeof(Item));
var items = new Item[nl.Count];
int i = 0;
foreach (Element e in nl)
{
items[i] = (Item) e;
items[i] = (Item)e;
i++;
}
return items;

View File

@ -178,17 +178,17 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub
public SubscriptionState SubscriptionState
{
get { return (SubscriptionState) GetAttributeEnum("subscription", typeof (SubscriptionState)); }
get { return (SubscriptionState)GetAttributeEnum("subscription", typeof(SubscriptionState)); }
set { SetAttribute("subscription", value.ToString()); }
}
public SubscribeOptions SubscribeOptions
{
get { return SelectSingleElement(typeof (SubscribeOptions)) as SubscribeOptions; }
get { return SelectSingleElement(typeof(SubscribeOptions)) as SubscribeOptions; }
set
{
if (HasTag(typeof (SubscribeOptions)))
RemoveTag(typeof (SubscribeOptions));
if (HasTag(typeof(SubscribeOptions)))
RemoveTag(typeof(SubscribeOptions));
if (value != null)
AddChild(value);

View File

@ -84,12 +84,12 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub
public Subscription[] GetSubscriptions()
{
ElementList nl = SelectElements(typeof (Subscription));
ElementList nl = SelectElements(typeof(Subscription));
var items = new Subscription[nl.Count];
int i = 0;
foreach (Element e in nl)
{
items[i] = (Subscription) e;
items[i] = (Subscription)e;
i++;
}
return items;

View File

@ -34,11 +34,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub.@event
public Delete Delete
{
get { return SelectSingleElement(typeof (Delete)) as Delete; }
get { return SelectSingleElement(typeof(Delete)) as Delete; }
set
{
if (HasTag(typeof (Delete)))
RemoveTag(typeof (Delete));
if (HasTag(typeof(Delete)))
RemoveTag(typeof(Delete));
if (value != null)
AddChild(value);
@ -47,11 +47,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub.@event
public Purge Purge
{
get { return SelectSingleElement(typeof (Purge)) as Purge; }
get { return SelectSingleElement(typeof(Purge)) as Purge; }
set
{
if (HasTag(typeof (Purge)))
RemoveTag(typeof (Purge));
if (HasTag(typeof(Purge)))
RemoveTag(typeof(Purge));
if (value != null)
AddChild(value);
@ -60,11 +60,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub.@event
public Items Items
{
get { return SelectSingleElement(typeof (Items)) as Items; }
get { return SelectSingleElement(typeof(Items)) as Items; }
set
{
if (HasTag(typeof (Items)))
RemoveTag(typeof (Items));
if (HasTag(typeof(Items)))
RemoveTag(typeof(Items));
if (value != null)
AddChild(value);

View File

@ -108,12 +108,12 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub.@event
/// <returns> returns an Array of Items </returns>
public Item[] GetItems()
{
ElementList nl = SelectElements(typeof (Item));
ElementList nl = SelectElements(typeof(Item));
var items = new Item[nl.Count];
int i = 0;
foreach (Element e in nl)
{
items[i] = (Item) e;
items[i] = (Item)e;
i++;
}
return items;

View File

@ -94,7 +94,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub.owner
public AffiliationType Affiliation
{
get { return (AffiliationType) GetAttributeEnum("affiliation", typeof (AffiliationType)); }
get { return (AffiliationType)GetAttributeEnum("affiliation", typeof(AffiliationType)); }
set { SetAttribute("affiliation", value.ToString()); }
}
}

View File

@ -106,12 +106,12 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub.owner
/// <returns> </returns>
public Affiliate[] GetAffiliates()
{
ElementList nl = SelectElements(typeof (Affiliate));
ElementList nl = SelectElements(typeof(Affiliate));
var affiliates = new Affiliate[nl.Count];
int i = 0;
foreach (Element e in nl)
{
affiliates[i] = (Affiliate) e;
affiliates[i] = (Affiliate)e;
i++;
}
return affiliates;

View File

@ -19,7 +19,6 @@
* http://www.ag-software.de *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
using ASC.Xmpp.Core.protocol.x.data;
using ASC.Xmpp.Core.utils.Xml.Dom;
namespace ASC.Xmpp.Core.protocol.extensions.pubsub.owner
@ -52,11 +51,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub.owner
/// </summary>
public x.data.Data Data
{
get { return SelectSingleElement(typeof (x.data.Data)) as x.data.Data; }
get { return SelectSingleElement(typeof(x.data.Data)) as x.data.Data; }
set
{
if (HasTag(typeof (x.data.Data)))
RemoveTag(typeof (x.data.Data));
if (HasTag(typeof(x.data.Data)))
RemoveTag(typeof(x.data.Data));
if (value != null)
AddChild(value);

View File

@ -19,7 +19,6 @@
* http://www.ag-software.de *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
using ASC.Xmpp.Core.protocol.x.data;
using ASC.Xmpp.Core.utils.Xml.Dom;
namespace ASC.Xmpp.Core.protocol.extensions.pubsub.owner
@ -52,11 +51,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub.owner
/// </summary>
public x.data.Data Data
{
get { return SelectSingleElement(typeof (x.data.Data)) as x.data.Data; }
get { return SelectSingleElement(typeof(x.data.Data)) as x.data.Data; }
set
{
if (HasTag(typeof (x.data.Data)))
RemoveTag(typeof (x.data.Data));
if (HasTag(typeof(x.data.Data)))
RemoveTag(typeof(x.data.Data));
if (value != null)
AddChild(value);

View File

@ -33,11 +33,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub.owner
public Delete Delete
{
get { return SelectSingleElement(typeof (Delete)) as Delete; }
get { return SelectSingleElement(typeof(Delete)) as Delete; }
set
{
if (HasTag(typeof (Delete)))
RemoveTag(typeof (Delete));
if (HasTag(typeof(Delete)))
RemoveTag(typeof(Delete));
if (value != null)
AddChild(value);
@ -46,11 +46,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub.owner
public Purge Purge
{
get { return SelectSingleElement(typeof (Purge)) as Purge; }
get { return SelectSingleElement(typeof(Purge)) as Purge; }
set
{
if (HasTag(typeof (Purge)))
RemoveTag(typeof (Purge));
if (HasTag(typeof(Purge)))
RemoveTag(typeof(Purge));
if (value != null)
AddChild(value);
@ -59,11 +59,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub.owner
public Subscribers Subscribers
{
get { return SelectSingleElement(typeof (Subscribers)) as Subscribers; }
get { return SelectSingleElement(typeof(Subscribers)) as Subscribers; }
set
{
if (HasTag(typeof (Subscribers)))
RemoveTag(typeof (Subscribers));
if (HasTag(typeof(Subscribers)))
RemoveTag(typeof(Subscribers));
if (value != null)
AddChild(value);
@ -72,11 +72,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub.owner
public Affiliates Affiliates
{
get { return SelectSingleElement(typeof (Affiliates)) as Affiliates; }
get { return SelectSingleElement(typeof(Affiliates)) as Affiliates; }
set
{
if (HasTag(typeof (Affiliates)))
RemoveTag(typeof (Affiliates));
if (HasTag(typeof(Affiliates)))
RemoveTag(typeof(Affiliates));
if (value != null)
AddChild(value);
@ -85,11 +85,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub.owner
public Configure Configure
{
get { return SelectSingleElement(typeof (Configure)) as Configure; }
get { return SelectSingleElement(typeof(Configure)) as Configure; }
set
{
if (HasTag(typeof (Configure)))
RemoveTag(typeof (Configure));
if (HasTag(typeof(Configure)))
RemoveTag(typeof(Configure));
if (value != null)
AddChild(value);

View File

@ -77,7 +77,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub.owner
public SubscriptionState SubscriptionState
{
get { return (SubscriptionState) GetAttributeEnum("subscription", typeof (SubscriptionState)); }
get { return (SubscriptionState)GetAttributeEnum("subscription", typeof(SubscriptionState)); }
set { SetAttribute("subscription", value.ToString()); }
}

View File

@ -104,12 +104,12 @@ namespace ASC.Xmpp.Core.protocol.extensions.pubsub.owner
/// <returns> </returns>
public Subscriber[] GetSubscribers()
{
ElementList nl = SelectElements(typeof (Subscriber));
ElementList nl = SelectElements(typeof(Subscriber));
var subscribers = new Subscriber[nl.Count];
int i = 0;
foreach (Element e in nl)
{
subscribers[i] = (Subscriber) e;
subscribers[i] = (Subscriber)e;
i++;
}
return subscribers;

View File

@ -87,7 +87,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.shim
/// <param name="name"> </param>
public Header GetHeader(string name)
{
return (Header) SelectSingleElement("header", "name", name);
return (Header)SelectSingleElement("header", "name", name);
}
public Header[] GetHeaders()
@ -98,7 +98,7 @@ namespace ASC.Xmpp.Core.protocol.extensions.shim
int i = 0;
foreach (Element e in nl)
{
headers[i] = (Header) e;
headers[i] = (Header)e;
i++;
}
return headers;

View File

@ -72,11 +72,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.si
/// </summary>
public FeatureNeg FeatureNeg
{
get { return SelectSingleElement(typeof (FeatureNeg)) as FeatureNeg; }
get { return SelectSingleElement(typeof(FeatureNeg)) as FeatureNeg; }
set
{
if (HasTag(typeof (FeatureNeg)))
RemoveTag(typeof (FeatureNeg));
if (HasTag(typeof(FeatureNeg)))
RemoveTag(typeof(FeatureNeg));
if (value != null)
AddChild(value);
@ -88,11 +88,11 @@ namespace ASC.Xmpp.Core.protocol.extensions.si
/// </summary>
public File File
{
get { return SelectSingleElement(typeof (File)) as File; }
get { return SelectSingleElement(typeof(File)) as File; }
set
{
if (HasTag(typeof (File)))
RemoveTag(typeof (File));
if (HasTag(typeof(File)))
RemoveTag(typeof(File));
if (value != null)
AddChild(value);

View File

@ -57,7 +57,7 @@ namespace ASC.Xmpp.Core.protocol.iq.blocklist
public BlockItem[] GetItems()
{
ElementList nl = SelectElements(typeof (BlockItem));
ElementList nl = SelectElements(typeof(BlockItem));
int i = 0;
var result = new BlockItem[nl.Count];
foreach (BlockItem ri in nl)

View File

@ -81,7 +81,7 @@ namespace ASC.Xmpp.Core.protocol.iq.browse
public BrowseItem[] GetItems()
{
ElementList nl = SelectElements(typeof (BrowseItem));
ElementList nl = SelectElements(typeof(BrowseItem));
var items = new BrowseItem[nl.Count];
int i = 0;
foreach (Element item in nl)

View File

@ -109,7 +109,7 @@ namespace ASC.Xmpp.Core.protocol.iq.browse
public BrowseItem[] GetItems()
{
ElementList nl = SelectElements(typeof (BrowseItem));
ElementList nl = SelectElements(typeof(BrowseItem));
var items = new BrowseItem[nl.Count];
int i = 0;
foreach (Element item in nl)
@ -126,7 +126,7 @@ namespace ASC.Xmpp.Core.protocol.iq.browse
/// <returns> </returns>
public Service[] GetServices()
{
ElementList nl = SelectElements(typeof (Service));
ElementList nl = SelectElements(typeof(Service));
var Services = new Service[nl.Count];
int i = 0;
foreach (Element service in nl)

View File

@ -23,13 +23,13 @@ using ASC.Xmpp.Core.utils.Xml.Dom;
namespace ASC.Xmpp.Core.protocol.iq.chatmarkers
{
public class Chatmarkers: Element
public class Chatmarkers : Element
{
public Chatmarkers()
{
TagName = "query";
Namespace = Uri.MSG_CHAT_MARKERS;
}
}
}

View File

@ -120,12 +120,12 @@ namespace ASC.Xmpp.Core.protocol.iq.disco
public DiscoIdentity[] GetIdentities()
{
ElementList nl = SelectElements(typeof (DiscoIdentity));
ElementList nl = SelectElements(typeof(DiscoIdentity));
var items = new DiscoIdentity[nl.Count];
int i = 0;
foreach (Element e in nl)
{
items[i] = (DiscoIdentity) e;
items[i] = (DiscoIdentity)e;
i++;
}
return items;
@ -137,12 +137,12 @@ namespace ASC.Xmpp.Core.protocol.iq.disco
/// <returns> </returns>
public DiscoFeature[] GetFeatures()
{
ElementList nl = SelectElements(typeof (DiscoFeature));
ElementList nl = SelectElements(typeof(DiscoFeature));
var items = new DiscoFeature[nl.Count];
int i = 0;
foreach (Element e in nl)
{
items[i] = (DiscoFeature) e;
items[i] = (DiscoFeature)e;
i++;
}
return items;

View File

@ -60,7 +60,7 @@ namespace ASC.Xmpp.Core.protocol.iq.disco
public DiscoAction Action
{
get { return (DiscoAction) GetAttributeEnum("action", typeof (DiscoAction)); }
get { return (DiscoAction)GetAttributeEnum("action", typeof(DiscoAction)); }
set
{
if (value == DiscoAction.NONE)

View File

@ -107,12 +107,12 @@ namespace ASC.Xmpp.Core.protocol.iq.disco
public DiscoItem[] GetDiscoItems()
{
ElementList nl = SelectElements(typeof (DiscoItem));
ElementList nl = SelectElements(typeof(DiscoItem));
var items = new DiscoItem[nl.Count];
int i = 0;
foreach (Element e in nl)
{
items[i] = (DiscoItem) e;
items[i] = (DiscoItem)e;
i++;
}
return items;

View File

@ -33,7 +33,7 @@ namespace ASC.Xmpp.Core.protocol.iq.jingle
public Server[] GetServers()
{
ElementList nl = SelectElements(typeof (Server));
ElementList nl = SelectElements(typeof(Server));
int i = 0;
var result = new Server[nl.Count];
foreach (Server ri in nl)
@ -91,11 +91,11 @@ namespace ASC.Xmpp.Core.protocol.iq.jingle
public virtual Stun Stun
{
get { return SelectSingleElement(typeof (Stun)) as Stun; }
get { return SelectSingleElement(typeof(Stun)) as Stun; }
set
{
RemoveTag(typeof (Stun));
RemoveTag(typeof(Stun));
if (value != null)
{
AddChild(value);

View File

@ -20,6 +20,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
using System;
using ASC.Xmpp.Core.utils.Xml.Dom;
// Send: <iq type='get' id='MX_5' to='jfrankel@coversant.net/SoapBox'>

View File

@ -87,13 +87,13 @@ namespace ASC.Xmpp.Core.protocol.iq.privacy
public Action Action
{
get { return (Action) GetAttributeEnum("action", typeof (Action)); }
get { return (Action)GetAttributeEnum("action", typeof(Action)); }
set { SetAttribute("action", value.ToString()); }
}
public Type Type
{
get { return (Type) GetAttributeEnum("type", typeof (Type)); }
get { return (Type)GetAttributeEnum("type", typeof(Type)); }
set
{
if (value != Type.NONE)

View File

@ -48,7 +48,7 @@ namespace ASC.Xmpp.Core.protocol.iq.privacy
/// <returns> </returns>
public Item[] GetItems()
{
ElementList el = SelectElements(typeof (Item));
ElementList el = SelectElements(typeof(Item));
int i = 0;
var result = new Item[el.Count];
foreach (Item itm in el)
@ -81,7 +81,7 @@ namespace ASC.Xmpp.Core.protocol.iq.privacy
/// </summary>
public void RemoveAllItems()
{
RemoveTags(typeof (Item));
RemoveTags(typeof(Item));
}
}
}

View File

@ -36,11 +36,11 @@ namespace ASC.Xmpp.Core.protocol.iq.privacy
/// </summary>
public Active Active
{
get { return SelectSingleElement(typeof (Active)) as Active; }
get { return SelectSingleElement(typeof(Active)) as Active; }
set
{
if (HasTag(typeof (Active)))
RemoveTag(typeof (Active));
if (HasTag(typeof(Active)))
RemoveTag(typeof(Active));
if (value != null)
AddChild(value);
@ -52,11 +52,11 @@ namespace ASC.Xmpp.Core.protocol.iq.privacy
/// </summary>
public Default Default
{
get { return SelectSingleElement(typeof (Default)) as Default; }
get { return SelectSingleElement(typeof(Default)) as Default; }
set
{
if (HasTag(typeof (Default)))
RemoveTag(typeof (Default));
if (HasTag(typeof(Default)))
RemoveTag(typeof(Default));
AddChild(value);
}
@ -77,7 +77,7 @@ namespace ASC.Xmpp.Core.protocol.iq.privacy
/// <returns> Array of all privacy lists </returns>
public List[] GetList()
{
ElementList el = SelectElements(typeof (List));
ElementList el = SelectElements(typeof(List));
int i = 0;
var result = new List[el.Count];
foreach (List list in el)

View File

@ -43,11 +43,11 @@ namespace ASC.Xmpp.Core.protocol.iq.@private
/// </summary>
public Storage Storage
{
get { return SelectSingleElement(typeof (Storage)) as Storage; }
get { return SelectSingleElement(typeof(Storage)) as Storage; }
set
{
if (HasTag(typeof (Storage)))
RemoveTag(typeof (Storage));
if (HasTag(typeof(Storage)))
RemoveTag(typeof(Storage));
if (value != null)
AddChild(value);

View File

@ -19,7 +19,6 @@
* http://www.ag-software.de *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
using ASC.Xmpp.Core.protocol.x.data;
using ASC.Xmpp.Core.utils.Xml.Dom;
// Sample 1
@ -105,11 +104,11 @@ namespace ASC.Xmpp.Core.protocol.iq.register
/// </summary>
public x.data.Data Data
{
get { return SelectSingleElement(typeof (x.data.Data)) as x.data.Data; }
get { return SelectSingleElement(typeof(x.data.Data)) as x.data.Data; }
set
{
if (HasTag(typeof (x.data.Data)))
RemoveTag(typeof (x.data.Data));
if (HasTag(typeof(x.data.Data)))
RemoveTag(typeof(x.data.Data));
if (value != null)
AddChild(value);

View File

@ -40,7 +40,7 @@ namespace ASC.Xmpp.Core.protocol.iq.roster
public RosterItem[] GetRoster()
{
ElementList nl = SelectElements(typeof (RosterItem));
ElementList nl = SelectElements(typeof(RosterItem));
int i = 0;
var result = new RosterItem[nl.Count];
foreach (RosterItem ri in nl)

View File

@ -76,13 +76,13 @@ namespace ASC.Xmpp.Core.protocol.iq.roster
public SubscriptionType Subscription
{
get { return (SubscriptionType) GetAttributeEnum("subscription", typeof (SubscriptionType)); }
get { return (SubscriptionType)GetAttributeEnum("subscription", typeof(SubscriptionType)); }
set { SetAttribute("subscription", value.ToString()); }
}
public AskType Ask
{
get { return (AskType) GetAttributeEnum("ask", typeof (AskType)); }
get { return (AskType)GetAttributeEnum("ask", typeof(AskType)); }
set
{
if (value == AskType.NONE)

View File

@ -22,6 +22,7 @@
using System;
using System.Collections;
using System.Globalization;
using ASC.Xmpp.Core.utils;
using ASC.Xmpp.Core.utils.Xml.Dom;
@ -109,31 +110,31 @@ namespace ASC.Xmpp.Core.protocol.iq.rpc
}
else if (param is Int32)
{
value.AddChild(new Element("i4", ((Int32) param).ToString()));
value.AddChild(new Element("i4", ((Int32)param).ToString()));
}
else if (param is Double)
{
var numberInfo = new NumberFormatInfo();
numberInfo.NumberDecimalSeparator = ".";
//numberInfo.NumberGroupSeparator = ",";
value.AddChild(new Element("double", ((Double) param).ToString(numberInfo)));
value.AddChild(new Element("double", ((Double)param).ToString(numberInfo)));
}
else if (param is Boolean)
{
value.AddChild(new Element("boolean", ((bool) param) ? "1" : "0"));
value.AddChild(new Element("boolean", ((bool)param) ? "1" : "0"));
}
// XML-RPC dates are formatted in iso8601 standard, same as xmpp,
// XML-RPC dates are formatted in iso8601 standard, same as xmpp,
else if (param is DateTime)
{
value.AddChild(new Element("dateTime.iso8601", Time.ISO_8601Date((DateTime) param)));
value.AddChild(new Element("dateTime.iso8601", Time.ISO_8601Date((DateTime)param)));
}
// byte arrays must be encoded in Base64 encoding
// byte arrays must be encoded in Base64 encoding
else if (param is byte[])
{
var b = (byte[]) param;
var b = (byte[])param;
value.AddChild(new Element("base64", Convert.ToBase64String(b, 0, b.Length)));
}
// Arraylist maps to an XML-RPC array
// Arraylist maps to an XML-RPC array
else if (param is ArrayList)
{
//<array>
@ -156,12 +157,12 @@ namespace ASC.Xmpp.Core.protocol.iq.rpc
array.AddChild(data);
value.AddChild(array);
}
// java.util.Hashtable maps to an XML-RPC struct
// java.util.Hashtable maps to an XML-RPC struct
else if (param is Hashtable)
{
var elStruct = new Element("struct");
var ht = (Hashtable) param;
var ht = (Hashtable)param;
IEnumerator myEnumerator = ht.Keys.GetEnumerator();
while (myEnumerator.MoveNext())
{

View File

@ -22,9 +22,10 @@
using System;
using System.Collections;
using System.Globalization;
using ASC.Xmpp.Core.utils;
using ASC.Xmpp.Core.utils.Xml.Dom;
using ASC.Xmpp.Core.utils.exceptions;
using ASC.Xmpp.Core.utils.Xml.Dom;
namespace ASC.Xmpp.Core.protocol.iq.rpc
{
@ -82,7 +83,7 @@ namespace ASC.Xmpp.Core.protocol.iq.rpc
if (fault != null)
{
Hashtable ht = ParseStruct(fault.SelectSingleElement("struct", true));
al.Add(new XmlRpcException((int) ht["faultCode"], (string) ht["faultString"]));
al.Add(new XmlRpcException((int)ht["faultCode"], (string)ht["faultString"]));
}
else
{

View File

@ -73,10 +73,10 @@ namespace ASC.Xmpp.Core.protocol.iq.rpc
/// </summary>
public MethodCall MethodCall
{
get { return (MethodCall) SelectSingleElement(typeof (MethodCall)); }
get { return (MethodCall)SelectSingleElement(typeof(MethodCall)); }
set
{
RemoveTag(typeof (MethodCall));
RemoveTag(typeof(MethodCall));
if (value != null)
AddChild(value);
}
@ -86,10 +86,10 @@ namespace ASC.Xmpp.Core.protocol.iq.rpc
/// </summary>
public MethodResponse MethodResponse
{
get { return (MethodResponse) SelectSingleElement(typeof (MethodResponse)); }
get { return (MethodResponse)SelectSingleElement(typeof(MethodResponse)); }
set
{
RemoveTag(typeof (MethodResponse));
RemoveTag(typeof(MethodResponse));
if (value != null)
AddChild(value);
}

View File

@ -19,7 +19,6 @@
* http://www.ag-software.de *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
using ASC.Xmpp.Core.protocol.x.data;
using ASC.Xmpp.Core.utils.Xml.Dom;
// Example 1. Requesting Search Fields
@ -102,11 +101,11 @@ namespace ASC.Xmpp.Core.protocol.iq.search
/// </summary>
public x.data.Data Data
{
get { return SelectSingleElement(typeof (x.data.Data)) as x.data.Data; }
get { return SelectSingleElement(typeof(x.data.Data)) as x.data.Data; }
set
{
if (HasTag(typeof (x.data.Data)))
RemoveTag(typeof (x.data.Data));
if (HasTag(typeof(x.data.Data)))
RemoveTag(typeof(x.data.Data));
if (value != null)
AddChild(value);
@ -125,12 +124,12 @@ namespace ASC.Xmpp.Core.protocol.iq.search
//}
public SearchItem[] GetItems()
{
ElementList nl = SelectElements(typeof (SearchItem));
ElementList nl = SelectElements(typeof(SearchItem));
var items = new SearchItem[nl.Count];
int i = 0;
foreach (Element e in nl)
{
items[i] = (SearchItem) e;
items[i] = (SearchItem)e;
i++;
}
return items;

View File

@ -83,7 +83,7 @@ namespace ASC.Xmpp.Core.protocol.iq.vcard
public AddressLocation Location
{
get { return (AddressLocation) HasTagEnum(typeof (AddressLocation)); }
get { return (AddressLocation)HasTagEnum(typeof(AddressLocation)); }
set { SetTag(value.ToString()); }
}

View File

@ -71,7 +71,7 @@ namespace ASC.Xmpp.Core.protocol.iq.vcard
public EmailType Type
{
get { return (EmailType) HasTagEnum(typeof (EmailType)); }
get { return (EmailType)HasTagEnum(typeof(EmailType)); }
set
{
if (value != EmailType.NONE)

View File

@ -25,6 +25,7 @@ using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Net;
using ASC.Xmpp.Core.utils.Xml.Dom;
#if !SL

View File

@ -85,13 +85,13 @@ namespace ASC.Xmpp.Core.protocol.iq.vcard
public TelephoneLocation Location
{
get { return (TelephoneLocation) HasTagEnum(typeof (TelephoneLocation)); }
get { return (TelephoneLocation)HasTagEnum(typeof(TelephoneLocation)); }
set { SetTag(value.ToString()); }
}
public TelephoneType Type
{
get { return (TelephoneType) HasTagEnum(typeof (TelephoneType)); }
get { return (TelephoneType)HasTagEnum(typeof(TelephoneType)); }
set { SetTag(value.ToString()); }
}
}

View File

@ -20,6 +20,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
using System;
using ASC.Xmpp.Core.utils.Xml.Dom;
// JEP-0054
@ -194,10 +195,10 @@ namespace ASC.Xmpp.Core.protocol.iq.vcard
/// </summary>
public Name Name
{
get { return SelectSingleElement(typeof (Name)) as Name; }
get { return SelectSingleElement(typeof(Name)) as Name; }
set
{
Element n = SelectSingleElement(typeof (Name));
Element n = SelectSingleElement(typeof(Name));
if (n != null)
n.Remove();
@ -211,10 +212,10 @@ namespace ASC.Xmpp.Core.protocol.iq.vcard
/// </summary>
public Photo Photo
{
get { return SelectSingleElement(typeof (Photo)) as Photo; }
get { return SelectSingleElement(typeof(Photo)) as Photo; }
set
{
Element p = SelectSingleElement(typeof (Photo));
Element p = SelectSingleElement(typeof(Photo));
if (p != null)
p.Remove();
@ -227,10 +228,10 @@ namespace ASC.Xmpp.Core.protocol.iq.vcard
/// </summary>
public Organization Organization
{
get { return SelectSingleElement(typeof (Organization)) as Organization; }
get { return SelectSingleElement(typeof(Organization)) as Organization; }
set
{
Element org = SelectSingleElement(typeof (Organization));
Element org = SelectSingleElement(typeof(Organization));
if (org != null)
org.Remove();
@ -240,7 +241,7 @@ namespace ASC.Xmpp.Core.protocol.iq.vcard
public Gender Gender
{
get { return (Gender) GetTagEnum("GENDER", typeof (Gender)); }
get { return (Gender)GetTagEnum("GENDER", typeof(Gender)); }
set
{
if (value == Gender.NONE) RemoveTag("GENDER");
@ -253,7 +254,7 @@ namespace ASC.Xmpp.Core.protocol.iq.vcard
/// <returns> </returns>
public Address[] GetAddresses()
{
ElementList el = SelectElements(typeof (Address));
ElementList el = SelectElements(typeof(Address));
int i = 0;
var result = new Address[el.Count];
foreach (Address add in el)
@ -301,7 +302,7 @@ namespace ASC.Xmpp.Core.protocol.iq.vcard
public Telephone[] GetTelephoneNumbers()
{
ElementList el = SelectElements(typeof (Telephone));
ElementList el = SelectElements(typeof(Telephone));
int i = 0;
var result = new Telephone[el.Count];
foreach (Telephone tel in el)
@ -350,7 +351,7 @@ namespace ASC.Xmpp.Core.protocol.iq.vcard
/// <returns> </returns>
public Email[] GetEmailAddresses()
{
ElementList el = SelectElements(typeof (Email));
ElementList el = SelectElements(typeof(Email));
int i = 0;
var result = new Email[el.Count];
foreach (Email mail in el)

View File

@ -108,50 +108,50 @@ namespace ASC.Xmpp.Core.protocol.sasl
{
switch (mechanism)
{
//case "KERBEROS_V4":
// return MechanismType.KERBEROS_V4;
//case "GSSAPI":
// return MechanismType.GSSAPI;
//case "SKEY":
// return MechanismType.SKEY;
//case "EXTERNAL":
// return MechanismType.EXTERNAL;
//case "CRAM-MD5":
// return MechanismType.CRAM_MD5;
//case "ANONYMOUS":
// return MechanismType.ANONYMOUS;
//case "OTP":
// return MechanismType.OTP;
//case "GSS-SPNEGO":
// return MechanismType.GSS_SPNEGO;
//case "KERBEROS_V4":
// return MechanismType.KERBEROS_V4;
//case "GSSAPI":
// return MechanismType.GSSAPI;
//case "SKEY":
// return MechanismType.SKEY;
//case "EXTERNAL":
// return MechanismType.EXTERNAL;
//case "CRAM-MD5":
// return MechanismType.CRAM_MD5;
//case "ANONYMOUS":
// return MechanismType.ANONYMOUS;
//case "OTP":
// return MechanismType.OTP;
//case "GSS-SPNEGO":
// return MechanismType.GSS_SPNEGO;
case "PLAIN":
return MechanismType.PLAIN;
//case "SECURID":
// return MechanismType.SECURID;
//case "NTLM":
// return MechanismType.NTLM;
//case "NMAS_LOGIN":
// return MechanismType.NMAS_LOGIN;
//case "NMAS_AUTHEN":
// return MechanismType.NMAS_AUTHEN;
//case "SECURID":
// return MechanismType.SECURID;
//case "NTLM":
// return MechanismType.NTLM;
//case "NMAS_LOGIN":
// return MechanismType.NMAS_LOGIN;
//case "NMAS_AUTHEN":
// return MechanismType.NMAS_AUTHEN;
case "DIGEST-MD5":
return MechanismType.DIGEST_MD5;
//case "9798-U-RSA-SHA1-ENC":
// return MechanismType.ISO_9798_U_RSA_SHA1_ENC;
//case "9798-M-RSA-SHA1-ENC":
// return MechanismType.ISO_9798_M_RSA_SHA1_ENC;
//case "9798-U-DSA-SHA1":
// return MechanismType.ISO_9798_U_DSA_SHA1;
//case "9798-M-DSA-SHA1":
// return MechanismType.ISO_9798_M_DSA_SHA1;
//case "9798-U-ECDSA-SHA1":
// return MechanismType.ISO_9798_U_ECDSA_SHA1;
//case "9798-M-ECDSA-SHA1":
// return MechanismType.ISO_9798_M_ECDSA_SHA1;
//case "KERBEROS_V5":
// return MechanismType.KERBEROS_V5;
//case "NMAS-SAMBA-AUTH":
// return MechanismType.NMAS_SAMBA_AUTH;
//case "9798-U-RSA-SHA1-ENC":
// return MechanismType.ISO_9798_U_RSA_SHA1_ENC;
//case "9798-M-RSA-SHA1-ENC":
// return MechanismType.ISO_9798_M_RSA_SHA1_ENC;
//case "9798-U-DSA-SHA1":
// return MechanismType.ISO_9798_U_DSA_SHA1;
//case "9798-M-DSA-SHA1":
// return MechanismType.ISO_9798_M_DSA_SHA1;
//case "9798-U-ECDSA-SHA1":
// return MechanismType.ISO_9798_U_ECDSA_SHA1;
//case "9798-M-ECDSA-SHA1":
// return MechanismType.ISO_9798_M_ECDSA_SHA1;
//case "KERBEROS_V5":
// return MechanismType.KERBEROS_V5;
//case "NMAS-SAMBA-AUTH":
// return MechanismType.NMAS_SAMBA_AUTH;
case "X-GOOGLE-TOKEN":
return MechanismType.X_GOOGLE_TOKEN;
default:

View File

@ -47,7 +47,7 @@ namespace ASC.Xmpp.Core.protocol.sasl
int i = 0;
foreach (Element e in elements)
{
items[i] = (Mechanism) e;
items[i] = (Mechanism)e;
i++;
}
return items;

View File

@ -59,11 +59,11 @@ namespace ASC.Xmpp.Core.protocol.stream
public StartTls StartTls
{
get { return SelectSingleElement(typeof (StartTls)) as StartTls; }
get { return SelectSingleElement(typeof(StartTls)) as StartTls; }
set
{
if (HasTag(typeof (StartTls)))
RemoveTag(typeof (StartTls));
if (HasTag(typeof(StartTls)))
RemoveTag(typeof(StartTls));
if (value != null)
AddChild(value);
@ -72,11 +72,11 @@ namespace ASC.Xmpp.Core.protocol.stream
public Bind Bind
{
get { return SelectSingleElement(typeof (Bind)) as Bind; }
get { return SelectSingleElement(typeof(Bind)) as Bind; }
set
{
if (HasTag(typeof (Bind)))
RemoveTag(typeof (Bind));
if (HasTag(typeof(Bind)))
RemoveTag(typeof(Bind));
if (value != null)
AddChild(value);
@ -100,11 +100,11 @@ namespace ASC.Xmpp.Core.protocol.stream
public Compression Compression
{
get { return SelectSingleElement(typeof (Compression)) as Compression; }
get { return SelectSingleElement(typeof(Compression)) as Compression; }
set
{
if (HasTag(typeof (Compression)))
RemoveTag(typeof (Compression));
if (HasTag(typeof(Compression)))
RemoveTag(typeof(Compression));
if (value != null)
AddChild(value);
@ -113,11 +113,11 @@ namespace ASC.Xmpp.Core.protocol.stream
public Register Register
{
get { return SelectSingleElement(typeof (Register)) as Register; }
get { return SelectSingleElement(typeof(Register)) as Register; }
set
{
if (HasTag(typeof (Register)))
RemoveTag(typeof (Register));
if (HasTag(typeof(Register)))
RemoveTag(typeof(Register));
if (value != null)
AddChild(value);
@ -126,11 +126,11 @@ namespace ASC.Xmpp.Core.protocol.stream
public Mechanisms Mechanisms
{
get { return SelectSingleElement(typeof (Mechanisms)) as Mechanisms; }
get { return SelectSingleElement(typeof(Mechanisms)) as Mechanisms; }
set
{
if (HasTag(typeof (Mechanisms)))
RemoveTag(typeof (Mechanisms));
if (HasTag(typeof(Mechanisms)))
RemoveTag(typeof(Mechanisms));
if (value != null)
AddChild(value);

View File

@ -56,7 +56,7 @@ namespace ASC.Xmpp.Core.protocol.stream.feature.compression
if (value != CompressionMethod.Unknown)
SetTag("method", value.ToString());
}
get { return (CompressionMethod) GetTagEnum("method", typeof (CompressionMethod)); }
get { return (CompressionMethod)GetTagEnum("method", typeof(CompressionMethod)); }
}
/// <summary>
@ -76,7 +76,7 @@ namespace ASC.Xmpp.Core.protocol.stream.feature.compression
/// <returns> </returns>
public bool SupportsMethod(CompressionMethod method)
{
ElementList nList = SelectElements(typeof (Method));
ElementList nList = SelectElements(typeof(Method));
foreach (Method m in nList)
{
if (m.CompressionMethod == method)
@ -87,7 +87,7 @@ namespace ASC.Xmpp.Core.protocol.stream.feature.compression
public Method[] GetMethods()
{
ElementList methods = SelectElements(typeof (Method));
ElementList methods = SelectElements(typeof(Method));
var items = new Method[methods.Count];
int i = 0;

View File

@ -20,6 +20,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
using System;
using ASC.Xmpp.Core.protocol.extensions.compression;
using ASC.Xmpp.Core.utils.Xml.Dom;
@ -63,7 +64,7 @@ namespace ASC.Xmpp.Core.protocol.stream.feature.compression
#if CF
return (CompressionMethod) util.Enum.Parse(typeof(CompressionMethod), this.Value, true);
#else
return (CompressionMethod) Enum.Parse(typeof (CompressionMethod), Value, true);
return (CompressionMethod)Enum.Parse(typeof(CompressionMethod), Value, true);
#endif
}
set { Value = value.ToString(); }

View File

@ -20,6 +20,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
using System;
using ASC.Xmpp.Core.utils;
using ASC.Xmpp.Core.utils.Xml.Dom;

Some files were not shown because too many files have changed in this diff Show More