/// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            GetRulesResponse response = new GetRulesResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("nextToken", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.NextToken = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("ruleDetails", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <RuleDetail, RuleDetailUnmarshaller>(RuleDetailUnmarshaller.Instance);
                    response.RuleDetails = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
예제 #2
0
        public GetRulesResponse GetRules()
        {
            ToastHelper.PopToast("Get rules");

            var rules    = FirewallHelper.GetRules2();
            var response = new GetRulesResponse();

            response.WindowsResult = rules;
            return(response);
        }
예제 #3
0
        public GetRulesResponse GetRules()
        {
            ToastHelper.PopToast("Get rules");
            //var chain = FirewallHelper.GetRules();
            //var dtoRules = chain.ToModel();

            var rules = FirewallHelper.GetRules();


            var response = new GetRulesResponse()
            {
                UfwResult = rules
            };

            return(response);
        }