Пример #1
0
        public void Execute(Arguments arguments)
        {
            var control = AccessManager.CurrentAccess.GetControlByPath(arguments.Path.Value);
            var value   = control.GetValue();
            var result  = new StructureConverter().Convert(value);

            Scripter.Variables.SetVariableValue(arguments.Result.Value, result);
        }
        public void Execute(Arguments arguments)
        {
            var form   = AccessManager.CurrentAccess.GetForm(arguments.Name.Value);
            var value  = form.GetPropertyValue(arguments.NameOfProperty.Value);
            var result = new StructureConverter().Convert(value);

            Scripter.Variables.SetVariableValue(arguments.Result.Value, result);
        }
        public void Execute(Arguments arguments)
        {
            var control = AccessManager.CurrentAccess.GetControlByPath(arguments.Path.Value);

            if (control.TryGetDynamicPropertyValue(arguments.NameOfProperty.Value, out object value))
            {
                var result = new StructureConverter().Convert(value);
                Scripter.Variables.SetVariableValue(arguments.Result.Value, result);
            }
            else
            {
                throw new ApplicationException($"Error getting dynamic property value for field {arguments.NameOfProperty.Value}");
            }
        }
Пример #4
0
        public static void Run()
        {
            Console.WriteLine("Show Class Demo, the class ClsDemo need StructLayout attr");
            var clsObj = new ClsDemo();

            Console.WriteLine(clsObj);
            var clsBuffer = StructureConverter.ToBytes <ClsDemo>(clsObj);
            var clsResult = StructureConverter.ToStructure <ClsDemo>(clsBuffer);

            Console.WriteLine(clsResult);

            Thread.Sleep(1000);

            Console.WriteLine("\nShow Struct Demo");
            var stObj = new StDemo(DateTime.Now);

            Console.WriteLine(stObj);
            var stBuffer = StructureConverter.ToBytes <StDemo>(stObj);
            var stResult = StructureConverter.ToStructure <StDemo>(stBuffer);

            Console.WriteLine(stResult);
        }