/// <summary>
        /// Creates the artifact serializers for the <see cref="BaseToolFactory.ArtifactProvider"/>.
        /// The subclasses should call the <see cref="SharpNL.Utility.Serialization.ArtifactProvider.RegisterArtifactType"/>
        /// </summary>
        /// <param name="provider">The provider.</param>
        public override void CreateArtifactSerializers(ArtifactProvider provider) {
            provider.RegisterArtifactType(Path.GetExtension(DummyDict), (artifact, stream) => {
                var dictionary = artifact as DummyDictionary;
                if (dictionary == null)
                    throw new InvalidOperationException();

                dictionary.Serialize(stream);
            }, stream => new DummyDictionary(stream));
        }
Example #2
0
        /// <summary>
        /// Creates the artifact serializers for the <see cref="BaseToolFactory.ArtifactProvider"/>.
        /// The subclasses should call the <see cref="SharpNL.Utility.Serialization.ArtifactProvider.RegisterArtifactType"/>
        /// </summary>
        /// <param name="provider">The provider.</param>
        public override void CreateArtifactSerializers(ArtifactProvider provider)
        {
            provider.RegisterArtifactType(Path.GetExtension(DummyDict), (artifact, stream) => {
                var dictionary = artifact as DummyDictionary;
                if (dictionary == null)
                {
                    throw new InvalidOperationException();
                }

                dictionary.Serialize(stream);
            }, stream => new DummyDictionary(stream));
        }
Example #3
0
        /// <summary>
        /// Creates the artifact serializers for the <see cref="BaseToolFactory.ArtifactProvider"/>.
        /// The subclasses should call the <see cref="SharpNL.Utility.Serialization.ArtifactProvider.RegisterArtifactType"/> method to register an new artifact type.
        /// </summary>
        /// <param name="provider">The artifact provider.</param>
        public override void CreateArtifactSerializers(ArtifactProvider provider) {
            base.CreateArtifactSerializers(provider);

            // TODO: the ITagDictionary is not extensive :(

            provider.RegisterArtifactType(".tagdict", 
                (artifact, stream) => ((POSDictionary) artifact).Serialize(stream), 
                stream => new POSDictionary(stream)
                );

        }