public RefineSearchTreeViewItemSettingWindow()
        {
            try
            {
                if (Item == null) Item = new RefineSearchTreeViewItem();
                _oldItem = Clone.DeepCopyClone<RefineSearchTreeViewItem>(Item);
            }
            catch { }

            InitializeComponent();

            FileNameListView.SelectionChanged+=new SelectionChangedEventHandler(FileNameListView_SelectionChanged);
            RegexFileNameListView.SelectionChanged+=new SelectionChangedEventHandler(RegexFileNameListView_SelectionChanged);
            CategoryListView.SelectionChanged+=new SelectionChangedEventHandler(CategoryListView_SelectionChanged);
            IdListView.SelectionChanged+=new SelectionChangedEventHandler(IdListView_SelectionChanged);
            HashListView.SelectionChanged+=new SelectionChangedEventHandler(HashListView_SelectionChanged);
        }
 private void Window_Closed(object sender, EventArgs e)
 {
     if (this.DialogResult != true)
     {
         Item = _oldItem;
     }
 }
Exemplo n.º 3
0
        Settings()
            : base()
        {
            FileShareFilter_GridViewColumn_Name_Width = 100;
            FileShareFilter_GridViewColumn_Category_Width = 100;
            FileShareFilter_GridViewColumn_ID_Width = 100;
            FileShareFilter_GridViewColumn_LimitSize_Width = 100;
            FileShareFilter_GridViewColumn_LowerSize_Width = 100;
            FileShareFilter_GridViewColumn_Hash_Width = 100;

            FileShareTrigger_GridViewColumn_Name_Width = 100;
            FileShareTrigger_GridViewColumn_Category_Width = 100;
            FileShareTrigger_GridViewColumn_ID_Width = 100;
            FileShareTrigger_GridViewColumn_LimitSize_Width = 100;
            FileShareTrigger_GridViewColumn_LowerSize_Width = 100;
            FileShareTrigger_GridViewColumn_Hash_Width = 100;

            FileShareNode_GridViewColumn_CommunicationType_Width = 100;
            FileShareNode_GridViewColumn_Node_Width = 100;
            FileShareNode_GridViewColumn_Description_Width = 100;
            FileShareNode_GridViewColumn_ConnectionTime_Width = 100;

            GridViewColumn_Filename_Width = 100;
            GridViewColumn_ID_Width = 100;
            GridViewColumn_Size_Width = 100;
            GridViewColumn_Status_Width = 100;
            GridViewColumn_Hash_Width = 100;

            Grid_ColumnDefinitions_Width = new GridLength(207);
            DownloadDirectoryPath = "";
            IsServiceStarted = false;

            Sign = "";
            PrivateKey = "";
            PublicKey = "";

            Query_GridViewColumn_Filename_Width = 100;
            Query_GridViewColumn_CategoryList_Width = 100;
            Query_GridViewColumn_Sign_Width = 100;
            Query_GridViewColumn_ID_Width = 100;
            Query_GridViewColumn_Size_Width = 100;
            Query_GridViewColumn_Status_Width = 100;
            Query_GridViewColumn_CreationTime_Width = 100;
            Query_GridViewColumn_Hash_Width = 100;
            Query_GridViewColumn_Review_Width = 100;

            RefineSearchTreeViewItemSettingWindow_GridViewColumn_Include_Width = 100;
            RefineSearchTreeViewItemSettingWindow_GridViewColumn_Value_Width = 100;

            _cacheController = new CacheController();
            _routeTable = new RouteTable();
            _keyController = new KeyController();

            TabRadioButton = false;
            TreeRadioButton = true;

            DisplaySize_1 = true;
            DisplaySize_2 = false;
            DisplaySize_3 = false;

            QueryTimerMaxCount = 2;
            StoreTimerMaxCount = 2;
            DownloadTimerMaxCount = 20;
            UploadTimerMaxCount = 2;

            SelectedIndexCategory = -1;
            _categoryDir = new Dictionary<string, string[]>();
            _categoryList = new BindingList<string>();
            _filterList = new BindingList<Profes.P2P.FileShare.FileShareControl.Filter>();
            _triggerList = new BindingList<Profes.P2P.FileShare.FileShareControl.Trigger>();
            _nodeShowList = new BindingList<NodeListViewItem>();
            UploadDiffusionList = new List<UploadDiffusion>();
            _downloadList = new BindingList<CacheListViewItem>();
            _uploadList = new BindingList<CacheListViewItem>();
            SearchTreeViewItem = new RefineSearchTreeViewItem { RefineSearchName = "Search", IsExpanded = true, };
            QueryList = new string[] { "test" };

            CommentsWindow_Height = 358;
            CommentsWindow_Width = 727;

            DownloadHistory = new List<CacheListViewItem>();

            ConnectionType = ConnectionType.Direct;

            DirectConnectionInformation = new DirectConnectionInformation()
            {
                IPAddress = "",
                Port = new Random().Next(1024, 65536),
            };

            UpnpConnectionInformation = new UpnpConnectionInformation()
            {
                GlobalIPAddress = "",
                MachineIPAddress = "",
                GatewayIPAddress = "",
                ExternalPort = new Random().Next(1024, 65536),
                InternalPort = new Random().Next(1024, 65536),
            };

            OtherConnectionInformation = new OtherConnectionInformation()
            {
                IPAddress = "",
                Port = new Random().Next(1024, 65536),
            };

            LogCheckBox_IsChecked = false;

            try
            {
                Load();
            }
            catch { }
        }