예제 #1
0
        public void LoadFromRepo(DICTSRVRLib.IPInterfaceType repoIntf)
        {
            var str = repoIntf.InterfaceName;

            if (!string.IsNullOrEmpty(str))
            {
                str = CleanInterfaceName(str);
                if (str != _name)
                {
                    Dict.AddImpliedInterface(str, this);
                    _dataType.Name   = _dataType.Source.ToString();
                    _dataType.Source = new Classifier.ProbeClassifiedString(Classifier.ProbeClassifierType.Interface, str);
                }
            }

            for (int m = 1, mm = repoIntf.MethodCount; m <= mm; m++)
            {
                var funcName       = repoIntf.MethodName[m];
                var returnDataType = ConvertRepoDataType(_name, funcName, repoIntf.MethodDataDef[m]);

                var args = new List <ArgumentDescriptor>();
                for (int a = 1, aa = repoIntf.MethodParamCount[m]; a <= aa; a++)
                {
                    args.Add(new ArgumentDescriptor(repoIntf.MethodParamName[m, a],
                                                    ConvertRepoDataType(_name, funcName, repoIntf.MethodParamDataDef[m, a])));
                }

                var sig = new FunctionSignature(false, FunctionPrivacy.Public, returnDataType, null, funcName, null, args);

                _methods.Add(new InterfaceMethod(_def, sig));
            }

            for (int p = 1, pp = repoIntf.PropertyCount; p <= pp; p++)
            {
                var propName     = repoIntf.PropertyName[p];
                var propDataType = ConvertRepoDataType(_name, propName, repoIntf.PropertyDataDef[p]);

                _properties.Add(new InterfaceProperty(_def, propName, propDataType));
            }
        }