public MulticastMessageEditWindow(Tag tag, string comment, AmoebaManager amoebaManager) { _tag = tag; _amoebaManager = amoebaManager; _digitalSignatureCollection.AddRange(Settings.Instance.Global_DigitalSignatures.ToArray()); InitializeComponent(); this.Title = LanguagesManager.Instance.MulticastMessageEditWindow_Title + " - " + MessageConverter.ToTagString(tag); { var icon = new BitmapImage(); icon.BeginInit(); icon.StreamSource = new FileStream(Path.Combine(_serviceManager.Paths["Icons"], "Amoeba.ico"), FileMode.Open, FileAccess.Read, FileShare.Read); icon.EndInit(); if (icon.CanFreeze) { icon.Freeze(); } this.Icon = icon; } _signatureComboBox.ItemsSource = _digitalSignatureCollection; _signatureComboBox.SelectedIndex = 0; _commentTextBox.Text = comment; _watchTimer = new WatchTimer(this.WatchThread, 0, 1000); this.Closed += (sender, e) => _watchTimer.Dispose(); _textEditor_Helper.Setup(_textEditor); }
public LinkControl(AmoebaManager amoebaManager, BufferManager bufferManager) { _amoebaManager = amoebaManager; _bufferManager = bufferManager; InitializeComponent(); _trustSignatureListView.ItemsSource = _trustSignatureCollection; _untrustSignatureListView.ItemsSource = _untrustSignatureCollection; this.Sort(); _watchThread = new Thread(this.WatchThread); _watchThread.Priority = ThreadPriority.Highest; _watchThread.IsBackground = true; _watchThread.Name = "LinkControl_WatchThread"; _watchThread.Start(); _mainWindow._tabControl.SelectionChanged += (object sender, SelectionChangedEventArgs e) => { if (e.OriginalSource != _mainWindow._tabControl) { return; } if (_mainWindow.SelectedTab == MainWindowTabType.Link) { this.Update(); } }; _searchRowDefinition.Height = new GridLength(0); }
public StoreControl(AmoebaManager amoebaManager, BufferManager bufferManager) { _amoebaManager = amoebaManager; _bufferManager = bufferManager; _seedStateCache = new SeedStateCache(_amoebaManager); InitializeComponent(); var storeDownloadControl = new StoreDownloadControl(this, _amoebaManager, _bufferManager); storeDownloadControl.Height = Double.NaN; storeDownloadControl.Width = Double.NaN; _storeDownloadTabItem.Content = storeDownloadControl; var storeUploadControl = new StoreUploadControl(this, _amoebaManager, _bufferManager); storeUploadControl.Height = Double.NaN; storeUploadControl.Width = Double.NaN; _storeUploadTabItem.Content = storeUploadControl; var libraryControl = new LibraryControl(this, _amoebaManager, _bufferManager); libraryControl.Height = Double.NaN; libraryControl.Width = Double.NaN; _libraryTabItem.Content = libraryControl; }
public DownloadControl(AmoebaManager amoebaManager, BufferManager bufferManager) { _amoebaManager = amoebaManager; _bufferManager = bufferManager; InitializeComponent(); _listView.ItemsSource = _listViewModelCollection; _showDownloadItemThread = new Thread(this.ShowDownloadItem); _showDownloadItemThread.Priority = ThreadPriority.Highest; _showDownloadItemThread.IsBackground = true; _showDownloadItemThread.Name = "DownloadControl_ShowDownloadItemThread"; _showDownloadItemThread.Start(); _watchThread = new Thread(this.Watch); _watchThread.Priority = ThreadPriority.Highest; _watchThread.IsBackground = true; _watchThread.Name = "DownloadControl_WatchThread"; _watchThread.Start(); _searchRowDefinition.Height = new GridLength(0); LanguagesManager.UsingLanguageChangedEvent += this.LanguagesManager_UsingLanguageChangedEvent; }
public OverlayNetworkManager(AmoebaManager amoebaManager, BufferManager bufferManager) { _amoebaManager = amoebaManager; _bufferManager = bufferManager; _settings = new Settings(); _amoebaManager.CreateCapEvent = this.CreateCap; _amoebaManager.AcceptCapEvent = this.AcceptCap; }
public ShareControl(AmoebaManager amoebaManager, BufferManager bufferManager) { _bufferManager = bufferManager; _amoebaManager = amoebaManager; InitializeComponent(); _listView.ItemsSource = _listViewItemCollection; _showShareItemThread = new Thread(ShowShareItem); _showShareItemThread.Priority = ThreadPriority.Highest; _showShareItemThread.IsBackground = true; _showShareItemThread.Name = "ShareControl_ShowShareItemThread"; _showShareItemThread.Start(); }
public UploadControl(AmoebaManager amoebaManager, BufferManager bufferManager) { _bufferManager = bufferManager; _amoebaManager = amoebaManager; InitializeComponent(); _listView.ItemsSource = _listViewItemCollection; _showUploadItemThread = new Thread(this.ShowUploadItem); _showUploadItemThread.Priority = ThreadPriority.Highest; _showUploadItemThread.IsBackground = true; _showUploadItemThread.Name = "UploadControl_ShowUploadItemThread"; _showUploadItemThread.Start(); LanguagesManager.UsingLanguageChangedEvent += this.LanguagesManager_UsingLanguageChangedEvent; }
public CatharsisManager(AmoebaManager amoebaManager, BufferManager bufferManager) { _amoebaManager = amoebaManager; _bufferManager = bufferManager; _settings = new Settings(this.ThisLock); #if DEBUG _watchTimer = new System.Threading.Timer(this.WatchTimer, null, new TimeSpan(0, 0, 0), new TimeSpan(1, 0, 0, 0)); #else _watchTimer = new System.Threading.Timer(this.WatchTimer, null, new TimeSpan(0, 3, 0), new TimeSpan(7, 0, 0, 0)); #endif _succeededUris = new VolatileHashSet <string>(new TimeSpan(1, 0, 0)); _failedUris = new VolatileHashSet <string>(new TimeSpan(1, 0, 0)); _amoebaManager.CheckUriEvent = this.ResultCache_CheckUri; }
public LinkOptionsWindow(AmoebaManager amoebaManager) { _amoebaManager = amoebaManager; InitializeComponent(); { var icon = new BitmapImage(); icon.BeginInit(); icon.StreamSource = new FileStream(Path.Combine(_serviceManager.Paths["Icons"], "Amoeba.ico"), FileMode.Open, FileAccess.Read, FileShare.Read); icon.EndInit(); if (icon.CanFreeze) { icon.Freeze(); } this.Icon = icon; } _downloadSignatureCollection.AddRange(Settings.Instance.Global_TrustSignatures); _downloadSignatureListView.ItemsSource = _downloadSignatureCollection; foreach (var item in Settings.Instance.Global_LinkItems) { var viewModel = new LinkViewModel(); viewModel.Signature = item.Signature; viewModel.TrustSignatures.AddRange(item.TrustSignatures); viewModel.DeleteSignatures.AddRange(item.DeleteSignatures); _uploadLinkCollection.Add(viewModel); } _uploadLinkListView.ItemsSource = _uploadLinkCollection; this.Sort(); }
public LinkOptionsWindow(AmoebaManager amoebaManager) { _amoebaManager = amoebaManager; InitializeComponent(); try { foreach (var item in Settings.Instance.LinkOptionsWindow_DownloadLinkItems) { var viewModel = new LinkViewModel(); viewModel.Signature = item.Signature; viewModel.TrustSignatures.AddRange(item.TrustSignatures); _downloadCollection.Add(viewModel); } foreach (var item in Settings.Instance.LinkOptionsWindow_UploadLinkItems) { var viewModel = new LinkViewModel(); viewModel.Signature = item.Signature; viewModel.TrustSignatures.AddRange(item.TrustSignatures); _uploadCollection.Add(viewModel); } } catch (Exception) { throw; } _downloadLinkListView.ItemsSource = _downloadCollection; _uploadLinkListView.ItemsSource = _uploadCollection; this.Sort(); }
public UploadWindow(string filePath, bool isShare, AmoebaManager amoebaManager) { _amoebaManager = amoebaManager; _filePath = filePath; _isShare = isShare; var digitalSignatureCollection = new List <object>(); digitalSignatureCollection.Add(new ComboBoxItem() { Content = "" }); digitalSignatureCollection.AddRange(Settings.Instance.Global_DigitalSignatureCollection.Select(n => new DigitalSignatureComboBoxItem(n)).ToArray()); InitializeComponent(); { var icon = new BitmapImage(); icon.BeginInit(); icon.StreamSource = new FileStream(Path.Combine(App.DirectoryPaths["Icons"], "Amoeba.ico"), FileMode.Open, FileAccess.Read, FileShare.Read); icon.EndInit(); if (icon.CanFreeze) { icon.Freeze(); } this.Icon = icon; } _nameTextBox.Text = System.IO.Path.GetFileName(_filePath); if (Settings.Instance.Global_UploadKeywords.Count >= 1) { _keywordsComboBox1.Text = Settings.Instance.Global_UploadKeywords[0]; } if (Settings.Instance.Global_UploadKeywords.Count >= 2) { _keywordsComboBox2.Text = Settings.Instance.Global_UploadKeywords[1]; } if (Settings.Instance.Global_UploadKeywords.Count >= 3) { _keywordsComboBox3.Text = Settings.Instance.Global_UploadKeywords[2]; } _keywordsComboBox1.Items.Add(new ComboBoxItem() { Content = "" }); _keywordsComboBox2.Items.Add(new ComboBoxItem() { Content = "" }); _keywordsComboBox3.Items.Add(new ComboBoxItem() { Content = "" }); foreach (var item in Settings.Instance.Global_SearchKeywords) { _keywordsComboBox1.Items.Add(new ComboBoxItem() { Content = item }); } foreach (var item in Settings.Instance.Global_SearchKeywords) { _keywordsComboBox2.Items.Add(new ComboBoxItem() { Content = item }); } foreach (var item in Settings.Instance.Global_SearchKeywords) { _keywordsComboBox3.Items.Add(new ComboBoxItem() { Content = item }); } _signatureComboBox.ItemsSource = digitalSignatureCollection; if (digitalSignatureCollection.Count > 0) { _signatureComboBox.SelectedIndex = 1; } _nameTextBox_TextChanged(null, null); }
public SeedStateCache(AmoebaManager amoebaManager) { _amoebaManager = amoebaManager; _watchTimer = new Timer(this.WatchTimer, null, 0, 1000 * 60); }
public UploadListWindow(IEnumerable <string> filePaths, bool isShare, AmoebaManager amoebaManager) { _amoebaManager = amoebaManager; var list = filePaths.ToList(); list.Sort(); foreach (var item in list) { _filePaths.Add(new UploadListViewItem() { Path = item }); } _isShare = isShare; var digitalSignatureCollection = new List <object>(); digitalSignatureCollection.Add(new ComboBoxItem() { Content = "" }); digitalSignatureCollection.AddRange(Settings.Instance.Global_DigitalSignatureCollection.Select(n => new DigitalSignatureComboBoxItem(n)).ToArray()); InitializeComponent(); { var icon = new BitmapImage(); icon.BeginInit(); icon.StreamSource = new FileStream(Path.Combine(App.DirectoryPaths["Icons"], "Amoeba.ico"), FileMode.Open, FileAccess.Read, FileShare.Read); icon.EndInit(); if (icon.CanFreeze) { icon.Freeze(); } this.Icon = icon; } if (Settings.Instance.Global_UploadKeywords.Count >= 1) { _keywordsComboBox1.Text = Settings.Instance.Global_UploadKeywords[0]; } if (Settings.Instance.Global_UploadKeywords.Count >= 2) { _keywordsComboBox2.Text = Settings.Instance.Global_UploadKeywords[1]; } if (Settings.Instance.Global_UploadKeywords.Count >= 3) { _keywordsComboBox3.Text = Settings.Instance.Global_UploadKeywords[2]; } _keywordsComboBox1.Items.Add(new ComboBoxItem() { Content = "" }); _keywordsComboBox2.Items.Add(new ComboBoxItem() { Content = "" }); _keywordsComboBox3.Items.Add(new ComboBoxItem() { Content = "" }); foreach (var item in Settings.Instance.Global_SearchKeywords) { _keywordsComboBox1.Items.Add(new ComboBoxItem() { Content = item }); } foreach (var item in Settings.Instance.Global_SearchKeywords) { _keywordsComboBox2.Items.Add(new ComboBoxItem() { Content = item }); } foreach (var item in Settings.Instance.Global_SearchKeywords) { _keywordsComboBox3.Items.Add(new ComboBoxItem() { Content = item }); } _listView.ItemsSource = _filePaths; _signatureComboBox.ItemsSource = digitalSignatureCollection; if (digitalSignatureCollection.Count > 0) { _signatureComboBox.SelectedIndex = 1; } }
public SeedInformationWindow(Seed seed, AmoebaManager amoebaManager) { if (seed == null) { throw new ArgumentNullException(nameof(seed)); } if (amoebaManager == null) { throw new ArgumentNullException(nameof(amoebaManager)); } _seed = seed; _amoebaManager = amoebaManager; InitializeComponent(); { var icon = new BitmapImage(); icon.BeginInit(); icon.StreamSource = new FileStream(Path.Combine(_serviceManager.Paths["Icons"], "Amoeba.ico"), FileMode.Open, FileAccess.Read, FileShare.Read); icon.EndInit(); if (icon.CanFreeze) { icon.Freeze(); } this.Icon = icon; } lock (_seed.ThisLock) { _nameTextBox.Text = _seed.Name; _keywordsTextBox.Text = string.Join(", ", _seed.Keywords); _signatureTextBox.Text = seed.Certificate?.ToString(); _creationTimeTextBox.Text = seed.CreationTime.ToLocalTime().ToString(LanguagesManager.Instance.DateTime_StringFormat, System.Globalization.DateTimeFormatInfo.InvariantInfo); _lengthTextBox.Text = string.Format("{0} ({1:#,0} Byte)", NetworkConverter.ToSizeString(_seed.Length), _seed.Length); } _storeSignatureListView.ItemsSource = _storeSignatureCollection; try { _storeTabItem.Cursor = Cursors.Wait; Task.Run(() => { return(this.GetSignature(_seed)); }).ContinueWith(task => { foreach (var signature in task.Result) { _storeSignatureCollection.Add(signature); } _storeTabItem.Cursor = null; }, TaskScheduler.FromCurrentSynchronizationContext()); } catch (Exception) { } }
public TransfarLimitManager(AmoebaManager amoebaManager) { _amoebaManager = amoebaManager; _settings = new Settings(this.ThisLock); }
public AutoBaseNodeSettingManager(AmoebaManager amoebaManager) { _amoebaManager = amoebaManager; _settings = new Settings(this.ThisLock); }
public ConnectionSettingManager(AmoebaManager amoebaManager) { _amoebaManager = amoebaManager; _settings = new Settings(); }
public TransfarLimitManager(AmoebaManager amoebaManager) { _amoebaManager = amoebaManager; _settings = new Settings(); }
public InformationControl(AmoebaManager amoebaManager, BufferManager bufferManager) { _bufferManager = bufferManager; _amoebaManager = amoebaManager; InitializeComponent(); _listView.ItemsSource = _listViewItemCollection; #if DEBUG _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_BufferManagerSize" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem()); #endif _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_SentByteCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_ReceivedByteCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem()); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_CreateConnectionCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_AcceptConnectionCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_BlockedConnectionCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem()); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_SurroundingNodeCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_RelayBlockCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem()); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_LockSpace" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_FreeSpace" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_UsingSpace" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem()); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_NodeCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_SeedCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_BlockCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_DownloadCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_UploadCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_ShareCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem()); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_PushNodeCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_PushBlockLinkCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_PushBlockRequestCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_PushBlockCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_PushSeedRequestCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_PushSeedCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem()); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_PullNodeCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_PullBlockLinkCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_PullBlockRequestCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_PullBlockCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_PullSeedRequestCount" }); _infomationListViewItemCollection.Add(new AmoebaInfomationListViewItem() { Id = "InformationControl_PullSeedCount" }); _infomationListView.ItemsSource = _infomationListViewItemCollection; _showAmoebaInfomationThread = new Thread(this.ShowAmoebaInfomation); _showAmoebaInfomationThread.Priority = ThreadPriority.Highest; _showAmoebaInfomationThread.IsBackground = true; _showAmoebaInfomationThread.Name = "InformationControl_ShowAmoebaInfomationThread"; _showAmoebaInfomationThread.Start(); _showConnectionInfomationwThread = new Thread(this.ShowConnectionInfomation); _showConnectionInfomationwThread.Priority = ThreadPriority.Highest; _showConnectionInfomationwThread.IsBackground = true; _showConnectionInfomationwThread.Name = "InformationControl_ShowConnectionInfomationThread"; _showConnectionInfomationwThread.Start(); }