public static string Presentation(string formula, FormulaParameter[] attributes, PresentationMode mode, object[][] values) { if (string.IsNullOrEmpty(formula)) { return string.Empty; } string result = string.Empty; Regex rxLetter = new Regex(@"[a-zA-Z]"); string letter = string.Empty; foreach (char ch in formula) { if (rxLetter.IsMatch(ch.ToString())) { letter += ch; } else { if (!string.IsNullOrEmpty(letter)) { result = result + GetValue(letter, attributes, values); letter = string.Empty; } result += ch; } } if (!string.IsNullOrEmpty(letter)) { result = result + GetValue(letter, attributes, values); } return result; }
public void PresentationMode(GameObject lesson) { if (SliceButtVisible) { ShowSliceButt(); } if (WayVisible) { Ways(currentWay); } PresentationMode present = lesson.GetComponent <PresentationMode>(); present.slide = slideTimer; present.WindOfChange(); sceneCube.SetActive(PresentationVisible); presentation.SetActive(!PresentationVisible); lesson.SetActive(!PresentationVisible); if (MenuVisible) { Clicked(); } sliceButt.SetActive(PresentationVisible); PresentationVisible = !PresentationVisible; _currentLesson = lesson; if (captionsVisible) { ShowCaption(); } if (lesson == present.rc) { present.TurnModel(); } }
public VariablePresentation() { Class = DefaultPresentationMode; Function = DefaultPresentationMode; Protected = DefaultPresentationMode; Special = DefaultPresentationMode; }
// Methods public PrintItem(ISelectPresentationsInformation selectPresentation, CultureInfo cultureInfo) { _rectangle = selectPresentation.DisplayRectangle; _mode = selectPresentation.PresentationMode; _presentationImage = selectPresentation.Image; _exportOption = DicomPrintSession.GetPresentationMode(_mode); _cultureInfo = cultureInfo; }
public void AnotherSlideLink(int link) { int link2 = link; int first = link2; while (link2 > 10) { first = (link2 /= 10) % 10; } switch (first) { case 1: AnotherSlideHelper(nr); break; case 2: AnotherSlideHelper(rp); break; case 3: AnotherSlideHelper(ap); break; case 4: AnotherSlideHelper(sn); break; case 5: AnotherSlideHelper(ms); break; case 6: AnotherSlideHelper(rc); break; case 7: AnotherSlideHelper(hm); break; } void AnotherSlideHelper(GameObject category) { category.SetActive(true); PresentationMode pm = category.GetComponent <PresentationMode>(); pm.slide = link - first * 100; pm.ShowButt(); pm.WindOfChange(); if (category != this1) { this1.SetActive(false); } pm.TurnModel(); } }
//-------------------------------------------------------------------------------------------------- #endregion public Layer() { _IsVisible = true; _IsLocked = false; _PresentationMode = PresentationMode.SolidWithBoundary; _Color = new Color("#c0c0c0"); _Transparency = 0; _LineStyle = LineStyle.Solid; _LineThickness = LineThickness.Normal; }
void ExecuteSwitchMode(PresentationMode mode) { var layer = DataContext as Layer; Debug.Assert(layer != null); if (layer.PresentationMode != mode) { layer.PresentationMode = mode; InteractiveContext.Current.WorkspaceController.Invalidate(); InteractiveContext.Current.Document.MarkAsUnsaved(); } }
private void Init() { _countries = new List <Country>(); _zoom = 6; _runAnimation = true; _mode = PresentationMode.POPULATION; InitResourcesFolder(); InitHtmlConst(); LoadFileCsv(); LoadFileHtml(); }
public void TogglePresentationMode() { if (mode == PresentationMode.Automatic) { CancelInvoke("getNextModel"); mode = PresentationMode.Manual; } else { InvokeRepeating("getNextModel", repeatRateSec, repeatRateSec); mode = PresentationMode.Automatic; } GetComponent <MyServer>().PresentationClientNotify(); }
internal static ExportOption GetPresentationMode(PresentationMode mode) { switch (mode) { case PresentationMode.Wysiwyg: return(ExportOption.Wysiwyg); case PresentationMode.CompleteImage: return(ExportOption.CompleteImage); case PresentationMode.TrueSize: return(ExportOption.TrueSize); } return(ExportOption.Wysiwyg); }
/// <summary> /// Dismisses the view model async. /// </summary> /// <returns>The view model async.</returns> /// <param name="presentationModel">Presentation model.</param> /// <param name="success">If set to <c>true</c> success.</param> public async Task DismissViewModelAsync(PresentationMode presentationMode, bool success) { if (presentationMode == PresentationMode.Default) { if (await _navigationPageStack.Peek().Page.Navigation.PopAsync() == null) { _navigationPageStack.Pop(); } } else if (presentationMode == PresentationMode.Modal) { await PopModalViewModelAsync(success); } else if (presentationMode == PresentationMode.Popup) { await PopCardViewModelAsync(); } }
private void DoImageProcess(object state) { FilmSize filmsize = DicomPrinter.Config.FilmBox.FilmSize.ToFilmSize(); int filmDpi = DicomPrinter.Config.StandardResolutionDPI; FilmOrientation filmOrientation = DicomPrinter.Config.FilmBox.FilmOrientation; PresentationMode presentationMode = DicomPrinter.Config.PresentationMode; ColorMode colorMode = this.DicomPrinter.Config.ColorMode; List <IPresentationImage> presentationImage = MergerDicomImageToBitmap.Merger(filmsize, filmDpi, filmOrientation, _selectPresentationsInformations, presentationMode, colorMode, _tileCount); _studyInstanceUid = new List <string>(); foreach (var selectPresentationsInformation in _selectPresentationsInformations) { IImageSopProvider image = (IImageSopProvider)selectPresentationsInformation.Image; if (image != null && !_studyInstanceUid.Contains(image.Sop.StudyInstanceUid)) { _studyInstanceUid.Add(image.Sop.StudyInstanceUid); } selectPresentationsInformation.Dispose(); } _selectPresentationsInformations.Clear(); foreach (var image in presentationImage) { var frame = ((IImageSopProvider)image).Frame; Rectangle client = new Rectangle(0, 0, frame.Columns, frame.Rows); _selectPresentationsInformations.Add(new SelectPresentionInformation(image, client)); } DicomPrinter.Config.FilmBox.ImageDisplayFormat = new PrinterImageDisplayFormat() { Value = @"STANDARD\1,1" }; }
public PresentationContext(T model, PresentationMode mode) { _model = model; _mode = mode; }
public static List <IPresentationImage> Merger(FilmSize filmSizeId, int filmDPI, FilmOrientation filmOrientation, List <ISelectPresentationsInformation> selects, PresentationMode presentationMode, ColorMode colorMode, int tileCount) { if (selects.Count == 0) { return(null); } List <IPresentationImage> results = new List <IPresentationImage>(); Size filmSize = CaclFilmAndImageSize.FilmBoxSize(filmSizeId, filmDPI, filmOrientation); if (filmSize == Size.Empty) { return(null); } Bitmap result = null; System.Drawing.Graphics graphics = null; string savePath = null; foreach (var temp in selects) { var imageSopProvider = temp.Image as IImageSopProvider; if (imageSopProvider == null) { continue; } var localSource = imageSopProvider.ImageSop.DataSource as ILocalSopDataSource; if (localSource != null) { int index = localSource.Filename.LastIndexOf("\\"); savePath = localSource.Filename.Substring(0, index); break; } } for (int i = 0; i < selects.Count; i++) { var select = selects[i]; if (i != 0 && i % tileCount == 0) //翻页时进入此处 { IPresentationImage presentationImage = CreateResultImage(result, colorMode, savePath); graphics.Dispose(); results.Add(presentationImage); result.Dispose(); result = null; } if (result == null) { result = new Bitmap(filmSize.Width, filmSize.Height); graphics = System.Drawing.Graphics.FromImage(result); } Point location; Size imageBoxSize = CaclFilmAndImageSize.ImageBoxSize(filmSize, out location, select.NormalizedRectangle); Bitmap bitmap = GetPrintImageBitmap(select, imageBoxSize, presentationMode); if (bitmap == null) { continue; } System.Drawing.Graphics borderGraphics = System.Drawing.Graphics.FromImage(bitmap); Platform.Log(LogLevel.Debug, new Size(bitmap.Width, bitmap.Height)); borderGraphics.DrawRectangle(new Pen(Color.White, 2), 0, 0, bitmap.Width, bitmap.Height); graphics.DrawImageUnscaled(bitmap, location.X, location.Y); bitmap.Dispose(); borderGraphics.Dispose(); } var image = CreateResultImage(result, colorMode, savePath); graphics.Dispose(); results.Add(image); result.Dispose(); return(results); }
private static Bitmap GetPrintImageBitmap(ISelectPresentationsInformation presentationsInformation, Size outputSize, PresentationMode presentationMode) { presentationsInformation.PresentationMode = presentationMode; var currentUiCulture = Thread.CurrentThread.CurrentUICulture; var printItem = new PrintItem(presentationsInformation, currentUiCulture); var exportImageItem = new PrintItem.ExportImageItem { printItem = printItem }; float scale = ScaleToFit(printItem.DisplayRectangle.Size, outputSize); var exportImageParams = new ExportImageParams(); exportImageParams.Dpi = 96; exportImageParams.SizeMode = SizeMode.ScaleToFit; exportImageParams.DisplayRectangle = new Rectangle(0, 0, (int)(outputSize.Width / scale), (int)(outputSize.Height / scale)); exportImageParams.OutputSize = outputSize; exportImageParams.ExportOption = ExportOption.Wysiwyg; exportImageItem.exportImageParams = exportImageParams; exportImageItem.bitmap = null; MemoryManager.Execute(exportImageItem.ExportImage); return(exportImageItem.bitmap); }
public static void SetPresentationMode(BindableObject obj, PresentationMode presentationMode) => obj.SetValue(PresentationModeProperty, presentationMode);
public virtual bool PresentRenderBuffer(nuint target, double presentationTime, PresentationMode mode) { switch (mode) { case PresentationMode.AtTime: return(_PresentRenderbufferAtTime(target, presentationTime)); case PresentationMode.AfterMinimumDuration: return(_PresentRenderbufferAfterMinimumDuration(target, presentationTime)); default: throw new ArgumentOutOfRangeException($"Unknown presentation mode: {mode}", nameof(mode)); } }
/// <summary> /// Dismisses the view model async. /// </summary> /// <returns>The view model async.</returns> /// <param name="viewModel">View model.</param> public Task DismissViewModelAsync(PresentationMode presentationMode) { return(DismissViewModelAsync(presentationMode, true)); }