private IBorder GetNewBorder(Cell source_cell, bool left, bool top, bool right, bool bottom) { IBorder border = source_cell.Border; IBorder newBorder = source_cell.Border; if (border is LineBorder) { LineBorder lineBorder = border as LineBorder; newBorder = new LineBorder(lineBorder.Color, lineBorder.Thickness, left, top, right, bottom); } else if (border is BevelBorder) { BevelBorder bevelBorder = border as BevelBorder; newBorder = new BevelBorder(bevelBorder.Type, bevelBorder.Highlight, bevelBorder.Shadow, bevelBorder.Thickness, left, top, right, bottom); } else if (border is ComplexBorder) { ComplexBorder complexBorder = border as ComplexBorder; } else if (border is CompoundBorder) { } else if (border is DoubleLineBorder) { } else if (border is RoundedLineBorder) { } return(newBorder); }
private void 背景颜色_Click(object sender, EventArgs e) { IBorder border = _host.LayoutRuntime.Layout.GetBorder(); border.BackColor = Color.Red; _host.Render(); }
internal static void UpdateMauiDrawable(this AView nativeView, IBorder border) { bool hasBorder = border.Shape != null && border.Stroke != null; if (!hasBorder) { return; } MauiDrawable?mauiDrawable = nativeView.Background as MauiDrawable; if (mauiDrawable == null) { mauiDrawable = new MauiDrawable(nativeView.Context); nativeView.Background = mauiDrawable; } mauiDrawable.SetBackground(border.Background); mauiDrawable.SetBorderBrush(border.Stroke); mauiDrawable.SetBorderWidth(border.StrokeThickness); mauiDrawable.SetBorderDash(border.StrokeDashPattern, border.StrokeDashOffset); mauiDrawable.SetBorderMiterLimit(border.StrokeMiterLimit); mauiDrawable.SetBorderLineJoin(border.StrokeLineJoin); mauiDrawable.SetBorderLineCap(border.StrokeLineCap); mauiDrawable.SetBorderShape(border.Shape); }
internal static void UpdateMauiCALayer(this UIView nativeView, IBorder border) { CALayer?backgroundLayer = nativeView.Layer as MauiCALayer; if (backgroundLayer == null) { backgroundLayer = nativeView.Layer?.Sublayers? .FirstOrDefault(x => x is MauiCALayer); if (backgroundLayer == null) { backgroundLayer = new MauiCALayer { Name = ViewExtensions.BackgroundLayerName }; nativeView.BackgroundColor = UIColor.Clear; nativeView.InsertBackgroundLayer(backgroundLayer, 0); } } if (backgroundLayer is MauiCALayer mauiCALayer) { mauiCALayer.SetBackground(border.Background); mauiCALayer.SetBorderBrush(border.Stroke); mauiCALayer.SetBorderWidth(border.StrokeThickness); mauiCALayer.SetBorderDash(border.StrokeDashPattern, border.StrokeDashOffset); mauiCALayer.SetBorderMiterLimit(border.StrokeMiterLimit); mauiCALayer.SetBorderLineJoin(border.StrokeLineJoin); mauiCALayer.SetBorderLineCap(border.StrokeLineCap); mauiCALayer.SetBorderShape(border.Shape); } }
public BorderPresenter(IInfrastructureFactory infrastructureFactory, IBorder border, IScreenSize screenSize) { _border = border; _view = infrastructureFactory.Cteate(Data.Enum.Infrastructure.Border) as ISceneBorderView; screenSize.ChangeSizeEvent += ChangeSizeEventHandler; ChangeSizeEventHandler(screenSize.Size); }
/// <summary> /// Occurs when this command is clicked /// </summary> public override void OnClick() { IActiveView pActiveView = (IActiveView)m_PageLayoutControl.PageLayout; IGraphicsContainer pGraphicsContainer = (IGraphicsContainer)pActiveView; IMap pMap = pActiveView.FocusMap; IMapFrame pMapFrame = (IMapFrame)pGraphicsContainer.FindFrame(pMap); IStyleSelector pStyleSelector = new BorderSelectorClass(); bool m_bOK; m_bOK = pStyleSelector.DoModal(m_PageLayoutControl.hWnd); if (!m_bOK) { return; } IBorder pBorder = (IBorder)pStyleSelector.GetStyle(0); pMapFrame.Border = pBorder; m_PageLayoutControl.Refresh(esriViewDrawPhase.esriViewBackground, null, null); }
private void btnBorderSelector_Click(object sender, EventArgs e) { try { frmSymbolSelector selector = new frmSymbolSelector(); if (selector != null) { selector.SetStyleGallery(this.istyleGallery_0); if (this.iborder_0 != null) { selector.SetSymbol(this.iborder_0); } else { selector.SetSymbol(new SymbolBorderClass()); } if (selector.ShowDialog() == DialogResult.OK) { this.iborder_0 = selector.GetSymbol() as IBorder; this.bool_0 = false; this.method_2(); IStyleGalleryItem styleGalleryItemAt = this.cboBorder.GetStyleGalleryItemAt(this.cboBorder.Items.Count - 1); if (styleGalleryItemAt != null) { if (styleGalleryItemAt.Name == "<定制>") { styleGalleryItemAt.Item = this.iborder_0; } else { styleGalleryItemAt = new MyStyleGalleryItem { Name = "<定制>", Item = this.iborder_0 }; this.cboBorder.Add(styleGalleryItemAt); this.cboBorder.SelectedIndex = this.cboBorder.Items.Count - 1; } } else { styleGalleryItemAt = new MyStyleGalleryItem { Name = "<定制>", Item = this.iborder_0 }; this.cboBorder.Add(styleGalleryItemAt); this.cboBorder.SelectedIndex = this.cboBorder.Items.Count - 1; } this.bool_0 = true; this.method_0(); } } } catch { } }
private string GenerateExcel(FilterViewModel FilterViewModel) { this.oWB = Factory.GetWorkbook(); this.OSHEET = this.oWB.Worksheets[0]; this.OSHEET.Name = "Report Filters"; this.OSHEET.Cells.WrapText = false; this.OSHEET.Cells.Font.Name = "Calibri"; this.OSHEET.Cells.Font.Size = 11; AddExcelRow(this.OSHEET, "Sr No.", 0, 0, true, false, HAlign.Left, false, true, true, false, 10, "", ""); AddExcelRow(this.OSHEET, "Project Name", 0, 1, true, false, HAlign.Center, false, true, true, false, 20, "", ""); AddExcelRow(this.OSHEET, "Prime Contractor", 0, 2, true, false, HAlign.Center, false, true, true, false, 15, "", ""); AddExcelRow(this.OSHEET, "Contract Number", 0, 3, true, false, HAlign.Center, false, true, true, false, 15, "", ""); AddExcelRow(this.OSHEET, "Task Order", 0, 4, true, false, HAlign.Center, false, true, true, false, 15, "", ""); AddExcelRow(this.OSHEET, "COR Name", 0, 5, true, false, HAlign.Center, false, true, true, false, 15, "", ""); AddExcelRow(this.OSHEET, "Traveler Name", 0, 6, true, false, HAlign.Center, false, true, true, false, 15, "", ""); AddExcelRow(this.OSHEET, "Traveler Cost", 0, 7, true, false, HAlign.Center, false, true, true, false, 15, "", ""); AddExcelRow(this.OSHEET, "From State/City", 0, 8, true, false, HAlign.Center, false, true, true, false, 25, "", ""); AddExcelRow(this.OSHEET, "To State/City", 0, 9, true, false, HAlign.Center, false, true, true, false, 25, "", ""); int rowIndex = 0; foreach (var item in FilterViewModel.lstTravelDetailModel) { rowIndex++; AddExcelRow(this.OSHEET, rowIndex.ToString(), rowIndex, 0, false, false, HAlign.Left, false, false, true, false, 0, "", ""); AddExcelRow(this.OSHEET, item.Summary_ProjectName, rowIndex, 1, false, false, HAlign.Left, false, false, true, false, 0, "", ""); AddExcelRow(this.OSHEET, item.Summary_PrimeContractor, rowIndex, 2, false, false, HAlign.Left, false, false, true, false, 0, "", ""); AddExcelRow(this.OSHEET, item.Summary_ContractNumber, rowIndex, 3, false, false, HAlign.Left, false, false, true, false, 0, "", ""); AddExcelRow(this.OSHEET, item.Summary_TaskOrder, rowIndex, 4, false, false, HAlign.Left, false, false, true, false, 0, "", ""); AddExcelRow(this.OSHEET, item.Summary_CorName, rowIndex, 5, false, false, HAlign.Left, false, false, true, false, 0, "", ""); AddExcelRow(this.OSHEET, item.Summary_TravelerName, rowIndex, 6, false, false, HAlign.Left, false, false, true, false, 0, "", ""); AddExcelRow(this.OSHEET, item.Cost_TotalExpense.ToString(), rowIndex, 7, false, false, HAlign.Left, false, false, true, false, 0, "", ""); AddExcelRow(this.OSHEET, item.TravelState1.Name + "/" + item.TravelCity.Name, rowIndex, 8, false, false, HAlign.Left, false, false, true, false, 0, "", ""); AddExcelRow(this.OSHEET, item.TravelState.Name + "/" + item.TravelCity1.Name, rowIndex, 9, false, false, HAlign.Left, false, false, true, false, 0, "", ""); } IRange range = this.OSHEET.Range[FilterViewModel.lstTravelDetailModel.Count(), 0, FilterViewModel.lstTravelDetailModel.Count(), 9]; IBorder border = range.Borders[SpreadsheetGear.BordersIndex.EdgeBottom]; border.LineStyle = SpreadsheetGear.LineStyle.Continous; border.Color = SpreadsheetGear.Drawing.Color.GetSpreadsheetGearColor(System.Drawing.Color.Black); border.Weight = SpreadsheetGear.BorderWeight.Thin; DownloadFileHelper.CreateFolder("ReportData", "Excel"); //delete old files DownloadFileHelper.DeleteOldExcelFiles(ExcelExportTypeEnum.ReportFilters); //delete old files //DownloadFileHelper.DeleteOldFiles(); string path = System.Web.HttpContext.Current.Server.MapPath("~\\ReportData\\Excel"); string timestamp = Guid.NewGuid().ToString(); string fileName = "ReportFilters_" + timestamp + ".xlsx"; string output = path + "\\" + fileName; this.oWB.SaveAs(output, SpreadsheetGear.FileFormat.OpenXMLWorkbook); string filePath = output; return(fileName); }
private BorderInformation GetBorderInformation(IBorder border) { return new BorderInformation { BorderStyle = border.LineStyle, Thickness = border.Weight }; }
/// <summary> /// Set Border in excel file /// </summary> /// <param name="range"></param> /// <param name="index"></param> private void SetBorder(IRange range, BordersIndex index) { IBorder border = range.Borders[index]; border.LineStyle = SpreadsheetGear.LineStyle.Continous; border.Color = SpreadsheetGear.Drawing.Color.GetSpreadsheetGearColor(System.Drawing.Color.Black); border.Weight = SpreadsheetGear.BorderWeight.Thin; }
/// <summary> /// Restart the border events /// </summary> /// <param name="border"></param> private void RestartBorderEvents(IBorder border) { if (border != null) { border.LocationChanged += OnLocationOfBorderChanged; border.SizeChanged += OnSizeBorderChanged; } }
Task ValidateHasColor(IBorder border, Color color, Action action = null) { return(InvokeOnMainThreadAsync(() => { var nativeBorder = GetNativeBorder(CreateHandler(border)); action?.Invoke(); nativeBorder.AssertContainsColor(color); })); }
public static void UpdateBackground(this ContentView nativeView, IBorder border) { bool hasBorder = border.Shape != null && border.Stroke != null; if (hasBorder) { nativeView.UpdateMauiCALayer(border); } }
public void Bind(IBorder border) { if (null != border) { BorderCtrl.Bind(border); DashStyle = border.DashStyle; BorderColor = border.BorderColor; ColorCmb.SelectedItem = border.BorderColor; } }
public static void UpdateStrokeDashPattern(this ContentPanel nativeView, IBorder border) { var strokeDashPattern = border.StrokeDashPattern; if (strokeDashPattern == null) { return; } nativeView.UpdateStrokeDashPattern(strokeDashPattern); }
public static void UpdateStrokeShape(this ContentPanel nativeView, IBorder border) { var shape = border.Shape; if (shape == null) { return; } nativeView.UpdateBorderShape(shape); }
public static void UpdateStroke(this ContentPanel nativeView, IBorder border) { var stroke = border.Stroke; if (stroke == null) { return; } nativeView.UpdateStroke(stroke); }
public static void UpdateStroke(this UIView nativeView, IBorder border) { var borderBrush = border.Stroke; CALayer?backgroundLayer = nativeView.Layer as MauiCALayer; if (backgroundLayer == null && borderBrush.IsNullOrEmpty()) { return; } nativeView.UpdateMauiCALayer(border); }
public GameScene(ISnake snake, IDrawManager drawManager, IFoodFactory foodFactory, IBorder border, IScoreBoard scoreBoard, IScene pauseScene, IScene gameOverScene) { this.snake = snake; this.drawManager = drawManager; this.foodFactory = foodFactory; this.border = border; this.scoreBoard = scoreBoard; this.pauseScene = pauseScene; this.gameOverScene = gameOverScene; this.spawnedFood = null; this.GameSpeed = GameMinSpeed; }
public static void UpdateStrokeShape(this UIView nativeView, IBorder border) { var borderShape = border.Shape; CALayer?backgroundLayer = nativeView.Layer as MauiCALayer; if (backgroundLayer == null && borderShape == null) { return; } nativeView.UpdateMauiCALayer(border); }
public static void UpdateStroke(this AView nativeView, IBorder border) { var stroke = border.Stroke; MauiDrawable?background = nativeView.Background as MauiDrawable; if (background == null && stroke.IsNullOrEmpty()) { return; } nativeView.UpdateMauiDrawable(border); }
public static void UpdateStrokeLineCap(this AView nativeView, IBorder border) { MauiDrawable?background = nativeView.Background as MauiDrawable; bool hasBorder = border.Shape != null && border.Stroke != null; if (background == null && !hasBorder) { return; } nativeView.UpdateMauiDrawable(border); }
public static void UpdateStrokeLineCap(this AView nativeView, IBorder border) { MauiDrawable?mauiDrawable = nativeView.Background as MauiDrawable; bool hasBorder = border.Shape != null && border.Stroke != null; if (mauiDrawable == null && !hasBorder) { return; } mauiDrawable?.SetBorderLineCap(border.StrokeLineCap); }
public static void UpdateStrokeShape(this AView nativeView, IBorder border) { var borderShape = border.Shape; MauiDrawable?mauiDrawable = nativeView.Background as MauiDrawable; if (mauiDrawable == null && borderShape == null) { return; } nativeView.UpdateMauiDrawable(border); }
public static void UpdateStrokeLineCap(this UIView nativeView, IBorder border) { CALayer?backgroundLayer = nativeView.Layer as MauiCALayer; bool hasBorder = border.Shape != null && border.Stroke != null; if (backgroundLayer == null && !hasBorder) { return; } nativeView.UpdateMauiCALayer(border); }
public static void UpdateBackground(this ContentPanel nativeView, IBorder border) { var hasBorder = border.Shape != null && border.Stroke != null; if (hasBorder) { nativeView?.UpdateBorderBackground(border); } else { nativeView?.UpdateNativeViewBackground(border); } }
public static void UpdateStrokeLineJoin(this ContentPanel nativeView, IBorder border) { bool hasBorder = border.Shape != null && border.Stroke != null; if (!hasBorder) { return; } var strokeLineJoin = border.StrokeLineJoin; nativeView.UpdateStrokeLineJoin(strokeLineJoin); }
public static void UpdateStrokeDashOffset(this AView nativeView, IBorder border) { MauiDrawable?mauiDrawable = nativeView.Background as MauiDrawable; bool hasBorder = border.Shape != null && border.Stroke != null; if (mauiDrawable == null && !hasBorder) { return; } mauiDrawable?.SetBorderDash(border.StrokeDashPattern, border.StrokeDashOffset); }
private void TryAdjustRelativeLocation(IBorder border, SizeF newSize) { float preX = border.Location.X + border.Size.Width; float preY = border.Location.Y + border.Size.Height; foreach (IElement ele in _elements) { if (ele is ISizableElement) { TryComputeElementLocation(ele as ISizableElement, preX, preY, newSize); } } }
public void Bind(IBorder border) { if (null == border) { return; } _hasLeft = border.HasLeftBorder; _hasRight = border.HasRightBorder; _hasBottom = border.HasBottomBorder; _hasTop = border.HasTopBorder; _borderColor = border.BorderColor; _dashStyle = border.DashStyle; }
public virtual void NextStep(IEnumerable<IParticle> _particles, IBorder _border) { GetNearests(_particles); Interract(); int? check = _border.Check(this); if (check!=null) { _border.Interract(this, (int) check); } else { m_CoordinatesNew = m_Coordinates + m_Speed; } }
private IBorder GetDefaultBorder() { // Setup initial conditions. if (defaultBorder != null) return defaultBorder; // Create and wire up events. defaultBorder = new BorderModel { Color = transparent }; defaultBorderObserver = new PropertyObserver<IBorder>(defaultBorder) .RegisterHandler(m => m.CornerRadius, m => OnBorderCornerRadiusChanged()); // Finish up. return defaultBorder; }
public ParticleBox(IParticleFactory2D _factory, int _count, IDrawer _draw, IBorder _border) { Particles = _factory.PopulateRandomDistributed(_count); Drawer = _draw; Border = _border; }