private async Task DeleteRow(Ship ship) { // ---------------- // Blazor Grid Demo: // IF ship in data_store (local) THEN // remove from data_store (local) -- ex. dbContext.Remove<T>)(t) // persist changes to underlying data_store -- ex. dbContext.SaveChanges() // DataGrid.Reload(); //ELSE // DataGrid.CancelEditRow(ship); Status("start"); var x = await DialogService.Confirm("Are you sure you want to delete this record?", "Confirm Delete", new ConfirmOptions() { OkButtonText = "Yes", CancelButtonText = "Cancel" }); if (x.HasValue && x.Value) { CurrentRecordState = RecordState.Deleted; SaveChanges(ship); await DataGrid.Reload(); } Status("end"); }
private void startRecording() { try { if (_einsatz == null) { return; } //Record Device _recordWaveStream = new WaveInEvent { DeviceNumber = 0, WaveFormat = new WaveFormat(44100, 16, 2) }; _recordWaveStream.DataAvailable += recordDevice_DataAvailable; _recordWaveStream.RecordingStopped += recordDevice_RecordingStopped; _recordWaveStream.StartRecording(); _recordMp3Writer = new LameMP3FileWriter(_einsatz.RecordPath, _recordWaveStream.WaveFormat, 32); _recordState = RecordState.Recording; Logger.WriteDebug(MethodBase.GetCurrentMethod(), $"recordDevice -> Started({_einsatz.RecordPath})"); } catch (Exception) { ExceptionOccured.RaiseEvent(this, new ExceptionEventArgs { Methode = MethodBase.GetCurrentMethod(), Message = "recordDevice -> error on start" }); } }
public void ForceUpdateState(int recId) { RecordState = RecordState.Unchanged; IsOnServer = true; RecordId = recId; //Todo: update 'Record ID#' field if it exists }
private object GetNestedObjectValue(object result) { if (result != DBNull.Value) { RecordState newSource = result as RecordState; if (newSource != null) { if (newSource.IsNull) { result = (object)DBNull.Value; } else { BridgeDataRecord bridgeDataRecord = new BridgeDataRecord(this._shaper, this.Depth + 1); bridgeDataRecord.SetRecordSource(newSource, true); result = (object)bridgeDataRecord; this._currentNestedRecord = bridgeDataRecord; this._currentNestedReader = (BridgeDataReader)null; } } else { Coordinator <RecordState> coordinator = result as Coordinator <RecordState>; if (coordinator != null) { BridgeDataReader bridgeDataReader = new BridgeDataReader(this._shaper, coordinator.TypedCoordinatorFactory, this.Depth + 1, (IEnumerator <KeyValuePair <Shaper <RecordState>, CoordinatorFactory <RecordState> > >)null); result = (object)bridgeDataReader; this._currentNestedRecord = (BridgeDataRecord)null; this._currentNestedReader = bridgeDataReader; } } } return(result); }
public void UpdateInfo(ChanState info) { Extension = info.Extension; AgentID = info.AgentID; LoginState = info.LoginState; CallState = info.CallState; RecordState = info.RecordState; RecordReference = info.RecordReference; DirectionFlag = info.DirectionFlag; CallerID = info.CallerID; CalledID = info.CalledID; StartRecordTime = info.StartRecordTime; StopRecordTime = info.StopRecordTime; RecordLength = info.RecordLength; StrLoginState = LoginState.ToString(); StrCallState = CallState.ToString(); StrRecordState = RecordState.ToString(); StrDirection = DirectionFlag.ToString(); StrStartRecordTime = StartRecordTime.ToString("yyyy-MM-dd HH:mm:ss"); StrStopRecordTime = StopRecordTime.ToString("yyyy-MM-dd HH:mm:ss"); StrRecordLength = RecordLength.ToString(); Info = info; }
private void LateUpdate() { if (!_recording) { return; } switch (_recordState) { case RecordState.CamToRenderTexture: CamToRenderTexture(); break; case RecordState.TextureToTexture: RenderTextureToTexture(); break; case RecordState.TextureToBytes: TextureToBytes(); break; case RecordState.Break: _recordState = RecordState.CamToRenderTexture; break; } }
private void FillRecord(XElement recordNode) { IsOnServer = true; var colIndex = 0; foreach (XElement fieldNode in recordNode.Elements("f")) { if (fieldNode.HasElements && fieldNode.Element("url") != null) { XElement childNode = fieldNode.Descendants().First(); FieldLoad(colIndex, childNode.Value); } else { FieldLoad(colIndex, fieldNode.Value); } if (fieldNode.Attribute("id").Value.Equals("3")) { RecordId = int.Parse(fieldNode.Value); } colIndex++; } RecordState = RecordState.Unchanged; }
protected virtual void Start() { recordState = RecordState.Idle; if (fps <= 0f) { m_TimePerFrame = 0.0f; } else { m_TimePerFrame = 1.0f / fps; } // int i = 0, imax = m_Transforms.Length; recordObjects = new RecordObject[imax]; for (; i < imax; ++i) { recordObjects[i] = new RecordObject(this, m_Transforms[i]); } // if (!string.IsNullOrEmpty(fileName)) { #if UNITY_EDITOR Load(fileName); #endif } }
private void stopRecording() { try { Logger.WriteDebug(MethodBase.GetCurrentMethod(), "recordDevice -> StopRecording"); if (_recordWaveStream != null) { _recordState = RecordState.RequestedStop; _recordWaveStream.StopRecording(); } else { Logger.WriteDebug(MethodBase.GetCurrentMethod(), "recordDevice -> already disposed"); recordDevice_RecordingStopped(this, null); } } catch (Exception ex) { ExceptionOccured.RaiseEvent(this, new ExceptionEventArgs { Methode = MethodBase.GetCurrentMethod(), Error = ex }); recordDevice_RecordingStopped(this, null); } }
private void SetExistingField(int index, int fieldIndex, object value) { if (Columns[index].ColumnType == FieldType.file) { string fileName = (string)value; this._fields[fieldIndex].Value = Path.GetFileName(fileName); this._fields[fieldIndex].FullName = fileName; if (RecordState != RecordState.New) { RecordState = RecordState.Modified; } } else { if (this._fields[fieldIndex].Value == null || !this._fields[fieldIndex].Value.Equals(value)) { this._fields[fieldIndex].Value = value; if (RecordState != RecordState.New) { RecordState = RecordState.Modified; } } } UncleanState = this._fields.Any(f => f.UncleanText == true); }
private void FillRecord(XPathNavigator recordNode) { IsOnServer = true; var fieldNodes = recordNode.Select("f"); var colIndex = 0; foreach (XPathNavigator fieldNode in fieldNodes) { if (fieldNode.HasChildren && fieldNode.MoveToChild("url", String.Empty)) { fieldNode.MoveToFirst(); FieldLoad(colIndex, fieldNode.TypedValue as string); } else { FieldLoad(colIndex, fieldNode.TypedValue as string); } if (fieldNode.GetAttribute("id", String.Empty).Equals("3")) { RecordId = fieldNode.ValueAsInt; } colIndex++; } RecordState = RecordState.Unchanged; }
private void SetShaper(Shaper <RecordState> shaper, CoordinatorFactory <RecordState> coordinatorFactory, int depth) { Shaper = shaper; CoordinatorFactory = coordinatorFactory; DataRecord = new BridgeDataRecord(shaper, depth); // To determine whether there are any rows for this coordinator at this place in // the root enumerator, we pretty much just look at it's current record (we'll read // one if there isn't one waiting) and if it matches our coordinator, we've got rows. _hasRows = false; if (!Shaper.DataWaiting) { Shaper.DataWaiting = Shaper.RootEnumerator.MoveNext(); } if (Shaper.DataWaiting) { RecordState currentRecord = Shaper.RootEnumerator.Current; if (null != currentRecord) { _hasRows = (currentRecord.CoordinatorFactory == CoordinatorFactory); } } // Once we've created the root enumerator, we can get the default record state DefaultRecordState = coordinatorFactory.GetDefaultRecordState(Shaper); Debug.Assert(null != DefaultRecordState, "no default?"); }
IEnumerator RecordCountdown() { float interval = 3.0f; while (interval > 0.5f) { //lower interval interval -= 0.5f; //wait for 0.5 seconds yield return(new WaitForSeconds(0.5f)); //set timer text to interval TimerCountdownText.color = countdown; TimerCountdownText.text = interval.ToString() + "s"; //if the interval drops below 0.5 continue if (interval <= 0.5f) { TimerCountdownText.text = "Recording"; exerciseConvertedBodies = new List <ConvertedBody>(); //exerciseRecordingFrames = new List<ExerciseFrame>(); state = RecordState.KinectRecording; yield return(new WaitForSeconds(0.5f)); TimerCountdownText.text = ""; } } }
public void RecordStateComparer_ByVersion_1() { RecordState first = new RecordState { Id = 1, Mfn = 123, Status = RecordStatus.Last, Version = 5 }; RecordState second = new RecordState { Id = 2, Mfn = 123, Status = RecordStatus.LogicallyDeleted, Version = 5 }; IEqualityComparer <RecordState> comparer = new RecordStateComparer.ByVersion(); Assert.IsTrue(comparer.Equals(first, second)); Assert.AreEqual(comparer.GetHashCode(first), comparer.GetHashCode(second)); second.Mfn = 124; Assert.IsFalse(comparer.Equals(first, second)); Assert.AreNotEqual(comparer.GetHashCode(first), comparer.GetHashCode(second)); second.Mfn = 123; second.Version = 6; Assert.IsFalse(comparer.Equals(first, second)); Assert.AreNotEqual(comparer.GetHashCode(first), comparer.GetHashCode(second)); }
private RecordState WriteRecordState(long rowNumber, RecordState state) { lock (recordList) { if (HasShutdown) { throw new IOException("IO operation while shutting down."); } // Find the record entry input the block list. var blockArea = recordList.GetRecord(rowNumber); var pos = blockArea.Position; // Get the status. var oldStatus = (RecordState)blockArea.ReadInt32(); // Write the new status try { Store.Lock(); blockArea.Position = pos; blockArea.Write((int)state); blockArea.Flush(); } finally { Store.Unlock(); } return(oldStatus); } }
private void recordDevice_RecordingStopped(object sender, StoppedEventArgs e) { try { Logger.WriteDebug(MethodBase.GetCurrentMethod(), "recordDevice -> Stopped"); if (_einsatz != null) { //Raise Event EinsatzFinished.RaiseEvent(this, new EinsatzFinishedEventArgs(_einsatz)); //Reset Einsatz _einsatz = null; Logger.WriteDebug(MethodBase.GetCurrentMethod(), "Reset einsatz -> finish"); } _recordMp3Writer?.Dispose(); _recordWaveStream?.Dispose(); } catch (Exception ex) { ExceptionOccured.RaiseEvent(this, new ExceptionEventArgs { Methode = MethodBase.GetCurrentMethod(), Error = ex }); } finally { _recordState = RecordState.Stopped; _recordWaveStream = null; _recordMp3Writer = null; } }
public _HwgrToWgr(HwgrToWgr entity) { _entity = entity; if (!_entity.IsNew) { _state = RecordState.UnModified; } }
public void StartRecord(MotionClip motionClip) { this._motionClip = motionClip; recordState = RecordState.RECORDING; _startTime = Time.time; _timer = 0f; Debug.Log("録画開始。"); }
private void RenderTextureToTexture() { RenderTexture.active = _renderTexture; _texture.ReadPixels(_rect, 0, 0); RenderTexture.active = null; _recordState = RecordState.TextureToBytes; }
void EditRow(Ship ship) { // --------------------------------------- // Blazor Grid Demo: grid.EditRow(context); Status("start"); CurrentRecordState = RecordState.Modified; DataGrid.EditRow(ship); Status("end"); }
public void RecordState_Serialization_1() { RecordState state = new RecordState(); _TestSerialization(state); state = _GetState(); _TestSerialization(state); }
internal void SetRecordSource(RecordState newSource, bool hasData) { this._source = !hasData ? (RecordState)null : newSource; this._status = BridgeDataRecord.Status.Open; this._lastColumnRead = -1; this._lastDataOffsetRead = -1L; this._lastOrdinalCheckedForNull = -1; this._lastValueCheckedForNull = (object)null; }
public void RecordState_Construction_1() { RecordState state = new RecordState(); Assert.AreEqual(0, state.Id); Assert.AreEqual(0, state.Mfn); Assert.AreEqual(0, (int)state.Status); Assert.AreEqual(0, state.Version); }
public void RecordState_ToString_1() { RecordState state = new RecordState(); Assert.AreEqual("0:0:0", state.ToString()); state = _GetState(); Assert.AreEqual("234:32:345", state.ToString()); }
public void RecordState_ToJson_1() { RecordState state = new RecordState(); Assert.AreEqual("{}", JsonUtility.SerializeShort(state)); state = _GetState(); Assert.AreEqual("{'mfn':234,'status':32,'version':345}", JsonUtility.SerializeShort(state)); }
public void RecordState_ToXml_1() { RecordState state = new RecordState(); Assert.AreEqual("<record />", XmlUtility.SerializeShort(state)); state = _GetState(); Assert.AreEqual("<record mfn=\"234\" status=\"Last\" version=\"345\" />", XmlUtility.SerializeShort(state)); }
public void TestMethod2() { //test Record State RecordState currState = new RecordState(); PlayState wrongState = new PlayState(); var result = currState.Handle(VHSContext.Events.StopClicked, new TapeInState()); Assert.AreNotEqual(wrongState, result); }
public void OnBtnStopReplay() { frame = 0; timer.Reset(); timer.Stop(); state = RecordState.KinectDisplaying; RecordView(); }
public void RecordState_ParseServerAnswer_1() { string line = "0 161608#0 0#1 101#"; RecordState state = RecordState.ParseServerAnswer(line); Assert.AreEqual(0, state.Id); Assert.AreEqual(161608, state.Mfn); Assert.AreEqual(0, (int)state.Status); Assert.AreEqual(1, state.Version); }
private void DoRecordStateChanged(string alarmID, RecordState state) { try { if (OnRecordStateChanged != null) OnRecordStateChanged(alarmID, state); } catch { } }
public void Start() { if (rcstate == RecordState.Record) { System.Windows.Forms.MessageBox.Show("Es wird bereits aufgenommen!"); return; } writer = null; writer = new WaveFileWriter(Directory.GetCurrentDirectory() + @"\" + DateTime.Now.ToString("dd-MM-yyyy-hh-mm-ss") + ".wav", wavein.WaveFormat); wavein.StartRecording(); rcstate = RecordState.Record; }
public void ForceUpdateState() { RecordState = RecordState.Unchanged; IsOnServer = true; }
/// <summary> /// 記錄操作控制 /// </summary> /// <param name="MachineMaintainInfo"></param> void RecordControl(MaintainRecordView MachineMaintainInfo) { try { switch (m_RecordState) { case RecordState.Creat: m_AbstractMachineMaintain.MaintainRecordCreate(MachineMaintainInfo); break; case RecordState.Modify: m_AbstractMachineMaintain.MaintainRecordModify(MachineMaintainInfo); break; case RecordState.Delete: m_AbstractMachineMaintain.MaintainRecordDelete(MachineMaintainInfo); break; case RecordState.Begin: m_AbstractMachineMaintain.MaintainRecordBegin(MachineMaintainInfo); break; case RecordState.End: m_AbstractMachineMaintain.MaintainRecordEnd(MachineMaintainInfo); break; default: break; } m_RecordState = RecordState.None; } catch (Exception ex) { ShowErrorMessage(ex); } }
private void btnStart_Click(object sender, EventArgs e) { if (!ShowQuestionMessage("是否開始該保養?")) { return; } m_RecordState = RecordState.Begin; MaintainRecordView recordInfo = GetSelectMaintainRecordView(); RecordControl(recordInfo); Gvbing(); }
private void btnEnd_Click(object sender, EventArgs e) { if (!ShowQuestionMessage("是否結束該保養?")) { return; } m_RecordState = RecordState.End; for (int index = 0; index < this.m_frmMaintenanceSituationBase.DataGridViewMantenanceRecords.Rows.Count; index++) { if (this.m_frmMaintenanceSituationBase.DataGridViewMantenanceRecords.Rows[index].Selected) { MaintainRecordView recordInfo = this.m_frmMaintenanceSituationBase.DataGridViewMantenanceRecords.Rows[index].DataBoundItem as MaintainRecordView; RecordControl(recordInfo); } } Gvbing(); }
public void Stopp() { if (rcstate == RecordState.Idle) { System.Windows.Forms.MessageBox.Show("Es wird aktuell nichts aufgenommen!"); return; } wavein.StopRecording(); writer.Close(); rcstate = RecordState.Idle; }
private void btnAdd_Click(object sender, EventArgs e) { m_RecordState = RecordState.Creat; this.SetFormControlState(FormState.Add); this._infoState = FormState.Add; }
private void SetExistingField(int index, int fieldIndex, object value) { if (Columns[index].ColumnType == FieldType.file) { string fileName = (string) value; _fields[fieldIndex].Value = Path.GetFileName(fileName); _fields[fieldIndex].FullName = fileName; if (RecordState != RecordState.New) { RecordState = RecordState.Modified; } } else { if (_fields[fieldIndex].Value == null || !_fields[fieldIndex].Value.Equals(value)) { _fields[fieldIndex].Value = value; if (RecordState != RecordState.New) { RecordState = RecordState.Modified; } } } }
void BeginShift() { if (state != RecordState.Started) { state = RecordState.Started; startTime = DateTime.Now; SendMessage("Logging Initialized @: " + startTime); if (activeLogging) { MovementTimer timer = new MovementTimer(this); lastMousePosition = Cursor.Position; } } else SendMessage("Error: Logging Already in Progress!"); }
void EndShift() { if (state == RecordState.Started) { state = RecordState.Stopped; endTime = DateTime.Now; totalTime += endTime - startTime; intervals.Add(startTime, endTime); SendMessage("Logging Complete @: " + endTime); CreateNewLog(true); TextDisplay.SelectionStart = TextDisplay.Text.Length; TextDisplay.ScrollToCaret(); Time.Text = totalTime.ToString("hh' : 'mm' : 'ss"); if (MovementTimer.Ticker != null) { MovementTimer.Ticker.Stop(); MovementTimer.Ticker.Dispose(); } } }
public void EnableSendCipher(ICryptoTransform encryptor, HMAC sendHMAC) { _encryptor = encryptor; _sendHMAC = sendHMAC; if (_recordType == RecordState.PlainText) _recordType = RecordState.CipherTextSendOnly; else _recordType = RecordState.CipherText; }
public void AcceptChanges() { var fieldsToPost = new List<IField>(); if(RecordState == RecordState.Modified) { foreach (var field in _fields) { if (field.Column.ColumnLookup) continue; //don't try to update values that are results of lookups if (field.Update) { IField qField = new Field(field.FieldId, field.Type, field.QBValue); if(field.Type == FieldType.file) { qField.File = field.FullName; } fieldsToPost.Add(qField); field.Update = false; } } var editRecord = new EditRecord.Builder(Application.Client.Ticket, Application.Token, Application.Client.AccountDomain, Table.TableId, RecordId, fieldsToPost).Build(); editRecord.Post(); RecordState = RecordState.Unchanged; } else if(RecordState == RecordState.New) { foreach (var field in _fields) { if (field.Column.ColumnLookup) continue; //don't try to update values that are results of lookups IField qField = new Field(field.FieldId, field.Type, field.QBValue); if (field.Type == FieldType.file) { qField.File = field.FullName; } fieldsToPost.Add(qField); } var addRecord = new AddRecord.Builder(Application.Client.Ticket, Application.Token, Application.Client.AccountDomain, Table.TableId, fieldsToPost).Build(); RecordState = RecordState.Unchanged; var xml = addRecord.Post().CreateNavigator(); RecordId = int.Parse(xml.SelectSingleNode("/qdbapi/rid").Value); RecordState = RecordState.Unchanged; IsOnServer = true; } }
private void btnCancel_Click(object sender, EventArgs e) { m_RecordState = RecordState.None; this.SetFormControlState(FormState.ReadOnly); }
private void btnDelete_Click(object sender, EventArgs e) { AlertForm alert = new AlertForm(); alert.MessageBoxButtons = MessageBoxButtons.YesNo; alert.Message = "是否刪除該保養?"; if (alert.ShowDialog() == DialogResult.Yes) { MaintainRecordView record = this.GetSelectMaintainRecordView(); m_RecordState = RecordState.Delete; ReturnValueInfo returnValue = this.m_AbstractMachineMaintain.MaintainRecordDelete(record); if (returnValue != null) { if (!returnValue.boolValue) { this.ShowWarningMessage(returnValue.messageText); } } } }
private void btnEdit_Click(object sender, EventArgs e) { m_RecordState = RecordState.Modify; this.SetFormControlState(FormState.Edit); _infoState = FormState.Edit; MaintainRecordView recordInfo = GetSelectMaintainRecordView(); try { this.ShowRecordInfo(recordInfo); } catch (Exception ex) { ShowErrorMessage(ex); } }
public void EnableReceiveCipher(ICryptoTransform decryptor, HMAC recvHMAC) { _decryptor = decryptor; _recvHMAC = recvHMAC; if (_recordType == RecordState.PlainText) _recordType = RecordState.CipherTextReceiveOnly; else _recordType = RecordState.CipherText; }
/// <summary> /// Loads the specified binary reader. /// </summary> /// <param name="br">The binary reader.</param> public virtual void Load(BinaryReader br) { FullPath = br.ReadString(); State = (RecordState)br.ReadByte(); }
/// <summary> /// Used to search UGC /// Returns a paged results /// </summary> /// <param name="recordTypeName"></param> /// <param name="searchString"></param> /// <returns></returns> public static PagedResult Search(string recordTypeName, string searchString, RecordState searchState = RecordState.Published, int recordCount = 10, int recordOffset = 0) { PagedResult results = new PagedResult(); try { using (Agility_UGC_API_WCFClient client = UGCAPIUtil.APIClient) { DataServiceAuthorization auth = UGCAPIUtil.GetDataServiceAuthorization(-1); RecordSearchArg arg = new RecordSearchArg() { RecordTypeName = recordTypeName, Search = searchString, State = searchState, PageSize = recordCount, RecordOffset = recordOffset }; //fetch results results = client.SearchRecords(auth, arg); } } catch (Exception ex) { Utilities.LogEvent(string.Format(ex.Message)); } return results; }