コード例 #1
0
ファイル: WuClient.cs プロジェクト: vackup/XWeather
        public void RemoveLocation(WuLocation location)
        {
            Locations.Remove(location);

            Locations.Sort();

            LocationRemoved?.Invoke(this, EventArgs.Empty);
        }
コード例 #2
0
ファイル: WuClient.cs プロジェクト: blparr/XWeather
        public void RemoveLocation(WuLocation location)
        {
            Locations.Remove(location);

            Locations.Sort();

            LocationRemoved?.Invoke(this, EventArgs.Empty);

            SettingsStudio.Settings.LocationsJson = Locations.GetLocationsJson();
        }
コード例 #3
0
        private void OnLocationRemoved(LocationRemoved obj)
        {
            var assets = obj.Removed.Assets.Where(x => !x.IsPlaceholder);

            foreach (var a in assets)
            {
                if (!SourceLocations.First().Assets.Contains(a))
                {
                    SourceLocations.First().Assets.Add(a);
                }
            }

            // (Konrad) Remove Placeholder asset if other ass
            if (SourceLocations.First()?.Assets.Count > 1 &&
                SourceLocations.FirstOrDefault()?.Assets.FirstOrDefault(x => x.IsPlaceholder) != null)
            {
                SourceLocations.First().RemovePlaceholder();
            }

            Locations.Remove(obj.Removed);
        }