Example #1
0
 public static async Task SaveUserMaps(IHubProxy HubProxy, UserMaps usrMaps)
 {
     try
     {
         await HubProxy.Invoke <UserMaps>("SaveUserMaps", usrMaps);
     }
     catch (Exception ex)
     {
     }
 }
Example #2
0
        public static async Task SaveUserMaps(IHubProxy HubProxy, UserMaps usrMaps)
        {
            try
            {
                await HubProxy.Invoke<UserMaps>("SaveUserMaps", usrMaps);
            }
            catch (Exception ex)
            {
            }

        }
Example #3
0
        public static async Task <UserMaps> GetUserMaps(IHubProxy HubProxy, string userName)
        {
            try
            {
                UserMaps maps = await HubProxy.Invoke <UserMaps>("GetUserMaps", userName);

                return(maps);
            }
            catch (Exception ex)
            {
            }

            return(null);
        }
Example #4
0
        private async void cmdSaveUser_Click(object sender, RoutedEventArgs e)
        {
            ApplyNewLayout();

           List<WMSProviderSelectedMaps> Maps = (List<WMSProviderSelectedMaps>)dataGridLayerName.ItemsSource;
           UserMaps usermaps = new UserMaps();
           List<UserMapPreference> MapPreferenceList = new List<UserMapPreference>();
           foreach (WMSProviderSelectedMaps SelectedMap in Maps)
           {
               if (SelectedMap.isSelected)
               {           
                   UserMapPreference userMapInfo = new UserMapPreference();
                   userMapInfo.MapName = SelectedMap.MapName;
                   userMapInfo.MaxZoom = SelectedMap.UserMaxZoom;
                   userMapInfo.MinZoom = SelectedMap.UserMinZoom;
                   MapPreferenceList.Add(userMapInfo);       
               }
            }
            usermaps.maps = MapPreferenceList.ToArray<UserMapPreference>();
            usermaps.User = VMMainViewModel.Instance.UserName;

         //   usermaps = await SAGSignalR.GetUserMaps(VMMainViewModel.Instance.SimulationHubProxy, UserName);

            try
            {
                if (VMMainViewModel.Instance.SimulationHubProxy != null)
                {
                    await SAGSignalR.SaveUserMaps(VMMainViewModel.Instance.SimulationHubProxy, usermaps);


                }
            }
            catch (Exception ex)
            { } 


            //MapInfo.UserMapList = usermapDictionary.Values.ToArray<UserMapLayerInfo>();
            //MapList.Add(MapInfo);

            //if (UserSession.ClientSideObject.m_GameManagerProxy != null)
            //{
            //    UserSession.ClientSideObject.m_GameManagerProxy.SetUserMapInfoCustomProvider(MapList.ToArray<UserMapInfo>());
            //}


        }