public void SetMarkButtonVisibility(MarkType type, bool value) { var b = _MarkButtons.FirstOrDefault(m => PNUtils.GetMarkType(m) == type); var v = value ? Visibility.Visible : Visibility.Collapsed; if (b != null) b.Visibility = v; }
public bool IsMarkButtonVisible(MarkType type) { var b = _MarkButtons.FirstOrDefault(m => PNUtils.GetMarkType(m) == type); if (b != null) return b.Visibility == Visibility.Visible; return false; }
public void SetMarkByZhanggui (long id, MarkType markType, string markInfo) { lock (LockObject) { Init(); mClient.Service.SetMarkByZhanggui(id,markType,markInfo ); } }
//Sets the mark type public void SetType(MarkType type) { this.type = type; gameObject.SetActive(true); if (type == MarkType.Good) GetComponent<MeshRenderer>().material = materialGood; else if (type == MarkType.Bad) GetComponent<MeshRenderer>().material = materialBad; else if (type == MarkType.Selection) GetComponent<MeshRenderer>().material = materialSelection; else if (type == MarkType.None) gameObject.SetActive(false); }
public CombinationDingdanData SearchDingdansByBiaoju (long[] biaoshiIds, MarkType[] markTypes, DateTime startTime, DateTime endTime, long lastId) { lock (LockObject) { Init(); return mClient.Service.SearchDingdansByBiaoju(biaoshiIds, markTypes,startTime,endTime,lastId); } }
public CombinationDingdanData SearchDingdansByZhanggui (long[] dianpuIds, MarkType[] markTypes, DateTime startTime, DateTime endTime, long lastId) { lock (LockObject) { Init(); return mClient.Service.SearchDingdansByZhanggui(dianpuIds, markTypes, startTime, endTime, lastId); } }
public void SetMarkByBiaoju (long id, MarkType markType, string markInfo) { using (var db = DbContextFactory.CreateDbContext()) { var xk = db.Xiakes.FirstOrDefault(a => a.XiakeName == Thread.CurrentPrincipal.Identity.Name); if(xk == null || xk.UserType != XiakeType.Biaoju) throw new FaultException("非镖局身份不可设置镖局MARK"); var dingdan = db.Dingdans.FirstOrDefault(a => a.Id == id); dingdan.BiaojuMarkInfo = markInfo; dingdan.BiaojuMarkType = markType; db.SaveChanges(); } }
/// <inheritdoc /> public void SetMarkLocation(MarkType markType) { if(_state.Course ==null || !(_state.Course is CourseByMarks)) { _state.Course = new CourseByMarks(); } if (_state.Location != null) { var course = _state.Course as CourseByMarks; if (course.Marks == null) { course.Marks = new List<Mark>(); } if (!course.Marks.Any()) { var mark = new Mark() { MarkType = markType, CaptureMethod = MarkCaptureMethod.Location, Location = _state.Location }; course.Marks.Add(mark); State.TargetMark = mark; } else if (_state.TargetMark != null && _state.TargetMark.MarkType == markType) { _state.TargetMark.CaptureMethod = MarkCaptureMethod.Location; _state.TargetMark.Location = _state.Location; } else if (State.TargetMark != null && _state.TargetMark.MarkType != markType) { var mark = new Mark() { MarkType = markType, CaptureMethod = MarkCaptureMethod.Location, Location = _state.Location }; course.Marks.Add(mark); //State.TargetMark = mark; } else { _logger.Error("User set mark location for " + markType + " but unsure what to do with it"); } } }
internal ChannelMark(int chnlCount) { value = float.MinValue; showText = false; showMarkShape = true; markType = MarkType.mrkNormal; searchType = MarkSearchType.schPoint; markShape = MarkShape.markPloygon; markColor = Color.White; sequence = new int[chnlCount]; for (int i = 0; i < chnlCount; i++) sequence[i] = -1; //默认,仅在channels[0]中,进行MARK点搜索 sequence[0] = 0; }
void Initialize(Vector3 position, Color color, int time, Texture2D label, MarkType type, bool screenSpace) { Color = color; RemainingTime = time; Label = label; Type = type; ScreenSpace = screenSpace; if (screenSpace) ScreenSpacePosition = new Vector2(position.X, position.Y); else { if (type == MarkType.Cross) { Mark = new VertexPositionColor[6]; } else { Mark = new VertexPositionColor[1]; } for (var i = 0; i < Mark.Length; i++) Mark[i].Color = color; MoveTo(position); } }
public MarkData(string name, MarkType type) : this() { this.name = name; this.type = type; }
public CombinationDingdanData SearchDingdansByBiaoju (long[] biaoshiIds, MarkType[] markTypes , DateTime startTime,DateTime endTime, long lastId) { var rv = new CombinationDingdanData(); using (var db = DbContextFactory.CreateDbContext()) { var xk = db.Xiakes.FirstOrDefault(a => a.XiakeName == Thread.CurrentPrincipal.Identity.Name); if (xk == null || xk.UserType != XiakeType.Biaoju) throw new FaultException("非镖局身份不可调用"); IQueryable<Dingdan> dingdans; if (lastId == 0) dingdans = db.Dingdans.Include(a => a.Biaoshi).Include(a => a.Dianpu).OrderByDescending(a => a.Id); else dingdans = db.Dingdans.Include(a => a.Biaoshi).Include(a => a.Dianpu).OrderByDescending(a => a.Id).Where(a => a.Id < lastId ); dingdans = dingdans.Where(a => biaoshiIds.Contains(a.Biaoshi.Id)); if (markTypes.Count() == 6) dingdans = dingdans.Where(a => a.BiaojuMarkType.HasValue == false || (a.BiaojuMarkType.HasValue == true && markTypes.Contains(a.BiaojuMarkType.Value))); else dingdans = dingdans.Where(a => (a.BiaojuMarkType.HasValue == true && markTypes.Contains(a.BiaojuMarkType.Value))); dingdans = dingdans.Where(a => a.DateTime >= startTime); dingdans = dingdans.Where(a => a.DateTime <= endTime); if (lastId == 0) rv.TotalCount = dingdans.Count(); dingdans = dingdans.Take(DomainDefinition.PAGE_SIZE); foreach (var dingdan in dingdans) { rv.Items.Add(new DingdanData() { ID = dingdan.Id, Goods = dingdan.Goods, BiaojuMarkType = dingdan.BiaojuMarkType, BiaojuMarkInfo = dingdan.BiaojuMarkInfo, SrcId = dingdan.SrcId, Price = dingdan.Price, Salary = dingdan.Salary , Time = dingdan.DateTime, Biaoshi = dingdan.Biaoshi.Title, BangpaiType = dingdan.Bangpai }); } if (rv.Items.Count < DomainDefinition.PAGE_SIZE) rv.IsLoadedAllData = true; } return rv; }
// Copy constructor. public MarkType(MarkType v) { Mark = v.Mark; Index = v.Index; }
internal MarkButtonClickedEventArgs(MarkType type) { Buttontype = type; }
/// <summary> /// /// </summary> /// <param name="type"></param> /// <returns></returns> public static string ConvertMarkTypeToString(this MarkType type) { switch (type) { case MarkType.FullStop: return("."); case MarkType.Comma: return(","); case MarkType.Colon: return(";"); case MarkType.SemiColon: return(":"); case MarkType.QuestionMark: return("?"); case MarkType.ExclamationMark: return("!"); case MarkType.Apostrope: return("`"); case MarkType.Hyphen: return("-"); case MarkType.Dash: return("--"); case MarkType.Dots: return("..."); case MarkType.SingleQuotationMark: return("'"); case MarkType.DoubleQuotationMark: return("\""); case MarkType.Parallel: return("|"); case MarkType.And: return("&"); case MarkType.SwungDash: return("~"); case MarkType.Plus: return("+"); case MarkType.Minus: return("-"); case MarkType.PlusOrMinus: return("±"); case MarkType.MutipliedBy: return("*"); case MarkType.DividedBy: return("/"); case MarkType.EquelTo: return("="); case MarkType.NotEquelTo: return("≠"); case MarkType.ApproximatelyEqual: return("≈"); case MarkType.LessThan: return("<"); case MarkType.MoreThan: return(">"); case MarkType.NotLessThan: return("≮ "); case MarkType.NotMoreThan: return("≯"); case MarkType.LessOrEquel: return("≤"); case MarkType.MoreOrEquel: return("≥"); case MarkType.Percent: return("%"); case MarkType.Permill: return("‰"); case MarkType.Infinity: return("∞"); case MarkType.Root: return("√"); case MarkType.Since: return("∵"); case MarkType.Hence: return("∴"); case MarkType.Pi: return("π"); case MarkType.PerpendicularTo: return("⊥"); case MarkType.UnionOf: return("∪"); case MarkType.IntersectionOf: return("∩"); case MarkType.IntegralOf: return("∫"); case MarkType.SummationOf: return("∑"); case MarkType.Degree: return("° "); case MarkType.Minute: return("′ "); case MarkType.Second: return("〃"); case MarkType.CelsiusSystem: return("℃"); case MarkType.OpenBrace: return("{"); case MarkType.CloseBrace: return("}"); case MarkType.OpenParen: return("("); case MarkType.CloseParen: return(")"); case MarkType.OpenBracket: return("["); case MarkType.CloseBracket: return("]"); case MarkType.ChineseQuestionMark: return("?"); case MarkType.ChineseExclamationMark: return("!"); case MarkType.ChineseComma: return(","); case MarkType.ChineseFullStop: return("。"); case MarkType.ChineseColon: return(";"); case MarkType.ChineseSemicolon: return(":"); case MarkType.ChineseOpenSingleQuotation: return("‘"); case MarkType.ChineseCloseSingleQuotation: return("’"); case MarkType.ChineseOpenDoubleQuotation: return("“"); case MarkType.ChineseCloseDoubleQuotation: return("”"); case MarkType.SlightPauseMark: return("、"); case MarkType.ChineseOpenBrace: return("{"); case MarkType.ChineseCloseBrace: return("}"); case MarkType.ChineseOpenBrackt: return("【"); case MarkType.ChineseCloseBrakt: return("】"); case MarkType.ChineseOpenParen: return("("); case MarkType.ChineseCloseParen: return(")"); case MarkType.OpenBookTitle: return("《"); case MarkType.CloseBookTitle: return("》"); case MarkType.Rmb: return("¥"); case MarkType.Doller: return("$"); case MarkType.Poun: return("£"); case MarkType.Angle: return("∠"); case MarkType.Triangle: return("△"); case MarkType.Arc: return("⌒"); case MarkType.Circle: return("⊙"); case MarkType.Power: return("^"); case MarkType.BelongTo: return("∈"); case MarkType.Include: return("⊇"); case MarkType.BeIncluded: return("⊆"); case MarkType.EquelMark: return("⇔"); case MarkType.Derivation: return("⇒"); case MarkType.Not: return("¬"); case MarkType.Any: return("∀"); case MarkType.UnderScode: return("_"); case MarkType.Hash: return("#"); case MarkType.At: return("@"); default: return("unknow"); } }
public MetafileRecordMarkT(double x, double y, MarkType type, int size) : base(x, y, type, size) { }
public MarkConfig() { type = MarkType.Active; }
public static void SetMarkType(DependencyObject obj, MarkType value) { obj.SetValue(MarkTypeProperty, value); }
public DebugMark(Vector3 position, Color color, Texture2D label, MarkType type, bool screenSpace) { Initialize(position, color, -1, label, type, screenSpace); }
private void Initialize(Vector3 position, Color color, int time, Texture2D label, MarkType type, bool screenSpace) { this.color = color; this.remainingTime = time; this.label = label; this.type = type; this.ScreenSpace = screenSpace; if (screenSpace) { ScreenSpacePosition = new Vector2(position.X, position.Y); } else { if (type == MarkType.Cross) { mark = new VertexPositionColor[6]; } else { mark = new VertexPositionColor[1]; } for (int i = 0; i < mark.Length; i++) { mark[i].Color = color; } MoveTo(position); } }
public async Task <IResultModel> Count(int TopicId, MarkType type) { var result = await _repository.Count(TopicId, type); return(ResultModel.Success <long>(result)); }
public Cell(int x, int y, MarkType type) : base(x, y) { Type = type; }
/// <summary> /// Return a string of a word with the "color" tag enveloping a character. The word is already reversed and fixed for rendering. /// </summary> public string GetWordWithMarkedLetterText(WordData wordData, StringPart letterToMark, Color color, MarkType type) { string tagStart = "<color=#" + GenericHelper.ColorToHex(color) + ">"; string tagEnd = "</color>"; string text = ProcessString(wordData.Text); string startText = text.Substring(0, letterToMark.fromCharacterIndex); string letterText = text.Substring(letterToMark.fromCharacterIndex, letterToMark.toCharacterIndex - letterToMark.fromCharacterIndex + 1); string endText = (letterToMark.toCharacterIndex >= text.Length - 1 ? "" : text.Substring(letterToMark.toCharacterIndex + 1)); if (type == MarkType.SingleLetter) { return(startText + tagStart + letterText + tagEnd + endText); } else if (type == MarkType.FromStartToLetter) { return(tagStart + startText + letterText + tagEnd + endText); } else { return(startText + tagStart + letterText + endText + tagEnd); } }
public MarkPanel(MarkType newMark) { mark = newMark; InitializeComponent(); criterionTable.AutoGenerateColumns = false; // bind simple components to underlying XML-derived classes taskNameBox.DataBindings.Add(new Binding("Text", mark, "Name")); taskDescBox.DataBindings.Add(new Binding("Text", mark, "Description")); rbGroup.DataBindings.Add(new Binding("Checked", mark, "group")); rbIndividual.DataBindings.Add(InvertedBinding.Create(rbGroup, "Checked")); // handle metadata that are only present for numeric tasks if (mark is NumericType nt) { cbBonus.DataBindings.Add(new Binding("Checked", nt, "bonus")); cbPenalty.DataBindings.Add(new Binding("Checked", nt, "penalty")); decimal computedMaxMark = 0; bool hasNumericSubtasks = false; if (nt.Subtasks != null) { foreach (var st in nt.Subtasks) { if (st is NumericType) { hasNumericSubtasks = true; computedMaxMark += ((NumericType)st).GetTotalMaxMark(); } } } // set value of max mark box if (hasNumericSubtasks) { maxMarkBox.Text = computedMaxMark.ToString("0.0"); maxMarkBox.Enabled = false; maxMarkLabel.Enabled = false; } else { maxMarkBox.DataBindings.Add(new Binding("Text", nt, "maxMark")); maxMarkBox.Enabled = true; maxMarkLabel.Enabled = true; maxMarkBox.TextChanged += new EventHandler(OnTextChanged); } // bind table of criteria criteriaSource = nt.Criteria; } else { cbBonus.Enabled = false; cbPenalty.Enabled = false; if (newMark is QualitativeType qt) { criteriaSource = qt.Criteria; } } if (criteriaSource != null) { source.DataSource = criteriaSource; DataGridViewColumn nameCol = new DataGridViewTextBoxColumn { DataPropertyName = "Name", Name = "Criterion name" }; criterionTable.Columns.Add(nameCol); criterionTable.DataSource = source; } else { criterionTable.Enabled = false; } // wire up events to propagate text changes to the tree taskNameBox.TextChanged += new EventHandler(OnTextChanged); rbGroup.CheckedChanged += new EventHandler(OnTextChanged); cbBonus.CheckedChanged += new EventHandler(OnTextChanged); cbPenalty.CheckedChanged += new EventHandler(OnTextChanged); // dirty detection ChangedSinceSave = false; }
public GUIContent GetIcon(MarkType type) { return(marks.Where(x => x.type == type).Select(x => x.Content).First()); }
public Task <long> Count(int TopicId, MarkType type) { return(Db.Find(m => m.TopicId == TopicId && m.Type == type).CountAsync()); }
public List <Mark> GetForTeacherIdByMarkType(string id, MarkType markType) { return(context.Marks.Where(_ => _.Teacher.Id == id && _.MarkType == markType).ToList()); }
/// <summary> /// Конструктор-инициализатор /// </summary> /// <param name="winner">Победитель</param> public GameOverEventArgs(MarkType winner) { this.Winner = winner; }
/// <summary> /// Event that fires when mouse is released after a drag. /// </summary> /// <param name="sender">A reference to the object that raised the event.</param> /// <param name="e">Event data.</param> private void TreeView_DragDrop(object sender, DragEventArgs e) { // Retrieve the client coordinates of the drop location. Point targetPoint = treeView.PointToClient(new Point(e.X, e.Y)); // Retrieve the node at the drop location. SIRTreeNode targetNode = treeView.GetNodeAt(targetPoint) as SIRTreeNode; // Where should the drop go? SIRTreeNode dest = ComputeDropDestination(targetNode, draggedNode); MarkType predecessor = ComputeDropAfter(dest, targetNode, draggedNode); // Don't allow drops outside nodes if (dest == null) { return; } // Confirm that the node at the drop location is not // the dragged node or a descendant of the dragged node. if (!draggedNode.Equals(targetNode) && CanDropOn(draggedNode, dest)) { if ((e.Effect | DragDropEffects.Move) == DragDropEffects.Move) { SIRTreeNode oldParent = draggedNode.Parent as SIRTreeNode; // Are we moving criteria? if (draggedNode.Mark is CriterionType) { DeleteCriterion(draggedNode.Mark as CriterionType, oldParent.Mark); if (dest.Mark is NumericType) { NumericType num = dest.Mark as NumericType; num.Criteria = (InsertAfterMark(num.Criteria, draggedNode.Mark, predecessor).Cast <CriterionType>()).ToArray(); } else if (dest.Mark is QualitativeType) { QualitativeType qual = dest.Mark as QualitativeType; qual.Criteria = (InsertAfterMark(qual.Criteria, draggedNode.Mark, predecessor).Cast <CriterionType>()).ToArray(); } } // Are we dragging to the root? else if (dest == treeView.Nodes[0]) { DeleteSubtask(draggedNode.Mark, oldParent.Mark); formScheme.Tasks = InsertAfterMark(formScheme.Tasks, draggedNode.Mark, predecessor).ToArray(); } // We are dragging a numeric or qualitative task to a subtask position. else { DeleteSubtask(draggedNode.Mark, oldParent.Mark); if (dest.Mark is NumericType) { NumericType num = dest.Mark as NumericType; if (num.Subtasks == null) { num.Subtasks = new MarkType[1] { draggedNode.Mark } } ; else { num.Subtasks = InsertAfterMark(num.Subtasks, draggedNode.Mark, predecessor).ToArray(); } } else if (dest.Mark is QualitativeType) { QualitativeType qual = dest.Mark as QualitativeType; qual.Subtasks = (InsertAfterMark(qual.Subtasks, draggedNode.Mark, predecessor).Cast <QualitativeType>()).ToArray(); } } RebuildTree(); return; } } }
public override void DrawMarkT(double x, double y, MarkType type, int size) { records.Add(new MetafileRecordMarkT(x, y, type, size)); }
/// <summary> /// 更新ListChild 的 Mark /// </summary> /// <param name="markType"></param> private void UpdateListChildMark(MarkType markType) { listChildrenDisplayPart.SelectedListChild.Mark = markType; ListChild.UpdateListChild(listChildrenDisplayPart.SelectedListChild); ReadListChildren(); popupMark.IsOpen = false; }
public T Type(MarkType type) { this.type = type; return(this as T); }
public Player(string name, MarkType mark) { this._name = name; this._mark = mark; }
/// <inheritdoc /> public void SetMarkBearing(MarkType markType, double bearing, bool magneticBearing) { if(markType==MarkType.Course) { if (_state.Course == null || !(_state.Course is CourseByAngle)) { _state.Course = new CourseByAngle(); if(magneticBearing) { if(_state.StateValues.ContainsKey(StateValue.MagneticDeviation)) { (_state.Course as CourseByAngle).CourseAngle = bearing + _state.StateValues[StateValue.MagneticDeviation]; } else { _logger.Error("Cannot set course angle using magnetic bearing without magnetic deviation!"); return; } } else { (_state.Course as CourseByAngle).CourseAngle = bearing; } } } else if (_state.Location != null) { if (_state.Course == null || !(_state.Course is CourseByMarks)) { _state.Course = new CourseByMarks(); } Bearing fullBearing = new Bearing() { Location = _state.Location, RecordedAt = _state.BestTime, CompassHeading = bearing }; //compensate for magnetic deviation if (magneticBearing) { if (_state.StateValues.ContainsKey(StateValue.MagneticDeviation)) { fullBearing.CompassHeading = fullBearing.CompassHeading + _state.StateValues[StateValue.MagneticDeviation]; } else { _logger.Error("Cannot calculate mark location using magnetic bearing without magnetic deviation!"); return; } } _logger.Info(string.Format("Received bearing for {0} of {1:0.00} ({2:0.00} true) from {3},{4}, altitude {5}, deviation {6}", markType, bearing, fullBearing.CompassHeading, fullBearing.Location.Latitude.Value, fullBearing.Location.Longitude.Value, _state.StateValues[StateValue.AltitudeInMeters], _state.StateValues[StateValue.MagneticDeviation])); Mark mark; var course = _state.Course as CourseByMarks; if (!course.Marks.Any(x => x.MarkType == markType)) { mark = new Mark() { MarkType = markType, CaptureMethod = MarkCaptureMethod.Bearing, Location = null }; mark.Bearings = new List<Bearing>(); mark.Bearings.Add(fullBearing); course.Marks.Add(mark); State.TargetMark = mark; } else { mark = course.Marks.Where(x => x.MarkType == markType).Last(); mark.Bearings.Add(fullBearing); } if (mark.Bearings.Count > 1 && mark.CaptureMethod == MarkCaptureMethod.Bearing) { var bearing1 = mark.Bearings[mark.Bearings.Count - 2]; var bearing2 = mark.Bearings[mark.Bearings.Count - 1]; var location = CoordinatePointUtilities.FindIntersection(bearing1.Location, bearing1.CompassHeading, bearing2.Location, bearing2.CompassHeading); mark.Location = location; _logger.Info(string.Format("Calculated new location of {0} via bearings to be {1},{2}", markType, mark.Location.Latitude.Value, mark.Location.Longitude.Value)); //TODO, if there's more than 2, do we average down? } } }
public void SetMarkButtonTooltip(MarkType type, string toolTip) { var b = _MarkButtons.FirstOrDefault(m => PNUtils.GetMarkType(m) == type); if (b != null) b.ToolTip = toolTip; }
public override void LoadFromStream(Stream aStream, HCStyle aStyle, ushort aFileVersion) { base.LoadFromStream(aStream, aStyle, aFileVersion); FMarkType = (MarkType)aStream.ReadByte(); }
/// <summary> /// Executes the action. /// </summary> public void ExecuteDo() { _previousMarking = _marking.Mark; _marking.Mark = _newMarking; }
public Task <long> Count(int RelationId, MarkType type) { return(Db.Find(m => m.RelationId == RelationId && m.Type == type).CountAsync()); }
public MarkData(MarkType type) : this() { this.type = type; }
public static void Dialog_Yes_No_Cancel(string contentKey, MarkType mark, System.Action yes, System.Action no) => OpenLogic(GetLanguage(contentKey), mark, -1f, null, yes, null, no, () => { });
public static void Open(string content, MarkType mark, params System.Action[] actions) => OpenLogic(content, mark, -1f, actions);
public static void Open(string content, MarkType mark, float height, params System.Action[] actions) => OpenLogic(content, mark, height, actions);
public override void ParseXml(XmlElement aNode) { base.ParseXml(aNode); FMarkType = (MarkType)byte.Parse(aNode.Attributes["mark"].Value); }
/// <summary> /// Constructor /// </summary> /// <param name="marking"> /// The section data to be marked. /// </param> /// <param name="newMarking"> /// The marking to be applied to the section. /// </param> public SetMarking(IMarking marking, MarkType newMarking) { _marking = marking ?? throw new ArgumentNullException(nameof(marking)); _newMarking = newMarking; }