示例#1
0
        public static Placement CreateFromDictionary(Dictionary<string, object> jsonMap) 
        {
            try 
            {
                if (jsonMap == null)
                {
                    return null;
                }

                var request = new Placement();
                
                
                if(jsonMap.ContainsKey("dock")) 
                {
                    request.Dock = (Dock) System.Enum.Parse(typeof(Dock), (string) jsonMap["dock"]);
                }
                
                if(jsonMap.ContainsKey("horizontalAlign")) 
                {
                    request.HorizontalAlign = (HorizontalAlign) System.Enum.Parse(typeof(HorizontalAlign), (string) jsonMap["horizontalAlign"]);
                }
                
                if(jsonMap.ContainsKey("adFit")) 
                {
                    request.AdFit = (AdFit) System.Enum.Parse(typeof(AdFit), (string) jsonMap["adFit"]);
                }

                return request;
            } 
            catch (System.ApplicationException ex) 
            {
                throw new AmazonException("Error encountered while creating Object from dicionary", ex);
            }
        }
 public abstract Ad CreateFloatingBannerAd(Placement placement);
 public override Ad CreateFloatingBannerAd(Placement placement)
 {
     Start();
     return Ad.CreateFromJson(CreateFloatingBannerAdJson(placement.ToJson()));
 }
示例#4
0
 public override Ad CreateFloatingBannerAd(Placement placement)
 {
     Start();
     return(Ad.CreateFromJson(CreateFloatingBannerAdJson(placement.ToJson())));
 }