Example #1
0
        /// <summary>
        /// Allocates and marshals an arary of OPCITEMPROPERTY structures.
        /// </summary>
        internal static OpcRcw.Da.OPCITEMPROPERTY GetItemProperty(TsCDaItemProperty input)
        {
            OpcRcw.Da.OPCITEMPROPERTY output = new OpcRcw.Da.OPCITEMPROPERTY();

            if (input != null)
            {
                output.dwPropertyID  = input.ID.Code;
                output.szDescription = input.Description;
                output.vtDataType    = (short)Technosoftware.DaAeHdaClient.Com.Interop.GetType(input.DataType);
                output.vValue        = MarshalPropertyValue(input.ID, input.Value);
                output.wReserved     = 0;
                output.hrErrorID     = Technosoftware.DaAeHdaClient.Com.Interop.GetResultID(input.Result);

                // set the property data type.
                TsDaPropertyDescription description = TsDaPropertyDescription.Find(input.ID);

                if (description != null)
                {
                    output.vtDataType = (short)Technosoftware.DaAeHdaClient.Com.Interop.GetType(description.Type);
                }

                // convert unified DA code to COM DA code.
                if (input.Result == OpcResult.Da.E_WRITEONLY)
                {
                    output.hrErrorID = Result.E_BADRIGHTS;
                }
            }

            return(output);
        }
        public PropertyFiltersCtrl()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            // popuplated the property names list
            TsDaPropertyDescription[] properties = TsDaPropertyDescription.Enumerate();

            foreach (TsDaPropertyDescription property in properties)
            {
                propertyNamesLb_.Items.Add(property);
            }
        }