public void GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("Id", Id); info.AddValue("Name", Name); info.AddValue("Introduction", Introduction); if (Avator != null) { MemoryStream Stream = new MemoryStream(); Avator.Save(Stream, ImageFormat.Png); info.AddValue("Avator", Stream.GetBuffer()); Stream.Close(); } else { info.AddValue("Avator", Encoding.UTF8.GetBytes("NULL")); } if (Drawing != null) { MemoryStream Stream = new MemoryStream(); Drawing.Save(Stream, Drawing.RawFormat); info.AddValue("Drawing", Stream.GetBuffer()); Stream.Close(); } else { info.AddValue("Drawing", Encoding.UTF8.GetBytes("NULL")); } info.AddValue("Radical", RadicalRatio); info.AddValue("Skills", SkillPool.ToDictionary(O => O.Key.Id, P => P.Value)); info.AddValue("Records", Records); }
internal void Clear() { _item = null; Title.ClearValue(TextBlock.TextProperty); Avator.ClearValue(Ellipse.FillProperty); VoteCount.ClearValue(TextBlock.TextProperty); Summary.ClearValue(TextBlock.TextProperty); }
/// <summary> /// 获取s the avator. /// </summary> /// <param name="size">The size.</param> public string GetAvator(int size = 48) { if (Avator.IsNullOrEmpty()) { return($@"/wwwroot/static/images/avator/{Sex}_{size}.png"); } return(Avator); }
void Start() { buttonSetTrans.onClick.AddListener(SetTrans); toggleLockTrans.isOn = false; toggleLockTrans.onValueChanged.AddListener(LockTrans); ava = UIDOFEditor.I.avatar; leftHand = ava[Bone.hand_l].transform; rightHand = ava[Bone.hand_r].transform; leftForearm = ava[Bone.forearm_l].transform; rightForearm = ava[Bone.forearm_r].transform; leftUpperarm = ava[Bone.upperarm_l].transform; rightUpperarm = ava[Bone.upperarm_r].transform; gun = ava[Bone.other].transform; }
public override int GetHashCode() { int hash = 1; if (Id != 0) { hash ^= Id.GetHashCode(); } if (Name.Length != 0) { hash ^= Name.GetHashCode(); } if (Height != 0F) { hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Height); } if (Weight != 0F) { hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Weight); } if (Avator.Length != 0) { hash ^= Avator.GetHashCode(); } if (Email.Length != 0) { hash ^= Email.GetHashCode(); } if (EmailVerified != false) { hash ^= EmailVerified.GetHashCode(); } hash ^= phoneNumber_.GetHashCode(); if (Gender != global::My.Project.Gender.NotSpecified) { hash ^= Gender.GetHashCode(); } if (birthday_ != null) { hash ^= Birthday.GetHashCode(); } hash ^= addresses_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
void Start() { this.AddInputCB(); ResetFs(); buttonSetArmTarget.onClick.AddListener(SetArmTarget); toggleTowardArmTarget.isOn = false; toggleTowardArmTarget.onValueChanged.AddListener(LockTrans); ava = UIDOFEditor.I.avatar; leftHand = ava[Bone.hand_l].transform; rightHand = ava[Bone.hand_r].transform; leftForearm = ava[Bone.forearm_l].transform; rightForearm = ava[Bone.forearm_r].transform; leftUpperarm = ava[Bone.upperarm_l].transform; rightUpperarm = ava[Bone.upperarm_r].transform; gun = ava[Bone.other].transform; }
private void SetAiAvator_Click(object Sender, RoutedEventArgs E) { OpenFileDialog FileDialog = new OpenFileDialog() { Filter = "图像文件|*.png", CheckFileExists = true, CheckPathExists = true, Title = "选择头像图片", InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures) }; bool?Result = FileDialog.ShowDialog(); if (!Result.HasValue || !Result.Value) { return; } string ImagePath = FileDialog.FileName; AvatorWindow Dialog = new AvatorWindow(); Dialog.Init(ImagePath); Dialog.ShowDialog(); if (Dialog.Canceled) { return; } Avator = Dialog.Target; using (MemoryStream Stream = new MemoryStream()) { Avator.Save(Stream, ImageFormat.Png); BitmapImage Temp = new BitmapImage(); Temp.BeginInit(); Temp.CacheOption = BitmapCacheOption.OnLoad; Temp.StreamSource = Stream; Temp.EndInit(); AvatorImage.ImageSource = Temp; } }
public void GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("Id", Id); info.AddValue("Name", Name); info.AddValue("Introduction", Introduction); info.AddValue("LanIp", LanIpAddress.ToString()); info.AddValue("WanIp", WanIpAddress.ToString()); if (Avator != null) { MemoryStream Stream = new MemoryStream(); Avator.Save(Stream, ImageFormat.Png); info.AddValue("Avator", Stream.GetBuffer()); Stream.Close(); } else { info.AddValue("Avator", Encoding.UTF8.GetBytes("NULL")); } info.AddValue("Records", Records); info.AddValue("Achievements", Achievements); }