コード例 #1
0
 /// ------------------------------------------------------------------------------------------------
 /// Name		AddTypedCell
 ///
 /// <summary>	Adds the paragraph to the stacklayout after save function is executed in paragraphViewcell
 /// </summary>
 ///  <param name="sRiActionParagraph">		The paragraph being entered.</param>
 /// <remarks>
 /// </remarks>
 /// ------------------------------------------------------------------------------------------------
 private void AddTypedCell(SRiActionParagraph sRiActionParagraph)
 {
     if (sRiActionParagraph.PlainText.Contains("^IN"))
     {
         // TblSec_ParagraphList.Add(new ParagraphInputViewCell() { BindingContext = sRiActionParagraph });
     }
     else
     {
         var customCell = AppData.PropertyModel.SelectedAction.Action.Paragraphs.FirstOrDefault(x => x == sRiActionParagraph);
         if (customCell != null)/* customCell.CellType = CellTypes.Custom;*/
         {
             TblSec_ParagraphList.Add(new ParagraphCustomViewCell()
             {
                 BindingContext = sRiActionParagraph
             });
         }
     }
     //else if (sRiActionParagraph.PlainText.Contains("^IN"))
     //{
     //    TblSec_ParagraphList.Add(new ParagraphInputViewCell() { BindingContext = sRiActionParagraph });
     //}
     //else
     //{
     //    TblSec_ParagraphList.Add(new ParagraphNormalViewCell() { BindingContext = sRiActionParagraph });
     //}
 }
コード例 #2
0
        /// ------------------------------------------------------------------------------------------------
        /// Name		AddTypedCell
        ///
        /// <summary>	Adds the paragraph to the stacklayout after save function is executed in paragraphViewcell
        /// </summary>
        ///  <param name="sRiActionParagraph">		The paragraph being entered.</param>
        /// <remarks>
        /// </remarks>
        /// ------------------------------------------------------------------------------------------------
        private void AddTypedCell(SRiActionParagraph sRiActionParagraph)
        {
            try
            {
                Tblvw_StandardParagraph.IsVisible = true;
                if (Device.OS == TargetPlatform.Android)
                {
                    var address = sRiActionParagraph.Text?.Replace("\r",
                                                                   Environment.NewLine);
                    sRiActionParagraph.Text = address;
                }

                if (sRiActionParagraph.PlainText.Contains("^IN"))
                {
                    //sRiActionParagraph.IsCellEditable = true;
                    //sRiActionParagraph.IsEditable = true;
                    TblSec_ParagraphList.Add(new ParagraphInputViewCell()
                    {
                        BindingContext = sRiActionParagraph
                    });
                }
                else if (sRiActionParagraph.PlainText == ParagraphViewModel.CUSTOM_PLACEHOLDER ||
                         sRiActionParagraph.CellType == CellTypes.Custom)
                {
                    var customCell = AppData.PropertyModel.SelectedAction.Action.Paragraphs.FirstOrDefault(x => x == sRiActionParagraph);
                    if (customCell != null)
                    {
                        customCell.CellType = CellTypes.Custom;
                        if (customCell.Text == ParagraphViewModel.CUSTOM_PLACEHOLDER)
                        {
                            customCell.Text = ParagraphViewModel.TAP_CUSTOM_PLACEHOLDER;
                        }
                    }
                    TblSec_ParagraphList.Add(new ParagraphCustomViewCell()
                    {
                        BindingContext = sRiActionParagraph
                    });
                }
                else
                {
                    TblSec_ParagraphList.Add(new ParagraphNormalViewCell()
                    {
                        BindingContext = sRiActionParagraph
                    });
                }
                TblSection = TblSec_ParagraphList;
            }
            catch (Exception ex)
            {
                LogTracking.LogTrace(ex.ToString());
            }
        }
コード例 #3
0
        /// ------------------------------------------------------------------------------------------------
        /// Name		RefreshList
        ///
        /// <summary>	Refresh the lists while the paragraph is selected and adds the next type and para.
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// ------------------------------------------------------------------------------------------------
        private void RefreshList()
        {
            int count = 0;

            TblSec_ParagraphList.Clear();
            if (Paralist != null)
            {
                foreach (var sRiActionParagraph in Paralist)
                {
                    sRiActionParagraph.Modified = IsEditable;
                    AddTypedCell(sRiActionParagraph);
                    count++;
                }
            }

            Tblvw_StandardParagraph.HeightRequest = count * 100 + 150;
            Sl_Main.HeightRequest = count * 100 + 185;
        }
コード例 #4
0
        /// ------------------------------------------------------------------------------------------------
        /// Name		RefreshList
        ///
        /// <summary>	Refresh the lists while the paragraph is selected and adds the next type and para.
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// ------------------------------------------------------------------------------------------------
        public void RefreshList()
        {
            try
            {
                int count = 0;
                TblSec_ParagraphList.Clear();
                if (Paralist != null)
                {
                    foreach (var sRiActionParagraph in Paralist)
                    {
                        sRiActionParagraph.IsEditable = IsEditable;
                        if (SingleTypeCode != null)
                        {
                            if (SingleTypeCode.Contains(sRiActionParagraph.ParagraphType))
                            {
                                sRiActionParagraph.IsCellEditable = !IsCellEditable;
                            }
                            else
                            {
                                sRiActionParagraph.IsCellEditable = IsCellEditable;
                            }
                        }
                        else
                        {
                            sRiActionParagraph.IsCellEditable = IsCellEditable;
                        }
                        AddTypedCell(sRiActionParagraph);
                        count++;
                    }
                }

                if ((Device.OS == TargetPlatform.Android) || (Device.OS == TargetPlatform.iOS))
                {
                    if (count > 0)
                    {
                        Tblvw_StandardParagraph.HeightRequest = count * 105;
                        Sl_Main.HeightRequest = count * 105 + 185;
                    }
                    else
                    {
                        Tblvw_StandardParagraph.HeightRequest = 0;
                        Sl_Main.HeightRequest = -1;
                    }
                }
                else
                {
                    if (count > 0)
                    {
                        Tblvw_StandardParagraph.HeightRequest = count * 105 + 150;
                        Sl_Main.HeightRequest = count * 105 + 185;
                    }
                    else
                    {
                        Tblvw_StandardParagraph.HeightRequest = 0;
                        Sl_Main.HeightRequest = -1;
                    }
                }
            }
            catch (Exception ex)
            {
                LogTracking.LogTrace(ex.ToString());
            }
        }