protected override void InitLines() { ArrayList temp = new ArrayList(); ArrayList title = new ArrayList(); byte lineNum = ReadByte(); while (lineNum != 0) { if (flagAnswers == 1 && lineNum == 200) { countAnswers = ReadByte(); for (byte i = 0; i < countAnswers; i++) { TitleEntry line = new TitleEntry(); line.number = ReadByte(); line.text = ReadPascalString(); title.Add(line); } } else { LineEntry line = new LineEntry(); line.number = lineNum; line.text = ReadPascalString(); temp.Add(line); } lineNum = ReadByte(); } lines = (LineEntry[])temp.ToArray(typeof(LineEntry)); if (flagAnswers > 0) titles = (TitleEntry[])title.ToArray(typeof(TitleEntry)); }
private void SetBorder(LineEntry view) { if (view.HasBorder == false) { var shape = new ShapeDrawable(new RectShape()); shape.Paint.Alpha = 0; shape.Paint.SetStyle(Paint.Style.Stroke); Control.SetBackgroundDrawable(shape); } else { Control.SetBackground(originalBackground); } }
protected virtual void InitLines() { ArrayList temp = new ArrayList(); byte lineNum = ReadByte(); while (lineNum != 0) { LineEntry line = new LineEntry(); line.number = lineNum; line.text = ReadPascalString(); temp.Add(line); lineNum = ReadByte(); } lines = (LineEntry[])temp.ToArray(typeof (LineEntry)); }
protected virtual void InitLines() { ArrayList temp = new ArrayList(); byte lineNum = ReadByte(); while (lineNum != 0) { LineEntry line = new LineEntry(); line.number = lineNum; line.text = ReadPascalString(); temp.Add(line); lineNum = ReadByte(); } lines = (LineEntry[])temp.ToArray(typeof(LineEntry)); }
public static void SpawnLine( Vector3 pos1, Vector3 pos2, Color color, float seconds = 1f, float delay = 0f ) { LineEntry entry = new LineEntry(); entry.pos1 = pos1; entry.pos2 = pos2; entry.color = color; entry.startTime = Game.time + (double)delay; entry.endTime = entry.startTime + (double)seconds; DebugDrawers.lineEntries.Add(entry); }
public override void GetPacketDataString(TextWriter text, bool flagsDescription) { text.Write("\n\tisTitle:{0} caption: \"{1}\" isGlued:0x{2:X2}", flagAnswers, caption, isGlued); for (int i = 0; i < lines.Length; i++) { LineEntry line = (LineEntry)lines[i]; text.Write("\n\t{0,2}: \"{1}\"", line.number, line.text); } if (flagAnswers > 0) { text.Write("\n\tcountAnswers:{0}", countAnswers); for (int i = 0; i < countAnswers; i++) { TitleEntry line = (TitleEntry)titles[i]; text.Write("\n\t{0,2}: \"{1}\"", line.number, line.text); } } }
/// <summary> /// Adds a line to be printed to the printer. Lines are printed /// in the order that they are added. /// </summary> /// <param name="line">The string of text to be printed.</param> /// <param name="align">The alignment of the text to be /// printed.</param> /// <param name="font">The font to use for printing this line.</param> /// <returns>The line number of the text.</returns> public int AddLine(string line, StringAlignment align, Font font) { LineEntry entry = new LineEntry(); entry.Text = line; entry.Alignment = align; if (font != null) { entry.Font = font; } else { entry.Font = m_defaultFont; } entry.Height = 0F; entry.IsPageBreak = false; return(m_lines.Add(entry)); }
/// <summary> /// Adds a line of text to the console. If there isn't enough room to push /// the new line at the end, previous lines are popped from the beginning /// to make space. /// </summary> public void AddLine(string text) { LineEntry entry = new LineEntry(); entry.text = text; entry.height = (int)consoleFont.MeasureString(text).Y; lock (lockObject) { currentConsoleHeight += entry.height; while (currentConsoleHeight > bounds.Height && outputText.Count > 0) { currentConsoleHeight -= outputText[0].height; outputText.RemoveAt(0); } outputText.Add(entry); } // print to the IDE as well. Debug.WriteLine(text); }
private bool checkLine(LineEntry lineEntry, string[] filterStrings, bool ignoreCase) { foreach (string filterString in filterStrings) { if (!ignoreCase) { if (lineEntry.Time.Contains(filterString.Trim()) || lineEntry.Type.Contains(filterString.Trim()) || lineEntry.Detail.Contains(filterString.Trim())) { return(true); } } else { string upperFilterString = filterString.Trim().ToUpper(); if (lineEntry.Time.ToUpper().Contains(upperFilterString) || lineEntry.Type.ToUpper().Contains(upperFilterString) || lineEntry.Detail.ToUpper().Contains(upperFilterString)) { return(true); } } } return(false); }
protected override void InitLines() { ArrayList temp = new ArrayList(); ArrayList title = new ArrayList(); byte lineNum = ReadByte(); while (lineNum != 0) { if (flagAnswers == 1 && lineNum == 200) { lineNum = ReadByte(); countAnswers = ReadByte(); for (byte i = 0; i < countAnswers; i++) { TitleEntry line = new TitleEntry(); line.number = ReadByte(); line.text = ReadPascalString(); title.Add(line); } } else { LineEntry line = new LineEntry(); line.number = lineNum; line.text = ReadPascalString(); temp.Add(line); } lineNum = ReadByte(); } lines = (LineEntry[])temp.ToArray(typeof(LineEntry)); if (flagAnswers > 0) { titles = (TitleEntry[])title.ToArray(typeof(TitleEntry)); } }
private void ShowCommonLines(Graphics g, TangraConfig.SpectraViewDisplaySettings displaySettings) { SpectraCalibrator calibrator = m_SpectroscopyController.GetSpectraCalibrator(); SizeF measuredLabel = g.MeasureString("H", displaySettings.LegendFont); float verticalSpacing = measuredLabel.Height * 1.3f; for (int i = 0; i < SpectraLineLibrary.CommonLines.Count; i++) { LineEntry line = SpectraLineLibrary.CommonLines[i]; float x2 = 0; if (line.IsWideArea) { int pixelNo = calibrator.ResolvePixelNo(line.FromWavelength); float x1 = GetMouseXFromSpectraPixel(pixelNo); pixelNo = calibrator.ResolvePixelNo(line.ToWavelength); x2 = GetMouseXFromSpectraPixel(pixelNo); g.FillRectangle(displaySettings.KnownLineBrush, x1, i * verticalSpacing + 2 * BORDER_GAP, x2 - x1, m_View.Height - i * verticalSpacing - 2 * BORDER_GAP - Y_AXIS_WIDTH); g.FillRectangle(displaySettings.KnownLineBrush, x1, m_View.Height - 10, x2 - x1, m_View.Height); } else { int pixelNo = calibrator.ResolvePixelNo(line.FromWavelength); x2 = GetMouseXFromSpectraPixel(pixelNo); g.DrawLine(displaySettings.KnownLinePen, x2, i * verticalSpacing + 2 * BORDER_GAP, x2, m_View.Height - Y_AXIS_WIDTH); g.DrawLine(displaySettings.KnownLinePen, x2, m_View.Height - 10, x2, m_View.Height); } g.DrawString(line.Designation != null ? string.Format("{0} ({1})", line.Element, line.Designation) : line.Element, displaySettings.LegendFont, displaySettings.KnownLineLabelBrush, x2 + 3, i * verticalSpacing + 2 * BORDER_GAP); } }
// Called by Game public static void OnDrawGizmos() { if (Application.isPlaying == false) { return; } if (DebugDrawers.lineEntries == null) { DebugDrawers.lineEntries = new List <LineEntry>(); } // Remove any line entries that are done. double currentTime = Game.time; for (int n = DebugDrawers.lineEntries.Count; n-- > 0;) { LineEntry entry = DebugDrawers.lineEntries[n]; if (currentTime > entry.endTime) { DebugDrawers.lineEntries.RemoveAt(n); } } // Draw each entry. foreach (LineEntry entry in DebugDrawers.lineEntries) { if (entry.startTime > currentTime) { continue; } Gizmos.color = entry.color; Gizmos.DrawLine(entry.pos1, entry.pos2); } }
private void popup() { double Altezza = (GetAltezzaPagina() * 30) / 100; double Larghezza = GetLarghezzaPagina() - 80; double banner = 50; var Round = new RoundedCornerView //coso che stonda { RoundedCornerRadius = 20, HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.Center, HeightRequest = Altezza, WidthRequest = Larghezza, }; var stackFondoAndroid = new StackLayout() //per android { HeightRequest = banner, WidthRequest = Larghezza, BackgroundColor = GetPrimaryAndroidColor(), Orientation = StackOrientation.Horizontal, }; var stackFondoiOS = new StackLayout() //per ios { HeightRequest = banner, WidthRequest = Larghezza, BackgroundColor = Color.Orange, Orientation = StackOrientation.Horizontal, }; var fondomerende = new Label //Label per Il titolo banner { Text = "Fondo merende", HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.CenterAndExpand, FontSize = 20, FontAttributes = FontAttributes.Bold, TextColor = Color.White, }; codiceAndroid = new LineEntry { Placeholder = "Codice univoco", WidthRequest = 250, Margin = new Thickness(0, 5, 0, 0), IsVisible = true, VerticalOptions = LayoutOptions.StartAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, HorizontalTextAlignment = TextAlignment.Center, }; codiceiOS = new LineEntry { Placeholder = "Codice univoco", WidthRequest = 250, FontSize = 18, HeightRequest = 35, VerticalOptions = LayoutOptions.StartAndExpand, IsVisible = true, HorizontalOptions = LayoutOptions.CenterAndExpand, HorizontalTextAlignment = TextAlignment.Center, }; var stackBody = new StackLayout //stack principale dove è contenuto l'interno di tutto (tranne round che stonda) { HeightRequest = Altezza, WidthRequest = Larghezza, BackgroundColor = Color.White, }; var stackBottoni = new StackLayout //stack che contiene la gridlia dei bottoni { VerticalOptions = LayoutOptions.EndAndExpand, WidthRequest = Larghezza, HeightRequest = banner, MinimumHeightRequest = banner, }; var griglia = new Grid //griglia che contiene i bottoni { }; var buttonCancel = new Button { Text = "Annulla", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, BackgroundColor = Color.Transparent, }; var buttonConfirm = new Button { Text = "Conferma", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, BackgroundColor = Color.Transparent, }; stackBottoni.Children.Add(griglia); griglia.Children.Add((buttonCancel)); //inzia nella prima colonna griglia.Children.Add((buttonConfirm)); //inizia seconda colonna Grid.SetColumn(buttonCancel, 0); //mi è toccato farlo qui Grid.SetColumn(buttonConfirm, 1); switch (Device.RuntimePlatform) { case Device.Android: stackFondoAndroid.Children.Add(fondomerende); stackBody.Children.Add(stackFondoAndroid); buttonCancel.Clicked += Discard_Clicked; buttonConfirm.Clicked += Apply_Clicked; stackBody.Children.Add(codiceAndroid); stackBody.Children.Add(stackBottoni); Round.Children.Add(stackBody); break; case Device.iOS: stackFondoiOS.Children.Add(fondomerende); stackBody.Children.Add(stackFondoiOS); buttonCancel.Clicked += Discard_Clicked; buttonConfirm.Clicked += Apply_Clicked; stackBody.Children.Add(codiceiOS); stackBody.Children.Add(stackBottoni); Round.Children.Add(stackBody); break; } // entry.TextChanged += Entrata; PopupCodice.Content = Round; }
private DataSet ViewInvoice(string SellerGSTN, string FromDt, String Todate) { Seller seller = new Seller(); seller.Reciever = new Reciever(); seller.Consignee = new Consignee(); int p = 0; int m = 0; DataTable dt = new DataTable(); string strInvoiceNo = string.Empty; #region INVOICE_TYPE switch (strInvoiceType) { case "B2BInvoice": Invoice b2bInvoice = InvoiceFactory.CreateInvoice(InvoiceType.B2BInvoice); seller.Invoice = b2bInvoice; break; case "AmendedB2BInvoice": Invoice AmendedB2BInvoice = InvoiceFactory.CreateInvoice(InvoiceType.AmendedB2BInvoice); seller.Invoice = AmendedB2BInvoice; break; case "B2CLargeInvoice": Invoice B2CLargeInvoice = InvoiceFactory.CreateInvoice(InvoiceType.B2CLargeInvoice); seller.Invoice = B2CLargeInvoice; break; case "AmendedB2CLargeInvoice": Invoice AmendedB2CLargeInvoice = InvoiceFactory.CreateInvoice(InvoiceType.AmendedB2CLargeInvoice); seller.Invoice = AmendedB2CLargeInvoice; break; case "B2BCreditNotesInvoice": Invoice B2BCreditNotesInvoice = InvoiceFactory.CreateInvoice(InvoiceType.B2BCreditNotesInvoice); seller.Invoice = B2BCreditNotesInvoice; break; case "B2BDebitNotesInvoice": Invoice B2BDebitNotesInvoice = InvoiceFactory.CreateInvoice(InvoiceType.B2BDebitNotesInvoice); seller.Invoice = B2BDebitNotesInvoice; break; case "AmendedB2BCreditNotesInvoice": Invoice AmendedB2BCreditNotesInvoice = InvoiceFactory.CreateInvoice(InvoiceType.AmendedB2BCreditNotesInvoice); seller.Invoice = AmendedB2BCreditNotesInvoice; break; case "AmendedB2BDebitNotesInvoice": Invoice AmendedB2BDebitNotesInvoice = InvoiceFactory.CreateInvoice(InvoiceType.AmendedB2BDebitNotesInvoice); seller.Invoice = AmendedB2BDebitNotesInvoice; break; case "B2BExportInvoice": Invoice B2BExportInvoice = InvoiceFactory.CreateInvoice(InvoiceType.B2BExportInvoice); seller.Invoice = B2BExportInvoice; break; case "AmendedB2BExportInvoice": Invoice AmendedB2BExportInvoice = InvoiceFactory.CreateInvoice(InvoiceType.AmendedB2BExportInvoice); seller.Invoice = AmendedB2BExportInvoice; break; } #endregion seller.Invoice.LineEntry = new List <LineEntry>(); LineEntry line; DataSet ds = new DataSet(); ds = seller.Invoice.ViewInvoice(SellerGSTN, FromDt, Todate); seller.SellerDaTa = new List <Seller>(); if (ds.Tables.Count > 0) { #region B2B if (ds.Tables.Contains("SellerDtls")) { if (ds.Tables["SellerDtls"].Rows.Count > 0) { int j = ds.Tables[0].Rows.Count; for (int i = 0; i <= j - 1; i++) { seller.SellerInvoice = (ds.Tables[0].Rows[i]["InvoiceNo"]).ToString(); seller.DateOfInvoice = (ds.Tables[0].Rows[i]["Invoicedate"]).ToString(); seller.GSTIN = (ds.Tables[0].Rows[i]["SellerGSTN"]).ToString(); seller.NameAsOnGST = (ds.Tables[0].Rows[i]["SellerName"]).ToString(); seller.Reciever.GSTIN = (ds.Tables[0].Rows[i]["ReceiverGSTN"]).ToString(); seller.Reciever.NameAsOnGST = (ds.Tables[0].Rows[i]["ReceiverName"]).ToString(); seller.Consignee.GSTIN = (ds.Tables[0].Rows[i]["ConsigneeGSTN"]).ToString(); seller.Consignee.NameAsOnGST = (ds.Tables[0].Rows[i]["ConsigneeName"]).ToString(); seller.Address = (ds.Tables[0].Rows[i]["SellerAddress"]).ToString(); seller.SellerStateCode = (ds.Tables[0].Rows[i]["SellerStateCode"]).ToString(); seller.SellerStateName = (ds.Tables[0].Rows[i]["SellerStateName"]).ToString(); seller.SellerStateCodeID = (ds.Tables[0].Rows[i]["SellerStateCodeID"]).ToString(); seller.Reciever.StateCode = (ds.Tables[0].Rows[i]["ReceiverStateCode"]).ToString(); seller.Consignee.StateCode = (ds.Tables[0].Rows[i]["ConsigneeStateCode"]).ToString(); seller.Invoice.Freight = Convert.ToInt32(ds.Tables[0].Rows[i]["Freight"]); seller.Invoice.Insurance = Convert.ToInt32(ds.Tables[0].Rows[i]["Insurance"]); seller.Invoice.PackingAndForwadingCharges = Convert.ToInt32(ds.Tables[0].Rows[i]["PackingAndForwadingCharges"]); seller.SellerGrossTurnOver = Convert.ToDecimal(ds.Tables[0].Rows[i]["SellerGrossTurnOver"]); seller.SellerFinancialPeriod = (ds.Tables[0].Rows[i]["SellerFinancialPeriod"]).ToString(); seller.Reciever.FinancialPeriod = (ds.Tables[0].Rows[i]["ReceiverFinancialPeriod"]).ToString(); seller.Reciever.StateName = (ds.Tables[0].Rows[i]["ReceiverStateName"]).ToString(); seller.Consignee.StateName = (ds.Tables[0].Rows[i]["ConsigneeStateName"]).ToString(); //if (((ds.Tables[0].Rows[i]["IsElectronicReferenceNoGenerated"]).ToString()) == "True") //{ // seller.IsElectronicReferenceNoGenerated = true; //} //else //{ // seller.IsElectronicReferenceNoGenerated = false; //} //seller.ElectronicReferenceNoGenerated = (ds.Tables[0].Rows[i]["ElectronicReferenceNoGenerated"]).ToString(); //seller.ElectronicReferenceNoGeneratedDate = (ds.Tables[0].Rows[i]["ElectronicReferenceNoGeneratedDate"]).ToString(); seller.Invoice.IsAdvancePaymentChecked = false; seller.Invoice.IsExportChecked = false; int n = ds.Tables[1].Rows.Count; for (m = p; m <= n - 1; m++) { if ((ds.Tables[0].Rows[i]["InvoiceNo"]).ToString() == (ds.Tables[1].Rows[m]["InvoiceNo"]).ToString()) { line = new LineEntry(); line.HSN = new com.B2B.GST.GSTInvoices.HSN(); //InvoiceNo Invoicedate SellerGSTN ReceiverGSTN InvoiceSeed LineID Description HSN Qty Unit Rate Total Discount //TaxableValue AmountWithTax IGSTRate IGSTAmt CGSTRate CGSTAmt SGSTRate SGSTAmt TotalQty TotalRate TotalAmount TotalDiscount //TotalTaxableAmount TotalCGSTAmount TotalSGSTAmount TotalIGSTAmount TotalAmountWithTax GrandTotalAmount GrandTotalAmountInWord isHSNNilRated //isHSNExempted isHSNZeroRated isHSNNonGSTGoods isSACNilRated isSACEcxempted isSACZeroRated isSACNonGSTService IsNotifedGoods IsNotifiedSAC //IsElectronicReferenceNoGenerated IsInter SellerStateCode SellerStateName ReceiverStateCode ReceiverStateName ConsigneeStateCode ConsigneeStateName line.LineID = Convert.ToInt32(ds.Tables[1].Rows[m]["LineID"]); line.HSN.Description = (ds.Tables[1].Rows[m]["Description"]).ToString(); line.HSN.HSNNumber = (ds.Tables[1].Rows[m]["HSN"]).ToString(); line.Qty = Convert.ToDecimal(ds.Tables[1].Rows[m]["Qty"]); line.HSN.UnitOfMeasurement = (ds.Tables[1].Rows[m]["Unit"]).ToString(); line.PerUnitRate = Convert.ToDecimal(ds.Tables[1].Rows[m]["Rate"]); line.TotalLineIDWise = Convert.ToDecimal(ds.Tables[1].Rows[m]["Total"]); line.Discount = Convert.ToDecimal(ds.Tables[1].Rows[m]["Discount"]); line.TaxValue = Convert.ToDecimal(ds.Tables[1].Rows[m]["TaxableValue"]); line.AmountWithTax = Convert.ToDecimal(ds.Tables[1].Rows[m]["AmountWithTax"]); line.HSN.RateIGST = Convert.ToDecimal(ds.Tables[1].Rows[m]["IGSTRate"]); line.AmtIGSTLineIDWise = Convert.ToDecimal(ds.Tables[1].Rows[m]["IGSTAmt"]); line.HSN.RateCGST = Convert.ToDecimal(ds.Tables[1].Rows[m]["CGSTRate"]); line.AmtCGSTLineIDWise = Convert.ToDecimal(ds.Tables[1].Rows[m]["CGSTAmt"]); line.HSN.RateSGST = Convert.ToDecimal(ds.Tables[1].Rows[m]["SGSTRate"]); line.AmtSGSTLineIDWise = Convert.ToDecimal(ds.Tables[1].Rows[m]["SGSTAmt"]); line.HSN.Cess = Convert.ToDecimal(ds.Tables[1].Rows[m]["Cess"]); seller.TotalQty = Convert.ToDecimal(ds.Tables[1].Rows[m]["TotalQty"]); seller.TotalRate = Convert.ToDecimal(ds.Tables[1].Rows[m]["TotalRate"]); seller.TotalAmount = Convert.ToDecimal(ds.Tables[1].Rows[m]["TotalAmount"]); seller.TotalDiscount = Convert.ToDecimal(ds.Tables[1].Rows[m]["TotalDiscount"]); seller.TotalTaxableAmount = Convert.ToDecimal(ds.Tables[1].Rows[m]["TotalTaxableAmount"]); seller.TotalCGSTAmount = Convert.ToDecimal(ds.Tables[1].Rows[m]["TotalCGSTAmount"]); seller.TotalSGSTAmount = Convert.ToDecimal(ds.Tables[1].Rows[m]["TotalSGSTAmount"]); seller.TotalIGSTAmount = Convert.ToDecimal(ds.Tables[1].Rows[m]["TotalIGSTAmount"]); seller.TotalAmountWithTax = Convert.ToDecimal(ds.Tables[1].Rows[m]["TotalAmountWithTax"]); seller.GrandTotalAmount = Convert.ToDecimal(ds.Tables[1].Rows[m]["GrandTotalAmount"]); seller.GrandTotalAmountInWord = Convert.ToString(ds.Tables[1].Rows[m]["GrandTotalAmountInWord"]); if (((ds.Tables[1].Rows[m]["IsInter"]).ToString()) == "True") { line.IsInter = true; } else { line.IsInter = false; } seller.Invoice.LineEntry.Add(line); p = 1 + p; } else { break; } } seller.SellerDaTa.Add(seller); Session["SellerDaTa"] = seller.SellerDaTa; seller = new Seller(); seller.Reciever = new Reciever(); seller.Consignee = new Consignee(); seller.SellerDaTa = new List <Seller>(); #region INVOICE_TYPE switch (strInvoiceType) { case "B2BInvoice": Invoice b2bInvoice = InvoiceFactory.CreateInvoice(InvoiceType.B2BInvoice); seller.Invoice = b2bInvoice; break; case "AmendedB2BInvoice": Invoice AmendedB2BInvoice = InvoiceFactory.CreateInvoice(InvoiceType.AmendedB2BInvoice); seller.Invoice = AmendedB2BInvoice; break; case "B2CLargeInvoice": Invoice B2CLargeInvoice = InvoiceFactory.CreateInvoice(InvoiceType.B2CLargeInvoice); seller.Invoice = B2CLargeInvoice; break; case "AmendedB2CLargeInvoice": Invoice AmendedB2CLargeInvoice = InvoiceFactory.CreateInvoice(InvoiceType.AmendedB2CLargeInvoice); seller.Invoice = AmendedB2CLargeInvoice; break; case "B2BCreditNotesInvoice": Invoice B2BCreditNotesInvoice = InvoiceFactory.CreateInvoice(InvoiceType.B2BCreditNotesInvoice); seller.Invoice = B2BCreditNotesInvoice; break; case "B2BDebitNotesInvoice": Invoice B2BDebitNotesInvoice = InvoiceFactory.CreateInvoice(InvoiceType.B2BDebitNotesInvoice); seller.Invoice = B2BDebitNotesInvoice; break; case "AmendedB2BCreditNotesInvoice": Invoice AmendedB2BCreditNotesInvoice = InvoiceFactory.CreateInvoice(InvoiceType.AmendedB2BCreditNotesInvoice); seller.Invoice = AmendedB2BCreditNotesInvoice; break; case "AmendedB2BDebitNotesInvoice": Invoice AmendedB2BDebitNotesInvoice = InvoiceFactory.CreateInvoice(InvoiceType.AmendedB2BDebitNotesInvoice); seller.Invoice = AmendedB2BDebitNotesInvoice; break; case "B2BExportInvoice": Invoice B2BExportInvoice = InvoiceFactory.CreateInvoice(InvoiceType.B2BExportInvoice); seller.Invoice = B2BExportInvoice; break; case "AmendedB2BExportInvoice": Invoice AmendedB2BExportInvoice = InvoiceFactory.CreateInvoice(InvoiceType.AmendedB2BExportInvoice); seller.Invoice = AmendedB2BExportInvoice; break; } #endregion seller.Invoice.LineEntry = new List <LineEntry>(); if ((List <Seller>)Session["SellerDaTa"] != null) { seller.SellerDaTa = (List <Seller>)Session["SellerDaTa"]; } } } } else { //change master page here--Ashish BALAJI.GSP.APPLICATION.User.User masterPage = this.Master as BALAJI.GSP.APPLICATION.User.User; ////masterPage.ShowModalPopup(); ////masterPage.ErrorMessage = "System error occured during data population of SellerDtls table !!!"; } #endregion #region ADVANCE if (ds.Tables.Contains("AdvanceSellerDtls")) { p = 0; m = 0; if (ds.Tables["AdvanceSellerDtls"].Rows.Count > 0) { int j = ds.Tables[3].Rows.Count; for (int i = 0; i <= j - 1; i++) { seller.SellerInvoice = (ds.Tables[3].Rows[i]["VoucherNo"]).ToString(); seller.DateOfInvoice = (ds.Tables[3].Rows[i]["Voucherdate"]).ToString(); seller.GSTIN = (ds.Tables[3].Rows[i]["SellerGSTN"]).ToString(); seller.NameAsOnGST = (ds.Tables[3].Rows[i]["SellerName"]).ToString(); seller.Reciever.GSTIN = (ds.Tables[3].Rows[i]["ReceiverGSTN"]).ToString(); seller.Reciever.NameAsOnGST = (ds.Tables[3].Rows[i]["ReceiverName"]).ToString(); seller.Consignee.GSTIN = (ds.Tables[3].Rows[i]["ConsigneeGSTN"]).ToString(); seller.Consignee.NameAsOnGST = (ds.Tables[3].Rows[i]["ConsigneeName"]).ToString(); seller.Address = (ds.Tables[3].Rows[i]["SellerAddress"]).ToString(); seller.SellerStateCode = (ds.Tables[3].Rows[i]["SellerStateCode"]).ToString(); seller.SellerStateName = (ds.Tables[3].Rows[i]["SellerStateName"]).ToString(); seller.SellerStateCodeID = (ds.Tables[3].Rows[i]["SellerStateCodeID"]).ToString(); seller.Reciever.StateCode = (ds.Tables[3].Rows[i]["ReceiverStateCode"]).ToString(); seller.Consignee.StateCode = (ds.Tables[3].Rows[i]["ConsigneeStateCode"]).ToString(); seller.Invoice.Freight = Convert.ToInt32(ds.Tables[3].Rows[i]["Freight"]); seller.Invoice.Insurance = Convert.ToInt32(ds.Tables[3].Rows[i]["Insurance"]); seller.Invoice.PackingAndForwadingCharges = Convert.ToInt32(ds.Tables[3].Rows[i]["PackingAndForwadingCharges"]); seller.Invoice.IsAdvancePaymentChecked = true; seller.Invoice.IsExportChecked = false; //if (((ds.Tables[3].Rows[i]["IsElectronicReferenceNoGenerated"]).ToString()) == "True") //{ // seller.IsElectronicReferenceNoGenerated = true; //} //else //{ // seller.IsElectronicReferenceNoGenerated = false; //} //seller.ElectronicReferenceNoGenerated = (ds.Tables[3].Rows[i]["ElectronicReferenceNoGenerated"]).ToString(); //seller.ElectronicReferenceNoGeneratedDate = (ds.Tables[3].Rows[i]["ElectronicReferenceNoGeneratedDate"]).ToString(); int n = ds.Tables[4].Rows.Count; for (m = p; m <= n - 1; m++) { if ((ds.Tables[3].Rows[i]["VoucherNo"]).ToString() == (ds.Tables[4].Rows[m]["VoucherNo"]).ToString()) { line = new LineEntry(); line.HSN = new com.B2B.GST.GSTInvoices.HSN(); line.LineID = Convert.ToInt32(ds.Tables[4].Rows[m]["LineID"]); line.HSN.Description = (ds.Tables[4].Rows[m]["Description"]).ToString(); line.HSN.HSNNumber = (ds.Tables[4].Rows[m]["HSN"]).ToString(); line.Qty = Convert.ToDecimal(ds.Tables[4].Rows[m]["Qty"]); line.HSN.UnitOfMeasurement = (ds.Tables[4].Rows[m]["Unit"]).ToString(); line.PerUnitRate = Convert.ToDecimal(ds.Tables[4].Rows[m]["Rate"]); line.TotalLineIDWise = Convert.ToDecimal(ds.Tables[4].Rows[m]["Total"]); line.Discount = Convert.ToDecimal(ds.Tables[4].Rows[m]["Discount"]); line.TaxValue = Convert.ToDecimal(ds.Tables[4].Rows[m]["TaxableValue"]); line.AmountWithTax = Convert.ToDecimal(ds.Tables[4].Rows[m]["AmountWithTax"]); line.HSN.RateIGST = Convert.ToDecimal(ds.Tables[4].Rows[m]["IGSTRate"]); line.AmtIGSTLineIDWise = Convert.ToDecimal(ds.Tables[4].Rows[m]["IGSTAmt"]); line.HSN.RateCGST = Convert.ToDecimal(ds.Tables[4].Rows[m]["CGSTRate"]); line.AmtCGSTLineIDWise = Convert.ToDecimal(ds.Tables[4].Rows[m]["CGSTAmt"]); line.HSN.RateSGST = Convert.ToDecimal(ds.Tables[4].Rows[m]["SGSTRate"]); line.AmtSGSTLineIDWise = Convert.ToDecimal(ds.Tables[4].Rows[m]["SGSTAmt"]); line.HSN.Cess = Convert.ToDecimal(ds.Tables[4].Rows[m]["Cess"]); seller.TotalQty = Convert.ToDecimal(ds.Tables[4].Rows[m]["TotalQty"]); seller.TotalRate = Convert.ToDecimal(ds.Tables[4].Rows[m]["TotalRate"]); seller.TotalAmount = Convert.ToDecimal(ds.Tables[4].Rows[m]["TotalAmount"]); seller.TotalDiscount = Convert.ToDecimal(ds.Tables[4].Rows[m]["TotalDiscount"]); seller.TotalTaxableAmount = Convert.ToDecimal(ds.Tables[4].Rows[m]["TotalTaxableAmount"]); seller.TotalCGSTAmount = Convert.ToDecimal(ds.Tables[4].Rows[m]["TotalCGSTAmount"]); seller.TotalSGSTAmount = Convert.ToDecimal(ds.Tables[4].Rows[m]["TotalSGSTAmount"]); seller.TotalIGSTAmount = Convert.ToDecimal(ds.Tables[4].Rows[m]["TotalIGSTAmount"]); seller.TotalAmountWithTax = Convert.ToDecimal(ds.Tables[4].Rows[m]["TotalAmountWithTax"]); seller.GrandTotalAmount = Convert.ToDecimal(ds.Tables[4].Rows[m]["GrandTotalAmount"]); seller.GrandTotalAmountInWord = Convert.ToString(ds.Tables[4].Rows[m]["GrandTotalAmountInWord"]); seller.Invoice.LineEntry.Add(line); p = 1 + p; } else { break; } } seller.SellerDaTa.Add(seller); Session["SellerDaTa"] = seller.SellerDaTa; seller = new Seller(); seller.Reciever = new Reciever(); seller.Consignee = new Consignee(); seller.SellerDaTa = new List <Seller>(); #region INVOICE_TYPE switch (strInvoiceType) { case "B2BInvoice": Invoice b2bInvoice = InvoiceFactory.CreateInvoice(InvoiceType.B2BInvoice); seller.Invoice = b2bInvoice; break; case "AmendedB2BInvoice": Invoice AmendedB2BInvoice = InvoiceFactory.CreateInvoice(InvoiceType.AmendedB2BInvoice); seller.Invoice = AmendedB2BInvoice; break; case "B2CLargeInvoice": Invoice B2CLargeInvoice = InvoiceFactory.CreateInvoice(InvoiceType.B2CLargeInvoice); seller.Invoice = B2CLargeInvoice; break; case "AmendedB2CLargeInvoice": Invoice AmendedB2CLargeInvoice = InvoiceFactory.CreateInvoice(InvoiceType.AmendedB2CLargeInvoice); seller.Invoice = AmendedB2CLargeInvoice; break; case "B2BCreditNotesInvoice": Invoice B2BCreditNotesInvoice = InvoiceFactory.CreateInvoice(InvoiceType.B2BCreditNotesInvoice); seller.Invoice = B2BCreditNotesInvoice; break; case "B2BDebitNotesInvoice": Invoice B2BDebitNotesInvoice = InvoiceFactory.CreateInvoice(InvoiceType.B2BDebitNotesInvoice); seller.Invoice = B2BDebitNotesInvoice; break; case "AmendedB2BCreditNotesInvoice": Invoice AmendedB2BCreditNotesInvoice = InvoiceFactory.CreateInvoice(InvoiceType.AmendedB2BCreditNotesInvoice); seller.Invoice = AmendedB2BCreditNotesInvoice; break; case "AmendedB2BDebitNotesInvoice": Invoice AmendedB2BDebitNotesInvoice = InvoiceFactory.CreateInvoice(InvoiceType.AmendedB2BDebitNotesInvoice); seller.Invoice = AmendedB2BDebitNotesInvoice; break; case "B2BExportInvoice": Invoice B2BExportInvoice = InvoiceFactory.CreateInvoice(InvoiceType.B2BExportInvoice); seller.Invoice = B2BExportInvoice; break; case "AmendedB2BExportInvoice": Invoice AmendedB2BExportInvoice = InvoiceFactory.CreateInvoice(InvoiceType.AmendedB2BExportInvoice); seller.Invoice = AmendedB2BExportInvoice; break; } #endregion seller.Invoice.LineEntry = new List <LineEntry>(); if ((List <Seller>)Session["SellerDaTa"] != null) { seller.SellerDaTa = (List <Seller>)Session["SellerDaTa"]; } } } } else { //UserInterface.loggedIn_applicationMasterPage masterPage = this.Master as UserInterface.loggedIn_applicationMasterPage; ////masterPage.ShowModalPopup(); ////masterPage.ErrorMessage = "System error occured during data population of SellerDtls table !!!"; } #endregion #region EXPORT if (ds.Tables.Contains("EXPORTSellerDtls")) { p = 0; m = 0; if (ds.Tables["EXPORTSellerDtls"].Rows.Count > 0) { int j = ds.Tables[6].Rows.Count; for (int i = 0; i <= j - 1; i++) { seller.SellerInvoice = (ds.Tables[6].Rows[i]["ExportNo"]).ToString(); seller.DateOfInvoice = (ds.Tables[6].Rows[i]["Exportdate"]).ToString(); seller.GSTIN = (ds.Tables[6].Rows[i]["SellerGSTN"]).ToString(); seller.NameAsOnGST = (ds.Tables[6].Rows[i]["SellerName"]).ToString(); seller.Reciever.GSTIN = (ds.Tables[6].Rows[i]["ReceiverGSTN"]).ToString(); seller.Reciever.NameAsOnGST = (ds.Tables[6].Rows[i]["ReceiverName"]).ToString(); seller.Consignee.GSTIN = (ds.Tables[6].Rows[i]["ConsigneeGSTN"]).ToString(); seller.Consignee.NameAsOnGST = (ds.Tables[6].Rows[i]["ConsigneeName"]).ToString(); seller.Address = (ds.Tables[6].Rows[i]["SellerAddress"]).ToString(); seller.SellerStateCode = (ds.Tables[6].Rows[i]["SellerStateCode"]).ToString(); seller.SellerStateName = (ds.Tables[6].Rows[i]["SellerStateName"]).ToString(); seller.SellerStateCodeID = (ds.Tables[6].Rows[i]["SellerStateCodeID"]).ToString(); seller.Reciever.StateCode = (ds.Tables[6].Rows[i]["ReceiverStateCode"]).ToString(); seller.Consignee.StateCode = (ds.Tables[6].Rows[i]["ConsigneeStateCode"]).ToString(); seller.Invoice.Freight = Convert.ToInt32(ds.Tables[6].Rows[i]["Freight"]); seller.Invoice.Insurance = Convert.ToInt32(ds.Tables[6].Rows[i]["Insurance"]); seller.Invoice.PackingAndForwadingCharges = Convert.ToInt32(ds.Tables[6].Rows[i]["PackingAndForwadingCharges"]); seller.Invoice.IsAdvancePaymentChecked = false; seller.Invoice.IsExportChecked = true; //if (((ds.Tables[6].Rows[i]["IsElectronicReferenceNoGenerated"]).ToString()) == "True") //{ // seller.IsElectronicReferenceNoGenerated = true; //} //else //{ // seller.IsElectronicReferenceNoGenerated = false; //} //seller.ElectronicReferenceNoGenerated = (ds.Tables[6].Rows[i]["ElectronicReferenceNoGenerated"]).ToString(); //seller.ElectronicReferenceNoGeneratedDate = (ds.Tables[6].Rows[i]["ElectronicReferenceNoGeneratedDate"]).ToString(); int n = ds.Tables[7].Rows.Count; for (m = p; m <= n - 1; m++) { if ((ds.Tables[6].Rows[i]["ExportNo"]).ToString() == (ds.Tables[7].Rows[m]["ExportNo"]).ToString()) { line = new LineEntry(); line.HSN = new com.B2B.GST.GSTInvoices.HSN(); line.LineID = Convert.ToInt32(ds.Tables[7].Rows[m]["LineID"]); line.HSN.Description = (ds.Tables[7].Rows[m]["Description"]).ToString(); line.HSN.HSNNumber = (ds.Tables[7].Rows[m]["HSN"]).ToString(); line.Qty = Convert.ToDecimal(ds.Tables[7].Rows[m]["Qty"]); line.HSN.UnitOfMeasurement = (ds.Tables[7].Rows[m]["Unit"]).ToString(); line.PerUnitRate = Convert.ToDecimal(ds.Tables[7].Rows[m]["Rate"]); line.TotalLineIDWise = Convert.ToDecimal(ds.Tables[7].Rows[m]["Total"]); line.Discount = Convert.ToDecimal(ds.Tables[7].Rows[m]["Discount"]); line.TaxValue = Convert.ToDecimal(ds.Tables[7].Rows[m]["TaxableValue"]); line.AmountWithTax = Convert.ToDecimal(ds.Tables[7].Rows[m]["AmountWithTax"]); line.HSN.RateIGST = Convert.ToDecimal(ds.Tables[7].Rows[m]["IGSTRate"]); line.AmtIGSTLineIDWise = Convert.ToDecimal(ds.Tables[7].Rows[m]["IGSTAmt"]); line.HSN.RateCGST = Convert.ToDecimal(ds.Tables[7].Rows[m]["CGSTRate"]); line.AmtCGSTLineIDWise = Convert.ToDecimal(ds.Tables[7].Rows[m]["CGSTAmt"]); line.HSN.RateSGST = Convert.ToDecimal(ds.Tables[7].Rows[m]["SGSTRate"]); line.AmtSGSTLineIDWise = Convert.ToDecimal(ds.Tables[7].Rows[m]["SGSTAmt"]); line.HSN.Cess = Convert.ToDecimal(ds.Tables[7].Rows[m]["Cess"]); seller.TotalQty = Convert.ToDecimal(ds.Tables[7].Rows[m]["TotalQty"]); seller.TotalRate = Convert.ToDecimal(ds.Tables[7].Rows[m]["TotalRate"]); seller.TotalAmount = Convert.ToDecimal(ds.Tables[7].Rows[m]["TotalAmount"]); seller.TotalDiscount = Convert.ToDecimal(ds.Tables[7].Rows[m]["TotalDiscount"]); seller.TotalTaxableAmount = Convert.ToDecimal(ds.Tables[7].Rows[m]["TotalTaxableAmount"]); seller.TotalCGSTAmount = Convert.ToDecimal(ds.Tables[7].Rows[m]["TotalCGSTAmount"]); seller.TotalSGSTAmount = Convert.ToDecimal(ds.Tables[7].Rows[m]["TotalSGSTAmount"]); seller.TotalIGSTAmount = Convert.ToDecimal(ds.Tables[7].Rows[m]["TotalIGSTAmount"]); seller.TotalAmountWithTax = Convert.ToDecimal(ds.Tables[7].Rows[m]["TotalAmountWithTax"]); seller.GrandTotalAmount = Convert.ToDecimal(ds.Tables[7].Rows[m]["GrandTotalAmount"]); seller.GrandTotalAmountInWord = Convert.ToString(ds.Tables[7].Rows[m]["GrandTotalAmountInWord"]); seller.Invoice.LineEntry.Add(line); p = 1 + p; } else { break; } } seller.SellerDaTa.Add(seller); Session["SellerDaTa"] = seller.SellerDaTa; seller = new Seller(); seller.Reciever = new Reciever(); seller.Consignee = new Consignee(); seller.SellerDaTa = new List <Seller>(); #region INVOICE_TYPE switch (strInvoiceType) { case "B2BInvoice": Invoice b2bInvoice = InvoiceFactory.CreateInvoice(InvoiceType.B2BInvoice); seller.Invoice = b2bInvoice; break; case "AmendedB2BInvoice": Invoice AmendedB2BInvoice = InvoiceFactory.CreateInvoice(InvoiceType.AmendedB2BInvoice); seller.Invoice = AmendedB2BInvoice; break; case "B2CLargeInvoice": Invoice B2CLargeInvoice = InvoiceFactory.CreateInvoice(InvoiceType.B2CLargeInvoice); seller.Invoice = B2CLargeInvoice; break; case "AmendedB2CLargeInvoice": Invoice AmendedB2CLargeInvoice = InvoiceFactory.CreateInvoice(InvoiceType.AmendedB2CLargeInvoice); seller.Invoice = AmendedB2CLargeInvoice; break; case "B2BCreditNotesInvoice": Invoice B2BCreditNotesInvoice = InvoiceFactory.CreateInvoice(InvoiceType.B2BCreditNotesInvoice); seller.Invoice = B2BCreditNotesInvoice; break; case "B2BDebitNotesInvoice": Invoice B2BDebitNotesInvoice = InvoiceFactory.CreateInvoice(InvoiceType.B2BDebitNotesInvoice); seller.Invoice = B2BDebitNotesInvoice; break; case "AmendedB2BCreditNotesInvoice": Invoice AmendedB2BCreditNotesInvoice = InvoiceFactory.CreateInvoice(InvoiceType.AmendedB2BCreditNotesInvoice); seller.Invoice = AmendedB2BCreditNotesInvoice; break; case "AmendedB2BDebitNotesInvoice": Invoice AmendedB2BDebitNotesInvoice = InvoiceFactory.CreateInvoice(InvoiceType.AmendedB2BDebitNotesInvoice); seller.Invoice = AmendedB2BDebitNotesInvoice; break; case "B2BExportInvoice": Invoice B2BExportInvoice = InvoiceFactory.CreateInvoice(InvoiceType.B2BExportInvoice); seller.Invoice = B2BExportInvoice; break; case "AmendedB2BExportInvoice": Invoice AmendedB2BExportInvoice = InvoiceFactory.CreateInvoice(InvoiceType.AmendedB2BExportInvoice); seller.Invoice = AmendedB2BExportInvoice; break; } #endregion seller.Invoice.LineEntry = new List <LineEntry>(); if ((List <Seller>)Session["SellerDaTa"] != null) { seller.SellerDaTa = (List <Seller>)Session["SellerDaTa"]; } } } } else { BALAJI.GSP.APPLICATION.User.User masterPage = this.Master as BALAJI.GSP.APPLICATION.User.User; ////masterPage.ShowModalPopup(); ////masterPage.ErrorMessage = "System error occured during data population of SellerDtls table !!!"; } #endregion } else { BALAJI.GSP.APPLICATION.User.User masterPage = this.Master as BALAJI.GSP.APPLICATION.User.User; ////masterPage.ShowModalPopup(); ////masterPage.ErrorMessage = "System Error !!!"; } if (ds.Tables["SellerDtls"].Rows.Count == 0 && ds.Tables["AdvanceSellerDtls"].Rows.Count == 0 && ds.Tables["EXPORTSellerDtls"].Rows.Count == 0) { BALAJI.GSP.APPLICATION.User.User masterPage = this.Master as BALAJI.GSP.APPLICATION.User.User; ////masterPage.ShowModalPopup(); ////masterPage.ErrorMessage = "No data to upload !!!"; BtnUpload.Attributes.Add("style", "display:none"); } return(ds); }
private void PopupEditUser() { double Altezza = 200; double Larghezza = GetLarghezzaPagina() - 80; double banner = 50; var Round = new RoundedCornerView //coso che stonda { RoundedCornerRadius = 20, HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.Center, HeightRequest = Altezza, WidthRequest = Larghezza, }; var stackFondoAndroid = new StackLayout() //per android { HeightRequest = banner, WidthRequest = Larghezza, BackgroundColor = GetPrimaryAndroidColor(), }; var stackFondoiOS = new StackLayout() //per ios { HeightRequest = banner, WidthRequest = Larghezza, BackgroundColor = Color.Orange, }; var fondomerende = new Label //Label per Il titolo banner { Text = "Fondo merende", HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.CenterAndExpand, FontSize = 20, FontAttributes = FontAttributes.Bold, TextColor = Color.White, }; var label = new Label { Text = "Inserire la vecchia password", VerticalOptions = LayoutOptions.StartAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, }; var entry = new LineEntry { Keyboard = Keyboard.Default, HorizontalOptions = LayoutOptions.CenterAndExpand, HorizontalTextAlignment = TextAlignment.Center, IsPassword = true, WidthRequest = 200, }; var stackBody = new StackLayout //stack principale dove è contenuto l'interno di tutto (tranne round che stonda) { HeightRequest = Altezza, WidthRequest = Larghezza, BackgroundColor = Color.White, }; var stackBottoni = new StackLayout //stack che contiene la gridlia dei bottoni { VerticalOptions = LayoutOptions.EndAndExpand, WidthRequest = Larghezza, HeightRequest = banner, MinimumHeightRequest = banner, }; var griglia = new Grid //griglia che contiene i bottoni { }; var buttonCancel = new Button { Text = "Annulla", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, BackgroundColor = Color.Transparent, }; var buttonConfirm = new Button { Text = "Conferma", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, BackgroundColor = Color.Transparent, }; stackBottoni.Children.Add(griglia); griglia.Children.Add((buttonCancel)); //inzia nella prima colonna griglia.Children.Add((buttonConfirm)); //inizia seconda colonna Grid.SetColumn(buttonCancel, 0); //mi è toccato farlo qui Grid.SetColumn(buttonConfirm, 1); switch (Device.RuntimePlatform) { case Device.Android: stackFondoAndroid.Children.Add(fondomerende); stackBody.Children.Add(stackFondoAndroid); break; case Device.iOS: stackFondoiOS.Children.Add(fondomerende); stackBody.Children.Add(stackFondoiOS); break; } entry.TextChanged += Entrata; buttonCancel.Clicked += Discard_Clicked; buttonConfirm.Clicked += Apply_Clicked; stackBody.Children.Add(label); stackBody.Children.Add(entry); stackBody.Children.Add(stackBottoni); Round.Children.Add(stackBody); EditUserPopUp.Content = Round; }
private void PopupEditSnack() { double Altezza = 0; switch (Device.RuntimePlatform) { case Device.Android: Altezza = (GetAltezzaPagina() * 70) / 100; break; case Device.iOS: Altezza = (GetAltezzaPagina() * 60) / 100; break; } double Larghezza = GetLarghezzaPagina() - 40; double banner = 50; var Round = new RoundedCornerView //coso che stonda { RoundedCornerRadius = 20, HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.Center, HeightRequest = Altezza, WidthRequest = Larghezza, }; var stackFondoAndroid = new StackLayout() //per android { HeightRequest = banner, WidthRequest = Larghezza, BackgroundColor = GetPrimaryAndroidColor(), }; var stackFondoiOS = new StackLayout() //per ios { HeightRequest = banner, WidthRequest = Larghezza, BackgroundColor = Color.Orange, }; var fondomerende = new Label //Label per Il titolo banner { Text = "Fondo merende", HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.CenterAndExpand, FontSize = 20, FontAttributes = FontAttributes.Bold, TextColor = Color.White, }; var stackImgBtn = new StackLayout() { HeightRequest = 50, }; immagine = new ImageButton { Source = ImageSource.FromResource("fondomerende.image.fill_full_256x256.png"), CornerRadius = 20, HeightRequest = 60, BackgroundColor = Color.White, Scale = 0.6, Margin = new Thickness(0, 0, 0, 400), HorizontalOptions = LayoutOptions.EndAndExpand, VerticalOptions = LayoutOptions.StartAndExpand, }; immagine.Clicked += Swap_Clicked; NomeSnack = new LineEntry { Keyboard = Keyboard.Default, HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.StartAndExpand, WidthRequest = 250, }; PrezzoSnack = new LineEntry { Keyboard = Keyboard.Numeric, HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.StartAndExpand, WidthRequest = 250, }; SnackPerBox = new LineEntry { Keyboard = Keyboard.Numeric, HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.StartAndExpand, WidthRequest = 250, }; ExpInDays = new LineEntry { Keyboard = Keyboard.Numeric, HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.StartAndExpand, WidthRequest = 250, }; Qta = new LineEntry { Keyboard = Keyboard.Numeric, HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.StartAndExpand, WidthRequest = 250, }; var stackBody = new StackLayout //stack principale dove è contenuto l'interno di tutto (tranne round che stonda) { Spacing = 10, HeightRequest = Altezza, WidthRequest = Larghezza, BackgroundColor = Color.White, }; var stackBottoni = new StackLayout //stack che contiene la gridlia dei bottoni { VerticalOptions = LayoutOptions.EndAndExpand, WidthRequest = Larghezza, HeightRequest = banner, MinimumHeightRequest = banner, }; var griglia = new Grid //griglia che contiene i bottoni { }; var buttonCancel = new Button { Text = "Annulla", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, BackgroundColor = Color.Transparent, }; var buttonConfirm = new Button { Text = "Conferma", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, BackgroundColor = Color.Transparent, }; stackBottoni.Children.Add(griglia); griglia.Children.Add((buttonCancel)); //inzia nella prima colonna griglia.Children.Add((buttonConfirm)); //inizia seconda colonna Grid.SetColumn(buttonCancel, 0); //mi è toccato farlo qui Grid.SetColumn(buttonConfirm, 1); switch (Device.RuntimePlatform) { case Device.Android: stackFondoAndroid.Children.Add(fondomerende); stackBody.Children.Add(stackFondoAndroid); break; case Device.iOS: stackFondoiOS.Children.Add(fondomerende); stackBody.Children.Add(stackFondoiOS); break; } NomeSnack.TextChanged += EntrataNome; PrezzoSnack.TextChanged += EntrataPrezzo; SnackPerBox.TextChanged += EntrataSnackPerScatola; ExpInDays.TextChanged += EntrataScadenzaInGiorni; buttonCancel.Clicked += Discard_Clicked; buttonConfirm.Clicked += Apply_Clicked; stackImgBtn.Children.Add(immagine); stackBody.Children.Add(stackImgBtn); stackBody.Children.Add(NomeSnack); stackBody.Children.Add(PrezzoSnack); stackBody.Children.Add(SnackPerBox); stackBody.Children.Add(ExpInDays); stackBody.Children.Add(Qta); NomeSnack.Placeholder = "Nome: " + EditSnackListPage.SelectedSnackName; PrezzoSnack.Placeholder = "Prezzo: " + Convert.ToString(EditSnackListPage.SelectedSnackPrice); SnackPerBox.Placeholder = "Snacks Per Scatola: " + Convert.ToString(EditSnackListPage.SelectedSnackPerBox); ExpInDays.Placeholder = "Scadenza In Giorni: " + Convert.ToString(EditSnackListPage.SelectedSnackExpiration); stackBody.Children.Add(stackBottoni); Round.Children.Add(stackBody); EditSnackPopUp.Content = Round; }
private LineEntry processLine(string line) { if (line.Length == 0) { LineEntry emptyEntry = new LineEntry(); emptyEntry.Time = ""; emptyEntry.Type = ""; emptyEntry.Detail = ""; return(emptyEntry); } string editedLine = line.Replace("\u0009", " "); LineEntry lineEntry = new LineEntry(); bool timePresent = false; if (editedLine[0] >= '0' && editedLine[0] <= '9') { lineEntry.Time = editedLine.Substring(0, 12); timePresent = true; } else { lineEntry.Time = ""; } int detailOffset = 13; if (timePresent && editedLine.Length > 17 && editedLine[13] == '<' && editedLine[15] == '>') { detailOffset = 17; switch (editedLine[14]) { case 'e': lineEntry.Type = errorText; break; case 'E': lineEntry.Type = exceptionText; break; case 'I': lineEntry.Type = informationText; break; case 'C': lineEntry.Type = completedText; break; case 'S': lineEntry.Type = summaryText; break; default: lineEntry.Type = informationText; break; } } else { lineEntry.Type = "Information"; } if (timePresent) { if (editedLine.Length > detailOffset) { lineEntry.Detail = editedLine.Substring(detailOffset); } else { lineEntry.Detail = ""; } } else { lineEntry.Detail = editedLine; } return(lineEntry); }
IEnumerator<object> SearchInFiles(SearchQuery search, BlockingQueue<string> filenames, IFuture completionFuture) { var searchedFiles = new List<string>(); var buffer = new List<SearchResult>(); var sb = new StringBuilder(); int numFiles = 0; using (Finally.Do(() => { SetSearchResults(buffer); lblStatus.Text = String.Format("{0} result(s) found.", buffer.Count); pbProgress.Style = ProgressBarStyle.Continuous; pbProgress.Value = 0; })) while (filenames.Count > 0 || !completionFuture.Completed) { var f = filenames.Dequeue(); yield return f; var filename = f.Result as string; if (filename == null) continue; if (searchedFiles.Contains(filename)) continue; if (PendingSearchQuery != null) break; searchedFiles.Add(filename); int lineNumber = 0; var lineBuffer = new LineEntry[3]; var insertResult = (Action)(() => { var item = new SearchResult(); item.Filename = filename; item.LineNumber = lineBuffer[1].LineNumber; sb.Remove(0, sb.Length); for (int i = 0; i < 3; i++) { if (lineBuffer[i].Text != null) { var line = lineBuffer[i].Text; if (line.Length > 512) line = line.Substring(0, 512); sb.Append(line); } if (i < 2) sb.Append("\r\n"); } item.Context = sb.ToString(); buffer.Add(item); if ((buffer.Count % 250 == 0) || ((buffer.Count < 50) && (buffer.Count % 5 == 1))) SetSearchResults(buffer); }); var stepSearch = (Action)(() => { string currentLine = lineBuffer[1].Text; if ((currentLine != null) && search.Regex.IsMatch(currentLine)) insertResult(); }); var insertLine = (Action<LineEntry>)((line) => { lineBuffer[0] = lineBuffer[1]; lineBuffer[1] = lineBuffer[2]; lineBuffer[2] = line; stepSearch(); }); numFiles += 1; if (numFiles % 50 == 0) { lblStatus.Text = String.Format("Scanning '{0}'...", filename); if (completionFuture.Completed) { int totalNumFiles = numFiles + filenames.Count; int progress = (numFiles * 1000 / totalNumFiles); if (pbProgress.Value != progress) pbProgress.Value = progress; if (pbProgress.Style != ProgressBarStyle.Continuous) pbProgress.Style = ProgressBarStyle.Continuous; } } FileDataAdapter adapter = null; try { adapter = new FileDataAdapter(filename, System.IO.FileMode.Open, System.IO.FileAccess.Read); } catch { if (adapter != null) adapter.Dispose(); continue; } using (adapter) { var fEncoding = Future.RunInThread( () => DetectEncoding(adapter.BaseStream) ); yield return fEncoding; Future<string> thisLine = null, nextLine = null; using (var reader = new AsyncTextReader(adapter, fEncoding.Result, SearchBufferSize)) while (true) { thisLine = nextLine; if (thisLine != null) yield return thisLine; nextLine = reader.ReadLine(); if (thisLine == null) continue; lineNumber += 1; string line = thisLine.Result; insertLine(new LineEntry { Text = line, LineNumber = lineNumber }); if (line == null) break; if (PendingSearchQuery != null) break; if (lineNumber % 10000 == 5000) { var newStatus = String.Format("Scanning '{0}'... (line {1})", filename, lineNumber); if (lblStatus.Text != newStatus) lblStatus.Text = newStatus; } } } } }
/// <summary> /// Handles the printer's PrintPage event. /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="e">An PrintPageEventArgs object that contains /// the event data.</param> void OnPrintPage(object sender, PrintPageEventArgs e) { // First check to see if there are any pages to print. if (m_lines.Count > 0) { // Calculate the printing rectangle. RectangleF fullRect; if (e.Graphics.VisibleClipBounds.X < 0) // Print Preview { fullRect = e.MarginBounds; } else { fullRect = new RectangleF( e.MarginBounds.Left - (e.PageBounds.Width - e.Graphics.VisibleClipBounds.Width) / 2, e.MarginBounds.Top - (e.PageBounds.Height - e.Graphics.VisibleClipBounds.Height) / 2, e.MarginBounds.Width, e.MarginBounds.Height); } // Calculate how many lines we can fit on this page. float totalHeight = 0.0F; for (int x = m_currentLine; x < m_lines.Count; x++) { LineEntry entry = ((LineEntry)m_lines[x]); if (!entry.IsPageBreak) { entry.Height = entry.Font.GetHeight(e.Graphics); totalHeight += entry.Height; if (totalHeight < fullRect.Height) { m_maxLine = x; } else // We've gone over the allowed height. { break; } } else // We've hit a page break. { m_maxLine = x; break; } } // Set up the string formatting. StringFormat format = new StringFormat(); format.Trimming = StringTrimming.EllipsisCharacter; format.FormatFlags |= StringFormatFlags.NoWrap; SolidBrush blackBrush = new SolidBrush(Color.Black); totalHeight = fullRect.Top; while (m_currentLine <= m_maxLine) { LineEntry entry = (LineEntry)m_lines[m_currentLine]; if (!entry.IsPageBreak) { // Draw the string to the printer. format.Alignment = entry.Alignment; RectangleF drawingRect = new RectangleF(fullRect.Left, totalHeight, fullRect.Width, entry.Height); e.Graphics.DrawString(entry.Text, entry.Font, blackBrush, drawingRect, format); totalHeight += entry.Height; } // Move to the next line. m_currentLine++; } // Check to see if we need to print on the next page. if (m_currentLine < m_lines.Count) { e.HasMorePages = true; } } }
protected void SetFontSize(LineEntry element) { Control.SetTextSize(Android.Util.ComplexUnitType.Sp, (float)element.FontSize); }
protected void DrawAll(LineEntry element) { DrawBorder(element); SetPlaceholderTextColor(element); SetFontSize(element); }
protected void SetPlaceholderTextColor(LineEntry element) { Control.SetHintTextColor(element.PlaceholderColor.ToAndroid()); }
private void PopupAddSnack() { /*switch(Device.RuntimePlatform) * { * case (Device.Android): * double Altezza = (GetAltezzaPagina()*60)/100; * break; * * }*/ double Altezza = (GetAltezzaPagina() * 60) / 100; double Larghezza = GetLarghezzaPagina() - 40; double banner = 50; var Round = new RoundedCornerView //coso che stonda { RoundedCornerRadius = 20, HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.Center, HeightRequest = Altezza, WidthRequest = Larghezza, }; var stackFondoAndroid = new StackLayout() //per android { HeightRequest = banner, WidthRequest = Larghezza, BackgroundColor = GetPrimaryAndroidColor(), }; var stackFondoiOS = new StackLayout() //per ios { HeightRequest = banner, WidthRequest = Larghezza, BackgroundColor = Color.Orange, }; var fondomerende = new Label //Label per Il titolo banner { Text = "Fondo merende", HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.CenterAndExpand, FontSize = 20, FontAttributes = FontAttributes.Bold, TextColor = Color.White, }; /*var stackImgBtn = new StackLayout() * { * HeightRequest = 50, * };*/ //variabili in line entry// NomeSnack = new LineEntry { Margin = new Thickness(0, 15, 0, 0), Keyboard = Keyboard.Default, VerticalOptions = LayoutOptions.StartAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, WidthRequest = 250, }; PrezzoSnack = new LineEntry { Keyboard = Keyboard.Numeric, VerticalOptions = LayoutOptions.StartAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, WidthRequest = 250, }; SnackPerBox = new LineEntry { Keyboard = Keyboard.Numeric, VerticalOptions = LayoutOptions.StartAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, WidthRequest = 250, }; ExpInDays = new LineEntry { Keyboard = Keyboard.Numeric, VerticalOptions = LayoutOptions.StartAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, WidthRequest = 250, }; var stackBody = new StackLayout //stack principale dove è contenuto l'interno di tutto (tranne round che stonda) { VerticalOptions = LayoutOptions.StartAndExpand, HeightRequest = Altezza, WidthRequest = Larghezza, BackgroundColor = Color.White, }; var stackBottoni = new StackLayout //stack che contiene la gridlia dei bottoni { VerticalOptions = LayoutOptions.EndAndExpand, WidthRequest = Larghezza, HeightRequest = banner, MinimumHeightRequest = banner, }; var griglia = new Grid //griglia che contiene i bottoni { }; var buttonCancel = new Button { Text = "Annulla", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, BackgroundColor = Color.Transparent, }; var buttonConfirm = new Button { Text = "Conferma", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, BackgroundColor = Color.Transparent, }; stackBottoni.Children.Add(griglia); griglia.Children.Add((buttonCancel)); //inzia nella prima colonna griglia.Children.Add((buttonConfirm)); //inizia seconda colonna Grid.SetColumn(buttonCancel, 0); //mi è toccato farlo qui Grid.SetColumn(buttonConfirm, 1); switch (Device.RuntimePlatform) { case Device.Android: stackFondoAndroid.Children.Add(fondomerende); stackBody.Children.Add(stackFondoAndroid); break; case Device.iOS: stackFondoiOS.Children.Add(fondomerende); stackBody.Children.Add(stackFondoiOS); break; } NomeSnack.TextChanged += EntrataNome; PrezzoSnack.TextChanged += EntrataPrezzo; SnackPerBox.TextChanged += EntrataSnackPerScatola; ExpInDays.TextChanged += EntrataScadenzaInGiorni; buttonCancel.Clicked += Discard_Clicked; buttonConfirm.Clicked += Apply_Clicked; NomeSnack.Placeholder = "Nome"; PrezzoSnack.Placeholder = "Prezzo"; SnackPerBox.Placeholder = "Snack per Scatola"; ExpInDays.Placeholder = "Giorni di scadenza"; //stackBody.Children.Add(stackImgBtn); stackBody.Children.Add(NomeSnack); stackBody.Children.Add(PrezzoSnack); stackBody.Children.Add(SnackPerBox); stackBody.Children.Add(ExpInDays); stackBody.Children.Add(stackBottoni); Round.Children.Add(stackBody); AddSnackPopUp.Content = Round; }
IEnumerator <object> SearchInFiles(SearchQuery search, BlockingQueue <string> filenames, IFuture completionFuture) { var searchedFiles = new HashSet <string>(StringComparer.Ordinal); var buffer = new List <SearchResult>(); var sb = new StringBuilder(); int numFiles = 0; using (Finally.Do(() => { SetSearchResults(buffer); lblStatus.Text = String.Format("{0} result(s) found.", buffer.Count); pbProgress.Style = ProgressBarStyle.Continuous; pbProgress.Value = 0; })) while (filenames.Count > 0 || !completionFuture.Completed) { var f = filenames.Dequeue(); yield return(f); var filename = f.Result as string; if (filename == null) { continue; } if (searchedFiles.Contains(filename)) { continue; } if (PendingSearchQuery != null) { break; } searchedFiles.Add(filename); int lineNumber = 0; var lineBuffer = new LineEntry[3]; var insertResult = (Action)(() => { var item = new SearchResult(); item.Filename = filename; item.LineNumber = lineBuffer[1].LineNumber; sb.Remove(0, sb.Length); for (int i = 0; i < 3; i++) { if (lineBuffer[i].Text != null) { var line = lineBuffer[i].Text; if (line.Length > 512) { line = line.Substring(0, 512); } sb.Append(line); } if (i < 2) { sb.Append("\r\n"); } } item.Context = sb.ToString(); buffer.Add(item); if ((buffer.Count % 250 == 0) || ((buffer.Count < 50) && (buffer.Count % 5 == 1))) { SetSearchResults(buffer); } }); var stepSearch = (Action)(() => { string currentLine = lineBuffer[1].Text; if ((currentLine != null) && search.Regex.IsMatch(currentLine)) { insertResult(); } }); var insertLine = (Action <LineEntry>)((line) => { lineBuffer[0] = lineBuffer[1]; lineBuffer[1] = lineBuffer[2]; lineBuffer[2] = line; stepSearch(); }); numFiles += 1; if (numFiles % 50 == 0) { lblStatus.Text = String.Format("Scanning '{0}'...", filename); if (completionFuture.Completed) { int totalNumFiles = numFiles + filenames.Count; int progress = (numFiles * 1000 / totalNumFiles); if (pbProgress.Value != progress) { pbProgress.Value = progress; } if (pbProgress.Style != ProgressBarStyle.Continuous) { pbProgress.Style = ProgressBarStyle.Continuous; } } } // Opening files is slow over network shares. FileDataAdapter adapter = null; var fAdapter = Future.RunInThread( () => new FileDataAdapter(filename, System.IO.FileMode.Open, System.IO.FileAccess.Read) ); yield return(fAdapter); if (fAdapter.Failed) { continue; } else { adapter = fAdapter.Result; } using (adapter) { var fEncoding = Future.RunInThread( () => DetectEncoding(adapter.BaseStream) ); yield return(fEncoding); Future <string> thisLine = null, nextLine = null; using (var reader = new AsyncTextReader(adapter, fEncoding.Result, SearchBufferSize)) while (true) { thisLine = nextLine; if (thisLine != null) { yield return(thisLine); } nextLine = reader.ReadLine(); if (thisLine == null) { continue; } lineNumber += 1; string line = thisLine.Result; insertLine(new LineEntry { Text = line, LineNumber = lineNumber }); if (line == null) { break; } if (PendingSearchQuery != null) { break; } if (lineNumber % 10000 == 5000) { var newStatus = String.Format("Scanning '{0}'... (line {1})", filename, lineNumber); if (lblStatus.Text != newStatus) { lblStatus.Text = newStatus; } } } } } }
private bool checkLine(LineEntry lineEntry, string[] filterStrings, bool ignoreCase) { foreach (string filterString in filterStrings) { if (!ignoreCase) { if (lineEntry.Time.Contains(filterString.Trim()) || lineEntry.Type.Contains(filterString.Trim()) || lineEntry.Detail.Contains(filterString.Trim())) return (true); } else { string upperFilterString = filterString.Trim().ToUpper(); if (lineEntry.Time.ToUpper().Contains(upperFilterString) || lineEntry.Type.ToUpper().Contains(upperFilterString) || lineEntry.Detail.ToUpper().Contains(upperFilterString)) return (true); } } return(false); }
private void PopupBuy() { Altezza = (GetAltezzaPagina() * 30) / 100; Larghezza = GetLarghezzaPagina() - 80; double banner = 50; Round = new RoundedCornerView //coso che stonda { RoundedCornerRadius = 20, HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.Center, HeightRequest = Altezza, WidthRequest = Larghezza, }; var stackFondoAndroid = new StackLayout() //per android { HeightRequest = banner, WidthRequest = Larghezza, BackgroundColor = GetPrimaryAndroidColor(), Orientation = StackOrientation.Horizontal, }; var stackFondoiOS = new StackLayout() //per ios { HeightRequest = banner, WidthRequest = Larghezza, BackgroundColor = Color.Orange, Orientation = StackOrientation.Horizontal, }; var fondomerende = new Label //Label per Il titolo banner { Text = "Fondo merende", HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.CenterAndExpand, FontSize = 20, FontAttributes = FontAttributes.Bold, TextColor = Color.White, }; lineAndroid = new LineEntry { Placeholder = "Quanti snack vuoi acquistare?", WidthRequest = 250, Keyboard = Keyboard.Numeric, Margin = new Thickness(0, 5, 0, 0), VerticalOptions = LayoutOptions.StartAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, HorizontalTextAlignment = TextAlignment.Center, }; prezzoAndroid = new LineEntry { Placeholder = "Inserire il prezzo", Keyboard = Keyboard.Numeric, WidthRequest = 250, IsVisible = false, VerticalOptions = LayoutOptions.StartAndExpand, Margin = new Thickness(0, 5, 0, 0), HorizontalOptions = LayoutOptions.CenterAndExpand, HorizontalTextAlignment = TextAlignment.Center, }; scadenzaAndroid = new LineEntry { Placeholder = "Inserire la scadenza", Keyboard = Keyboard.Numeric, WidthRequest = 250, Margin = new Thickness(0, 5, 0, 0), IsVisible = false, VerticalOptions = LayoutOptions.StartAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, HorizontalTextAlignment = TextAlignment.Center, }; lineiOs = new LineEntry { Placeholder = "Quanti snack vuoi acquistare?", WidthRequest = 250, FontSize = 18, HeightRequest = 35, Margin = new Thickness(0, 10, 0, 0), Keyboard = Keyboard.Numeric, VerticalOptions = LayoutOptions.StartAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, HorizontalTextAlignment = TextAlignment.Center, }; prezzoiOs = new LineEntry { Placeholder = "Inserire il prezzo", Keyboard = Keyboard.Numeric, WidthRequest = 250, FontSize = 18, HeightRequest = 35, VerticalOptions = LayoutOptions.StartAndExpand, IsVisible = false, HorizontalOptions = LayoutOptions.CenterAndExpand, HorizontalTextAlignment = TextAlignment.Center, }; scadenzaiOs = new LineEntry { Placeholder = "Inserire la scadenza", Keyboard = Keyboard.Numeric, WidthRequest = 250, FontSize = 18, HeightRequest = 35, VerticalOptions = LayoutOptions.StartAndExpand, IsVisible = false, HorizontalOptions = LayoutOptions.CenterAndExpand, HorizontalTextAlignment = TextAlignment.Center, }; stackBody = new StackLayout //stack principale dove è contenuto l'interno di tutto (tranne round che stonda) { HeightRequest = Altezza, WidthRequest = Larghezza, BackgroundColor = Color.White, }; var stackBottoni = new StackLayout //stack che contiene la gridlia dei bottoni { VerticalOptions = LayoutOptions.EndAndExpand, WidthRequest = Larghezza, HeightRequest = banner, MinimumHeightRequest = banner, }; var griglia = new Grid //griglia che contiene i bottoni { }; immagine = new ImageButton { Source = ImageSource.FromResource("fondomerende.image.Edit_Icon_32x32.png"), CornerRadius = 20, Scale = 1.5, BackgroundColor = Color.Transparent, Margin = new Thickness(0, 0, 15, 0), Aspect = Aspect.AspectFit, }; buttonCancel = new Button { Text = "Annulla", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, BackgroundColor = Color.Transparent, }; buttonConfirm = new Button { Text = "Conferma", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, BackgroundColor = Color.Transparent, }; stackBottoni.Children.Add(griglia); griglia.Children.Add((buttonCancel)); //inzia nella prima colonna griglia.Children.Add((buttonConfirm)); //inizia seconda colonna Grid.SetColumn(buttonCancel, 0); //mi è toccato farlo qui Grid.SetColumn(buttonConfirm, 1); switch (Device.RuntimePlatform) { case Device.Android: stackFondoAndroid.Children.Add(fondomerende); stackFondoAndroid.Children.Add(immagine); stackBody.Children.Add(stackFondoAndroid); immagine.Clicked += Immagine_Clicked; prezzoAndroid.TextChanged += EntrataPrezzoAndroid; buttonCancel.Clicked += Discard_Clicked; buttonConfirm.Clicked += Apply_ClickedAndroid; stackBody.Children.Add(lineAndroid); stackBody.Children.Add(prezzoAndroid); stackBody.Children.Add(scadenzaAndroid); stackBody.Children.Add(stackBottoni); Round.Children.Add(stackBody); break; case Device.iOS: stackFondoiOS.Children.Add(fondomerende); stackFondoiOS.Children.Add(immagine); stackBody.Children.Add(stackFondoiOS); immagine.Clicked += Immagine_Clicked; prezzoAndroid.TextChanged += EntrataPrezzoiOs; buttonCancel.Clicked += Discard_Clicked; buttonConfirm.Clicked += Apply_ClickediOs; stackBody.Children.Add(lineiOs); stackBody.Children.Add(prezzoiOs); stackBody.Children.Add(scadenzaiOs); stackBody.Children.Add(stackBottoni); Round.Children.Add(stackBody); break; } // entry.TextChanged += Entrata; PopupBuySnack.Content = Round; }
private LineEntry processLine(string line) { if (line.Length == 0) { LineEntry emptyEntry = new LineEntry(); emptyEntry.Time = ""; emptyEntry.Type = ""; emptyEntry.Detail = ""; return (emptyEntry); } string editedLine = line.Replace("\u0009", " "); LineEntry lineEntry = new LineEntry(); bool timePresent = false; if (editedLine[0] >= '0' && editedLine[0] <= '9') { lineEntry.Time = editedLine.Substring(0, 12); timePresent = true; } else lineEntry.Time = ""; int detailOffset = 13; if (timePresent && editedLine.Length > 17 && editedLine[13] == '<' && editedLine[15] == '>') { detailOffset = 17; switch (editedLine[14]) { case 'e': lineEntry.Type = errorText; break; case 'E': lineEntry.Type = exceptionText; break; case 'I': lineEntry.Type = informationText; break; case 'C': lineEntry.Type = completedText; break; case 'S': lineEntry.Type = summaryText; break; default: lineEntry.Type = informationText; break; } } else lineEntry.Type = "Information"; if (timePresent) { if (editedLine.Length > detailOffset) lineEntry.Detail = editedLine.Substring(detailOffset); else lineEntry.Detail = ""; } else lineEntry.Detail = editedLine; return(lineEntry); }
private void PopupEditUserInfo() { double Altezza = (GetAltezzaPagina() * 45) / 100; double Larghezza = GetLarghezzaPagina() - 40; double banner = 50; var Round = new RoundedCornerView //coso che stonda { RoundedCornerRadius = 20, HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.Center, HeightRequest = Altezza, WidthRequest = Larghezza, }; var stackFondoAndroid = new StackLayout() //per android { HeightRequest = banner, WidthRequest = Larghezza, BackgroundColor = GetPrimaryAndroidColor(), }; var stackFondoiOS = new StackLayout() //per ios { HeightRequest = banner, WidthRequest = Larghezza, BackgroundColor = Color.Orange, }; var fondomerende = new Label //Label per Il titolo banner { Text = "Fondo merende", HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.CenterAndExpand, FontSize = 20, FontAttributes = FontAttributes.Bold, TextColor = Color.White, }; var stackImgBtn = new StackLayout() { HeightRequest = 50, }; //variabili in line entry// entryUsername = new LineEntry { Margin = new Thickness(0, -40, 0, 0), HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.StartAndExpand, WidthRequest = 250, IsSpellCheckEnabled = false, IsTextPredictionEnabled = false, Keyboard = Keyboard.Plain, HorizontalTextAlignment = TextAlignment.Center, }; entryFriendlyName = new LineEntry { HorizontalOptions = LayoutOptions.CenterAndExpand, WidthRequest = 250, VerticalOptions = LayoutOptions.StartAndExpand, IsSpellCheckEnabled = false, IsTextPredictionEnabled = false, Keyboard = Keyboard.Plain, HorizontalTextAlignment = TextAlignment.Center, }; entryNewPassword = new LineEntry { Keyboard = Keyboard.Default, VerticalOptions = LayoutOptions.StartAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, WidthRequest = 250, IsPassword = true, HorizontalTextAlignment = TextAlignment.Center, }; var stackBody = new StackLayout //stack principale dove è contenuto l'interno di tutto (tranne round che stonda) { HeightRequest = Altezza, WidthRequest = Larghezza, BackgroundColor = Color.White, }; var stackBottoni = new StackLayout //stack che contiene la gridlia dei bottoni { VerticalOptions = LayoutOptions.EndAndExpand, WidthRequest = Larghezza, HeightRequest = banner, MinimumHeightRequest = banner, }; var griglia = new Grid //griglia che contiene i bottoni { }; var buttonCancel = new Button { Text = "Annulla", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, BackgroundColor = Color.Transparent, }; var buttonConfirm = new Button { Text = "Conferma", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, BackgroundColor = Color.Transparent, }; stackBottoni.Children.Add(griglia); griglia.Children.Add((buttonCancel)); //inzia nella prima colonna griglia.Children.Add((buttonConfirm)); //inizia seconda colonna Grid.SetColumn(buttonCancel, 0); //mi è toccato farlo qui Grid.SetColumn(buttonConfirm, 1); switch (Device.RuntimePlatform) { case Device.Android: stackFondoAndroid.Children.Add(fondomerende); stackBody.Children.Add(stackFondoAndroid); break; case Device.iOS: stackFondoiOS.Children.Add(fondomerende); stackBody.Children.Add(stackFondoiOS); break; } entryUsername.TextChanged += EntrataUsername; entryFriendlyName.TextChanged += EntrataFriendlyName; entryNewPassword.TextChanged += EntrataPasswordNuova; buttonCancel.Clicked += Discard_Clicked; buttonConfirm.Clicked += ApplyChanges_Clicked_1; entryUsername.Placeholder = Preferences.Get("username", null); entryFriendlyName.Placeholder = Preferences.Get("friendly-name", null); entryNewPassword.Placeholder = "Nuova Password "; stackBody.Children.Add(stackImgBtn); stackBody.Children.Add(entryUsername); stackBody.Children.Add(entryFriendlyName); stackBody.Children.Add(entryNewPassword); stackBody.Children.Add(stackBottoni); Round.Children.Add(stackBody); EditUserInfoPopUpXaml.Content = Round; }