//public BoundModel TabCollecton; public EditorWebRequestPage(EditorMainMenuWindow _EditorMainMenuWindow) { InitializeComponent(); //TabCollecton = new BoundModel(); ProjectData.TabCollecton = new BoundModel(); DataContext = ProjectData.TabCollecton; ProjectData.TabCollecton.Items.Add(BoundNewItem.AddTab()); this._EditorMainMenuWindow = _EditorMainMenuWindow; TabControl_Requests.SelectionChanged += TabControl_Requests_SelectionChanged; }
private void NetworkActions() { NetworkDelegates.Add(delegate(MResponse ServerResponse) { var HistoryRequests = Package.Unpacking <WebRequestHistory[]>(ServerResponse.DataBytes); WebRequestHistory[] WebRequestsHistoryTemp = WebRequestsHistory.ToArray(); foreach (var HistoryItem in HistoryRequests) { if (!Array.Exists(WebRequestsHistoryTemp, x => x.Id == HistoryItem.Id)) { WebRequestsHistory.Add(HistoryItem); } } }, Dispatcher, -1, "RequestsHistory.GetAll.Confirm", "EditorHistoryRequestsControl"); NetworkDelegates.Add(delegate(MResponse ServerResponse) { var HistoryRequestItem = Package.Unpacking <WebRequestHistory>(ServerResponse.DataBytes); if (!Array.Exists(WebRequestsHistory.ToArray(), x => x.Id == HistoryRequestItem.Id)) { WebRequestsHistory.Add(HistoryRequestItem); } }, Dispatcher, -1, "RequestsHistory.Add.Confirm", "EditorHistoryRequestsControl"); NetworkDelegates.Add(delegate(MResponse ServerResponse) { var RequestDirectory = Package.Unpacking <ModelRequestDirectory>(ServerResponse.DataBytes); if (_EditorMainMenuWindow._EditorWebRequestPage != null) { _EditorMainMenuWindow._EditorWebRequestPage.ClosePage(); } _EditorMainMenuWindow._EditorWebRequestPage = new EditorWebRequestPage(_EditorMainMenuWindow); _EditorMainMenuWindow._EditorWebRequestPage.OpenPage(); _EditorMainMenuWindow.Frame_Main.Content = _EditorMainMenuWindow._EditorWebRequestPage; ProjectData.TabCollecton.Items.Add( BoundNewItem.AddTab( RequestDirectory.RequestTitle, RequestDirectory ) ); }, Dispatcher, -1, "WebRequestDir.History.Edit.Confirm", "EditorHistoryRequestsControl"); }
private void ButtonClick_OpenWebRequest(object sender, RoutedEventArgs e) { var RowRequestDirectory = (sender as Button).DataContext as ModelRequestDirectory; if (ProjectData.TabCollecton != null) { ModelRequestDirectory RequestDirectoryItem = Array.Find(VirtualRequestDirs.ToArray(), x => x.Id == RowRequestDirectory.Id); ProjectData.TabCollecton.Items.Add( BoundNewItem.AddTab( RequestDirectoryItem.RequestTitle, RequestDirectoryItem ) ); } }