public ClipDataObject(SerializableClipObject fromOjbect) { extractedItems = fromOjbect.ExtractedItems; ExtractedTypeLookupTable = fromOjbect.ExtractedTypeLookupTable; CompresionTypeLookup = new Dictionary <string, Shared.DataType>(); foreach (var item in fromOjbect.CompresionTypeLookup) { CompresionTypeLookup.Add(item.Key, (Shared.DataType)item.Value); } Key = fromOjbect.Key; Label = GenerateLabel(ClipboardObject()); }
public SerializableClipObject ToOjbect() { if (FileSize > Shared.MaxFileSize()) { return(null); } SerializableClipObject response = new SerializableClipObject { CompresionTypeLookup = new Dictionary <string, byte>() }; foreach (var item in CompresionTypeLookup) { response.CompresionTypeLookup.Add(item.Key, (byte)item.Value); } response.ExtractedItems = extractedItems; response.ExtractedTypeLookupTable = ExtractedTypeLookupTable; response.Key = Key; return(response); }