~travis-plummer/openstack-cli-powershell/master

« back to all changes in this revision

Viewing changes to Openstack.Client.Powershell/Providers/Compute/KeyPairsUIContainer.cs

  • Committer: Monty Taylor
  • Date: 2015-10-17 20:03:56 UTC
  • Revision ID: git-v1:803406e7e09f6f4199f7a92f11f2904ad1d6cc15
Retire stackforge/openstack-cli-powershell

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* ============================================================================
2
 
Copyright 2014 Hewlett Packard
3
 
 
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
7
 
 
8
 
    http://www.apache.org/licenses/LICENSE-2.0
9
 
 
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
 
============================================================================ */
16
 
using System.Collections.Generic;
17
 
using Openstack.Administration.Domain;
18
 
using System.Collections;
19
 
using Openstack.Client.Powershell.Providers.Common;
20
 
using Openstack.Objects.Domain.Compute;
21
 
using Openstack.Objects.Domain;
22
 
 
23
 
namespace Openstack.Client.Powershell.Providers.Compute
24
 
{
25
 
    public class KeyPairsUIContainer : BaseUIContainer
26
 
    {
27
 
//=========================================================================================================
28
 
/// <summary>
29
 
/// 
30
 
/// </summary>
31
 
/// <param name="name"></param>
32
 
/// <param name="description"></param>
33
 
/// <param name="path"></param>
34
 
//=========================================================================================================
35
 
        public KeyPairsUIContainer(BaseUIContainer parentContainer,
36
 
                              string name,
37
 
                              string description,
38
 
                              string path)
39
 
            : base(parentContainer, name, description, path)
40
 
        {
41
 
            this.ObjectType = ObjectType.Container;
42
 
        }
43
 
        public KeyPairsUIContainer()
44
 
        { }
45
 
        #region Methods
46
 
//=========================================================================================================
47
 
/// <summary>
48
 
/// 
49
 
/// </summary>
50
 
/// <typeparam name="T"></typeparam>
51
 
/// <returns></returns>
52
 
//=========================================================================================================
53
 
        public override void Load()
54
 
        {
55
 
            IList keypairs = this.RepositoryFactory.CreateKeyPairRepository().GetKeyPairs();
56
 
            if (keypairs != null && keypairs.Count > 0)
57
 
            {
58
 
                this.SetUIContainers<ImageUIContainer>(keypairs);
59
 
                this.Entities = keypairs;
60
 
            }
61
 
            else
62
 
            {
63
 
                this.Containers.Clear();
64
 
                this.Entities.Clear();
65
 
            }
66
 
        }
67
 
        #endregion
68
 
    }
69
 
}