Пример #1
0
        static void Main()
        {
            using (CloudServiceClient cloudService = new CloudServiceClient())
            using (ArtifactServiceClient artifactService = new ArtifactServiceClient())
            {
                Artifact artifact = cloudService.CreateArtifact();
                Console.WriteLine("Id: {0}, Type: {1}", artifact.Id, artifact.GetType());

                CollectionArtifact collection = cloudService.CreateCollectionArtifact();
                Console.WriteLine("Id: {0}, Type: {1}", collection.Id, collection.GetType());

                Artifact[] artifacts = cloudService.GetArtifacts();
                foreach (var item in artifacts)
                {
                    Console.WriteLine("Id: {0}, Type: {1}", item.Id, item.GetType());
                }

                artifactService.AddProperty(artifact, "a string", "asdf");
                artifactService.AddProperty(artifact, "a int", 1234);

                Property[] properties = artifactService.GetProperties(artifact);
                foreach (var item in properties)
                {
                    Console.WriteLine("Parent: {0}, Name: {1}, Value: {2}", item.Parent.Id, item.Name, item.Value);
                }
            }
        }