/// <summary> /// 统计的分页方法 /// </summary> /// <param name="dataSource">统计的名称</param> /// <param name="fileds">选择列</param> /// <param name="filters">过滤条件</param> /// <param name="orders">排序条件</param> /// <param name="selectors">选择条件</param> /// <param name="page">页数</param> /// <param name="pageSize">每页显示多少条</param> /// <param name="statisticsEngName">统计的名称</param> /// <returns></returns> public static PagingData QueryByStatisticForPaging(WebDataSource dataSource, String[] fileds, List <Expression> filters, List <Order> orders, List <Expression> selectors, int page, int pageSize, String statisticsEngName) { try { DataTransmission _data = GetData(dataSource, fileds, filters, orders, selectors, page, pageSize, true, statisticsEngName); PagingData _DS = QueryStaticsForPaging(_data); return(_DS); } catch (Exception ex) { String errMsg = String.Empty; errMsg += "dataSource:" + dataSource.ToString(); errMsg += ",fileds:"; for (int i = 0; i < fileds.Length; i++) { errMsg += fileds[i].ToString() + "||"; } for (int i = 0; i < filters.Count; i++) { errMsg += filters[i].GetString + "||"; } errMsg += ",orders:"; for (int i = 0; i < orders.Count; i++) { errMsg += orders[i].ToQueryString() + "||"; } errMsg += ",page:" + page; errMsg += ",pageSize:" + pageSize; LogHelper.WriteLog(errMsg + ",QueryByStatisticForPaging方法异常:", ex); throw new Exception(dataSource.ToString() + ex.ToString()); //throw ex; } }
public override void ReceivedData(NSData data, WebDataSource dataSource) { LocationIsValid = false; try { var handle = long.Parse(data.ToString()); var obj = ObjectCache.Shared.GetObject(handle); if (obj == null) { return; } Polyline = obj as ChangeableWrapper <GeoPolyline>; if (Polyline != null) { Location = Polyline.Value.Points?.FirstOrDefault(); LocationIsValid = true; return; } Location = obj as GeoLocation; if (Location != null) { LocationIsValid = true; } } catch (Exception e) { Log.Error("XIMapViewWebDocumentRepresentation", e); return; } }
/// <summary> /// 通道的分页方法 /// </summary> /// <param name="dataSource">数据源id</param> /// <param name="fileds">选择列</param> /// <param name="filters">过滤条件</param> /// <param name="orders">排序条件</param> /// <param name="selectors">选择条件</param> /// <param name="page">页数</param> /// <param name="pageSize">每页显示多少条</param> /// <returns></returns> public static PagingData PQuery(WebDataSource dataSource, String[] fileds, List <Expression> filters, List <Order> orders, List <Expression> selectors, int page, int pageSize) { try { DataTransmission _data = GetData(dataSource, fileds, filters, orders, selectors, page, pageSize, false, ""); //DataQuery _DQ = new DataQuery(); return(IDataQuery.QueryForPagging(_data)); } catch (Exception ex) { String errMsg = String.Empty; errMsg += "dataSource:" + dataSource.ToString(); errMsg += ",fileds:"; for (int i = 0; i < fileds.Length; i++) { errMsg += fileds[i].ToString() + "||"; } for (int i = 0; i < filters.Count; i++) { errMsg += filters[i].GetString + "||"; } errMsg += ",orders:"; for (int i = 0; i < orders.Count; i++) { errMsg += orders[i].ToQueryString() + "||"; } errMsg += ",page:" + page; errMsg += ",pageSize:" + pageSize; LogHelper.WriteLog(errMsg + ",PQuery方法异常:", ex); //LogHelper.WriteLog("参数:" + dataSource.ToString() + "PQuery方法异常:", ex); throw new Exception(dataSource.ToString() + ex.ToString()); //throw ex; } }
public IActionResult New(SessionIndexModel model) { Index index = createIndexForUser(); ViewData.Add("Docodo", docodo.getVersion()); ViewResult res = View(new SessionIndexModel(index)); ViewBag.Languages = docodo.getLanguages(); switch (model.Type) { case SessionIndexModel.TypeEnum.Web: WebDataSource web = new WebDataSource("web", model.Path); web.MaxItems = 20; index.AddDataSource(web); index.CreateAsync(); break; default: ViewData.Add("Error", $"Data Source {model.Type} is not supported"); break; } return(res); }
private async System.Threading.Tasks.Task LoadData(Boolean forceRefresh) { int selectedIndex = pivot.SelectedIndex; var sampleDataGroup = await WebDataSource.GetGroupAsync(Games[selectedIndex].Name, forceRefresh); this.DefaultViewModel[Games[selectedIndex].GroupName] = sampleDataGroup; }
void DataSourceUpdated(WebDataSource dataSource) { var oldDataSource = DataSource; DataSource = dataSource; DataSourceUpdated(oldDataSource, DataSource); }
public async Task skal_hente_ned_joker_resultater() { JokerData resultatdata = (JokerData)await WebDataSource.GetGroupAsync("joker", false); Assert.IsNotNull(resultatdata); string[] vinnertallArray = resultatdata.Vinnertall.Split(','); Assert.AreEqual(5, vinnertallArray.Length); }
public async Task skal_hente_ned_vikinglotto_resultater() { LottoData resultatdata = (LottoData)await WebDataSource.GetGroupAsync("vikinglotto", false); Assert.IsNotNull(resultatdata); string[] vinnertallArray = resultatdata.Vinnertall.Split(','); Assert.AreEqual(6, vinnertallArray.Length); }
/// <summary> /// 统计 /// </summary> /// <param name="dataSource">数据源id</param> /// <param name="fileds">选择列</param> /// <param name="filters">过滤条件</param> /// <param name="orders">排序条件</param> /// <param name="selectors">选择条件</param> /// <param name="page">页数</param> /// <param name="pageSize">每页显示多少条</param> /// <param name="statisticsEngName">统计的名称</param> /// <returns></returns> public static ResultData QueryByStatistic(WebDataSource dataSource, String[] fileds, List <Expression> filters, List <Order> orders, List <Expression> selectors, int page, int pageSize, String statisticsEngName) { try { DataTransmission _data = GetData(dataSource, fileds, filters, orders, selectors, page, pageSize, false, statisticsEngName); ResultData _DS = QueryStatics(_data); return(_DS); } catch (Exception ex) { throw new Exception(dataSource.ToString() + ex.ToString()); } }
/// <summary> /// 通过通道 查询MongoDB里面写数据 /// </summary> /// <param name="dataSource"></param> /// <param name="fileds"></param> /// <param name="filters"></param> /// <param name="orders"></param> /// <param name="selectors"></param> /// <param name="page"></param> /// <param name="pageSize"></param> /// <param name="isPaging"></param> /// <returns></returns> public static List <T> MongoQuery <T>(WebDataSource dataSource, String[] fileds, List <Expression> filters, List <Order> orders, List <Expression> selectors, int page, int pageSize, bool isPaging) { try { DataTransmission _dt = GetData(dataSource, fileds, filters, orders, selectors, page, pageSize, isPaging, ""); //DataQuery _DQ = new DataQuery(); //return IDataQuery.MongoQuery<T>(_dt); return(new List <T>()); } catch (Exception ex) { throw ex; } }
private async System.Threading.Tasks.Task SelectedAndTellLotto(int selectedIndex, string gruppenavn) { pivot.SelectedIndex = selectedIndex; { using (var speech = new SpeechSynthesizer()) { LottoData sampleDataGroup = (LottoData)await WebDataSource.GetGroupAsync(gruppenavn, true); var voiceStream = await speech.SynthesizeTextToStreamAsync("Winning numbers are " + sampleDataGroup.Vinnertall + ". Additional numbers are " + sampleDataGroup.Tilleggstall); player.SetSource(voiceStream, voiceStream.ContentType); player.Play(); } } }
private async System.Threading.Tasks.Task SelectedAndTellJoker(int selectedIndex, string gruppenavn) { pivot.SelectedIndex = selectedIndex; { using (var speech = new SpeechSynthesizer()) { JokerData sampleDataGroup = (JokerData)await WebDataSource.GetGroupAsync(gruppenavn, true); var voiceStream = await speech.SynthesizeTextToStreamAsync("Winning numbers are " + sampleDataGroup.Vinnertall + ". Winning player card numbers is " + sampleDataGroup.Spillerkortnummer); player.SetSource(voiceStream, voiceStream.ContentType); player.Play(); } } }
/// <summary> /// 通道的获取数据的方法 /// </summary> /// <param name="dataSource">数据源id</param> /// <param name="fileds">选择列</param> /// <param name="filters">过滤条件</param> /// <param name="orders">排序条件</param> /// <param name="selectors">选择条件</param> /// <param name="page">页数</param> /// <param name="pageSize">每页显示多少条</param> /// <returns></returns> public static DataSet Query(WebDataSource dataSource, String[] fileds, List <Expression> filters, List <Order> orders, List <Expression> selectors, int page, int pageSize) { try { DataTransmission _data = GetData(dataSource, fileds, filters, orders, selectors, page, pageSize, false, ""); List <DataTransmission> _dataList = new List <DataTransmission>(); _dataList.Add(_data); DataSet _DS = Query(_dataList); return(_DS); } catch (Exception ex) { //LogHelper.WriteLog("源名:" + dataSource.ToString() + ",Query方法异常:", ex); throw new Exception(dataSource.ToString() + ex.ToString()); //throw ex; } }
protected override void DataSourceUpdated(WebDataSource oldDataSource, WebDataSource newDataSource) { if (mapView.Overlays != null) { mapView.RemoveOverlays(mapView.Overlays); } var representation = (XIMapViewWebDocumentRepresentation)newDataSource?.Representation; if (representation == null || !representation.LocationIsValid) { return; } if (representation.Polyline == null) { var coordinate = representation.Location.ToCoordinate(); AddLocationAnnotation(coordinate); mapView.Region = MKCoordinateRegion.FromDistance(coordinate, 15000, 15000); } else { var coords = representation.Polyline.Value.ToCoordinates(); for (var i = 0; i < coords.Length; i++) { AddLocationAnnotation( coords [i], representation.Polyline, i); } var mkpolyline = MKPolyline.FromCoordinates(coords); mapView.AddOverlay(mkpolyline); mapView.SetVisibleMapRect( mkpolyline.BoundingMapRect, new NSEdgeInsets(45, 35, 35, 35), false); } }
public override void OnReceivedResponse(WebView sender, NSObject identifier, NSUrlResponse responseReceived, WebDataSource dataSource);
public override void OnCancelledAuthenticationChallenge(WebView sender, NSObject identifier, NSUrlAuthenticationChallenge challenge, WebDataSource dataSource);
public override NSUrlRequest OnSendRequest(WebView sender, NSObject identifier, NSUrlRequest request, NSUrlResponse redirectResponse, WebDataSource dataSource);
public override NSObject OnIdentifierForInitialRequest(WebView sender, NSUrlRequest request, WebDataSource dataSource);
public override void OnFailedLoading(WebView sender, NSObject identifier, NSError withError, WebDataSource dataSource);
public override void ReceivedError(NSError error, WebDataSource dataSource) { }
public override void ReceivedData(NSData data, WebDataSource dataSource) { }
public void OnReceivedContentLength(WebView sender, NSObject identifier, nint length, WebDataSource dataSource) { Console.WriteLine("OnReceivedContentLength: {0}", length); InvokeOnMainThread(() => { progressBar.IncrementBy(2.5); }); }
public override void SetDataSource(WebDataSource dataSource) { }
public override void OnReceivedContentLength(WebView sender, NSObject identifier, int length, WebDataSource dataSource);
public override void OnFinishedLoading(WebView sender, NSObject identifier, WebDataSource dataSource);
public URLRequest RequestHandler(WebView sender, object identifier, URLRequest initialRequest, URLResponse urlResponse, WebDataSource datasource) { // if ( ((URL)(initialRequest.urL)).relativeString.ToString().IndexOf("http://monodoc/load?") == 0) { // FIXME if (initialRequest.URL.AbsoluteString.IndexOf("http://monodoc/load?") == 0) { string url = initialRequest.URL.AbsoluteString.Replace("http://monodoc/load?", ""); string content = ""; if (url.StartsWith("edit:")) { // XmlNode edit_node = EditingUtils.GetNodeFromUrl (url, help_tree); // Console.WriteLine (edit_node.InnerXml); } Node n; try { content = help_tree.RenderUrl(url, out n); } catch (Exception e) { content = "Exception Rendering the requested URL: " + e; } if (content != null && !content.Equals("")) { content = content.Replace("a href='", "a href='http://monodoc/load?"); content = content.Replace("a href=\"", "a href=\"http://monodoc/load?"); webView.Render(content); addHistoryItem(url); } return(null); } return(initialRequest); }
public override void OnPlugInFailed(WebView sender, NSError error, WebDataSource dataSource);
// =============== #if MAC private NSUrlRequest OnSendRequest(WebView sender, NSObject identifier, NSUrlRequest request, NSUrlResponse redirectResponse, WebDataSource dataSource) { return(request); }
public void OnReceivedResponse(WebView sender, NSObject identifier, NSUrlResponse responseReceived, WebDataSource dataSource) { Console.WriteLine("OnReceivedResponse: {0}", responseReceived.ExpectedContentLength); }
/// <summary> /// 生成 DataTransmission /// </summary> /// <param name="dataSource">源或统计的名称</param> /// <param name="fileds">查询的字段</param> /// <param name="filters">过滤条件</param> /// <param name="orders">排序</param> /// <param name="selectors"></param> /// <param name="page">当前页码</param> /// <param name="pageSize">每页记录数</param> /// <param name="IsPaging">是否分页(只在统计分页方法的时候有效)</param> /// <param name="statisticsEngName">统计的名称</param> /// <returns></returns> public static DataTransmission GetData(WebDataSource dataSource, String[] fileds, List <Expression> filters, List <Order> orders, List <Expression> selectors, int page, int pageSize, bool IsPaging, String statisticsEngName) { DataTransmission data = GetData(dataSource.ToString(), fileds, filters, orders, selectors, page, pageSize, IsPaging, statisticsEngName); return(data); }