Ejemplo n.º 1
0
        public MainWindow(ref OpenSshController controller, ref FolderManager FolderManager)
        {
            this.controller       = controller;
            this.FolderManager    = FolderManager;
            DataBinding           = new MainWindowDataBinding();
            registerWithAwsThread = new Thread(RegisterWithAws);

            InitializeComponent();

            FindOrInstallOpenSshLocation();

            // This can be read in from the settings file.
            // TODO: create persistent settings file.
            this.FolderManager.DirectoryPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            DataBinding.LanIp   = controller.GetLocalIp();
            DataBinding.LanPort = controller.GetLocalPort().ToString();
            DataBinding.WanIp   = controller.GetRemoteIp();
            DataBinding.WanPort = controller.GetRemotePort().ToString();


            WanIpTextBox.IsReadOnly   = true;
            WanPortTextBox.IsReadOnly = true;
            LanIpTextBox.IsReadOnly   = true;
            LanPortTextBox.IsReadOnly = true;
        }
Ejemplo n.º 2
0
        public FileListing(ref FolderManager folderManager, Action showMainWindow)
        {
            this.FolderManager  = folderManager;
            this.showMainWindow = showMainWindow;
            InitializeComponent();

            // Create a new list view, add content,
            fileListView.ItemsSource = folderManager.getFilesInDirectory();
        }
Ejemplo n.º 3
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            controller    = new OpenSshController();
            folderManager = new FolderManager();
            MainWindow    = new MainWindow(ref controller, ref folderManager);
            ShowMainWindow();

            FileListingWindow = new FileListing(ref folderManager, new Action(() => ShowMainWindow()));

            NotifyIcon              = new System.Windows.Forms.NotifyIcon();
            NotifyIcon.DoubleClick += (s, args) => ShowFileListingWindow();
            NotifyIcon.Icon         = Flingr.Properties.Resources.FlingrIcon;
            NotifyIcon.Visible      = true;

            CreateContextMenu();
        }