static void Main(string[] args) { while (true) { Console.WriteLine("开始分析" + DateTime.Now); log4net.ILog log = log4net.LogManager.GetLogger("MyLogger"); log.Debug(string.Format("{0}---〉{1}", "开始分析", DateTime.Now)); MysqlHelper mysqlHelper = new MysqlHelper(); string newscontent = mysqlHelper.SelectAllContent(); if (newscontent == null) { Thread.Sleep(1000 * 60 * 50); } LabelHelper labelHelper; List <Title> titles = GetTitle(); SearchPersons(titles, newscontent); if (persons != null && persons.Count != 0) { labelHelper = new LabelHelper(persons, newscontent); } log4net.ILog log2 = log4net.LogManager.GetLogger("MyLogger"); log.Debug(string.Format("{0}---〉{1}", "要分析的人数:", persons.Count.ToString())); Thread.Sleep(1000 * 60 * 60); } }
public override int Insert(FormM form, DFDictionary entity, ref string message) { try { if (string.IsNullOrWhiteSpace(entity["ModuleId"])) { throw new Exception("请选择模块".GetRes()); } if (string.IsNullOrWhiteSpace(entity["PMenuId"])) { throw new Exception("请选择父菜单".GetRes()); } var parent = WF_M_MENULoader.Query(entity["PMenuId"]).FirstOrDefault(); var siblings = WF_M_MENULoader.Query(null, parent.MenuLabel).ToList(); var newEntity = entity.To <WF_M_MENU>(); newEntity.MenuId = Guid.NewGuid().ToString(); var user = Util.GetCurrentUser(); newEntity.CreateTime = DateTime.Now; newEntity.CreateUser = user.UserName; newEntity.LastModifyTime = DateTime.Now; newEntity.LastModifyUser = user.UserName; newEntity.MenuLabel = LabelHelper.GetNextLabelUsingSubLabelList(parent.MenuLabel, siblings.Select(a => a.MenuLabel).ToList()); WF_M_MENULoader.Insert(newEntity); message = "新增成功".GetRes(); return(DFPub.EXECUTE_SUCCESS); } catch (Exception ex) { message = ex.Message; return(DFPub.EXECUTE_ERROR); } }
private void SetLabelsContent() { LabelHelper.SetLabelContent(EmailLabel, language.Email); LabelHelper.SetLabelContent(PasswordLabel, language.Password); LabelHelper.SetLabelContent(FullNameLabel, language.FullName); LabelHelper.SetLabelContent(RolesLabel, language.Roles); }
private void TestExpression() { if (txtExpression.Text.ToLower() == NoExpression) { return; } string expr = LabelHelper.FixExpression(txtExpression.Text); if (expr == String.Empty) { lblResult.ForeColor = Color.Black; lblResult.Text = @"No expression"; } else { string err; if (!_featureSet.Table.TestExpression(expr, TableValueType.String, out err)) { lblResult.ForeColor = Color.Red; lblResult.Text = err; } else { lblResult.ForeColor = Color.Green; lblResult.Text = @"Expression is valid"; } } }
// TODO Permissions public string GetById(Guid id) { var transferSettings = _paymentQueries.GetTransferSettings(id); var obj = new { Brand = new { transferSettings.Brand.Id, transferSettings.Brand.Name, Licensee = new { id = transferSettings.Brand.LicenseeId } }, TransferType = LabelHelper.LabelTransferType(transferSettings.TransferType), transferSettings.CurrencyCode, VipLevel = _paymentQueries.GetVipLevel(transferSettings.VipLevelId).Name, Wallet = _brandQueries.GetWalletTemplate(new Guid(transferSettings.WalletId)).Name, transferSettings.MinAmountPerTransaction, transferSettings.MaxAmountPerTransaction, transferSettings.MaxAmountPerDay, transferSettings.MaxTransactionPerDay, transferSettings.MaxTransactionPerWeek, transferSettings.MaxTransactionPerMonth, }; return(SerializeJson(obj)); }
public ActionResult ApproveList(SearchPackage searchPackage) { var data = SearchOfflineDeposits( searchPackage, new[] { OfflineDepositStatus.Verified }, obj => new[] { obj.Player.Username, obj.TransactionNumber, LabelHelper.LabelPaymentMethod(obj.PaymentMethod), obj.CurrencyCode, obj.Amount.ToString(CultureInfo.InvariantCulture), obj.Status.ToString(), obj.Brand.Name, obj.Created.ToString("yyyy/MM/dd HH:mm:ss zzz"), obj.VerifiedBy, obj.DepositType.ToString(), obj.BankAccount.AccountId, obj.BankAccount.Bank.BankName, obj.BankAccount.Province, obj.BankAccount.Branch, obj.BankAccount.AccountNumber, obj.BankAccount.AccountName }, _paymentQueries.GetOfflineDeposits()); return(new JsonResult { Data = data, MaxJsonLength = int.MaxValue, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
/// <summary> /// 添加各种选项 /// </summary> /// <param name="articleId">文章ID</param> /// <param name="ops">一级选项名字,二级选项名字</param> /// <returns></returns> public static bool addOptions(int articleId, Dictionary <string, string> ops) { List <int> opsls = new List <int>(); foreach (KeyValuePair <string, string> s in ops) { opsls.Add(LabelHelper.getOptionId(s.Key, s.Value)); } try { using (var db = new PaperDbEntities()) { //增加所有选项 foreach (int id in opsls) { TypeConnection tc = new TypeConnection(); tc.ArticleId = articleId; tc.OptionId = id; db.TypeConnection.Add(tc); } db.SaveChanges(); return(true); } } catch (Exception ex) { return(false); } }
public override void OnInspectorGUI() { UIManConfig config = target as UIManConfig; if (screenPath == null || dialogPath == null || bgPath == null) { screenPath = new PathBrowser(config.screenPrefabFolder, rootUrl); dialogPath = new PathBrowser(config.dialogPrefabFolder, rootUrl); bgPath = new PathBrowser(config.backgroundRootFolder, rootUrl); } LabelHelper.TitleLabel("UIMan Configuration"); LineHelper.Draw(Color.blue); EditorGUILayout.Space(); GUILayout.BeginVertical("Box"); config.screenPrefabFolder = screenPath.Draw(screenGUI); config.dialogPrefabFolder = dialogPath.Draw(dialogGUI); config.backgroundRootFolder = bgPath.Draw(bgGUI); GUILayout.EndVertical(); GUILayout.BeginHorizontal("Box"); GUILayout.Label("<b>Warning:</b> This configuration use to set default path of prefabs/images for UI, destination folder must be child of Unity's Resources folder.\n\n" + "If you don't want to use this default path for your Screen/Dialog, apply UIDescriptor to your class to define custom path.", EditorGUIHelper.RichText(true)); GUILayout.EndHorizontal(); EditorUtility.SetDirty(target); }
public static string GetLabel(ModelMetadata modelMetaData, string label) { if (label != null) { /*Das Label wurde als Parameter übergeben => den Parameter verwenden*/ return(label); } else { if (!string.IsNullOrEmpty(modelMetaData.DisplayName)) { /*Es wurde ein Display- bzw. ein DisplayNameAttribute am Property definiert*/ return(modelMetaData.DisplayName); } else { /*Label wird über die per Konvention definierte Resource versucht zu laden.*/ if (!string.IsNullOrWhiteSpace(modelMetaData.PropertyName)) { return(LabelHelper.GetLabelFromResourceByPropertyName <Resources_Domain>(modelMetaData.ContainerType, modelMetaData.PropertyName)); } } } return(string.Empty); }
public override void OnInspectorGUI() { var config = this.target as UIManConfig; if (this.namespaceField == null || this.screenPath == null || this.dialogPath == null || this.bgPath == null) { this.namespaceField = new TextFieldHelper(config.classNamespace); this.screenPath = new PathBrowser(config.screenPrefabFolder, Application.dataPath); this.dialogPath = new PathBrowser(config.dialogPrefabFolder, Application.dataPath); this.bgPath = new PathBrowser(config.backgroundRootFolder, Application.dataPath); this.animPath = new PathBrowser(config.animRootFolder, Application.dataPath); } LabelHelper.TitleLabel("UIMan Configuration"); LineHelper.Draw(Color.blue); EditorGUILayout.Space(); GUILayout.BeginVertical("Box"); config.classNamespace = this.namespaceField.Draw(this.namespaceGUI); config.screenPrefabFolder = this.screenPath.Draw(this.screenGUI); config.dialogPrefabFolder = this.dialogPath.Draw(this.dialogGUI); config.backgroundRootFolder = this.bgPath.Draw(this.bgGUI); config.animRootFolder = this.animPath.Draw(this.animRootGUI); GUILayout.EndVertical(); GUILayout.BeginHorizontal("Box"); GUILayout.Label("<b>Warning:</b> This configuration use to set default path of prefabs/images for UI, destination folder must be child of Unity's Resources folder.\n\n" + "If you don't want to use this default path for your Screen/Dialog, apply UIDescriptor to your class to define custom path.", EditorGUIHelper.RichText(true)); GUILayout.EndHorizontal(); EditorUtility.SetDirty(this.target); }
public D3ItemJewelLabelControl(SocketedGem socketedGem) : this() { guiJewelEffectLabel.Text = String.Empty; guiJewelNameLabel.Text = socketedGem.Item.Name; guiJewelRankLabel.Text = socketedGem.JewelRank.ToString(); if (socketedGem.Attributes.Primary != null && socketedGem.Attributes.Primary.Any()) { foreach (var primary in socketedGem.Attributes.Primary) { LabelHelper.ConcatOnNewLine(ref guiJewelEffectLabel, primary.Text); } } if (socketedGem.Attributes.Secondary != null && socketedGem.Attributes.Secondary.Any()) { foreach (var secondary in socketedGem.Attributes.Secondary) { LabelHelper.ConcatOnNewLine(ref guiJewelEffectLabel, secondary.Text); } } if (socketedGem.Attributes.Passive != null && socketedGem.Attributes.Passive.Any()) { foreach (var passive in socketedGem.Attributes.Passive) { LabelHelper.ConcatOnNewLine(ref guiJewelEffectLabel, passive.Text); } } }
/// <summary> /// Constructor for setting label expression and options /// </summary> public LabelStyleForm(IAppContext context, ILayer layer) : base(context) { InitializeComponent(); InitLayer(context, layer); // old-style labels not based on expression if (_featureSet.Labels.Expression == "" && !_featureSet.Labels.Empty && _featureSet.Labels.Items[0].Text != "") { txtExpression.Text = NoExpression; listBox1.Enabled = false; btnPlus.Enabled = false; btnQuotes.Enabled = false; btnNewLine.Enabled = false; txtExpression.Enabled = false; } else { txtExpression.Text = LabelHelper.StripNewLineQuotes(_featureSet.Labels.Expression); } dynamicVisibilityControl1.Initialize(_featureSet.Labels, _context.Map.CurrentZoom, _context.Map.CurrentScale); dynamicVisibilityControl1.ValueChanged += (s, e) => { btnApply.Enabled = true; }; Initialize(_featureSet.Labels.Style); tabControlAdv1.SelectedIndex = tabNumber; }
private void ImageLeftMosueButtonDown(object sender, MouseButtonEventArgs e) { if (!_isMoving) { ResetLastIndexSelcted(); hed_main_tb_label_text.Focus(); _isMoving = false; LabelHelper lbl = new LabelHelper(); lbl.label.Foreground = Brushes.Black; lbl.label.Content = "TestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTest"; lbl.label.Name = "lbl_gen_cnt_" + text_on_image.Count; lbl.label.Margin = new Thickness(mouseLocation.X + 10, mouseLocation.Y + 10, mouseLocation.X + 10, mouseLocation.Y + 10); lbl.label.PreviewMouseDown += Label_OnPreviewMouseDown; lbl.label.PreviewMouseMove += Label_OnPreviewMouseMove; lbl.label.PreviewMouseUp += Label_OnPreviewMouseUp; lbl.label.MouseEnter += Label_OnMouseHoverEnter; lbl.label.MouseLeave += Label_OnMouseHoverLeave; lbl.label.KeyUp += Label_OnKeyUp; cnt_labels.Children.Add(lbl.label); text_on_image.Add(lbl); //Set this under an if, because this option should be changeable by the user currentLabelIndex = text_on_image.Count - 1; hed_main_tb_label_text.Text = ""; } }
private void hed_main_btn_load_click(object sender, RoutedEventArgs e) { Reset(); information = mwh.LoadFile(); BitmapImage image = mwh.GetImage(information.ImageUri); currentBitmap = BitmapImage2Bitmap(image); ft_tb_currentpath.Text = image.UriSource.ToString(); cnt_image.Height = image.Height; cnt_image.Width = image.Width; cnt_image.Source = image; information.ImageUri = image.UriSource.ToString(); currentSave = image.UriSource.LocalPath.ToString(); foreach (Text item in information.Texts) { LabelHelper lbl = new LabelHelper(); lbl.label.Name = item.Name; lbl.label.Content = item.Content; lbl.label.Margin = new Thickness(item.Margin.Left, item.Margin.Top, item.Margin.Left, item.Margin.Top); lbl.label.Foreground = Brushes.Black; lbl.label.FontSize = item.FontSize; System.Windows.Media.FontFamily font = new System.Windows.Media.FontFamily(item.Font); lbl.label.FontFamily = font; lbl.label.PreviewMouseDown += Label_OnPreviewMouseDown; lbl.label.PreviewMouseMove += Label_OnPreviewMouseMove; lbl.label.PreviewMouseUp += Label_OnPreviewMouseUp; lbl.label.MouseEnter += Label_OnMouseHoverEnter; lbl.label.MouseLeave += Label_OnMouseHoverLeave; lbl.label.KeyUp += Label_OnKeyUp; cnt_labels.Children.Add(lbl.label); text_on_image.Add(lbl); } ShowHiddenStartContent(); }
public void TestLabelHelper() { Assert.AreEqual(LabelHelper.TypeToColour(MonType.bug), Color.GreenYellow); Assert.AreEqual(LabelHelper.TypeToColour(MonType.fire), Color.OrangeRed); Assert.AreEqual(LabelHelper.TypeToColour(MonType.water), Color.RoyalBlue); Assert.AreEqual(LabelHelper.TypeToColour(MonType.electric), Color.Goldenrod); }
public override int Insert(FormM form, DFDictionary entity, ref string message) { var item = Get(GetSelectSql("WF_M_DEPT"), new { DeptId = entity["DeptId"] }); if (item != null) { throw new WFException("记录已经存在".GetRes()); } CheckInput(form, entity); var newEntity = entity; CheckData("WF_M_DEPT", newEntity, Util.GetCurrentUser().UserName); var parent = WF_M_DEPTLoader.Query(newEntity["PDeptId"]).FirstOrDefault(); var siblings = WF_M_DEPTLoader.Query(null, null, parent.DeptLabel).ToList(); newEntity.Add("DeptLabel", LabelHelper.GetNextLabelUsingSubLabelList(parent.DeptLabel, siblings.Select(a => a.DeptLabel).ToList())); SaveData("WF_M_DEPT", newEntity, IMPORT_TYPE_INSERT); var sb = new System.Text.StringBuilder(DFPub.DF_SCRIPT); sb.AppendFormat("alert('保存成功');".GetRes()); sb.AppendFormat("closeSelfDialog();"); message = sb.ToString(); return(DFPub.EXECUTE_SUCCESS); }
/// <summary> /// Fügt der Tabelle der diese Spalte zugeordnet ist eine weitere Spalte hinzu, die für jede Zeile den Wert ausgibt, /// der sich aus der festgelegten Expression /// ergibt. /// </summary> /// <typeparam name="TColumn"> /// Typ der Eigenschaft des <see cref="TGrid">Zeilen-Models</see>, welches in der Spalte /// angezeigt wird. /// </typeparam> /// <typeparam name="TModel"></typeparam> /// <typeparam name="TGrid"></typeparam> /// <param name="column"></param> /// <param name="expression">Expression über die für jede Zeile der anzuzeigende Wert ermittelt wird.</param> /// <param name="title">Titel der Spalte, der im Tabellenkopf angezeigt werden soll.</param> /// <returns>Die Spalte.</returns> public static GridColumn <TModel, TGrid, TColumn> ColumnFor <TModel, TGrid, TColumn>(this IGridColumn <TModel, TGrid> column, Expression <Func <TGrid, TColumn> > expression) { string labelByresource = LabelHelper.GetLabelFromResourceByPropertyName <Resources_Domain>(typeof(TGrid), expression.ToString().Split('.').Last()); return(column.Grid.ColumnFor(expression, labelByresource)); }
private async Task <String> GetProductLabelsHtml(int id, string designName, int imageWidth, int imageHeight) { string returnHtml; var pageDesignTask = PageDesignService.GetPageDesignByName(StoreId, designName); var labelsTask = LabelService.GetLabelsByItemTypeId(StoreId, id, StoreConstants.ProductType); LabelHelper.StoreSettings = GetStoreSettings(); LabelHelper.ImageWidth = imageWidth == 0 ? GetSettingValueInt("ProductLabels_ImageWidth", 50) : imageWidth; LabelHelper.ImageHeight = imageHeight == 0 ? GetSettingValueInt("ProductLabels_ImageHeight", 50) : imageHeight; await Task.WhenAll(pageDesignTask, labelsTask); var labels = labelsTask.Result; var pageDesign = pageDesignTask.Result; if (pageDesign == null) { throw new Exception("PageDesing is null"); } var pageOuput = LabelHelper.GetProductLabels(labels, pageDesign); returnHtml = pageOuput.PageOutputText; return(returnHtml); }
/// <summary> /// Renders a Twitter Bootstrap label component /// </summary> /// <param name="helper">The html helper.</param> /// <param name="text">The text.</param> /// <param name="status">The label status.</param> /// <param name="htmlAttributes">The HTML attributes.</param> /// <returns>Returns a label html string</returns> public static MvcHtmlString Label(this HtmlHelper helper, string text, BootstrapStatus status, object htmlAttributes) { LabelHelper labelHelper = new LabelHelper(GetStatusStrategy(status), text, status, htmlAttributes); return(MvcHtmlString.Create(labelHelper.Render())); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LabelHelper.bindLables(ref gdvKeywords, "keyword"); gdvKeywords.DataBind(); } }
protected void bindDplOption(Dictionary <DropDownList, string> dict) { foreach (KeyValuePair <DropDownList, string> d in dict) { d.Key.DataSource = LabelHelper.getSecondOptionName(d.Value); d.Key.DataBind(); } }
public void PrintLabel() { var document = Document as TachographDocument; if (Document != null && document != null) { LabelHelper.Print(document); } }
private void PrintLabel(TachographDocument tachographDocument) { if (ReprintMode != ReprintMode.Label) { return; } LabelHelper.Print(tachographDocument); }
//+ //- #GetDataSource -// protected override Object GetDataSource() { return(rawDataSource.OrderBy(p => p.Title).Select(label => new { Title = label.Title, Url = LabelHelper.GetLabelUrl(label), EntryCount = label.BlogEntryCount })); }
private void SetLabelsContent() { LabelHelper.SetLabelContent(NameLabel, language.Name); LabelHelper.SetLabelContent(LastNameLabel, language.LastName); LabelHelper.SetLabelContent(AccountLabel, language.Account); LabelHelper.SetLabelContent(WorkExperienceLabel, language.WorkExperience); LabelHelper.SetLabelContent(MedicalTitleLabel, language.MedicalTitle); LabelHelper.SetLabelContent(ClinicsLabel, language.Clinics); }
public override void OnInspectorGUI() { GUILayout.BeginHorizontal("Box"); LabelHelper.HeaderLabel("UIMan Loading Indicator"); GUILayout.EndHorizontal(); GUILayout.BeginVertical("Box"); DrawDefaultInspector(); GUILayout.EndVertical(); }
public override string ToHtmlString() { string expression = ExpressionHelper.GetExpressionText(InitExpression); string labelText = Html.GetLabelText(InitExpression, this.LabelText()); string checkBoxHtml = Html.BuildCheckBoxFor(InitExpression).BuildWith(CheckBoxModifier).ToHtmlStringSafe(); return(LabelHelper.RenderCheckboxLabelHtml(Html, expression, labelText, checkBoxHtml, HtmlAttributes)); }
/// <summary> /// 返回一级选项下面的二级选项 /// </summary> /// <param name="firstLevel">一级选名字</param> /// <returns>二级选项名字</returns> public static List <string> getSecondOptionName(string firstLevel) { List <string> ans = new List <string>(); foreach (Option op in LabelHelper.bindSecondLevel(firstLevel)) { ans.Add(op.Name); } return(ans); }
private void OnGenerateM1N1(Grid root) { if (!IsValid(root)) { ShowError(Properties.Resources.EXC_MISSING_FIELDS); return; } LabelHelper.Print(M1N1Document); ShowMessage(Properties.Resources.TXT_LABEL_ADDED_TO_QUEUE, Properties.Resources.TXT_PRINT); }
private void SetLabelsContent() { LabelHelper.SetLabelContent(NameLabel, language.Name); LabelHelper.SetLabelContent(LastNameLabel, language.LastName); LabelHelper.SetLabelContent(AccountLabel, language.Account); LabelHelper.SetLabelContent(WorkExperienceLabel, language.WorkExperience); LabelHelper.SetLabelContent(ClinicLabel, language.Clinic); LabelHelper.SetLabelContent(SinceLabel, language.Since); LabelHelper.SetLabelContent(UntilLabel, language.Until); LabelHelper.SetLabelContent(MedicalTitleLabel, language.MedicalTitle); LabelHelper.SetLabelContent(GetTitleDateLabel, language.GettingTitleDate); }
/// <summary> /// Renders a Twitter Bootstrap label component /// </summary> /// <param name="helper">The html helper.</param> /// <param name="text">The text.</param> /// <param name="status">The label status.</param> /// <param name="htmlAttributes">The HTML attributes.</param> /// <returns>Returns a label html string</returns> public static MvcHtmlString Label(this HtmlHelper helper, string text, BootstrapStatus status, object htmlAttributes) { LabelHelper labelHelper = new LabelHelper(GetStatusStrategy(status), text, status, htmlAttributes); return new MvcHtmlString(labelHelper.Render()); }