/// <summary> /// Publishes a RealEstate object. /// </summary> /// <param name="realEstate">The RealEstate object.</param> public async Task PublishAsync(RealEstate realEstate) { var req = Connection.CreateRequest("publish"); req.AddParameter("realestate", realEstate.id); req.AddParameter("publishchannel", ImportExportClient.ImmobilienscoutPublishChannelId); var pos = await Connection.ExecuteAsync <publishObjects>(req, ""); if (pos.publishObject == null || !pos.publishObject.Any()) { req = Connection.CreateRequest("publish", Method.POST); var p = new PublishObject { publishChannel = new PublishChannel { id = ImportExportClient.ImmobilienscoutPublishChannelId, idSpecified = true }, realEstate = new PublishObjectRealEstate { id = realEstate.id, idSpecified = true } }; req.AddBody(p); var pres = await Connection.ExecuteAsync <messages>(req, ""); if (!pres.IsSuccessful(MessageCode.MESSAGE_RESOURCE_CREATED)) { throw new IS24Exception(string.Format("Error publishing RealEstate {0}: {1}", realEstate.externalId, pres.message.ToMessage())) { Messages = pres } } ; } } }
/// <summary> /// Publishes a RealEstate object. /// </summary> /// <param name="realEstate">The RealEstate object.</param> /// <param name="channelId">The channelId of the channel to publish to.</param> /// <exception cref="IS24Exception"></exception> public async Task PublishAsync(RealEstate realEstate, int channelId) { var pos = await GetAsync(realEstate, channelId); if (pos.PublishObject == null || !pos.PublishObject.Any()) { var req = Connection.CreateRequest("publish", Method.POST); var p = new PublishObject { PublishChannel = new PublishChannel { Id = channelId }, RealEstate = new PublishObjectRealEstate { Id = realEstate.Id } }; req.AddBody(p); var pres = await ExecuteAsync <Messages>(Connection, req); if (!pres.IsSuccessful(MessageCode.MESSAGE_RESOURCE_CREATED)) { throw new IS24Exception(string.Format("Error publishing RealEstate {0}: {1}", realEstate.ExternalId, pres.ToMessage())) { Messages = pres } } ; } }
/// <summary> /// 发布 /// </summary> /// <param name="asynchronousClient"></param> private static void Publish(AsynchronousClient asynchronousClient) { PublishObject publishObject = new PublishObject(); publishObject.topic = "test"; publishObject.content = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + new Random().Next(999).ToString(); Console.WriteLine($"我在主题[{publishObject.topic}]发布了一条消息:{publishObject.content}"); asynchronousClient.Send(publishObject, MsgOperation.发布广播); }
private void button14_Click(object sender, EventArgs e) { Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application(); excel.Visible = true; Workbook wb = excel.Workbooks.Add(); Worksheet sheet = wb.ActiveSheet; ListObject tab1 = sheet.ListObjects.Add(XlListObjectSourceType.xlSrcRange, sheet.get_Range("A1:D4")); PublishObject po = wb.PublishObjects.Add(XlSourceType.xlSourceRange, "e:\\1.htm", "Sheet1", "A1:D4", XlHtmlType.xlHtmlStatic, "wkbk_0009", ""); Microsoft.Office.Interop.Excel.Shape shape = sheet.Shapes.AddChart(Microsoft.Office.Interop.Excel.XlChartType.xlPie); Microsoft.Office.Interop.Excel.Chart chart = shape.Chart;// (Microsoft.Office.Interop.Excel.Chart) chart.Export("e:\\11.png"); //chart.ExportAsFixedFormat(XlFixedFormatType.xlTypeXPS, "e:\\111.xps"); po.Publish(true); po.AutoRepublish = false; wb.Close(false); excel.Quit(); }
public void SetPublishDelegate(PublishObject publishMethod) { this.publish = publishMethod; }
public MethodSwitchboard(PublishObject publishMethod) { this.publishMethod = publishMethod; this.instances = new InstanceCache(publishMethod); this.methods = new ConcurrentDictionary<string, MethodExecutor>(); }
public InstanceCache(PublishObject publishMethod) { this.publishMethod = publishMethod; }
/// <summary> /// Publishes a RealEstate object. /// </summary> /// <param name="realEstate">The RealEstate object.</param> /// <param name="channelId">The channelId of the channel to publish to.</param> /// <exception cref="IS24Exception"></exception> public async Task PublishAsync(RealEstate realEstate, int channelId) { var pos = await GetAsync(realEstate, channelId); if (pos.PublishObject == null || !pos.PublishObject.Any()) { var req = Connection.CreateRequest("publish", Method.POST); var p = new PublishObject { PublishChannel = new PublishChannel { Id = channelId }, RealEstate = new PublishObjectRealEstate { Id = realEstate.Id } }; req.AddBody(p); var pres = await ExecuteAsync<Messages>(Connection, req); if (!pres.IsSuccessful(MessageCode.MESSAGE_RESOURCE_CREATED)) throw new IS24Exception(string.Format("Error publishing RealEstate {0}: {1}", realEstate.ExternalId, pres.ToMessage())) { Messages = pres }; } }