private static void DeserializeInternal(ILPanelEditor editor, IDeserializer deserializer, object instance, IEnumerable<PropertyInfo> properties, string path)
        {
            foreach (PropertyInfo property in properties)
            {
                if (property.CanRead && property.CanWrite)
                {
                    object value = property.GetValue(instance, null);

                    string configPrefixChild = String.Format("{0}:{1}", path, ToIdentifier(property.Name));
                    if (deserializer.Contains(SplitPath(configPrefixChild)))
                    {
                        PropertyInfo[] childProperties = GetProperties(value);
                        if (childProperties.Length > 0 && editor.WrapperMap.Values.Contains(value.GetType()))
                        {
                            DeserializeInternal(editor, deserializer, value, childProperties, String.Format("{0}:{1}", path, ToIdentifier(property.Name)));
                            continue;
                        }
                    }

                    try
                    {
                        string[] pathParts = SplitPath(path);
                        if (deserializer.Contains(pathParts, property.Name))
                            property.SetValue(instance, deserializer.Get(pathParts, property.Name, property.PropertyType), null);
                    }
                    catch
                    {
                        // Exception in deserialization (e.g. ElementNotFound or not deserializable)
                    }
                }
            }
        }
Example #2
0
		public AnsweringCord(short cid, IDeserializer qDeserializer, ISerializer aSerializer )
		{
			this.INCid = cid;
			this.OUTCid = (short)(-INCid);
			this.Deserializer = qDeserializer;
			this.Serializer = aSerializer;
		}
 public TokenConnectionFactory(
     string anubisUri,
     IWebRequestFactory webRequestFactory,
     IDeserializer<NamedToken> serializer)
     : this(anubisUri, webRequestFactory, serializer, null)
 {
 }
 public ConfigurationStore(IZipper zipper, IDeserializer deserializer, ISerializer serializer, IDialog dialog)
 {
     _zipper = zipper;
     _deserializer = deserializer;
     _serializer = serializer;
     _dialog = dialog;
 }
Example #5
0
        public SitecoreDataStore(IDeserializer deserializer)
        {
            Assert.ArgumentNotNull(deserializer, "deserializer");

            _deserializer = deserializer;
            _deserializer.ParentDataStore = this;
        }
        public static void Deserialize(this ILPanelEditor editor, IDeserializer deserializer)
        {
            foreach (ILWrapperBase wrapper in editor.Wrappers)
                DeserializeInternal(editor, deserializer, wrapper, GetProperties(wrapper), wrapper.Path);

            editor.Panel.Configure();
            editor.Update();
        }
 public override void Deserialize(IDeserializer deserializer)
 {
     // CODE HERE
     LogicComponent logicCOm = this.Owner as LogicComponent;
     if (logicCOm == null)
         throw new Exception("PL_NormalLogicBehavior: Expect Logic Component");
     logicCOm.Health = deserializer.DeserializeInteger("Health");
 }
        protected EventStoreSubscriptionView()
        {
            _log = Context.GetLogger();

            var extension = EventStorePersistence.Instance.Apply(Context.System);
            _connection = extension.ServerSettings.Connection;

            _deserializer = extension.JournalSettings.Deserializer;
            _serializer = Context.System.Serialization.FindSerializerForType(typeof(IPersistentRepresentation));
        }
 public object Unpack(IDeserializer deserializer, IUnpacker unpacker)
 {
     CacheString cacheString = new CacheString()
                               {
                                   Id = deserializer.DeserializeVariantInt(),
                                   Value = deserializer.DeserializeString()
                               };
     this.RaiseEvent(CacheStringDeserializer, cacheString);
     return cacheString;
 }
 public TokenConnectionFactory(
     string anubisUri,
     IWebRequestFactory webRequestFactory,
     IDeserializer<NamedToken> serializer,
     BaseConnectionFactory secureConnectionFactory)
 {
     _anubisUri = anubisUri;
     _webRequestFactory = webRequestFactory;
     _serializer = serializer;
     _secureConnectionFactory = secureConnectionFactory;
 }
        public EventStoreJournal()
        {
            _log = Context.GetLogger();

            var serialization = Context.System.Serialization;
            _serializer = serialization.FindSerializerForType(typeof(IPersistentRepresentation));

            var extension = EventStorePersistence.Instance.Apply(Context.System);
            var journalSettings = extension.JournalSettings;
            _deserializer = journalSettings.Deserializer;

            _connection = extension.ServerSettings.Connection;
        }
Example #12
0
        /// <summary>
        /// Creates a new <see cref="IRestClient"/> with <see cref="RestSharp.Deserializers.IDeserializer" /> handlers.
        /// </summary>
        /// <returns></returns>
        IRestClient CreateRestClient(IDeserializer deserializer)
        {
            var client = new RestClient(options.ApiAddress);

            client.ClearHandlers();

            client.AddHandler("application/json", deserializer);
            client.AddHandler("text/json", deserializer);
            client.AddHandler("text/x-json", deserializer);
            client.AddHandler("text/javascript", deserializer);
            client.AddHandler("*+json", deserializer);

            return client;
        }
        public OnlineManager(IDownloadBuffer dbf,  IDataManager dm, IDeserializer ds, IWebClientMaker wm)
        {
            _dm = dm;
            _ds = ds;
            _wm = wm;
            _wm.DownloadFailed += OnDownloadFailed;
            //			DownloadFinished += (object sender, EventArgs e) => {
            //				if(!_downloadError)
            //				{
            //					_dbf.addBufferToDatabase ();
            //					CheckDatabaseIntegrity ();
            //				}
            //			};

            _dbf = dbf;
            resetOnlineManager ();
            log = HelperMethods.ReportInfo;
        }
Example #14
0
 protected override IConsumer <TKey, TValue> CreateConsumer(ConsumerConfig config, Action <Consumer <TKey, TValue>, Error> errorHandler, Action <IConsumer <TKey, TValue>, System.Collections.Generic.List <TopicPartition> > partitionsAssignedHandler, Action <IConsumer <TKey, TValue>, System.Collections.Generic.List <TopicPartitionOffset> > partitionsRevokedHandler, IAsyncDeserializer <TValue> asyncValueDeserializer = null, IDeserializer <TValue> valueDeserializer = null, IAsyncDeserializer <TKey> keyDeserializer = null)
 {
     return(this.consumer ??
            base.CreateConsumer(config, errorHandler, partitionsAssignedHandler, partitionsRevokedHandler, asyncValueDeserializer, valueDeserializer, keyDeserializer));
 }
Example #15
0
 public static IDeserializer <ImmutableArray <A> > collectionDeserializer <A>(
     IDeserializer <A> deserializer
     ) => new ImmutableArrayDeserializer <A>(deserializer);
Example #16
0
 public DocumentService(IDeserializer deserializer, IConfigReader configReader, IFileWrapper fileWrapper)
 {
     _deserializer = deserializer;
     _configReader = configReader;
     _fileWrapper = fileWrapper;
 }
Example #17
0
 public MappedDeserializer(IDeserializer <A> aDeserializer, Fn <A, Option <B> > mapper)
 {
     this.aDeserializer = aDeserializer;
     this.mapper        = mapper;
 }
Example #18
0
 public HttpDeserializer(IHttpClient httpClient, IDeserializer deserializer)
 {
     _httpClient   = httpClient;
     _deserializer = deserializer;
 }
Example #19
0
 public ListObjectVersionsResponseDeserializer(IDeserializer <Stream, ListVersionsResult> contentDeserializer)
     : base(contentDeserializer)
 {
 }
Example #20
0
 public SimpleResponseDeserializer(IDeserializer <Stream, T> contentDeserializer)
     : base(contentDeserializer)
 {
 }
Example #21
0
 public FireAntClient(IDeserializer serializer, IErrorLogger errorLogger) : base(serializer, errorLogger, _baseUrl)
 {
 }
Example #22
0
 public FireAntClient(ICacheService cache, IDeserializer serializer, IErrorLogger errorLogger, string baseUrl) : base(cache, serializer, errorLogger, baseUrl)
 {
 }
