SelectConsoleElement() public static méthode

Selects the specified element in the console
public static SelectConsoleElement ( string consoleId, EntityToken entityToken ) : void
consoleId string The console id.
entityToken Composite.C1Console.Security.EntityToken The entity token.
Résultat void
Exemple #1
0
        public void HandleConsoleCommand(string consoleId, string commandPayload)
        {
            var serializedEntityToken = commandPayload.Replace("%5C", "\\");

            var entityToken = EntityTokenSerializer.Deserialize(serializedEntityToken);

            ConsoleCommandHelper.SelectConsoleElement(consoleId, entityToken);
        }
        public void HandleConsoleCommand(string consoleId, string commandPayload)
        {
            string url = commandPayload;

            var entityToken = UrlToEntityTokenFacade.TryGetEntityToken(url);

            if (entityToken == null)
            {
                PageUrlData pageUrlData = PageUrls.ParseUrl(url);

                var page = pageUrlData?.GetPage();
                if (page == null)
                {
                    return;
                }

                entityToken = page.GetDataEntityToken();
            }

            ConsoleCommandHelper.SelectConsoleElement(consoleId, entityToken);
        }
Exemple #3
0
        public void HandleConsoleCommand(string consoleId, string commandPayload)
        {
            string[] parts = commandPayload.Split(':');
            if (parts.Length < 2)
            {
                return;
            }

            string typeName  = parts[0];
            string keyString = string.Join(":", parts.Skip(1));

            var supportedInterfaces = DataFacade.GetAllInterfaces();

            var type = supportedInterfaces.FirstOrDefault(t => t.Name == typeName || t.FullName == typeName);

            if (type == null)
            {
                return;
            }

            var keyProperty = type.GetKeyProperties().Single();

            object key = ValueTypeConverter.Convert(keyString, keyProperty.PropertyType);

            IData data;

            using (new DataConnection())
            {
                data = DataFacade.TryGetDataByUniqueKey(type, key);
                if (data == null)
                {
                    return;
                }
            }

            var entityToken = data.GetDataEntityToken();

            ConsoleCommandHelper.SelectConsoleElement(consoleId, entityToken);
        }