/// <summary> /// Initializes a new instance of the <see cref="RequestGetData"/> class. /// </summary> /// <param name="path">Path to the node</param> /// <param name="options">Options for this request</param> /// <param name="optionArgument">Argument for options</param> /// <param name="watcher"><see cref="IWatcher"/> to associate with the node</param> /// <param name="uid">Unique Id of the request</param> public RequestGetData(string path, GetDataOptions options, IGetDataOptionArgument optionArgument, IWatcher watcher, ulong uid = 0) : base(RingMasterRequestType.GetData, path, uid) { this.Watcher = watcher; this.Options = options; this.OptionArgument = optionArgument; }
public static void GetByDate(DateTime dateFrom, DateTime dateTo) { var routeClient = new APIClient(); var result = Login(routeClient); if (result.ErrorLevel != "None") { System.Diagnostics.Debug.WriteLine("login error: " + result.Message); } var options = new GetDataOptions { Variants = true, VariantsData = true, DateFrom = dateFrom.ToString("yyyy-MM-dd"), DateTo = dateFrom.ToString("yyyy-MM-dd"), Variant = 1 }; var getResult = routeClient.GetData(options, result.AuthToken); if (getResult.ErrorLevel != "None") { System.Diagnostics.Debug.WriteLine("get error: " + getResult.Message); } File.WriteAllText(HttpContext.Current.Server.MapPath("~/GetData.xml"), getResult.Data); }
/// <summary> /// Initializes a new instance of the <see cref="RequestGetData"/> class. /// </summary> /// <param name="path">Path to the node</param> /// <param name="options">Options for this request</param> /// <param name="watcher"><see cref="IWatcher"/> to associate with the node</param> /// <param name="uid">Unique Id of the request</param> public RequestGetData(string path, GetDataOptions options, IWatcher watcher, ulong uid = 0) : this(path, options, null, watcher, uid) { }
/// <summary> /// Gets a value indicating whether the given option flag is set. /// </summary> /// <param name="option">Option flag</param> /// <returns><c>true</c> if the option flag is set</returns> private bool IsOptionSet(GetDataOptions option) { return((this.Options & option) == option); }