Example #23
0
        public TwitterService(ISerializer serializer = null, IDeserializer deserializer = null, string proxy = null)
        {
            Proxy          = proxy;
            FormatAsString = ".json";

            var          jsonSerializer = new JsonSerializer();
            const string userAgent      = "TweetSharp";

            _oauth = new RestClient
            {
                Authority                  = Globals.Authority,
                Proxy                      = Proxy,
                UserAgent                  = userAgent,
                DecompressionMethods       = DecompressionMethods.GZip,
                GetErrorResponseEntityType = (request, @base) => typeof(TwitterErrors),
#if SILVERLIGHT
                HasElevatedPermissions = true
#endif
            };

            _client = new RestClient
            {
                Authority                  = Globals.Authority,
                QueryHandling              = QueryHandling.AppendToParameters,
                VersionPath                = "1.1",
                Serializer                 = serializer ?? jsonSerializer,
                Deserializer               = deserializer ?? jsonSerializer,
                DecompressionMethods       = DecompressionMethods.GZip,
                GetErrorResponseEntityType = (request, @base) => typeof(TwitterErrors),
                UserAgent                  = userAgent,
                Proxy = Proxy,
#if !SILVERLIGHT && !WINRT
                FollowRedirects = true,
#endif
#if SILVERLIGHT
                HasElevatedPermissions = true
#endif
            };

            _uploadMediaClient = new RestClient
            {
                Authority                  = Globals.MediaUploadAuthority,
                QueryHandling              = QueryHandling.AppendToParameters,
                VersionPath                = "1.1",
                Serializer                 = serializer ?? jsonSerializer,
                Deserializer               = deserializer ?? jsonSerializer,
                DecompressionMethods       = DecompressionMethods.GZip,
                GetErrorResponseEntityType = (request, @base) => typeof(TwitterErrors),
                UserAgent                  = userAgent,
                Proxy = Proxy,
#if !SILVERLIGHT && !WINRT
                FollowRedirects = true,
#endif
#if SILVERLIGHT
                HasElevatedPermissions = true
#endif
            };

            _userStreamsClient = new RestClient
            {
                Authority                  = Globals.UserStreamsAuthority,
                Proxy                      = Proxy,
                VersionPath                = "1.1",
                Serializer                 = serializer ?? jsonSerializer,
                Deserializer               = deserializer ?? jsonSerializer,
                DecompressionMethods       = DecompressionMethods.GZip,
                GetErrorResponseEntityType = (request, @base) => typeof(TwitterErrors),
                UserAgent                  = userAgent,
#if !SILVERLIGHT && !WINRT
                FollowRedirects = true,
#endif
#if SILVERLIGHT
                HasElevatedPermissions = true
#endif
            };

            _publicStreamsClient = new RestClient
            {
                Authority            = Globals.PublicStreamsAuthority,
                Proxy                = Proxy,
                VersionPath          = "1.1",
                Serializer           = serializer ?? jsonSerializer,
                Deserializer         = deserializer ?? jsonSerializer,
                DecompressionMethods = DecompressionMethods.GZip,
                UserAgent            = userAgent,
#if !SILVERLIGHT && !WINRT
                FollowRedirects = true,
#endif
#if SILVERLIGHT
                HasElevatedPermissions = true
#endif
            };

            InitializeService();
        }
Example #24
0
 public TwitterService(string consumerKey, string consumerSecret, string token, string tokenSecret, ISerializer serializer, IDeserializer deserializer)
     : this(serializer, deserializer)
 {
     _consumerKey    = consumerKey;
     _consumerSecret = consumerSecret;
     _token          = token;
     _tokenSecret    = tokenSecret;
 }
 public ConfigurationSerializer(ILogger <ConfigurationSerializer> logger, IMapper mapper, IDeserializer <MetricsDeclarationV1> v1Deserializer)
 {
     _logger         = logger;
     _mapper         = mapper;
     _v1Deserializer = v1Deserializer;
 }
Example #26
0
 public RepositoryService(IDeserializer deserializer, IFileWrapper fileWrapper, IConfigReader configReader)
 {
     _deserializer = deserializer;
     _fileWrapper = fileWrapper;
     _configReader = configReader;
 }
 public GetCorsResponseDeserializer(IDeserializer <Stream, SetBucketCorsRequestModel> contentDeserializer)
     : base(contentDeserializer)
 {
 }
 public RottenTomatoesEventExtractor(IDeserializer <MovieCollection> deserializer)
 {
     _deserializer = deserializer;
 }
 public void Deserialize(IDeserializer deserializer)
 {
     deserializer.Deserialize("PlantShadows", shadowFB);
     deserializer.Deserialize("Buttons", buttonFB);
 }
