Exemple #1
0
        internal static SharedFavorite ConvertFromFavorite(IPersistence persistence, FavoriteConfigurationElement Favorite)
        {
            var            favoriteSecurity = new FavoriteConfigurationSecurity(persistence, Favorite);
            SharedFavorite fav = new SharedFavorite();

            fav.Colors             = Favorite.Colors;
            fav.ConnectToConsole   = Favorite.ConnectToConsole;
            fav.DesktopShare       = Favorite.DesktopShare;
            fav.DesktopSize        = Favorite.DesktopSize;
            fav.DomainName         = favoriteSecurity.ResolveDomainName();
            fav.Name               = Favorite.Name;
            fav.Port               = Favorite.Port;
            fav.Protocol           = Favorite.Protocol;
            fav.RedirectClipboard  = Favorite.RedirectClipboard;
            fav.RedirectDevices    = Favorite.RedirectDevices;
            fav.RedirectedDrives   = Favorite.RedirectedDrives;
            fav.RedirectPorts      = Favorite.RedirectPorts;
            fav.RedirectPrinters   = Favorite.RedirectPrinters;
            fav.RedirectSmartCards = Favorite.RedirectSmartCards;
            fav.ServerName         = Favorite.ServerName;
            fav.DisableWallPaper   = Favorite.DisableWallPaper;
            fav.Sounds             = Favorite.Sounds;
            var tagsConverter = new TagsConverter();

            fav.Tags                  = tagsConverter.ResolveTags(Favorite);
            fav.ConsoleBackColor      = Favorite.ConsoleBackColor;
            fav.ConsoleCols           = Favorite.ConsoleCols;
            fav.ConsoleCursorColor    = Favorite.ConsoleCursorColor;
            fav.ConsoleFont           = Favorite.ConsoleFont;
            fav.ConsoleRows           = Favorite.ConsoleRows;
            fav.ConsoleTextColor      = Favorite.ConsoleTextColor;
            fav.VMRCAdministratorMode = Favorite.VMRCAdministratorMode;
            fav.VMRCReducedColorsMode = Favorite.VMRCReducedColorsMode;
            return(fav);
        }
        private void AssertTagsWriteRead(string tagsToAssign, string expectedTags, string assertMessage)
        {
            var favorite = this.CreateFavorite();

            favorite.Tags = tagsToAssign;
            var    converter = new TagsConverter();
            string current   = converter.ResolveTags(favorite);

            Assert.AreEqual(expectedTags, current, assertMessage);
        }
Exemple #3
0
        private static void ExportGeneralOptions(XmlTextWriter w, FavoriteConfigurationElement favorite)
        {
            w.WriteElementString("protocol", favorite.Protocol);
            w.WriteElementString("port", favorite.Port.ToString());
            w.WriteElementString("serverName", favorite.ServerName);
            w.WriteElementString("url", favorite.Url);
            w.WriteElementString("name", favorite.Name);
            w.WriteElementString("notes", favorite.Notes);
            var tagsConverter = new TagsConverter();

            w.WriteElementString("tags", tagsConverter.ResolveTags(favorite));
            w.WriteElementString("newWindow", favorite.NewWindow.ToString());
            w.WriteElementString("toolBarIcon", favorite.ToolBarIcon);
            w.WriteElementString("bitmapPeristence", favorite.Protocol);
        }