Fix transcript in transfer window.
[cyberduck.git] / source / ch / cyberduck / ui / StructureMapBootstrapper.cs
blob0fcba73cd38bd9ec8abe72e5f4c0f1341ca7d912
1 //
2 // Copyright (c) 2010-2014 Yves Langisch. All rights reserved.
3 // http://cyberduck.ch/
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // Bug fixes, suggestions and comments should be sent to:
16 // yves@cyberduck.ch
17 //
19 using Ch.Cyberduck.Ui.Controller;
20 using Ch.Cyberduck.Ui.Winforms;
21 using Ch.Cyberduck.Ui.Winforms.Controls;
22 using StructureMap;
24 namespace Ch.Cyberduck.Ui
26 public class StructureMapBootstrapper : IBootstrapper
28 private static bool _hasStarted;
30 public void BootstrapStructureMap()
32 ObjectFactory.Initialize(x =>
34 x.For<IBrowserView>().Use<BrowserForm>();
35 x.For<IInfoView>().Use<InfoForm>();
36 x.For<IActivityView>().Use<ActivityForm>();
37 x.For<ILoginView>().Use<LoginForm>();
38 x.For<IBookmarkView>().Use<BookmarkForm>();
39 x.For<IConnectionView>().Use<ConnectionForm>();
40 x.For<ITransferPromptView>().Use<TransferPromptForm>();
41 x.For<IErrorView>().Use<ErrorForm>();
42 x.For<INewFolderPromptView>().Use<NewFolderPromptForm>();
43 x.For<ICreateFilePromptView>().Use<CreateFilePromptForm>();
44 x.For<ICreateSymlinkPromptView>().Use<CreateSymlinkPromptForm>();
45 x.For<IGotoPromptView>().Use<GotoPromptForm>();
46 x.For<IDuplicateFilePromptView>().Use<DuplicateFilePromptForm>();
47 x.For<IDonationView>().Use<DonationForm>();
48 x.For<ITransferView>().Use<TransferForm>();
49 x.For<IProgressView>().Use<TransferControl>();
50 x.For<ICommandView>().Use<CommandForm>();
52 // Singletons
53 x.For<IPreferencesView>().Singleton().Use<PreferencesForm>();
55 // might be a singleton
56 x.For<IUpdateView>().Use<UpdateForm>();
57 });
60 public static void Restart()
62 if (_hasStarted)
64 ObjectFactory.ResetDefaults();
66 else
68 Bootstrap();
69 _hasStarted = true;
73 public static void Bootstrap()
75 new StructureMapBootstrapper().BootstrapStructureMap();