Ejemplo n.º 1
0
        private static async Task <PlacementHeader> CreatePlacementWithAttributeUpdates(
            So3ApiConnector connector,
            Guid layoutPageGuid,
            string symbolPath,
            int locationX,
            List <AttributeValuePart> attributeValueParts)
        {
            var attributeUpdates = new List <AttributeUpdates> {
                new AttributeUpdates(attributeValueParts)
            };

            try
            {
                var placements = await connector.CreatePlacement(
                    layoutPageGuid,
                    symbolPath,
                    locationX,
                    0,
                    attributeUpdates : attributeUpdates);

                return(placements.Single());
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error creating placement: " + ex.Message);
                var keyPartNames = attributeValueParts
                                   .Select(x => x.Name)
                                   .Distinct()
                                   .OrderBy(x => x)
                                   .Concatenate(", ");
                Console.WriteLine("Please verify that all key part names are correctly configured: " + keyPartNames);
                throw;
            }
        }
Ejemplo n.º 2
0
        private static async Task CreateMacroReference(So3ApiConnector connector, Guid layoutPageGuid)
        {
            Console.WriteLine();
            Console.WriteLine("Create macro reference:");
            var placements = await connector.CreatePlacement(
                layoutPageGuid,
                EnvironmentInfo.MacroPath,
                100,
                300,
                (float)Math.PI / 2,
                "==XXX");

            placements.ForEach(DumpPlacement);

            Console.WriteLine();
            Console.WriteLine("Load macro placements via identification:");
            var loadedPlacement4 = await connector.GetPlacements(
                layoutPageGuid,
                "en-US",
                selectorIdentificationPrefix : "==XXX"
                );

            foreach (var placement in loadedPlacement4)
            {
                DumpPlacement(placement);
            }
        }
Ejemplo n.º 3
0
        private static async Task <List <PlacementHeader> > CreatePlacementWithIdentification(
            So3ApiConnector connector,
            Guid layoutPageGuid,
            string symbolPath,
            int locationX,
            string identification)
        {
            var placements = await connector.CreatePlacement(
                layoutPageGuid,
                symbolPath,
                locationX,
                0,
                identification : identification);

            return(placements);
        }
Ejemplo n.º 4
0
        private static async Task <PlacementHeader> CreateAnonymousPlacement(
            So3ApiConnector connector,
            Guid layoutPageGuid,
            string symbolPath,
            int locationX,
            float rotationZ)
        {
            var placements = await connector.CreatePlacement(
                layoutPageGuid,
                symbolPath,
                locationX,
                0,
                rotationZ);

            return(placements.Single());
        }