Example #30
0
 public ClientDataService(ICacheService cache, IDeserializer serializer, IErrorLogger errorLogger) : base(cache, serializer, errorLogger)
 {
     BaseUrl = new Uri(BaseUrl, Constant.ClientsUrl);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ResponseErrorHandler" /> class.
 /// </summary>
 /// <param name="deserializer">The deserializer.</param>
 /// <param name="translator">The error to exception translator.</param>
 public ResponseErrorHandler(IDeserializer deserializer, IErrorToExceptionTranslator translator)
 {
     this.deserializer = deserializer;
     this.translator   = translator;
 }
Example #32
0
 public MagicAvroDeserializer(IDeserializer <TValue> impl)
 {
     this.impl = impl;
 }
Example #33
0
 public ImmutableArrayDeserializer(
     IDeserializer <A> deserializer
     )
 {
     this.deserializer = deserializer;
 }
Example #34
0
 public static Database Load(string text, IDeserializer serializer)
 {
     return new Database(serializer.Deserialize(text));
 }
Example #35
0
 public JointRW(ISerializer <A> serializer, IDeserializer <A> deserializer)
 {
     this.serializer   = serializer;
     this.deserializer = deserializer;
 }
        private SerializedAsMasterEvaluator CreateTestEvaluator(ISerializedAsMasterEvaluatorLogger logger = null, IDeserializer deserializer = null, IItemComparer comparer = null)
        {
            if (deserializer == null) deserializer = Substitute.For<IDeserializer>();

            var dataStore = new ConfigurationDataStore(new Lazy<IDataStore>(() => new SitecoreDataStore(deserializer)));

            if (comparer == null)
            {
                comparer = Substitute.For<IItemComparer>();
                comparer.FastCompare(Arg.Any<IItemData>(), Arg.Any<IItemData>()).Returns(new ItemComparisonResult(new FakeItem(), new FakeItem()));
            }

            return new SerializedAsMasterEvaluator(Substitute.For<ILogger>(), logger ?? Substitute.For<ISerializedAsMasterEvaluatorLogger>(), comparer, CreateTestFieldFilter(), dataStore, Substitute.For<ITargetDataStore>(), Substitute.For<IConfiguration>());
        }
        public void Deserialize(IDeserializer deserializer)
        {
            Name = deserializer.DeserializeString("Name");
            // Zombie
            var zombieDesers = deserializer.DeserializeAll("Zombie");
            foreach (var zombieDer in zombieDesers)
            {
                Zombies.Add(zombieDer.DeserializeString("Value"));
            }
            // Number
            var numberDer = deserializer.SubDeserializer("Number");
            NumberFrom = numberDer.DeserializeInteger("From");
            NumberTo = numberDer.DeserializeInteger("To");

            _timeNextWave = deserializer.DeserializeDouble("TimeNextWave");
            _timeBeginWave = deserializer.DeserializeDouble("TimeBeginWave");
            _timeNextZombieFrom = deserializer.DeserializeDouble("TimeNextZombieFrom");
            _timeNextZombieTo = deserializer.DeserializeDouble("TimeNextZombieTo");
        }
 public void Deserialize(IDeserializer reader)
 {
     BinarySerializableClass = (BinarySerializableClass)reader.ReadBinarySerializable();
 }
 public JsonResourceContentProvider(IDeserializer jsonDeserializer, IStreamProvider dataStreamHelper)
 {
     _jsonDeserializer = jsonDeserializer;
     _dataStreamHelper = dataStreamHelper;
 }
Example #40
0
 public static T Deserializer <T>(this T restObject, string contentType,
                                  IDeserializer deserializer) where T : RestClient
 {
     restObject.ContentHandlers[contentType] = deserializer;
     return(restObject);
 }
Example #41
0
 public Context(IDeserializer serializer = null)
 {
     DefaultTerritoryName = "US";
     _serializer = serializer ?? new DefaultDeserializer();
 }
Example #42
0
        public Rectangle DeserializeRectangle(IDeserializer deserializer, string serName)
        {
            IDeserializer subDeser = deserializer.SubDeserializer(serName);

            return new Rectangle(subDeser.DeserializeInteger(tagLeft), subDeser.DeserializeInteger(tagTop), subDeser.DeserializeInteger(tagWidth), subDeser.DeserializeInteger(tagHeight));
        }
Example #43
0
 public EcsRxPipelineNeedsObjectBuilder DeserializeWith(IDeserializer deserializer)
 {
     _steps.Add(new DeserializeStep(deserializer));
     return(new EcsRxPipelineNeedsObjectBuilder(_container, _steps));
 }
Example #44
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CustomDeserialization"/> class.
 /// </summary>
 /// <param name="converter">Dependency injection</param>
 public CustomDeserialization(IDeserializer converter)
 {
     _converter = converter;
 }
Example #45
0
 public static Database LoadFile(string filename, IDeserializer serializer)
 {
     return Load(File.ReadAllText(filename), serializer);
 }
Example #46
0
 public static ISerializedRW <A> a <A>(
     ISerializer <A> serializer, IDeserializer <A> deserializer
     ) => new JointRW <A>(serializer, deserializer);
 public virtual void Deserialize(IDeserializer deserializer)
 {
 }
Example #48
0
 public static IDeserializer <B> map <A, B>(
     this IDeserializer <A> a, Fn <A, Option <B> > mapper
     ) => new MappedDeserializer <A, B>(a, mapper);
 public void Deserialize(IDeserializer reader)
 {
     Value = reader.ReadString();
 }
Example #50
0
 public static IDeserializer <C> collectionDeserializer <A, C>(
     IDeserializer <A> deserializer, CollectionBuilderKnownSizeFactory <A, C> factory
     ) => new CollectionDeserializer <A, C>(deserializer, factory);
Example #51
0
 public SerializationTest()
 {
     _deserializer = new JsonDeserializer();
     _serializer = new JsonSerializer();
 }
Example #52
0
 public AppSettings(IConfigNodeProvider nodeProvider, IDeserializer deserializer, ICombiner combiner)
 {
     _nodeProvider = nodeProvider;
     _deserializer = deserializer;
     _combiner     = combiner;
 }
Example #53
0
		/// <summary>
		/// Registers a content handler to process response content
		/// </summary>
		/// <param name="contentType">MIME content type of the response content</param>
		/// <param name="deserializer">Deserializer to use to process content</param>
		public void AddHandler(string contentType, IDeserializer deserializer)
		{
			ContentHandlers[contentType] = deserializer;
			if (contentType != "*")
			{
				AcceptTypes.Add(contentType);
			}
		}
Example #54
0
 public T Deserialize <T>(IDeserializer context, ICfgNode cfgNode)
 {
     return(_deserializer.Deserialize <T>(context, cfgNode));
 }
Example #55
0
        public Vector2 DeserializeVector2(IDeserializer deserializer, string serName)
        {
            IDeserializer subDeser = deserializer.SubDeserializer(serName);

            return new Vector2((float) subDeser.DeserializeDouble(tagX), (float) subDeser.DeserializeDouble(tagY));
        }
        public DefaultLoadEntityDatabasePipeline(EcsRxPipelineBuilder pipelineBuilder, IDeserializer deserializer, IFromEntityDatabaseDataTransformer dataTransformer, IReceiveDataEndpoint endpoint)
        {
            Deserializer    = deserializer;
            DataTransformer = dataTransformer;
            Endpoint        = endpoint;

            Steps = BuildSteps(pipelineBuilder);
        }
 public HttpRoutingInfoRetreiver(IWebRequestFactory webRequestFactory, string urlExpression, IDeserializer<RoutingInfo> serializer)
 {
     _webRequestFactory = webRequestFactory;
     _urlExpression = urlExpression;
     _serializer = serializer;
 }
Example #58
0
 public OptionConverter(IDeserializer deserializer)
 {
     this.Deserializer = deserializer;
 }
 public override void Deserialize(IDeserializer deserializer)
 {
     // CODE HERE
     shootTime = TimeSpan.FromSeconds(deserializer.DeserializeDouble("TimeShoot"));
 }
Example #60
0
 public AzureResourceDeserializerFactory(IDeserializer <SecretV1> secretDeserializer, ILoggerFactory loggerFactory)
 {
     _secretDeserializer = secretDeserializer;
     _loggerFactory      = loggerFactory;
 }