private void PlayerViewModel_PlayerChanged(object sender, EventArgs e) { HitDice.ReplaceRange(from h in Context.Player.GetHitDie() orderby h select new HitDieViewModel(this, h)); OnPropertyChanged(null); Skills.ReplaceRange(Context.Player.GetSkills()); Scores.Update(Context.Player); ShowClasses.ChangeCanExecute(); ShowRace.ChangeCanExecute(); ShowBackground.ChangeCanExecute(); UpdateAllConditions(); UpdateCondtions(); resources.Clear(); resources.AddRange(from r in Context.Player.GetResourceInfo(true).Values select new ResourceViewModel(r, this)); resources.AddRange(from r in Context.Player.GetBonusSpells(false) select new ResourceViewModel(r, this)); UpdateResources(); features = (from f in Context.Player.GetFeatures() where f.Name != "" && !f.Hidden select f).ToList(); UpdateFeatures(); proficiencies = new List <IXML>(); proficiencies.AddRange(Context.Player.GetLanguages()); proficiencies.AddRange(Context.Player.GetToolProficiencies()); proficiencies.AddRange(from p in Context.Player.GetToolKWProficiencies() select new Feature(p, "Proficiency")); proficiencies.AddRange(from p in Context.Player.GetOtherProficiencies() select new Feature(p, "Proficiency")); UpdateProficiencies(); UpdateItems(); UpdateSpellcasting(); UpdateInventoryChoices(); UpdateJournal(); UpdateNotes(); }
private void Parent_PlayerChanged(object sender, EventArgs e) { HitDice.ReplaceRange(from h in Context.Player.GetHitDie() orderby h select new HitDieViewModel(this, h)); Scores.Update(Context.Player); ShowClasses.ChangeCanExecute(); ShowRace.ChangeCanExecute(); ShowBackground.ChangeCanExecute(); }
protected override IEnumerator ProcessPayload(VisualPayload payload) { var label = VisualizerFactory.InstantiateLabelVisualizerPrefab(); label.Initialize(this, payload); var meshRenderer = label.TextComponent.GetComponent <MeshRenderer>(); var targetFont = FontFactory.GetFontPair(FontName.GetFirstValue(payload.Data)); var newMaterial = FontFactory.GenerateNewSpatialMaterial(targetFont.FontTexture); label.TextComponent.font = targetFont.Font; label.TextComponent.fontSize = Mathf.FloorToInt(FontSize.GetFirstValue(payload.Data) * targetFont.FontScale); label.transform.localPosition = new Vector3(0f, label.TextComponent.fontSize * targetFont.VerticalOffset, 0f); label.CharactersPerLine = CharactersPerLine.GetFirstValue(payload.Data); label.MaxLines = MaxLines.GetFirstValue(payload.Data); newMaterial.color = FontColor.GetFirstValue(payload.Data); meshRenderer.material = newMaterial; label.BackgroundPadding = BackgroundPadding.GetFirstValue(payload.Data); label.BackgroundDepth = BackgroundDepth.GetFirstValue(payload.Data); label.LateralJustification = Justification.GetFirstValue(payload.Data); label.VerticalJustification = VerticalJustification.GetFirstValue(payload.Data); label.MinHeight = MinHeight.GetFirstValue(payload.Data); label.MaxHeight = MaxHeight.GetFirstValue(payload.Data); label.Orientation = Orientation.GetFirstValue(payload.Data); label.SetClickState(ClickState); label.RemoveBackground = !ShowBackground.GetFirstValue(payload.Data); label.Text = LabelText.GetFirstValue(payload.Data); var newPayload = new VisualPayload(payload.Data, new VisualDescription(label.Bound)); var iterator = DefaultState.Transmit(newPayload); while (iterator.MoveNext()) { yield return(null); } }
public System.Xml.XmlNode ToXml(System.Xml.XmlDocument doc) { var layout = doc.CreateElement("layout"); Helper.XmlHelper.AddAttribute("version", version, layout); var property = doc.CreateElement("property"); //绘制人 var author = doc.CreateElement("author"); Helper.XmlHelper.AddAttribute("name", Author, author); property.AppendChild(author); //尺寸 var canvas = doc.CreateElement("canvas"); Helper.XmlHelper.AddSizeAttribute(SizeF, canvas); property.AppendChild(canvas); //背景[可选] if (m_backgroungPath != string.Empty) { var background = doc.CreateElement("background"); Helper.XmlHelper.AddRectangleAttribute(BackgroundRect, background); Helper.XmlHelper.AddAttribute("src", BackgroundPath, background); Helper.XmlHelper.AddAttribute("visible", ShowBackground.ToString(), background); property.AppendChild(background); } //时间 var datetime = doc.CreateElement("datetime"); Helper.XmlHelper.AddAttribute("createtime", CreateTime.ToString(), datetime); Helper.XmlHelper.AddAttribute("updatetime", DateTime.Now.ToString(), datetime); property.AppendChild(datetime); layout.AppendChild(property); //序列化控件 var items = doc.CreateElement("items"); if (m_collection != null) { foreach (var ctl in m_collection) { items.AppendChild(ctl.ToXml(items)); } } layout.AppendChild(items); return(layout); }
// Use this for initialization void Start() { string tg=""; if (gameObject.name.Equals("PlayText")) tg="PlaySelected"; if (gameObject.name.Equals("ScoresText")) tg="ScoresSelected"; if (gameObject.name.Equals("ExitText")) tg="ExitSelected"; if(gameObject.name.Equals("InstructionsText")){ tg="InstructionsSelected"; } GameObject clock = GameObject.Find(tg); this.background = (ShowBackground)clock.GetComponent(typeof(ShowBackground)); this.ts = (TextMesh)gameObject.GetComponent("TextMesh"); this.GetComponent<Renderer>().material.color = background.getColor(); }
public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; if (Visible != null) { hashCode = hashCode * 59 + Visible.GetHashCode(); } if (ShowSpikes != null) { hashCode = hashCode * 59 + ShowSpikes.GetHashCode(); } if (SpikeSides != null) { hashCode = hashCode * 59 + SpikeSides.GetHashCode(); } if (SpikeThickness != null) { hashCode = hashCode * 59 + SpikeThickness.GetHashCode(); } if (SpikeColor != null) { hashCode = hashCode * 59 + SpikeColor.GetHashCode(); } if (ShowBackground != null) { hashCode = hashCode * 59 + ShowBackground.GetHashCode(); } if (BackgroundColor != null) { hashCode = hashCode * 59 + BackgroundColor.GetHashCode(); } if (ShowAxesLabels != null) { hashCode = hashCode * 59 + ShowAxesLabels.GetHashCode(); } if (Color != null) { hashCode = hashCode * 59 + Color.GetHashCode(); } if (CategoryOrder != null) { hashCode = hashCode * 59 + CategoryOrder.GetHashCode(); } if (CategoryArray != null) { hashCode = hashCode * 59 + CategoryArray.GetHashCode(); } if (Title != null) { hashCode = hashCode * 59 + Title.GetHashCode(); } if (Type != null) { hashCode = hashCode * 59 + Type.GetHashCode(); } if (AutoRange != null) { hashCode = hashCode * 59 + AutoRange.GetHashCode(); } if (RangeMode != null) { hashCode = hashCode * 59 + RangeMode.GetHashCode(); } if (Range != null) { hashCode = hashCode * 59 + Range.GetHashCode(); } if (TickMode != null) { hashCode = hashCode * 59 + TickMode.GetHashCode(); } if (NTicks != null) { hashCode = hashCode * 59 + NTicks.GetHashCode(); } if (Tick0 != null) { hashCode = hashCode * 59 + Tick0.GetHashCode(); } if (DTick != null) { hashCode = hashCode * 59 + DTick.GetHashCode(); } if (TickVals != null) { hashCode = hashCode * 59 + TickVals.GetHashCode(); } if (TickText != null) { hashCode = hashCode * 59 + TickText.GetHashCode(); } if (Ticks != null) { hashCode = hashCode * 59 + Ticks.GetHashCode(); } if (Mirror != null) { hashCode = hashCode * 59 + Mirror.GetHashCode(); } if (TickleN != null) { hashCode = hashCode * 59 + TickleN.GetHashCode(); } if (TickWidth != null) { hashCode = hashCode * 59 + TickWidth.GetHashCode(); } if (TickColor != null) { hashCode = hashCode * 59 + TickColor.GetHashCode(); } if (ShowTickLabels != null) { hashCode = hashCode * 59 + ShowTickLabels.GetHashCode(); } if (TickFont != null) { hashCode = hashCode * 59 + TickFont.GetHashCode(); } if (TickAngle != null) { hashCode = hashCode * 59 + TickAngle.GetHashCode(); } if (TickPrefix != null) { hashCode = hashCode * 59 + TickPrefix.GetHashCode(); } if (ShowTickPrefix != null) { hashCode = hashCode * 59 + ShowTickPrefix.GetHashCode(); } if (TickSuffix != null) { hashCode = hashCode * 59 + TickSuffix.GetHashCode(); } if (ShowTickSuffix != null) { hashCode = hashCode * 59 + ShowTickSuffix.GetHashCode(); } if (ShowExponent != null) { hashCode = hashCode * 59 + ShowExponent.GetHashCode(); } if (ExponentFormat != null) { hashCode = hashCode * 59 + ExponentFormat.GetHashCode(); } if (SeparateThousands != null) { hashCode = hashCode * 59 + SeparateThousands.GetHashCode(); } if (TickFormat != null) { hashCode = hashCode * 59 + TickFormat.GetHashCode(); } if (TickFormatStops != null) { hashCode = hashCode * 59 + TickFormatStops.GetHashCode(); } if (HoverFormat != null) { hashCode = hashCode * 59 + HoverFormat.GetHashCode(); } if (ShowLine != null) { hashCode = hashCode * 59 + ShowLine.GetHashCode(); } if (LineColor != null) { hashCode = hashCode * 59 + LineColor.GetHashCode(); } if (LineWidth != null) { hashCode = hashCode * 59 + LineWidth.GetHashCode(); } if (ShowGrid != null) { hashCode = hashCode * 59 + ShowGrid.GetHashCode(); } if (GridColor != null) { hashCode = hashCode * 59 + GridColor.GetHashCode(); } if (GridWidth != null) { hashCode = hashCode * 59 + GridWidth.GetHashCode(); } if (ZeroLine != null) { hashCode = hashCode * 59 + ZeroLine.GetHashCode(); } if (ZeroLineColor != null) { hashCode = hashCode * 59 + ZeroLineColor.GetHashCode(); } if (ZeroLineWidth != null) { hashCode = hashCode * 59 + ZeroLineWidth.GetHashCode(); } if (Calendar != null) { hashCode = hashCode * 59 + Calendar.GetHashCode(); } if (CategoryArraySrc != null) { hashCode = hashCode * 59 + CategoryArraySrc.GetHashCode(); } if (TickValsSrc != null) { hashCode = hashCode * 59 + TickValsSrc.GetHashCode(); } if (TickTextSrc != null) { hashCode = hashCode * 59 + TickTextSrc.GetHashCode(); } return(hashCode); } }
public bool Equals([AllowNull] XAxis other) { if (other == null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return((Visible == other.Visible && Visible != null && other.Visible != null && Visible.Equals(other.Visible)) && (ShowSpikes == other.ShowSpikes && ShowSpikes != null && other.ShowSpikes != null && ShowSpikes.Equals(other.ShowSpikes)) && (SpikeSides == other.SpikeSides && SpikeSides != null && other.SpikeSides != null && SpikeSides.Equals(other.SpikeSides)) && (SpikeThickness == other.SpikeThickness && SpikeThickness != null && other.SpikeThickness != null && SpikeThickness.Equals(other.SpikeThickness)) && (SpikeColor == other.SpikeColor && SpikeColor != null && other.SpikeColor != null && SpikeColor.Equals(other.SpikeColor)) && (ShowBackground == other.ShowBackground && ShowBackground != null && other.ShowBackground != null && ShowBackground.Equals(other.ShowBackground)) && (BackgroundColor == other.BackgroundColor && BackgroundColor != null && other.BackgroundColor != null && BackgroundColor.Equals(other.BackgroundColor)) && (ShowAxesLabels == other.ShowAxesLabels && ShowAxesLabels != null && other.ShowAxesLabels != null && ShowAxesLabels.Equals(other.ShowAxesLabels)) && (Color == other.Color && Color != null && other.Color != null && Color.Equals(other.Color)) && (CategoryOrder == other.CategoryOrder && CategoryOrder != null && other.CategoryOrder != null && CategoryOrder.Equals(other.CategoryOrder)) && (Equals(CategoryArray, other.CategoryArray) || CategoryArray != null && other.CategoryArray != null && CategoryArray.SequenceEqual(other.CategoryArray)) && (Title == other.Title && Title != null && other.Title != null && Title.Equals(other.Title)) && (Type == other.Type && Type != null && other.Type != null && Type.Equals(other.Type)) && (AutoRange == other.AutoRange && AutoRange != null && other.AutoRange != null && AutoRange.Equals(other.AutoRange)) && (RangeMode == other.RangeMode && RangeMode != null && other.RangeMode != null && RangeMode.Equals(other.RangeMode)) && (Equals(Range, other.Range) || Range != null && other.Range != null && Range.SequenceEqual(other.Range)) && (TickMode == other.TickMode && TickMode != null && other.TickMode != null && TickMode.Equals(other.TickMode)) && (NTicks == other.NTicks && NTicks != null && other.NTicks != null && NTicks.Equals(other.NTicks)) && (Tick0 == other.Tick0 && Tick0 != null && other.Tick0 != null && Tick0.Equals(other.Tick0)) && (DTick == other.DTick && DTick != null && other.DTick != null && DTick.Equals(other.DTick)) && (Equals(TickVals, other.TickVals) || TickVals != null && other.TickVals != null && TickVals.SequenceEqual(other.TickVals)) && (Equals(TickText, other.TickText) || TickText != null && other.TickText != null && TickText.SequenceEqual(other.TickText)) && (Ticks == other.Ticks && Ticks != null && other.Ticks != null && Ticks.Equals(other.Ticks)) && (Mirror == other.Mirror && Mirror != null && other.Mirror != null && Mirror.Equals(other.Mirror)) && (TickleN == other.TickleN && TickleN != null && other.TickleN != null && TickleN.Equals(other.TickleN)) && (TickWidth == other.TickWidth && TickWidth != null && other.TickWidth != null && TickWidth.Equals(other.TickWidth)) && (TickColor == other.TickColor && TickColor != null && other.TickColor != null && TickColor.Equals(other.TickColor)) && (ShowTickLabels == other.ShowTickLabels && ShowTickLabels != null && other.ShowTickLabels != null && ShowTickLabels.Equals(other.ShowTickLabels)) && (TickFont == other.TickFont && TickFont != null && other.TickFont != null && TickFont.Equals(other.TickFont)) && (TickAngle == other.TickAngle && TickAngle != null && other.TickAngle != null && TickAngle.Equals(other.TickAngle)) && (TickPrefix == other.TickPrefix && TickPrefix != null && other.TickPrefix != null && TickPrefix.Equals(other.TickPrefix)) && (ShowTickPrefix == other.ShowTickPrefix && ShowTickPrefix != null && other.ShowTickPrefix != null && ShowTickPrefix.Equals(other.ShowTickPrefix)) && (TickSuffix == other.TickSuffix && TickSuffix != null && other.TickSuffix != null && TickSuffix.Equals(other.TickSuffix)) && (ShowTickSuffix == other.ShowTickSuffix && ShowTickSuffix != null && other.ShowTickSuffix != null && ShowTickSuffix.Equals(other.ShowTickSuffix)) && (ShowExponent == other.ShowExponent && ShowExponent != null && other.ShowExponent != null && ShowExponent.Equals(other.ShowExponent)) && (ExponentFormat == other.ExponentFormat && ExponentFormat != null && other.ExponentFormat != null && ExponentFormat.Equals(other.ExponentFormat)) && (SeparateThousands == other.SeparateThousands && SeparateThousands != null && other.SeparateThousands != null && SeparateThousands.Equals(other.SeparateThousands)) && (TickFormat == other.TickFormat && TickFormat != null && other.TickFormat != null && TickFormat.Equals(other.TickFormat)) && (Equals(TickFormatStops, other.TickFormatStops) || TickFormatStops != null && other.TickFormatStops != null && TickFormatStops.SequenceEqual(other.TickFormatStops)) && (HoverFormat == other.HoverFormat && HoverFormat != null && other.HoverFormat != null && HoverFormat.Equals(other.HoverFormat)) && (ShowLine == other.ShowLine && ShowLine != null && other.ShowLine != null && ShowLine.Equals(other.ShowLine)) && (LineColor == other.LineColor && LineColor != null && other.LineColor != null && LineColor.Equals(other.LineColor)) && (LineWidth == other.LineWidth && LineWidth != null && other.LineWidth != null && LineWidth.Equals(other.LineWidth)) && (ShowGrid == other.ShowGrid && ShowGrid != null && other.ShowGrid != null && ShowGrid.Equals(other.ShowGrid)) && (GridColor == other.GridColor && GridColor != null && other.GridColor != null && GridColor.Equals(other.GridColor)) && (GridWidth == other.GridWidth && GridWidth != null && other.GridWidth != null && GridWidth.Equals(other.GridWidth)) && (ZeroLine == other.ZeroLine && ZeroLine != null && other.ZeroLine != null && ZeroLine.Equals(other.ZeroLine)) && (ZeroLineColor == other.ZeroLineColor && ZeroLineColor != null && other.ZeroLineColor != null && ZeroLineColor.Equals(other.ZeroLineColor)) && (ZeroLineWidth == other.ZeroLineWidth && ZeroLineWidth != null && other.ZeroLineWidth != null && ZeroLineWidth.Equals(other.ZeroLineWidth)) && (Calendar == other.Calendar && Calendar != null && other.Calendar != null && Calendar.Equals(other.Calendar)) && (CategoryArraySrc == other.CategoryArraySrc && CategoryArraySrc != null && other.CategoryArraySrc != null && CategoryArraySrc.Equals(other.CategoryArraySrc)) && (TickValsSrc == other.TickValsSrc && TickValsSrc != null && other.TickValsSrc != null && TickValsSrc.Equals(other.TickValsSrc)) && (TickTextSrc == other.TickTextSrc && TickTextSrc != null && other.TickTextSrc != null && TickTextSrc.Equals(other.TickTextSrc))); }