public static void ReSave(LongUzorData data, string path) { FileStream fsr = new FileStream(path, FileMode.Truncate); new BinaryFormatter().Serialize(fsr, data); fsr.Dispose(); }
public LongUzorDrawingObject(LongUzorData data) { this.Data = data; uzorPainter.Data = data.UzorElements[0]; sideUzorPainter.Data = data.SidePattern; calculateSizes(); }
public LongUzorItem(LongUzorData data, string path, MainPage p) { InitializeComponent(); this.Data = data; this.path = path; LongUzorView v = this.preview; v.Data = data; if (data.Name == null) { data.Name = ""; } this.itemName.Text = data.Name.Split("/".ToCharArray()).Last(); this.itemDate.Text = data.DataOfCreation.ToString(); /*this.mineFrame.BackgroundColor = new Color(data.Layers[0].BackColor.R, * data.Layers[0].BackColor.G, * data.Layers[0].BackColor.B);*/ //this.backgroungStartGradientColor.Color = new Color( data.BackColor.R, data.BackColor.G, data.BackColor.B, /*data.BackColor.A*/ 20); //this.backgroungStopGradientColor.Color = new Color(data.BackColor.R, data.BackColor.G, data.BackColor.B, 20); this.backGround.BackgroundColor = data.BackColor.ToNativeColor(); //new Color(data.BackColor.R, data.BackColor.G, data.BackColor.B, data.BackColor.A); if (data.BackColor.A > 180 && data.BackColor.ToXamarinFormsColor().GetBrightness() < 0.5f) { this.itemDate.TextColor = Color.White; this.itemName.TextColor = Color.White; } this.pageForAlert = p; }
public NameEditorView(LongUzorData data, Grid grid) { InitializeComponent(); this.grid = grid; grid.Children.Add(this); this.ldata = data; this.nameEntry.Text = data.Name == null ? "" : data.Name; }
public LongUzorItemPage(LongUzorData data, string path, MainPage p) { InitializeComponent(); this.path = path; this.pageForAlert = p; this.itemNameLabel.Text = data.Name; this.longUzorView.Data = data; }
const int currentPixelSize = 10; // using for size-calculation & bitmap drawing public ImageBufferSaveView(LongUzorData data) { this.longUzorData = data; InitializeComponent(); setDefaultPickerValue(); updateLongUzorBitmap(); this.bitmapPreviewViewFrame.Content = new BitmapPreviewView(bitmap); }
public ColorPickerView(LongUzorData data) { this.longUzorData = data; InitializeComponent(); this.frontColor = data.FrontColor.ToNativeColor(); this.backColor = data.BackColor.ToNativeColor(); this.picker.SelectedIndex = 0; setColorSliderValues(); updateView(); }
public void SaveSetting(UzorData data) { creatingPageGrid.Children.Remove(newUzorSettingView); var v = new UzorEditElementView(data, this.mainGrid); v.IsNewUzor = true; // only for set cropMask as standart figure v.PageForAlert = this.pageForAlert; //uzorDataList.Add(v.UzorView.ThisData); uzorEditElementViewList.Add(v); creatingPageGrid.Children.Add(v, 0, 1); if (newUzorSettingView.IsSquareUzorMode) { this.saveTopPanel = new UzorEditorSaveTopPanel(); saveTopPanel.SaveButton.Clicked += v.SaveButton_Click; saveTopPanel.BackButton.Clicked += BackButton_Clicked; creatingPageGrid.Children.Add(saveTopPanel, 0, 0); v.cropButton.IsVisible = false; v.cropButtonShadow.IsVisible = false; isSquareMode = true; //v.cropSlider.IsVisible = false; } else { this.stepsPanel = new UzorEditorStepsTopPanel(); this.longUzorData = new LongUzorData(); longUzorData.UzorElements = new UzorData[2] { data, null }; stepsPanel.NextButton.Clicked += NextButton_Clicked; stepsPanel.BeforeButton.Clicked += BeforeButton_Clicked; creatingPageGrid.Children.Add(stepsPanel, 0, 0); this.stepsPanel.StepLabel.Text = this.stepNumber + "/" + this.maxStepValue; } // gridCreatingPage.Children.Add(new NewUzorSetting(SaveSetting)); creatingPageGrid.RowDefinitions[0].Height = 60; if (Preferences.Get("TipViewShow", true)) { Device.StartTimer(TimeSpan.FromSeconds(1), () => { var t = new TipsViewer(this.mainGrid, !newUzorSettingView.IsSquareUzorMode); this.mainGrid.Children.Add(t); return(false); }); } }
public LongUzorEditorPage(LongUzorData data, MainPage p, bool isNewLongUzor = false) { InitializeComponent(); this.longUzorView.Data = data; this.pageForAlert = p; initializeDropMenus(); if (isNewLongUzor) { calculateLongUzorParameters(); } else { this.saveView.stackOfOkCancelButtons.IsVisible = true; this.saveView.stackOfSavingProjectButton.IsVisible = false; } setSlidersValue(); }
public static string SaveInInternalStorage(LongUzorData data) // returns the save path { return(saveObjectInInternalStorage(data, data.Name, ".lubf")); }
public LongUzorView(LongUzorData data) { InitializeComponent(); this.LongUzorGraphic.Data = data; bitmapInit(); }