コード例 #1
0
        public static void Run()
        {
            // get uda attribute
            DbAttribute uda = DbAttribute.GetDbAttribute(":VOLUME");

            if (uda != null)
            {
                // Create instance of delegate containing "VolumeCalculation" method
                Ps.GetDoubleDelegate dele = new Ps.GetDoubleDelegate(VolumeCalculation);
                // Pass delegate instance to core PDMS. This will be invoked later
                Ps.AddGetDoubleAttribute(uda, NOUN.BOX, dele);

                // Now get value on a box
                double vol = Example.Instance.mBox.GetDouble(uda);
                Console.WriteLine(vol);
            }
        }
コード例 #2
0
        public static void Run()
        {
            // get uda attribute
            DbAttribute uda = DbAttribute.GetDbAttribute(":VOLUME");

            if (uda != null)
            {
                // Create instance of delegate containing "VolumeCalculation" method
                Ps.GetDoubleDelegate dele = new Ps.GetDoubleDelegate(VolumeCalculation);
                // Pass delegate instance to core PDMS. This will be invoked later
                Ps.AddGetDoubleAttribute(uda, NOUN.BOX, dele);

                // Now get value on a box
                double vol = Example.Instance.mBox.GetDouble(uda);
                Console.WriteLine(vol);
            }
        }