public void PublishNotification(string message, PublishType publishType = PublishType.Both, NotificationType notificationType = NotificationType.All) { if (CurrentRequestData.CurrentContext.AreNotificationsDisabled()) return; var notification = new Notification { Message = message, User = _getCurrentUser.Get(), NotificationType = notificationType }; switch (publishType) { case PublishType.Transient: PushNotification(notification); break; case PublishType.Persistent: SaveNotification(notification); break; case PublishType.Both: SaveNotification(notification); PushNotification(notification); break; default: throw new ArgumentOutOfRangeException("publishType"); } }
public SampleGUI(PublishType publishType) { m_PublishType = publishType; InitializeComponent(); // Subscribe to the Reflect logger to display the logs in the console. // Note : you can also use the FileLogReceiver class for easy file logging. Logger.AddReceiver(this); }
void Publish(PublishType publishType) { try { // This indicates the name and version of the software used for publishing. var pluginName = "C# Publisher Sample"; var pluginVersion = Assembly.GetExecutingAssembly().GetName().Version; // Display the project selection external window and return when the project selection has ended (whether it succeeded or not). var settings = WindowFactory.ShowPublisherSettings(pluginName, pluginVersion, publishType); // If the user cancels (or in a few other cases), we don't want to export data. if (settings != null) { Logger.Info($"Logged in as {settings.User.DisplayName}"); Logger.Info($"Target project : {settings.TargetProject.Name}"); Logger.Info($"Target sync server : {settings.TargetProject.Host.ServerName}"); // Let's customize the settings before opening the client CustomizePublisherSettings(settings); // This is the public name of the Source Project you want to export (it doesn't have to be unique). var sourceName = "C# Sample Quad"; // This identifies the Source Project you want to export and must be unique and persistent over multiple publishing sessions. var sourceId = "internal guid"; // Create a Publisher Client, that will allow us to publish data into the selected Target Project. m_PublisherClient = Publisher.OpenClient(sourceName, sourceId, settings); if (publishType == PublishType.Export) { // Simple export flow. PerformExportTransaction(); // Properly close the connection to the SyncServer. m_PublisherClient.CloseAndWait(); } else if (publishType == PublishType.ExportAndSync) { // Sync flow (first export + sync updates). PerformExportTransaction(); PerformSyncUpdates(); } } else { Logger.Warn("No project selected."); } } catch (Exception e) { Logger.Error(e.ToString()); } }
protected override string GenerateCommandLineCommands() { string publishType = PublishType.ToLowerInvariant(); string commandLine = $" \"{CliExecutablePath}\" {publishType} --toolname Fib.Net.MSBuild"; if (publishType == "tar") { return(commandLine + $" --outputfile {OutputTarFile}"); } return(commandLine); }
public PublishCommandOptions(ScriptFile file, string outputDirectory, string libraryName, PublishType publishType, OptimizationLevel optimizationLevel, string[] packageSources, string runtimeIdentifier, bool noCache) { File = file; OutputDirectory = outputDirectory; LibraryName = libraryName; PublishType = publishType; OptimizationLevel = optimizationLevel; PackageSources = packageSources; RuntimeIdentifier = runtimeIdentifier ?? ScriptEnvironment.Default.RuntimeIdentifier; NoCache = noCache; }
public async Task <ExamsDTOEnvelope> GetCurrenUserExams( [FromQuery] PublishType publishType, [FromQuery] PrivateType privateType, [FromQuery] int?limit, [FromQuery] int?offset, [FromQuery] bool?includeTags, [FromQuery] bool?includeUser ) { return(await _mediator.Send(new UserExamList.Query( publishType, privateType, limit, offset, includeTags, includeUser))); }
private void OPR_SendData(object sender, PublishType pt, bool isLogin, string Msg, object oResult) { if (pt == PublishType.PostDataOver) { IsOpen = true; ModelGatherItem modelArticle = (ModelGatherItem)oResult; ope.Message = modelArticle.Title + "_" + Msg; if (PublishOP != null) { PublishOP(this, ope); } } }
/// <summary> /// 发布广告 /// </summary> /// <param name="ap_id"></param> /// <param name="type"></param> /// <returns></returns> public string ADPublish(long ap_id, PublishType type = PublishType.NewPublish) { M_ADService adservice = new M_ADService(); string result = ""; try { ADPublish adPublish = this.ReadADPublish(ap_id); result = adservice.PublishAD(adPublish, this.ReadPublishUser(ap_id), this.ReadADItems((long)adPublish.AC_ID), type); } catch (Exception ex) { result = ex.Message; } return(result); }
public Query( PublishType publishType, PrivateType privateType, int?limit, int?offset, bool?includeTags, bool?includeUser ) { this.PublishType = publishType; this.PrivateType = privateType; this.Limit = limit ?? Constants.FETCH_LIMIT; this.Offset = offset ?? Constants.FETCH_OFFSET; this.IncludeTags = includeTags ?? false; this.IncludeUser = includeUser ?? false; }
public static void PublishAndroid(PublishType t) { //OpenDebugMode(); if (t == PublishType.My) { PackageEditor.ToMy(); } else if (t == PublishType.Park) { PackageEditor.ToPack(); } CopyResToAsset(); CreateAssetBundle.CreateAsset(); ExportAndroid(t); CopyAssetToRes(); //CloseDebugMode(); EditorUtility.DisplayDialog("提示", "导出完成!", "确定"); }
private void OPR_SendData(object sender, PublishType pt, bool isLogin, string Msg, object oResult) { if (pt == PublishType.Login) { MessageBox.Show(Msg.ToString()); } else if (pt == PublishType.LoginOver) { MessageBox.Show(Msg.ToString()); } else if (pt == PublishType.PostData) { iPublish.Publish_PostData(mGatherItem, mClassList); } else if (pt == PublishType.PostDataOver) { this.BakDataBase(Title, Content); } }
private static void ExportAndroid(PublishType t) { string fileName = "Superwings"; if (t == PublishType.My) { fileName = "Superwings_My"; } string name = "Superwings_Unity"; PlayerSettings.companyName = "xxxxxxxxx"; PlayerSettings.productName = name; PlayerSettings.applicationIdentifier = "com.xxx.xxxxxx"; PlayerSettings.bundleVersion = "1.0.0"; PlayerSettings.Android.bundleVersionCode = 100; DirectoryInfo info = new DirectoryInfo(Application.dataPath); FileUtil.DeleteFileOrDirectory(AndroidPath + name); #if UNITY_2018 BuildReport res = BuildPipeline.BuildPlayer(FindEnabledEditorScenes(), AndroidPath.Substring(0, AndroidPath.Length - 1), BuildTarget.Android, BuildOptions.AcceptExternalModificationsToPlayer); #else string res = BuildPipeline.BuildPlayer(FindEnabledEditorScenes(), AndroidPath.Substring(0, AndroidPath.Length - 1), BuildTarget.Android, BuildOptions.AcceptExternalModificationsToPlayer); if (res.Length > 0) { throw new Exception("BuildPlayer failure: " + res); } #endif FileUtil.DeleteFileOrDirectory(AndroidPath + fileName + "/assets/bin"); FileUtil.DeleteFileOrDirectory(AndroidPath + fileName + "/assets/AssetBundle"); //FileUtil.DeleteFileOrDirectory(info.Parent.FullName + "/Android/" + fileName + "/res/drawable/unity_static_splash.png"); //FileUtil.CopyFileOrDirectory(info.Parent.FullName + "/Android/" + name + "/res/drawable/unity_static_splash.png", info.Parent.FullName + "/Android/" + fileName + "/res/drawable/unity_static_splash.png"); CopyDirectory(AndroidPath + name + "/assets/bin", AndroidPath + fileName + "/assets/bin"); CopyDirectory(AndroidPath + name + "/assets/AssetBundle", AndroidPath + fileName + "/assets/AssetBundle"); if (File.Exists(AndroidPath + name + "/assets/AppConfig.json")) { File.Copy(AndroidPath + name + "/assets/AppConfig.json", AndroidPath + fileName + "/assets/AppConfig.json", true); } }
public void Handle(string destName, PublishType type, string subscriptionName = null, IEnumerable <IMessageFilter> filters = null) { _connection = _factory.CreateConnection(); _session = _connection.CreateSession(); _receiverClient = type == PublishType.Queue ? _session.CreateConsumer(_session.GetQueue(destName)) : _session.CreateDurableConsumer(_session.GetTopic(destName), subscriptionName, _filterFactory.Create(filters), false); _connection.Start(); _receiverClient.Listener += (msg) => { var message = msg as IBytesMessage; if (message == null) { throw new SerializerContentTypeMismatch(); } if (message.Properties["ContentType"].Equals(_serializer.ContentType) == false) { throw new SerializerContentTypeMismatch(); } _logger.LogInformation($"Processing message {message.Properties["MessageId"]}."); var payload = new byte[message.BodyLength]; if (message.BodyLength != message.ReadBytes(payload)) { throw new IOException("Is was not possible to read all the message's payload"); } var messageBody = _serializer.Deserialize(payload); // Needs its own DI Scope using (var scope = _serviceProvider.CreateScope()) { var processor = scope.ServiceProvider.GetService <IMessageProcessor>(); processor.Process(messageBody).Wait(); } }; }
public async Task Publish(string destName, PublishType type, IMessage message) { var messagePayload = _serializer.Serialize(message); ISenderClient senderClient = type == PublishType.Queue ? new QueueClient(_configuration.ConnectionString, destName) as ISenderClient : new TopicClient(_configuration.ConnectionString, destName); var messageGuid = Guid.NewGuid().ToString(); await senderClient.SendAsync(new Microsoft.Azure.ServiceBus.Message(messagePayload) { CorrelationId = message.Id.ToString(), MessageId = messageGuid, ContentType = _serializer.ContentType, Label = message.Label }); await senderClient.CloseAsync(); _logger.LogInformation($"Message {messageGuid} published to {destName}."); }
public ActionResult Create(FormCollection collection) { var publishType = new PublishType(); try { this.RadynTryUpdateModel(publishType, collection); publishType.CurrentUICultureName = collection["LanguageId"]; if (NewsComponent.Instance.PublishTypeFacade.Insert(publishType)) { ShowMessage(Resources.Common.InsertSuccessMessage, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Succeed); return(RedirectToAction("Index")); } ShowMessage(Resources.Common.ErrorInInsert, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Error); return(RedirectToAction("Index")); } catch (Exception exception) { ShowExceptionMessage(exception); return(View(publishType)); } }
public void SetDefaults() { this.Applications = new ArrayList(); RegistryKey bizTalkKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\BizTalk Server\3.0"); string btsInstallDirectory = (string)bizTalkKey.GetValue("InstallPath", @"C:\Program Files\Microsoft BizTalk Server 2006\"); string privateBinPath = AppDomain.CurrentDomain.SetupInformation.PrivateBinPath; privateBinPath += String.Format(";{0}", Path.Combine(btsInstallDirectory, @"Tracking\Control")); AppDomain.CurrentDomain.SetupInformation.PrivateBinPath = privateBinPath; RegistryKey bizTalkAdminKey = bizTalkKey.OpenSubKey(@"Administration"); RegistryKey bizTalkRulesKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\BusinessRules\3.0"); this.Server = (string)bizTalkAdminKey.GetValue("MgmtDBServer", Environment.MachineName); this.Database = (string)bizTalkAdminKey.GetValue("MgmtDBName", "BizTalkMgmtDb"); this.RulesServer = (string)bizTalkRulesKey.GetValue("DatabaseServer", Environment.MachineName); this.RulesDatabase = (string)bizTalkRulesKey.GetValue("DatabaseName", "BizTalkRuleEngineDb"); this.OutputDir = Path.GetTempPath(); this.ReportName = "BizTalk Documentation - " + this.Server; this.PublishType = PublishType.EntireConfiguration; //this.Publisher = new CompiledHelpPublisher(); bizTalkKey.Close(); bizTalkAdminKey.Close(); bizTalkRulesKey.Close(); try { AppDomain.CurrentDomain.Load(@"Microsoft.BizTalk.XLangView"); Assembly.LoadFrom(Path.Combine(btsInstallDirectory, @"Tracking\Control") + @"\Microsoft.BizTalk.XLangView.dll"); } catch (Exception) { } }
private void OPR_SendData(object sender, PublishType pt, bool isLogin, string Msg, object oResult) { if (pt == PublishType.Login) { MessageBox.Show(Msg.ToString()); } else if (pt == PublishType.LoginOver) { MessageBox.Show(Msg.ToString()); } else if (pt == PublishType.GetClassListOver) { List <ModelClassItem> ListModelClassItem = (List <ModelClassItem>)oResult; int WebSiteID = StringHelper.Instance.SetNumber(this.txtID.Text); DALWebSiteClassList dal = new DALWebSiteClassList(); foreach (ModelClassItem item in ListModelClassItem) { dal.InsertClassList(WebSiteID.ToString(), item.ClassID, item.ClassName, string.Empty); } this.Bind_ClassList(); } }
/// <summary> /// 发布广告 /// </summary> /// <param name="ap">广告发布信息</param> /// <param name="listMeter">广告用户列表</param> /// <param name="aDItems">广告内容列表</param> /// <param name="type">发布类型</param> /// <returns></returns> public string PublishAD(ADPublish ap, List <ADPublisMeter> listMeter, List <ADItem> aDItems, PublishType type) { //创建一个任务 ser++; MongoDBHelper <Task> mongo_task = new MongoDBHelper <Task>(); // DataItem_C109(byte ser, ADPublishOperatorCode operatorCode,byte fileCount,List<ADFile> fileList) //发布文件列表 List <Common.Item.ADFile> fileList = new List <Common.Item.ADFile>(); //操作码 ADPublishOperatorCode operatorCode = type == PublishType.NewPublish ? ADPublishOperatorCode.ReDefineList : ADPublishOperatorCode.AddList; //文件条数 byte fileCount = (byte)aDItems.Count; foreach (ADItem item in aDItems) { Common.Item.ADFile aDfile = new Common.Item.ADFile((int)item.OrderID, item.StoreName, (DateTime)item.BDate, (DateTime)item.EDate, (int)item.Length, (int)item.FileLength); fileList.Add(aDfile); } foreach (ADPublisMeter meter in listMeter) { Task task = new Task(); task.MeterMac = meter.MeterNo.Trim(); task.TaskDate = QuShi.getDate(); task.TaskID = Guid.NewGuid().ToString(); //用于和指令进行进行关联 task.TaskState = TaskState.Waitting; task.TaskType = TaskType.TaskType_发布广告; //广告文件(GGF) task.TaskSource = string.Format("{0}|{1}|{2}", meter.AP_ID, meter.UserID, meter.CompanyID); mongo_task.Insert(CollectionNameDefine.TaskCollectionName, task); //meter.TaskID = task.TaskID; //设置任务编号 //准备指令 Command cmd = new Command(); DataItem_C109 item_c109 = new DataItem_C109(ser, operatorCode, fileCount, fileList); cmd.Identification = ((UInt16)item_c109.IdentityCode).ToString("X2");; cmd.ControlCode = (byte)ControlCode.CYWriteData;//设置参数 byte[] tmp = item_c109.GetBytes(); cmd.DataLength = Convert.ToByte(tmp.Length); cmd.DataCommand = MyDataConvert.BytesToHexStr(tmp); //指令内容 cmd.Order = (byte)1; cmd.TaskID = task.TaskID; CommandDA.Insert(cmd); } //Command cmd = new Command(); //byte ser = Convert.ToByte(new Random().Next(0, 255)); //byte fileid = (byte)adfile.id;//广告命令 只存储文件编号 //byte[] contentAllBytes = new byte[1]; //contentAllBytes[0] = fileid; ////1.文件发送 //DataItem_C108 item_C108 = new DataItem_C108(ser, adfile.FileName, 1, 1, 1, 1, contentAllBytes);// //cmd.TaskID = task.TaskID; //cmd.Identification = ((UInt16)item_C108.IdentityCode).ToString("X2"); ; //cmd.ControlCode = (byte)ControlCode.CYWriteData;//设置参数 //cmd.DataLength = Convert.ToByte(contentAllBytes.Length); //cmd.DataCommand = MyDataConvert.BytesToHexStr(item_C108.GetBytes()); ; //文件内容 //cmd.Order = (byte)1; //CommandDA.Insert(cmd); //1.文件配置发送指令 //cmd = new Command(); //DataItem_C109 item_C109 = new DataItem_C109(Convert.ToByte(new Random().Next(0, 255)), adddfile.FileNO, adddfile.FileName, adddfile.DTStart, adddfile.DTEnd, adddfile.PollTime, adddfile.OpShowStatus, adddfile.OpDeleteStatus);// //cmd.TaskID = task.TaskID; //cmd.Identification = ((UInt16)item_C109.IdentityCode).ToString("X2"); //cmd.ControlCode = (byte)ControlCode.CYWriteData;//设置参数 //cmd.DataLength = Convert.ToByte(item_C109.Length); //cmd.DataCommand = MyDataConvert.BytesToHexStr(item_C109.GetBytes()); //cmd.Order = (byte)(2); //CommandDA.Insert(cmd); return("");//返回空表示成功 }
public static void PublishScript(string scriptPath, PublishType publishType) { try { if (!_appSettings.ServerSettings.ServerConnectionEnabled) { return; } _httpLogger.Information("Client is publishing a script to the server"); var script = new PublishedScript(); script.WorkerID = _appSettings.ServerSettings.HTTPGuid; script.ScriptType = publishType; script.FriendlyName = new System.IO.FileInfo(scriptPath).Name; WebClient webClient = new WebClient(); string uri = _appSettings.ServerSettings.HTTPServerURL + "/api/Scripts/Exists?workerID=" + script.WorkerID + "&friendlyName=" + script.FriendlyName; var content = webClient.DownloadString(uri); var scriptExists = JsonConvert.DeserializeObject <bool>(content); if (scriptExists) { var messageText = "It appears this task has already been published. Should we overwrite the existing task on the server?"; var messageCaption = "Overwrite Existing Task?"; var overwritePreference = MessageBox.Show(messageText, messageCaption, MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (overwritePreference == DialogResult.Yes) { script.OverwriteExisting = true; } else { script.OverwriteExisting = false; } } else { script.OverwriteExisting = false; } //based on publish type upload local reference or whole task if (publishType == PublishType.ClientReference) { script.ScriptData = scriptPath; } else { script.ScriptData = System.IO.File.ReadAllText(scriptPath); } var scriptJson = JsonConvert.SerializeObject(script); _httpLogger.Information("Posting Json to Publish API: " + scriptJson); //create webclient and upload webClient.Headers["Content-Type"] = "application/json"; webClient.UploadStringCompleted += new UploadStringCompletedEventHandler(PublishTaskCompleted); var api = new Uri(_appSettings.ServerSettings.HTTPServerURL + "/api/Scripts/Publish"); webClient.UploadStringAsync(api, "POST", scriptJson); return; } catch (Exception ex) { _httpLogger.Information("Publish Error: " + ex.ToString()); MessageBox.Show("Publish Error: " + ex.ToString()); } }
public static void Run(PublishType publishType) { var sample = new PublisherSample(); sample.Publish(publishType); }
public PublishSettings(PublishType aPublishType, string aPublishPath, bool aFormatUsbDrive) { PublishType = aPublishType; PublishPath = aPublishPath; FormatUsbDrive = aFormatUsbDrive; }
/// <summary> /// 发表主题 /// </summary> /// <param name="gId">游戏团编号</param> /// <param name="uId">发布者编号</param> /// <param name="nickName">发布者昵称</param> /// <param name="title">发布标题</param> /// <param name="content">发布内容</param> /// <param name="postSort">帖子系统分类编号</param> /// <param name="publishId">团主自定义板块编号</param> /// <returns></returns> public int CreateGroupBBSInfo(int gId, decimal uId, string nickName, string title, string content, PublishType publishType, int sortId = 0) { var ut = this.GroupServices.CheckManageRight(gId, uId); if (ut == UserType.游客 || ut == UserType.申请中成员) return -1; var retdata = this.GroupbbsRepository.Add(new group_bbs { clickNum = 0, content = content, gId = gId, isLight = false, isTop = false, isPith = false, lastNickName = nickName, lastTime = System.DateTime.Now, lastUid = uId, nickName = nickName, postSortId = sortId, replyNum = 0, publishId = (int)publishType, sendTime = System.DateTime.Now, title = title, uId = uId }); this.GroupServices.ChangeGroupPoint((int)gId, GameGroupPointType.发新帖子); this.GroupServices.ModifyGroupPostNum((int)gId, 1, 1); this.GroupMeberServices.updatePostCount((int)gId, uId, 1); return retdata.bbsId; }