1
/* ============================================================================
2
Copyright 2014 Hewlett Packard
4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
8
http://www.apache.org/licenses/LICENSE-2.0
10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
============================================================================ */
17
using System.Collections.Generic;
20
using Openstack.Client.Powershell.Providers.Common;
21
using Openstack.Objects.Domain.Networking;
22
using Openstack.Objects.Domain.Networking;
24
namespace Openstack.Client.Powershell.Providers.Networking
26
public class FloatingIPsUIContainer : BaseUIContainer
28
private bool _hasLoaded = false;
30
//=========================================================================================================
34
/// <param name="name"></param>
35
/// <param name="description"></param>
36
/// <param name="path"></param>
37
//=========================================================================================================
38
public FloatingIPsUIContainer() { }
39
//=========================================================================================================
43
/// <param name="name"></param>
44
/// <param name="description"></param>
45
/// <param name="path"></param>
46
//=========================================================================================================
47
public FloatingIPsUIContainer(BaseUIContainer parentContainer,
51
: base(parentContainer, name, description, path)
53
this.ObjectType = Common.ObjectType.Container;
55
//=========================================================================================================
59
//=========================================================================================================
60
public override void Load()
67
//=================================================================================================
71
//=================================================================================================
72
public void Load(List<FloatingIP> floatingIPs)
74
this.Containers.Clear();
75
this.SetUIContainers<FloatingIPUIContainer>(floatingIPs);
76
this.Entities = floatingIPs;
79
//=========================================================================================================
83
/// <typeparam name="T"></typeparam>
84
/// <returns></returns>
85
//=========================================================================================================
86
private void LoadEntities()
88
List<FloatingIP> floatingIPs = this.RepositoryFactory.CreateFloatingIPRepository().GetFloatingIPs();
90
if (floatingIPs != null && floatingIPs.Count > 0)
92
this.SetUIContainers<FloatingIPUIContainer>(floatingIPs);
93
this.Entities = floatingIPs;
97
this.Containers.Clear();
98
this.Entities.Clear();