Example #1
0
 public void DiscoverFromFolder_Ok()
 {
     var itemDiscoverer = new ItemDiscoverer();
     var item = itemDiscoverer.DiscoverFromFolder(@"Data\Test");
     Assert.IsNotNull(item);
     Assert.AreEqual("Test", item.SynchItemData.Name);
     Assert.AreEqual(3,item.Items.Count);
     Assert.AreEqual(1,item.Items[0].Items.Count);
 }
Example #2
0
        private static void BuildFromFolder(string startFromFolder, string outputFile)
        {
            var itemDiscoverer = new ItemDiscoverer(startFromFolder);

            itemDiscoverer.DiscoveringFolder += new EventHandler<FolderDiscoveredArg>(itemDiscoverer_DiscoveringFolder);
            var synchItem = itemDiscoverer.DiscoverFromFolder(startFromFolder);

            XmlSerializer xmlSerializer = new XmlSerializer(typeof(SynchItem));

            using (FileStream fs = new FileStream(outputFile, FileMode.Create))
                xmlSerializer.Serialize(fs, synchItem);
        }
Example #3
0
 public void DiscoverFromFolder_NoFolder_Sent()
 {
     var itemDiscoverer = new ItemDiscoverer();
     itemDiscoverer.DiscoverFromFolder(null);
 }
Example #4
0
 public void DiscoverFromFolder_NoFolder_Exists()
 {
     var itemDiscoverer = new ItemDiscoverer();
     itemDiscoverer.DiscoverFromFolder(@"Data\Test1");
 }
Example #5
0
 public void Initialize(string rootFolder,ItemDiscoverer itemDiscoverer)
 {
     LoggingManager.Debug("Initializing publisher with rootfolder: " +rootFolder);
     try
     {
         if (string.IsNullOrEmpty(rootFolder))
             throw new ArgumentNullException("rootFolder");
         _sourceRootName = rootFolder;
         _itemDiscoverer = itemDiscoverer;
         _temporaryStore = GetOfflineChanges(CurrentRepository);
         LoggingManager.Debug("Publisher initialized");
     }
     catch (Exception ex)
     {
         LoggingManager.LogMySynchSystemError(ex);
     }
 }