コード例 #1
0
 public SynchronicRepository(IDataMapper <T> primary,
                             IDataMapper <T> secondary,
                             CopyStrategy copyStrategy,
                             ProgressState progressState)
 {
     if (primary == null)
     {
         Dispose();
         throw new ArgumentNullException("primary");
     }
     if (secondary == null)
     {
         Dispose();
         throw new ArgumentNullException("secondary");
     }
     if (copyStrategy == null)
     {
         Dispose();
         throw new ArgumentNullException("copyStrategy");
     }
     if (ReferenceEquals(primary, secondary))
     {
         Dispose();
         throw new ArgumentException("primary and secondary must not be equal");
     }
     _primary             = primary;
     _secondary           = secondary;
     _copyStrategy        = copyStrategy;
     _primarySecondaryMap = new Dictionary <RepositoryId, RepositoryId>();
     SynchronizeRepositories();
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: oduma/MySynch
        static void Main(string[] args)
        {
            //IPublisherProxy publisherProxy = new PublisherClient();
            //publisherProxy.InitiateUsingEndpoint("PublisherSciendoLaptop");
            //publisherProxy.PublishPackage();

            ISourceOfDataProxy sourceOfDataProxy = new SourceOfDataClient();
            sourceOfDataProxy.InitiateUsingEndpoint("SourceOfDataSciendoLaptop");
            //var data = sourceOfDataProxy.GetData(new RemoteRequest {FileName = @"C:\MySynch.Source.Test.Root\img001.jpg"});

            ISubscriberProxy subscriberProxy = new SubscriberClient();
            subscriberProxy.InitiateUsingEndpoint("SubscriberSciendoLaptop");
            CopyStrategy copyStrategy= new CopyStrategy();
            copyStrategy.Initialize(sourceOfDataProxy);
            subscriberProxy.ApplyChangePackage(new ChangePushPackage(), "SourceOfDataSciendoLaptop");
        }
コード例 #3
0
 public SynchronicRepository(IDataMapper <T> primary,
                             IDataMapper <T> secondary,
                             CopyStrategy copyStrategy)
     : this(primary, secondary, copyStrategy, null)
 {
 }
コード例 #4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: protected <U> ComponentFieldMetadata<T, U> createField(Field field, org.terasology.reflection.copy.CopyStrategy<U> copyStrategy, org.terasology.reflection.reflect.ReflectFactory factory) throws org.terasology.reflection.reflect.InaccessibleFieldException
        protected internal virtual ComponentFieldMetadata <T, U> createField <U>(Field field, CopyStrategy <U> copyStrategy, ReflectFactory factory)
        {
            return(new ComponentFieldMetadata <>(this, field, copyStrategy, factory, false));
        }