protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int streamID = Convert.ToInt32(RouteData.Values["StreamID"]); if (streamID > 0) { //update statement TStream stream = new TStream(streamID); txtStreamID.Text = stream.StreamID.ToString(); txtStreamName.Text = stream.StreamName; txtStreamPoints.Text = stream.StreamRank.ToString(); txtStreamIsBanned.Text = stream.StreamIsBanned.ToString(); lbInsert.Visible = false; } else if (streamID <= 0) { //insrrt statement btnDelete.Visible = false; txtStreamID.Enabled = false; txtStreamID.Visible = false; lblStreamID.Visible = false; txtStreamIsBanned.Text = ""; txtStreamName.Text = ""; txtStreamPoints.Text = ""; lbUpdate.Visible = false; } } }
/// <summary> /// Create new UserTextFrameClass /// </summary> /// <param name="FrameID">4 Characters tag identifier</param> /// <param name="Flags">Frame Flagsr</param> /// <param name="Data">TagStream to read information from</param> /// <param name="Length">Maximum available length of data for current frame in TagStream</param> public UserTextFrame(string FrameID, FrameFlags Flags, int Length, Stream FS) : base(FrameID, Flags, FS) { TextEncoding = (TextEncodings)TStream.ReadByte(FS); Length--; if (!IsValidEnumValue(TextEncoding, ExceptionLevels.Error, FrameID)) { return; } _Description = TStream.ReadText(Length, TextEncoding, ref Length, true); if (!IsUrl) // is text frame { Text = TStream.ReadText(Length, TextEncoding); } else { Text = TStream.ReadText(Length, TextEncodings.Ascii); } // User URL frames use this class and use Text property as URL // URL property must be in AScii format // all URL frames start with W and text frames with T }
private static TStream StreamContainer(Guid id) { if (!stdstream.ContainsKey(id) || stdstream[id] == null) { stdstream[id] = new TStream(); } return(stdstream[id]); }
/// <summary> /// Writing Data to specific TagStream /// </summary> /// <param name="writer">TagStream to write data</param> /// <param name="MinorVersion">ID3 minor version</param> protected override void OnWritingData(int MinorVersion) { TStream.WriteText(_FrameIdentifier, TextEncodings.Ascii, false); TStream.WriteText(URL, TextEncodings.Ascii, true); // Write URL TStream.WriteText(_AdditionalData, TextEncodings.Ascii, false); }
public void LocalFileTest() { byte[] score = TStream.GetFileByteArr("d:\\1.docx"); byte[] convert = TAes.Encrypt(score, TAes.GetAesKey("hello", 128), TAes.GetIv(TAes.defultIv), CipherMode.CFB, TAes.defaultPaddingMode); TStream.SaveFile(convert, "d:\\2.docx"); byte[] result = TAes.Decrypt(convert, TAes.GetAesKey("hello", 128), TAes.GetIv(TAes.defultIv), CipherMode.CFB, TAes.defaultPaddingMode); TStream.SaveFile(result, "d:\\3.docx"); }
/// <summary> /// Writing Data to specific TagStream /// </summary> /// <param name="writer">TagStream to write data</param> /// <param name="MinorVersion">ID3 minor version</param> protected override void OnWritingData(int MinorVersion) { TStream.WriteText(EMail, TextEncodings.Ascii, true); TStream.FS.WriteByte(_Rating); byte[] Buf = BitConverter.GetBytes(_Counter); Array.Reverse(Buf); TStream.FS.Write(Buf, 0, 8); }
public static TStream GetCurrent <TStream>() where TStream : BufferStream, new() { LocalDataStoreSlot namedDataSlot = Thread.GetNamedDataSlot("ThreadBufferListStream"); TStream val = Thread.GetData(namedDataSlot) as TStream; if (val != null) { return(val); } val = new TStream(); Thread.SetData(namedDataSlot, val); return(val); }
// Token: 0x060006DA RID: 1754 RVA: 0x0001AECC File Offset: 0x000190CC public static TStream GetCurrent <TStream>() where TStream : BufferStream, new() { LocalDataStoreSlot namedDataSlot = Thread.GetNamedDataSlot("ThreadBufferListStream"); TStream tstream = Thread.GetData(namedDataSlot) as TStream; if (tstream != null) { return(tstream); } tstream = Activator.CreateInstance <TStream>(); Thread.SetData(namedDataSlot, tstream); return(tstream); }
protected void lbInsert_Click(object sender, EventArgs e) { TStream s_stream = new TStream(); s_stream.StreamName = txtStreamName.Text; s_stream.StreamRank = Convert.ToInt32(txtStreamPoints.Text); s_stream.StreamIsBanned = Convert.ToBoolean(txtStreamIsBanned.Text); TStream.InsertStream(s_stream); Response.Redirect("~/Admin/Streams"); }
/// <summary> /// Writing Data to specific TagStream /// </summary> /// <param name="writer">TagStream to write data</param> /// <param name="MinorVersion">ID3 minor version</param> protected override void OnWritingData(int MinorVersion) { if (ID3v2.AutoTextEncoding) { SetEncoding(); } TStream.FS.WriteByte((byte)TextEncoding); // Write Text Encoding _Language.Write(TStream.FS); TStream.WriteText(Description, TextEncoding, true); TStream.WriteText(Text, TextEncoding, false); }
/// <summary> /// Gets the current buffer stream from the thread context /// </summary> /// <typeparam name="TStream">The type of the stream.</typeparam> /// <returns></returns> public static TStream GetCurrent <TStream>() where TStream : BufferStream, new() { var slot = Thread.GetNamedDataSlot(c_ThreadBufferSegmentStream); var stream = Thread.GetData(slot) as TStream; if (stream != null) { return(stream); } stream = new TStream(); Thread.SetData(slot, stream); return(stream); }
private void DisplayVideoWindow(TStream stm, TAPIMEDIATYPES mediaType, TERMINAL_DIRECTION direction) { TTerminal t = stm.FindTerminal(mediaType, direction); if (t != null) { IVideoWindow videoWindow = t.QueryInterface(typeof(IVideoWindow)) as IVideoWindow; if (videoWindow != null) { videoWindow.Owner = (direction == TERMINAL_DIRECTION.TD_RENDER) ? localVidPlaceholder.Handle.ToInt32() : remoteVidPlaceholder.Handle.ToInt32(); videoWindow.WindowStyle = 0x40800000; // WS_CHILD | WS_BORDER; videoWindow.SetWindowPosition(0, 0, localVidPlaceholder.Width, localVidPlaceholder.Height); videoWindow.Visible = 1; } } }
/// <summary> /// Create new LinkFrame /// </summary> /// <param name="FrameID">4 Characters tag identifier</param> /// <param name="Flags">2 Bytes flags identifier</param> /// <param name="Data">Contain Data for this frame</param> /// <param name="Length"></param> public LinkFrame(string FrameID, FrameFlags Flags, int Length, Stream FS) : base(FrameID, Flags, FS) { _FrameIdentifier = TStream.ReadText(4, TextEncodings.Ascii); if (!ValidatingFrameID(_FrameIdentifier, ExceptionLevels.Warning)) { return; } Length -= 4; // There is 3 byte in article that i think it's not true // because frame identifier is 4 character // use Text variable as URL URL = TStream.ReadText(Length, TextEncodings.Ascii, ref Length, true); _AdditionalData = TStream.ReadText(Length, TextEncodings.Ascii); }
/// <summary> /// Writing Data to specific TagStream /// </summary> /// <param name="writer">TagStream to write data</param> /// <param name="MinorVersion">ID3 minor version</param> protected override void OnWritingData(int MinorVersion) { if (!IsUrl) { if (ID3v2.AutoTextEncoding) { SetEncoding(); } TStream.FS.WriteByte((byte)_TextEncoding); // Write Text Encoding TStream.WriteText(Text, _TextEncoding, false); // Write Text } else { TStream.WriteText(Text, TextEncodings.Ascii, false); } }
/// <summary> /// Writing Data to specific TagStream /// </summary> /// <param name="writer">TagStream to write data</param> /// <param name="MinorVersion">ID3 minor version</param> protected override void OnWritingData(int MinorVersion) { if (ID3v2.AutoTextEncoding) { SetEncoding(); } TStream.FS.WriteByte((byte)TextEncoding); // Write Encoding TStream.WriteText(_Description, TextEncoding, true); if (!IsUrl) { TStream.WriteText(Text, TextEncoding, false); } else // URL frames always use ascii encoding for text value { TStream.WriteText(Text, TextEncodings.Ascii, false); } }
/// <summary> /// Create new TextFrame Class /// </summary> /// <param name="FrameID">4 Characters frame identifier</param> /// <param name="Flags">Flag of frame</param> /// <param name="Data">FileStream to read frame data from</param> /// <param name="Length">Maximum length of frame</param> public TextFrame(string FrameID, FrameFlags Flags, int Length, Stream FS) : base(FrameID, Flags, FS) { // If it was URL frame the TextEncoding is ascii and must not read if (IsUrl) { TextEncoding = TextEncodings.Ascii; } else { TextEncoding = (TextEncodings)TStream.ReadByte(FS); Length--; if (!IsValidEnumValue(TextEncoding, ExceptionLevels.Error, FrameID)) { return; } } Text = TStream.ReadText(Length, _TextEncoding); }
protected void btnUpdate_Click(object sender, EventArgs e) { //here we will update the selected player-info //to-do: incorporate api fetch here //create new obj to forward to player-info class TStream s_stream = new TStream(); s_stream.StreamID = Convert.ToInt32(txtStreamID.Text); s_stream.StreamName = txtStreamName.Text; s_stream.StreamRank = Convert.ToInt32(txtStreamPoints.Text); s_stream.StreamIsBanned = Convert.ToBoolean(txtStreamIsBanned.Text); TStream.UpdateStreamInfo(s_stream); Response.Redirect("~/Admin/Streams"); }
private void OnMediaEvent(object sender, TapiCallMediaEventArgs e) { // When the video rendering stream activates, popup the video window if it's available. if (e.Event == CALL_MEDIA_EVENT.CME_STREAM_ACTIVE) { TStream stm = e.Stream; if (stm.Direction == TERMINAL_DIRECTION.TD_RENDER && stm.MediaType == TAPIMEDIATYPES.VIDEO) { TTerminal t = stm.FindTerminal(stm.MediaType, stm.Direction); if (t != null) { IVideoWindow vw = t.QueryInterface(typeof(IVideoWindow)) as IVideoWindow; if (vw != null) { // Position to the right vw.SetWindowPosition(this.Left + this.Width + 2, this.Top, vw.Width, vw.Height); vw.Visible = 1; } } } else if (currCall != null && stm.Direction == TERMINAL_DIRECTION.TD_CAPTURE && stm.MediaType == TAPIMEDIATYPES.AUDIO && playbackTerminal != null) { try { playbackTerminal.Start(); toolStripStatusLabel1.Text = "File Playback Terminal started "; } catch (TapiException ex) { MessageBox.Show(ex.Message); } } } }
private void OnMediaChange(object sender, TapiCallMediaEventArgs e) { if (e.Call.Privilege != CALL_PRIVILEGE.CP_OWNER) { return; } // Find out if this stream has a video render terminal. If not, // we don't need to do anything with this stream. Also note // if this is the video capture stream or the video render stream. if (e.Event == CALL_MEDIA_EVENT.CME_STREAM_ACTIVE) { TStream stm = e.Stream; if (stm != null && stm.MediaType == TAPIMEDIATYPES.VIDEO) { if (stm.Direction == TERMINAL_DIRECTION.TD_RENDER || stm.Direction == TERMINAL_DIRECTION.TD_CAPTURE) { DisplayVideoWindow(stm, stm.MediaType, stm.Direction); } } } }
/// <summary> /// Inno Setup <a href="https://jrsoftware.org/ishelp/index.php?topic=scriptclasses">Documentation</a> /// </summary> public void LoadFromStream(TStream stream) { }
/** * Sets the internal value with the value passed */ public override void SetAsStream(TStream Value) { streamValue = Value; }
private static TStream StreamContainer(Guid id) { if(!stdstream.ContainsKey(id) || stdstream[id] == null) { stdstream[id] = new TStream(); } return stdstream[id]; }
public void Test1() { byte[] byteArr = TStream.GetFileByteArr("F:\\华为手机备忘录.txt"); string text = TConvert.BytesToString(byteArr); }
/// <summary> /// Inno Setup <a href="https://jrsoftware.org/ishelp/index.php?topic=scriptclasses">Documentation</a> /// </summary> public void SaveToStream(TStream stream) { }
public void Test() { var buffer = TStream.GetFileByteArr(@"d:\¹ÅÊ«´ÊÃû¾ä¡¾¹Ù·½ÍƼö¡¿.scel"); string txt = TConvert.BytesToString(buffer, Encoding.Default); }
/** * Sets the internal value with the value passed */ public override void SetAsStream(TStream Value) { streamValue = Value; }