public static WCFPlayerWindowInformation2 ToWCF(PlayerWindowInformation2 info) { ScreenInformation[] keys = info.Configuration.Keys.ToArray(); ItemConfiguration[][] values = new ItemConfiguration[keys.Length][]; WCFScreenInformation[] newKeys = new WCFScreenInformation[keys.Length]; WCFItemConfiguration[][] newValues = new WCFItemConfiguration[keys.Length][]; int index = 0; foreach (var key in keys) { values[index] = info.Configuration[key].ToArray(); newKeys[index] = ToWCF(key); newValues[index++] = ToWCF(values[index]).ToArray(); } WCFPlayerWindowInformation2 res = new WCFPlayerWindowInformation2() { Displays = newKeys, Components = newValues }; return(res); }
void Player_OpenPlayerWindow2(PlayerWindowInformation2 config) { foreach (var key in config.Configuration.Keys) { Player_OpenPlayerWindow(new PlayerWindowInformation { Components = config.Configuration[key], Display = key }); } }
public static PlayerWindowInformation2 ToNET(WCFPlayerWindowInformation2 info) { PlayerWindowInformation2 res = new PlayerWindowInformation2(); int index = 0; foreach (var key in info.Displays) { res.Configuration.Add(ToNET(key), ToNET(info.Components[index])); } return(res); }