Esempio n. 1
0
        public void AddProperty(PocoArtifact pocoArtifact, string name, object value)
        {
            IEnumerable<IArtifact> artifacts = cloud.getArtifacts().Where(a => a.Id == pocoArtifact.Id);

            if (artifacts.Count() == 1)
            {
                IArtifact artifact = artifacts.First();
                cloud.createProperty(artifact, name, value);
            }
        }
Esempio n. 2
0
        public IList<PocoProperty> GetProperties(PocoArtifact pocoArtifact)
        {
            IEnumerable<IArtifact> artifacts = cloud.getArtifacts().Where(a => a.Id == pocoArtifact.Id);

            if (artifacts.Count() == 1)
            {
                IArtifact artifact = artifacts.First();

                IList<PocoProperty> pocos = new List<PocoProperty>();
                foreach (IProperty property in artifact.Properties)
                {
                    PocoArtifact pocoParent = new PocoArtifact(property.Parent.Id);
                    pocos.Add(new PocoProperty(pocoParent, property.Name, property.Value));
                }

                return pocos;
            }
            else
            {
                return null;
            }
        }
Esempio n. 3
0
 public PocoArtifact CreateArtifact()
 {
     IArtifact artifact = cloud.createArtifact();
     PocoArtifact poco = new PocoArtifact(artifact.Id);
     return poco;
 }
Esempio n. 4
0
 public PocoProperty(PocoArtifact parent, string name, object value)
 {
     _parent = parent;
     _name = name;
     _value = value;
 }