public void GoToTheScreen(string p0) { string url; Assert.IsTrue(RouteCache.TryGetUrl(p0, out url), "The supplied route key not found in the route cache"); Br.Navigate().GoToUrl(url); }
//偏差指数评价 private void button2_Click(object sender, EventArgs e) { double Br, Bg, Bb;//三通道偏差指数 double r, g, b; r = g = b = 0; Bitmap map2 = (Bitmap)img2; for (int i = 0; i < newBitmap.Width; i++) { for (int j = 0; j < newBitmap.Height; j++) { Color pixel1 = newBitmap.GetPixel(i, j); Color piexl2 = map2.GetPixel(i, j); r += Math.Abs(pixel1.R - piexl2.R) * 1.0 / piexl2.R; g += Math.Abs(pixel1.G - piexl2.G) * 1.0 / piexl2.G; b += Math.Abs(pixel1.B - piexl2.B) * 1.0 / piexl2.B; } } Br = r / (newBitmap.Width * newBitmap.Height); Bg = g / (newBitmap.Width * newBitmap.Height); Bb = b / (newBitmap.Width * newBitmap.Height); MessageBox.Show("融合图三通道偏差指数" + "\r\n" + "Br:" + Br.ToString() + " " + "Bg:" + Bg.ToString() + " " + "Bb:" + Bb.ToString()); }
public void ClickTheCheckboxLabelled(string p0) { var xPath = string.Format(@"//label[contains(text(),'{0}')]", p0); var label = Br.FindElement(By.XPath(xPath)); Br.FindElement(By.Id(label.GetAttribute("for"))).Click(); }
public void TypeIntoTextBoxLabelled(string p0, string p1) { var xPath = string.Format(@"//label[contains(text(),'{0}')]", p1); var label = Br.FindElement(By.XPath(xPath)); ClearAndType(p0, label.GetAttribute("for")); }
public void Dispose() { Br.Dispose(); Bw.Dispose(); Close(); GC.SuppressFinalize(this); }
public override void Read() { _configurationVersion = Br.ReadByte(); _profile = Br.ReadByte(); _profileCompatibility = Br.ReadByte(); _level = Br.ReadByte(); _naluLengthSize = Br.ReadByte(); _naluLengthSize = (byte)(1 + (_naluLengthSize & 0x03)); _seqCount = Br.ReadByte(); _seqCount = (byte)(_seqCount & 0x1f); for (int i = 0; i < _seqCount; i++) { AVCCParameter parameter; parameter.Size = Br.ReadUInt16(); parameter.Data = null; if (parameter.Size > 0) { parameter.Data = Br.ReadBytes(parameter.Size); } _seqParameters.Add(parameter); } _picCount = Br.ReadByte(); for (int i = 0; i < _seqCount; i++) { AVCCParameter parameter; parameter.Size = Br.ReadUInt16(); parameter.Data = null; if (parameter.Size > 0) { parameter.Data = Br.ReadBytes(parameter.Size); } _picParameters.Add(parameter); } }
public void SelectFromTheDropdown(string p0, string p1) { var xPath = string.Format(@".//option[contains(text(),'{0}')]", p0); var ddl = Br.FindElement(By.Id(p1)); ddl.FindElement(By.XPath(xPath)).Click(); }
public override void Read() { Version = Br.ReadByte(); Br.Read(Flags, 0, 3); ReadData(); base.Read(); }
public override void ReadData() { while (Br.BaseStream.GetAvaliableByteCounts() > 0) { Entries.Add(new Entry(Br.ReadByte())); } }
public void ThenTheTextShouldBeDisplayed(string p0) { var xPath = string.Format(@"//*[contains(text(),'{0}')]", p0); var list = Br.FindElements(By.XPath(xPath)); Assert.IsTrue(list.Any()); }
//监听服务器端发来的消息 private void TcpListen() { while (iswork) { string receiveMsg = null; try { receiveMsg = Br.ReadString(); } catch (Exception) { } if (receiveMsg != null) { AddMessage(receiveMsg, true); string command = string.Empty; string[] splitStrings = receiveMsg.Split('#'); command = splitStrings[0]; switch (command) { case "barchmsg": AddMessage(receiveMsg, true); break; case "users": Users = receiveMsg.Replace("users#", ""); //LoadUser(); break; } } } }
public Bitmap GetIndexedBitmapNotLz(int img, Color[] pal, int width, int height) { int length = (height * width) << 1; Seek(img); byte[] img_data = Br.ReadBytes(length); return(ImgFunction.ConvertGBAImageToBitmapIndexed(img_data, pal, width, height)); }
public override void ReadData() { TrackID = Br.ReadUInt32(); DefaultSampleDescriptionIndex = Br.ReadUInt32(); DefaultSampleDuration = Br.ReadUInt32(); DefaultSampleSize = Br.ReadUInt32(); DefaultSampleFlags = Br.ReadUInt32(); }
public void ValidationMessageIsDisplayed(string p0) { var msgs = Br.FindElements( By.XPath("//div[contains(concat(' ', @class, ' '), ' validation-summary-errors ')]/ul/li")); Assert.IsTrue(msgs.Any(e => e.Text == p0)); }
public override void ReadData() { var count = Br.ReadUInt32(); for (int i = 0; i < count; i++) { Entries.Add(Br.ReadUInt32()); } }
public override void ReadData() { ComonentType = new string(new [] { Br.ReadChar(), Br.ReadChar(), Br.ReadChar(), Br.ReadChar() }); ComponentSubType = Br.ReadUInt32(); ComponentManufacturer = Br.ReadUInt32(); ComponentFlags = Br.ReadUInt32(); ComponentFlagsMask = Br.ReadUInt32(); ComponentName = Encoding.ASCII.GetString(Br.ReadBytes((int)(Size - 32))); }
public override void Read() { _majorBrand = Br._ReadUInt32(); _minorVersion = Br._ReadUInt32(); for (int i = 16; i < Size; i += 4) { CompatibleBrands.Add(Br._ReadUInt32()); } }
public void OnException(ExceptionContext context) { var errorBr = new Br <string>(context.Exception.Message, -1, context.Exception.Message, stackTrance: context.Exception.StackTrace); context.Result = new JsonResult(errorBr); context.ExceptionHandled = true; IALogger logger = ServiceResolver.GetService <IALogger>(context); logger.Exception(context.Exception); }
public override int GetHashCode() { unchecked { var hashCode = Br != null?Br.GetHashCode() : 0; hashCode = hashCode * 397 ^ (Stw != null ? Stw.GetHashCode() : 0); hashCode = hashCode * 397 ^ (Creative != null ? Creative.GetHashCode() : 0); return(hashCode); } }
public int ReadPointer(int offset) { Seek(offset); int k = Br.ReadInt32() - 0x8000000; if (k < 0) { throw new NullReferenceException(Convert.ToString(offset, 16)); } return(k); }
public override void ReadData() { var count = Br.ReadUInt32(); for (int i = 0; i < count; i++) { Entry entry; entry.SampleCount = Br.ReadUInt32(); entry.SampleOffset = Br.ReadInt32(); Entries.Add(entry); } }
public override void ReadData() { var entryCount = Br.ReadUInt32(); for (int i = 0; i < entryCount; i++) { SttsEntries.Add(new Entry() { Count = Br.ReadUInt32(), Delta = Br.ReadUInt32() }); } }
protected void ClearAndType(string p0, string p1) { Br.FindElement(By.Id(p1)).Clear(); p0 = (p0.Contains(@"uniquevalue")) ? p0.Replace(@"uniquevalue", GuidString()) : p0; p0 = (p0.Contains(@"cache")) ? FeatureContext.Current.Get <string>(p0.Substring(p0.LastIndexOf('.') + 1)) : p0; p0 = (p0.Contains(@"config")) ? ConfigurationManager.AppSettings[p0.Substring(p0.LastIndexOf('.') + 1)] : p0; Br.FindElement(By.Id(p1)).SendKeys(p0); }
public String[] GetObjectNames(int pointer, int size, int total) { String[] src = new String[total]; int Nameoffset = ReadPointer(pointer); fs.Seek(Nameoffset, SeekOrigin.Begin); for (int x = 0; x < total; x++) { byte[] name = Br.ReadBytes(size); src[x] = TransToCH(name); } return(src); }
public PicChannelMixerWindow(BitmapSource bs) { InitializeComponent(); this.bs = bs; Content.DataContext = picChannelMixerControl; R.AddHandler(Slider.MouseLeftButtonUpEvent, new MouseButtonEventHandler(Slider_MouseLeftButtonUp), true); Rg.AddHandler(Slider.MouseLeftButtonUpEvent, new MouseButtonEventHandler(Slider_MouseLeftButtonUp), true); Rb.AddHandler(Slider.MouseLeftButtonUpEvent, new MouseButtonEventHandler(Slider_MouseLeftButtonUp), true); Gr.AddHandler(Slider.MouseLeftButtonUpEvent, new MouseButtonEventHandler(Slider_MouseLeftButtonUp), true); G.AddHandler(Slider.MouseLeftButtonUpEvent, new MouseButtonEventHandler(Slider_MouseLeftButtonUp), true); Gb.AddHandler(Slider.MouseLeftButtonUpEvent, new MouseButtonEventHandler(Slider_MouseLeftButtonUp), true); Br.AddHandler(Slider.MouseLeftButtonUpEvent, new MouseButtonEventHandler(Slider_MouseLeftButtonUp), true); Bg.AddHandler(Slider.MouseLeftButtonUpEvent, new MouseButtonEventHandler(Slider_MouseLeftButtonUp), true); B.AddHandler(Slider.MouseLeftButtonUpEvent, new MouseButtonEventHandler(Slider_MouseLeftButtonUp), true); }
//修改属性 /*private void mustate(string GID,string groupname,string sign) * { * foreach (ListViewItem item in this.lv_group.Items) * { * if (item.Text == GID) * { * item.SubItems[1].Text = groupname; * item.SubItems[4].Text = sign; * } * } * } * private void state(string UID,string username,string sign) * { * * }*/ //关闭窗口 private void list_FormClosed(object sender, FormClosedEventArgs e) { try { string sendmsg = "logout#" + UID; Bw.Write(sendmsg); Bw.Flush(); iswork = false; Br.Close(); Bw.Close(); } catch { } Application.Exit(); }
public override void ReadData() { SampleSize = Br.ReadUInt32(); _sampleCount = Br.ReadUInt32(); if (SampleSize != 0) { Entries[0] = SampleSize; } else { for (var i = 0; i < _sampleCount; i++) { Entries[i] = Br.ReadUInt32(); } } }
/// <summary> /// 转换为字符串,保留到小数点后n位 /// </summary> /// <param name="n">保留到小数点后n位</param> /// <param name="mode">0表示返回度分秒,1表示返回ddffmm.mmm,其他返回表示弧度</param> /// <returns></returns> public string ToFormatString(int n, int mode = 0) { if (mode == 0) { return(B.ToFormatString(n) + "," + L.ToFormatString(n)); } else if (mode == 1) { return(B.ChangeToDouble().ToFormatString(n) + "," + L.ChangeToDouble().ToFormatString(n)); } else { return(Br.ToFormatString(n) + "," + Lr.ToFormatString(n)); } }
public override void ReadData() { CreationTime = Br.ReadUInt32(); ModificationTime = Br.ReadUInt32(); TrackId = Br.ReadUInt32(); _reserved1 = Br.ReadBytes(4); Duration = Br.ReadUInt32(); _reserved2 = Br.ReadBytes(8); Layer = Br.ReadUInt16(); AlternateGroup = Br.ReadUInt16(); Volume = Br.ReadInt16(); _reserved3 = Br.ReadBytes(2); Matrix = Matrix.FromByteBuffer(Br.BaseStream); Width = Br.ReadUInt32(); Height = Br.ReadUInt32(); }
public void ThenTheDivWithShouldContainTheText(string p0, string p1, string p2) { IWebElement div = null; switch (p0.ToUpper()) { case "TITLE": div = Br.FindElement(By.XPath(@"//div[@title='" + p1 + "']")); break; case "ID": div = Br.FindElement(By.Id(p1)); break; } Assert.IsNotNull(div); Assert.IsTrue(div.Text.Contains(p2)); }