Beispiel #1
0
        private static SerializationContext SerializeRdpVncDeserializeRdpOnly()
        {
            var           fullSerializer = new FavoritesFileSerializer(TestConnectionManager.Instance);
            FavoritesFile file           = CreateTestFile(RDP_FAVORITE, VNC_FAVORITE);
            var           context        = new SerializationContext(file, new UnknonwPluginElements());

            fullSerializer.Serialize(context, FILE_NAME);
            var rdpOnlyManager    = TestConnectionManager.CreateRdpOnlyManager();
            var limitedSerializer = new FavoritesFileSerializer(rdpOnlyManager);

            return(limitedSerializer.Deserialize(FILE_NAME));
        }
Beispiel #2
0
        private static bool RestoreXmlSerializedFavorite(Tuple <string, Type> testCase)
        {
            var           serializer = new FavoritesFileSerializer(TestConnectionManager.Instance);
            FavoritesFile file       = CreateTestFile(testCase.Item1);
            var           context    = new SerializationContext(file, new UnknonwPluginElements());

            serializer.Serialize(context, FILE_NAME);
            SerializationContext loaded = serializer.Deserialize(FILE_NAME);
            Favorite             target = loaded.File.Favorites[0];

            return(target.ProtocolProperties.GetType().FullName == testCase.Item2.FullName);
        }