Skip to content

Instantly share code, notes, and snippets.

@takeshik
Created March 13, 2010 15:44
Show Gist options
  • Save takeshik/331378 to your computer and use it in GitHub Desktop.
Save takeshik/331378 to your computer and use it in GitHub Desktop.
this.Client.Connectors.Let(
cs => cs.ItemsAdded += (csender, ce) =>
ce.NewElements
.ForEach(ct => this.serversTreeView.Nodes.Insert(ct.Index, ct.Key)
.Let(nc =>
this.Client.Connectors[nc.FullPath].Views.Let(
vs => vs.ItemsAdded += (vsender, ve) => ve.NewElements
.ForEach(vt => this.serversTreeView.Nodes.Insert(vt.Index, vt.Key)
.Let(nf =>
nf.FullPath.Split('\\')
.Do(fe => this.Client.Connectors[fe[0]].Views[fe[1]].Filters
.Do(fs => fs.Walk((_, p) => _[p].ChildFilters, fe.Skip(2)))
)
.Let(
fs => fs.ItemsAdded += (fsender, fe) => fe.NewElements
.ForEach(ft => this.serversTreeView.Nodes.Insert(ft.Index, ft.Key)
.Let(this.InitializeObjectViewCollection)
),
c => c.ItemsRemoved += (sender, e) => e.OldElements.ForEach(t => this.serversTreeView.Nodes.RemoveAt(t.Index))
)
)
),
vs => vs.ItemsRemoved += (vsender, ve) => ve.OldElements.ForEach(vt => this.serversTreeView.Nodes.RemoveAt(vt.Index))
)
)
),
c => c.ItemsRemoved += (sender, e) => e.OldElements.ForEach(t => this.serversTreeView.Nodes.RemoveAt(t.Index))
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment