示例#1
0
        private void HandleRepo(Configuration configuration)
        {
            LogService.Log("found a new config: " + configuration.Name);

            Timer timer = new Timer(180000);
            var   tuple = Tuple.Create(configuration, timer);

            InfoHolder.Configurations.Add(configuration.Name, tuple);

            string path = Path.Combine(InfoHolder.syncFolder, configuration.Name);

            FileReaderWriter.CreateConfigurationOnDisk(path);

            timer.Elapsed += delegate(Object sender, ElapsedEventArgs args) { RefreshRepository(tuple); };
            RefreshRepository(tuple);
        }
示例#2
0
        private void IndexChild(Tuple <Entity, string> child, List <Tuple <Entity, string> > newChildren)
        {
            string childName = child.Item1.Original.NameDecorator.SystemName;
            string path      = Path.Combine(child.Item2, childName);

            if (child.Item1.Original.ContainerDecorator != null)
            {
                var childChildren = api.GetChildren(child.Item1).Select(c =>
                                                                        Tuple.Create(c, path)
                                                                        );
                var childChildrenList = childChildren.ToList();
                newChildren.AddRange(childChildrenList);

                DeleteUnavailableChildren(path, childChildrenList);
            }

            FileReaderWriter.WriteEntityToDisk(path, child.Item1);
        }