示例#1
0
            /// <summary>
            /// Creates a new ServiceObject.
            /// </summary>
            /// <param name="service">The service object that is used to invoke methods on</param>
            /// <param name="serviceAttribute">NGRIDService attribute of service object's class</param>
            public ServiceObject(NGRIDService service, NGRIDServiceAttribute serviceAttribute)
            {
                Service          = service;
                ServiceAttribute = serviceAttribute;

                _serviceClassName = service.GetType().Name;

                //Find all methods
                _methods = new SortedList <string, bool>();
                foreach (var methodInfo in Service.GetType().GetMethods())
                {
                    var attributes = methodInfo.GetCustomAttributes(typeof(NGRIDServiceMethodAttribute), true);
                    _methods.Add(methodInfo.Name, attributes.Length > 0);
                }
            }
            /// <summary>
            /// Creates a new ServiceObject.
            /// </summary>
            /// <param name="service">The service object that is used to invoke methods on</param>
            /// <param name="serviceAttribute">NGRIDService attribute of service object's class</param>
            public ServiceObject(NGRIDService service, NGRIDServiceAttribute serviceAttribute)
            {
                Service = service;
                ServiceAttribute = serviceAttribute;

                _serviceClassName = service.GetType().Name;

                //Find all methods
                _methods = new SortedList<string, bool>();
                foreach (var methodInfo in Service.GetType().GetMethods())
                {
                    var attributes = methodInfo.GetCustomAttributes(typeof(NGRIDServiceMethodAttribute), true);
                    _methods.Add(methodInfo.Name, attributes.Length > 0);
                }
            }