private static OrderLine addOrderLine(LineViewModel l) { var o = new OrderLine(); l.Update(o); return(o); }
public ActionResult AddWork(long id, string part = "") { string strm; try { strm = _conntext.VUMM_HH_OPEN_CALLS.Find(id).STRM_CODE; } catch { strm = _conntext.VUMM_HH_HNDL_CALLS.Find(id).STRM_CODE; } SelectList partsList = FindWorkPart(strm); LineViewModel vm = new LineViewModel { doc_nbr = id, part_code_name = part, qnty = 1, WParts = partsList, //part_code = part_code }; return(View(vm)); }
private List <ILogViewModel> CreateLogsResult(TopDocs topDocs) { var result = new List <ILogViewModel>(); foreach (var scoreDoc in topDocs.ScoreDocs) { var document = GetDocument(scoreDoc); switch (document.Get(LogField.LOG_TYPE)) { case "Line": result.Add(LineViewModel.Get(this, document)); break; case "CloseGroup": result.Add(CloseGroupViewModel.Get(this, document)); break; case "OpenGroup": result.Add(OpenGroupViewModel.Get(this, document)); break; default: throw new ArgumentException(nameof(document)); } } return(result); }
private static TaxOnLine addTaxLine(LineViewModel l) { var o = new TaxOnLine(); l.Update(o); return(o); }
private static ChargeLine addChargeLine(LineViewModel l) { var o = new ChargeLine(); l.Update(o); return(o); }
public LineMonitor() { InitializeComponent(); LineModel = new LineViewModel(); this.DataContext = LineModel; Closing += MainWindowClosing; }
public LineViewModel MapToViewModel(Line model) { LineViewModel viewModel = new LineViewModel(); PropertyCopier <Line, LineViewModel> .Copy(model, viewModel); return(viewModel); }
public Line MapToModel(LineViewModel viewModel) { Line model = new Line(); PropertyCopier <LineViewModel, Line> .Copy(viewModel, model); return(model); }
public LineViewModel GetEmptyData() { LineViewModel Data = new LineViewModel(); Data.Name = ""; Data.Code = ""; return(Data); }
public ActionResult List() { LineViewModel model = new LineViewModel(); model.Sites = _siteService.GetAll("").ToArray(); model.Plants = this._plantService.GetPlantsForSite(model.Sites.Select(s => s.Id).FirstOrDefault()); //_plantService.GetAll("", 0).ToArray(); return(View(model)); }
private void WriteEnableLine(LineViewModel model) { var message = string.Join( " ", "set InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.1.Line.1.Enable", "Enabled"); this.WriteMessage(message); }
public void Setup() { var mockClipboard = new Mock <IClipboardService>(); var mockTimer = new Mock <ITimerService>(); var mockBackgroundWorkerService = new Mock <IBackgroundWorkerService>(); codeEditor = new CodeEditorViewModel(mockClipboard.Object, mockTimer.Object, mockBackgroundWorkerService.Object); viewModel = new LineViewModel(codeEditor, 1); }
public ActionResult Line(int sportId, int leagueId, int eventId) { IPinnacleApi pinnacle = new PinnacleApi(_token); LineModel line = pinnacle.GetLineForEvent(sportId, leagueId, eventId); LineViewModel lineVm = _mapper.Map <LineViewModel>(line); return(View(lineVm)); }
public void Phase0(LineViewModel line) { var iv = LayoutRoot; ImageContent.Opacity = 0; ImageContent.Height = double.NaN; CommentIndicator.Opacity = 0; ProgressBar.Opacity = 0; TextContent.Opacity = 1; if (ImageContent.Source != null) { var bitmap = ImageContent.Source as BitmapImage; bitmap.DownloadProgress -= Image_DownloadProgress; ImageContent.ClearValue(Image.SourceProperty); } if (line.IsImage) { if (!AppGlobal.ShouldAutoLoadImage) { TextContent.Text = ImageTapToLoadPlaceholder; } else { TextContent.Text = ImageLoadingTextPlaceholder; } double aspect = line.ImageWidth <= 0? .0 : (double)line.ImageHeight / (double)line.ImageWidth; double ih = iv.Width * aspect; if (ih > 1.0) { ImageContent.Height = ih; ImagePlaceHolder.Height = ih; } else { ImagePlaceHolder.Height = double.NaN; } ProgressBar.Visibility = Visibility.Visible; ImageContent.Visibility = Visibility.Visible; ImagePlaceHolder.Visibility = Visibility.Visible; TextContent.TextAlignment = TextAlignment.Center; } else { TextContent.Text = " " + line.Content; //textContent.Height = double.NaN; TextContent.TextAlignment = TextAlignment.Left; ImagePlaceHolder.Visibility = Visibility.Collapsed; ImageContent.Visibility = Visibility.Collapsed; ImageContent.DataContext = null; } }
private void WriteAuthPassword(LineViewModel model, int index) { var message = string.Format( "set InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.1.Line.{0}.SIP.AuthPassword {1}", index, model.AuthPassword); this.WriteMessage(message); }
private void WriteRegUserName(LineViewModel model, int index) { var message = string.Format( "set InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.1.Line.{0}.SIP.RegUserName {1}", index, model.RegUserName); this.WriteMessage(message); }
private void SendVoiceProfileModelLine(LineViewModel model, int index) { this.WriteAddLine(model); this.WriteRegUserName(model, index); this.WriteAuthUserName(model, index); this.WriteAuthPassword(model, index); this.WriteEnableLine(model); }
public void Phase1(LineViewModel line) { CommentIndicator.Opacity = line.HasComments ? 1 : 0; if (line.IsImage) { ProgressBar.Value = 0; ProgressBar.Opacity = 1; } }
private async Task CompleteCode(WindowViewModel windowvm, LineViewModel linevm) { var completions = await services.CompleteCodeAsync(linevm.Id, linevm.Document.Text, linevm.CaretOffset); if (completions.Any()) { windowvm.IsIntellisenseWindowOpen = true; linevm.TriggerIntellisense(completions, () => windowvm.IsIntellisenseWindowOpen = false); } }
public void OnMouseWheel(LineViewModel lineViewModel, UIElement uiElement, MouseWheelEventArgs e) { if (lineViewModel.Line.Owner.ViewModel != null) { lineViewModel.Line.Owner.ViewModel.OnMouseWheel(uiElement, e); } else { lineViewModel.Line.Owner.Root.ItemsCanvas.Zoom(e); } }
private LineViewModel GetLine1Model() { var line1Model = new LineViewModel { RegUserName = this.txtLine1RegUserName.Text, AuthUserName = this.txtLine1AuthUserName.Text, AuthPassword = this.txtLine1AuthPassword.Text }; return(line1Model); }
public ActionResult Line(int?did) { CheckCr(); var viewModel = new LineViewModel(); viewModel.Discussions = db.Discussions; ViewBag.DiscLId = did; List <Line> fil; fil = db.Lines.Where(f => f.Disc.DiscId == did).ToList(); viewModel.Lines = fil; return(View(viewModel)); }
public void Select(LineViewModel clickedLine) { if (clickedLine == selectedItem) { // User clicked om selected line Deselect(); return; } Deselect(); selectedItem = clickedLine; selectedItem.IsSelected = true; }
public void CreateGraph() { GraphViewModel vm = new GraphViewModel(); double r = Math.Sqrt(Math.Pow(MyGraphControl.ActualHeight, 1.8) + Math.Pow(MyGraphControl.ActualWidth, 1.8)) / 20; for (int i = 0; i < 10; ++i) { double arc = Math.PI / 5 * i; double x = MyGraphControl.ActualWidth / 2 + (MyGraphControl.ActualWidth / 2 - r / 2) * Math.Cos(arc); double y = MyGraphControl.ActualHeight / 2 + (MyGraphControl.ActualHeight / 2 - r / 2) * Math.Sin(arc); vm.Nodes.Add(new CircleViewModel() { X = x, Y = y, Radius = r, Color = new SolidColorBrush(Colors.Yellow) }); } for (int y = 0; y < 10; ++y) { for (int x = 0; x < 10; ++x) { if (model.HasConnection(x, y) == false) { continue; } double arc1 = Math.PI / 5 * y; double arc2 = Math.PI / 5 * x; double x1 = MyGraphControl.ActualWidth / 2 + (MyGraphControl.ActualWidth / 2 - r / 2) * Math.Cos(arc1); double y1 = MyGraphControl.ActualHeight / 2 + (MyGraphControl.ActualHeight / 2 - r / 2) * Math.Sin(arc1); double x2 = MyGraphControl.ActualWidth / 2 + (MyGraphControl.ActualWidth / 2 - r / 2) * Math.Cos(arc2); double y2 = MyGraphControl.ActualHeight / 2 + (MyGraphControl.ActualHeight / 2 - r / 2) * Math.Sin(arc2); LineViewModel lineVM = new LineViewModel() { X1 = x1, Y1 = y1, X2 = x2, Y2 = y2 }; vm.Connections.Add(lineVM); } } MyGraphControl.VM = vm; }
private void createWeight(LineViewModel lineVM) { if (VM.ShowWeights) { var dialog = new SelectWeightWindow(); dialog.Weight = Graph.getWeight(lineVM.StartNode, lineVM.EndNode); dialog.ShowDialog(); int node1 = lineVM.StartNode; int node2 = lineVM.EndNode; int weight = dialog.Weight; Graph.setWeight(node1, node2, weight); Graph.OnChange(); } }
protected override object GetUpdateDialogView() { if (ViewModel is LinesViewModel viewModel && viewModel.SelectedModel != null) { var lineVm = new LineViewModel() { Id = viewModel.SelectedModel.Id, Name = viewModel.SelectedModel.Name }; return(new LineDialog("Изменить", lineVm)); } return(null); }
private void LoadItemIllustation(Grid iv, LineViewModel line) { var bitMap = new BitmapImage(line.ImageUri); var imageContent = iv.FindName("ImageContent") as Image; imageContent.DataContext = line; var imagePlaceHolder = iv.FindName("ImagePlaceHolder") as Windows.UI.Xaml.Shapes.Path; var progressIndicator = iv.FindName("ProgressBar") as ProgressBar; bitMap.SetValue(BitmapLoadingIndicatorProperty, progressIndicator); bitMap.DownloadProgress += Image_DownloadProgress; imageContent.ImageOpened += imageContent_ImageOpened; imageContent.ImageFailed += ImageContent_Failed; imageContent.Source = bitMap; }
public async Task <IActionResult> Line(int ID) { ModelLine line = await _modelLineService.GetAsync(p => p.Id == ID); Description description = await _descriptionService.GetAsync(p => p.LineId == ID); ViewBag.Documents = FileUtil.GetLibraryFileNames(line.Name); LineViewModel lvm = new LineViewModel { Line = line, Description = description }; return(View(lvm)); }
private static Guid?MoveToNextLine(WindowViewModel windowvm, LineViewModel linevm) { int currentIndex = windowvm.Entries.IndexOf(linevm); LineViewModel newLine = null; if (currentIndex == windowvm.Entries.Count - 1) { newLine = new LineViewModel(); windowvm.Entries.Add(newLine); } windowvm.FocusIndex = currentIndex + 1; return(newLine?.Id); }
public async Task HandleKeyDown(WindowViewModel windowvm, LineViewModel linevm, KeyEventArgs e) { if (windowvm.IsIntellisenseWindowOpen) { return; } int previousHistoryPointer = ResetHistoryCyclePointer(windowvm); if (KeyboardShortcuts.MapToCommand(e) is ReplCommand command) { e.Handled = true; // tricky! we're in an async void event handler. WPF will see this value // first, as the event handler will complete before our task is does. e.Handled = await HandleCommand(windowvm, linevm, command, previousHistoryPointer); } }
public CommandAddLine(LineViewModel line, ObservableCollection<LineViewModel> lines) { this.lines = lines; this.line = line; }