コード例 #1
0
ファイル: fmSLClientWizard.cs プロジェクト: san90279/UK_OAS
        //private void GenMainBlockControlFor3DCard(TBlockItem BlockItem, int columnCount)
        //{
        //    BlockItem.wDataSource = new WebDataSource();
        //    String strReadOnlyTemplate = ComposeFormViewXML(BlockItem.BlockFieldItems, "ReadOnlyTemplate", columnCount);
        //    WriteToXaml(FClientData.FullXamlName, "<Grid><toolkit:DataField x:Name=\"fvMasterReadOnlyTemplate\" /></Grid>", strReadOnlyTemplate);
        //    String strNewItemTemplate = ComposeFormViewXML(BlockItem.BlockFieldItems, "NewItemTemplate", columnCount);
        //    WriteToXaml(FClientData.FullXamlName, "<Grid><toolkit:DataField x:Name=\"fvMasterNewItemTemplate\" /></Grid>", strNewItemTemplate);
        //    String strEditTemplate = ComposeFormViewXML(BlockItem.BlockFieldItems, "EditTemplate", columnCount);
        //    WriteToXaml(FClientData.FullXamlName, "<Grid><toolkit:DataField x:Name=\"fvMasterEditTemplate\" /></Grid>", strEditTemplate);
        //    String strGridViewColumns = ComposeGridViewXML(BlockItem.BlockFieldItems);
        //    WriteToXaml(FClientData.FullXamlName,
        //                "<SLTools:SLDataGrid.Columns><data:DataGridTextColumn Header=\"gvMasterDataGridColumns\" /></SLTools:SLDataGrid.Columns>",
        //                strGridViewColumns);
        //}
        private String ComposeViewFormViewXML(TBlockFieldItems BlockFieldItems, String mode, int columnCount)
        {
            XmlDocument xmlTemplate = new XmlDocument();
            XmlNode xnTemplate = xmlTemplate.CreateNode(XmlNodeType.Element, "Grid", "");
            XmlAttribute xaMargin = xmlTemplate.CreateAttribute("Margin");
            xaMargin.Value = "10,5,10,5";
            xnTemplate.Attributes.Append(xaMargin);
            XmlNode xdGridRowDefinitions = xmlTemplate.CreateNode(XmlNodeType.Element, "Grid.RowDefinitions", "");
            double temp = Convert.ToDouble(BlockFieldItems.Count) / Convert.ToDouble(columnCount);
            for (int i = 0; i < System.Math.Ceiling(temp); i++)
            {
                XmlNode xmlRowDefinition = xmlTemplate.CreateNode(XmlNodeType.Element, "RowDefinition", "");
                XmlAttribute xaHeight = xmlTemplate.CreateAttribute("Height");
                xaHeight.Value = "30";
                xmlRowDefinition.Attributes.Append(xaHeight);
                xdGridRowDefinitions.AppendChild(xmlRowDefinition);
            }
            xnTemplate.AppendChild(xdGridRowDefinitions);

            XmlNode xdGridColumnDefinitions = xmlTemplate.CreateNode(XmlNodeType.Element, "Grid.ColumnDefinitions", "");
            for (int i = 0; i < columnCount; i++)
            {
                XmlNode xmlColumnDefinition = xmlTemplate.CreateNode(XmlNodeType.Element, "ColumnDefinition", "");
                xdGridColumnDefinitions.AppendChild(xmlColumnDefinition);
            }
            xnTemplate.AppendChild(xdGridColumnDefinitions);

            int X = 0;
            foreach (TBlockFieldItem BFI in BlockFieldItems)
            {
                XmlNode xnFiels = xmlTemplate.CreateNode(XmlNodeType.Element, "toolkit", "DataField", "infolight");
                XmlAttribute xaGridRow = xmlTemplate.CreateAttribute("Grid.Row");
                xaGridRow.Value = (X / columnCount).ToString();
                xnFiels.Attributes.Append(xaGridRow);

                XmlAttribute xaGridColumn = xmlTemplate.CreateAttribute("Grid.Column");
                xaGridColumn.Value = (X % columnCount).ToString();
                xnFiels.Attributes.Append(xaGridColumn);

                XmlAttribute xaLabelStyle = xmlTemplate.CreateAttribute("LabelStyle");
                xaLabelStyle.Value = "{StaticResource FieldCaptionStyle}";
                xnFiels.Attributes.Append(xaLabelStyle);

                XmlAttribute xaForegroundStyle = xmlTemplate.CreateAttribute("Style");
                xaForegroundStyle.Value = "{StaticResource FieldForegroundStyle}";
                xnFiels.Attributes.Append(xaForegroundStyle);

                XmlAttribute xaLabel = xmlTemplate.CreateAttribute("Label");
                if (BFI.Description == null || BFI.Description == String.Empty || BFI.Description == " ")
                    xaLabel.Value = BFI.DataField;
                else
                    xaLabel.Value = BFI.Description;
                xnFiels.Attributes.Append(xaLabel);

                XmlNode xnFieldControl = null;
                if (BFI.ControlType == "TextBox")
                {
                    if (mode == "ReadOnlyTemplate")
                    {
                        xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLTextBox", "infolight");
                        XmlAttribute xaBindingField = xmlTemplate.CreateAttribute("BindingField");
                        xaBindingField.Value = BFI.DataField;
                        xnFieldControl.Attributes.Append(xaBindingField);

                        //XmlAttribute xaText = xmlTemplate.CreateAttribute("Text");
                        //xaText.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "OneWay");
                        //xaText.Value = "{" + xaText.Value + "}";
                        //xnFieldControl.Attributes.Append(xaText);

                        XmlAttribute xaWidth = xmlTemplate.CreateAttribute("Width");
                        xaWidth.Value = "180";
                        xnFieldControl.Attributes.Append(xaWidth);

                        XmlAttribute xaHorizontalAlignment = xmlTemplate.CreateAttribute("HorizontalAlignment");
                        xaHorizontalAlignment.Value = "Left";
                        xnFieldControl.Attributes.Append(xaHorizontalAlignment);

                        XmlAttribute xaName = xmlTemplate.CreateAttribute("Name");
                        xaName.Value = "TextBox" + BFI.DataField;
                        xnFieldControl.Attributes.Append(xaName);

                        //给FormView的ItemTemplate加上只读
                        if (FClientData.BaseFormName == "SL3DCard" || FClientData.BaseFormName == "SL3DCardMasterDetail"
                            || FClientData.BaseFormName == "SLFormList" || FClientData.BaseFormName == "SLFormListMasterDetail")
                        {
                            XmlAttribute xaIsEnabled = xmlTemplate.CreateAttribute("IsEnabled");
                            xaIsEnabled.Value = "False";
                            xnFieldControl.Attributes.Append(xaIsEnabled);
                        }
                    }
                    else if (mode == "NewItemTemplate" || mode == "EditTemplate")
                    {
                        xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLTextBox", "infolight");
                        XmlAttribute xaBindingField = xmlTemplate.CreateAttribute("BindingField");
                        xaBindingField.Value = BFI.DataField;
                        xnFieldControl.Attributes.Append(xaBindingField);

                        //xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "TextBox", "");
                        //XmlAttribute xaText = xmlTemplate.CreateAttribute("Text");
                        //xaText.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "TwoWay");
                        //xaText.Value = "{" + xaText.Value + "}";
                        //xnFieldControl.Attributes.Append(xaText);

                        XmlAttribute xaStyle = xmlTemplate.CreateAttribute("Style");
                        xaStyle.Value = "{StaticResource FieldEditor}";
                        xnFieldControl.Attributes.Append(xaStyle);

                        XmlAttribute xaWidth = xmlTemplate.CreateAttribute("Width");
                        xaWidth.Value = "180";
                        xnFieldControl.Attributes.Append(xaWidth);

                        XmlAttribute xaHorizontalAlignment = xmlTemplate.CreateAttribute("HorizontalAlignment");
                        xaHorizontalAlignment.Value = "Left";
                        xnFieldControl.Attributes.Append(xaHorizontalAlignment);

                        XmlAttribute xaName = xmlTemplate.CreateAttribute("Name");
                        xaName.Value = "TextBox" + BFI.DataField;
                        xnFieldControl.Attributes.Append(xaName);
                    }
                }
                else if (BFI.ControlType == "DateTimeBox")
                {
                    if (mode == "ReadOnlyTemplate")
                    {
                        xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLTextBox", "infolight");
                        XmlAttribute xaBindingField = xmlTemplate.CreateAttribute("BindingField");
                        xaBindingField.Value = BFI.DataField;
                        xnFieldControl.Attributes.Append(xaBindingField);

                        //xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "TextBox", "");
                        //XmlAttribute xaText = xmlTemplate.CreateAttribute("Text");
                        //xaText.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "OneWay");
                        //xaText.Value = "{" + xaText.Value + "}";
                        //xnFieldControl.Attributes.Append(xaText);

                        XmlAttribute xaWidth = xmlTemplate.CreateAttribute("Width");
                        xaWidth.Value = "180";
                        xnFieldControl.Attributes.Append(xaWidth);

                        XmlAttribute xaHorizontalAlignment = xmlTemplate.CreateAttribute("HorizontalAlignment");
                        xaHorizontalAlignment.Value = "Left";
                        xnFieldControl.Attributes.Append(xaHorizontalAlignment);

                        XmlAttribute xaName = xmlTemplate.CreateAttribute("Name");
                        xaName.Value = "DateTime" + BFI.DataField;
                        xnFieldControl.Attributes.Append(xaName);

                        //给FormView的ItemTemplate加上只读
                        if (FClientData.BaseFormName == "SL3DCard" || FClientData.BaseFormName == "SL3DCardMasterDetail"
                            || FClientData.BaseFormName == "SLFormList" || FClientData.BaseFormName == "SLFormListMasterDetail")
                        {
                            XmlAttribute xaIsEnabled = xmlTemplate.CreateAttribute("IsEnabled");
                            xaIsEnabled.Value = "False";
                            xnFieldControl.Attributes.Append(xaIsEnabled);
                        }
                    }
                    else if (mode == "NewItemTemplate" || mode == "EditTemplate")
                    {
                        xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "controls", "DatePicker", "infolight");
                        XmlAttribute xaSelectedDate = xmlTemplate.CreateAttribute("SelectedDate");
                        xaSelectedDate.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "TwoWay");
                        xaSelectedDate.Value = "{" + xaSelectedDate.Value + "}";
                        xnFieldControl.Attributes.Append(xaSelectedDate);

                        XmlAttribute xaStyle = xmlTemplate.CreateAttribute("Style");
                        xaStyle.Value = "{StaticResource FieldEditor}";
                        xnFieldControl.Attributes.Append(xaStyle);

                        XmlAttribute xaWidth = xmlTemplate.CreateAttribute("Width");
                        xaWidth.Value = "180";
                        xnFieldControl.Attributes.Append(xaWidth);

                        XmlAttribute xaHorizontalAlignment = xmlTemplate.CreateAttribute("HorizontalAlignment");
                        xaHorizontalAlignment.Value = "Left";
                        xnFieldControl.Attributes.Append(xaHorizontalAlignment);

                        XmlAttribute xaName = xmlTemplate.CreateAttribute("Name");
                        xaName.Value = "DateTime" + BFI.DataField;
                        xnFieldControl.Attributes.Append(xaName);
                    }
                }
                else
                {
                    if (mode == "ReadOnlyTemplate")
                    {
                        xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLTextBox", "infolight");
                        XmlAttribute xaBindingField = xmlTemplate.CreateAttribute("BindingField");
                        xaBindingField.Value = BFI.DataField;
                        xnFieldControl.Attributes.Append(xaBindingField);

                        //xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "TextBox", "");
                        //XmlAttribute xaText = xmlTemplate.CreateAttribute("Text");
                        //xaText.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "OneWay");
                        //xaText.Value = "{" + xaText.Value + "}";
                        //xnFieldControl.Attributes.Append(xaText);

                        XmlAttribute xaWidth = xmlTemplate.CreateAttribute("Width");
                        xaWidth.Value = "180";
                        xnFieldControl.Attributes.Append(xaWidth);

                        XmlAttribute xaHorizontalAlignment = xmlTemplate.CreateAttribute("HorizontalAlignment");
                        xaHorizontalAlignment.Value = "Left";
                        xnFieldControl.Attributes.Append(xaHorizontalAlignment);

                        XmlAttribute xaName = xmlTemplate.CreateAttribute("Name");
                        xaName.Value = "TextBox" + BFI.DataField;
                        xnFieldControl.Attributes.Append(xaName);

                        //给FormView的ItemTemplate加上只读
                        if (FClientData.BaseFormName == "SL3DCard" || FClientData.BaseFormName == "SL3DCardMasterDetail"
                            || FClientData.BaseFormName == "SLFormList" || FClientData.BaseFormName == "SLFormListMasterDetail")
                        {
                            XmlAttribute xaIsEnabled = xmlTemplate.CreateAttribute("IsEnabled");
                            xaIsEnabled.Value = "False";
                            xnFieldControl.Attributes.Append(xaIsEnabled);
                        }
                    }
                    else if (mode == "NewItemTemplate" || mode == "EditTemplate")
                    {
                        xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLTextBox", "infolight");
                        XmlAttribute xaBindingField = xmlTemplate.CreateAttribute("BindingField");
                        xaBindingField.Value = BFI.DataField;
                        xnFieldControl.Attributes.Append(xaBindingField);

                        //xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "TextBox", "");
                        //XmlAttribute xaText = xmlTemplate.CreateAttribute("Text");
                        //xaText.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "TwoWay");
                        //xaText.Value = "{" + xaText.Value + "}";
                        //xnFieldControl.Attributes.Append(xaText);

                        XmlAttribute xaStyle = xmlTemplate.CreateAttribute("Style");
                        xaStyle.Value = "{StaticResource FieldEditor}";
                        xnFieldControl.Attributes.Append(xaStyle);

                        XmlAttribute xaWidth = xmlTemplate.CreateAttribute("Width");
                        xaWidth.Value = "180";
                        xnFieldControl.Attributes.Append(xaWidth);

                        XmlAttribute xaHorizontalAlignment = xmlTemplate.CreateAttribute("HorizontalAlignment");
                        xaHorizontalAlignment.Value = "Left";
                        xnFieldControl.Attributes.Append(xaHorizontalAlignment);

                        XmlAttribute xaName = xmlTemplate.CreateAttribute("Name");
                        xaName.Value = "TextBox" + BFI.DataField;
                        xnFieldControl.Attributes.Append(xaName);
                    }
                }
                xnFiels.AppendChild(xnFieldControl);
                xnTemplate.AppendChild(xnFiels);
                X++;
            }
            return xnTemplate.OuterXml.Replace("xmlns:toolkit=\"infolight\"", String.Empty).Replace("xmlns:controls=\"infolight\"", String.Empty).Replace("xmlns:SLTools=\"infolight\"", String.Empty);
        }
コード例 #2
0
ファイル: fmJQueryToJQMobile.cs プロジェクト: san90279/UK_OAS
 private void LoadBlockFieldItems(XmlNode Node, TBlockFieldItems BlockFieldItems)
 {
     TBlockFieldItem BFI;
     int I;
     XmlNode BlockFieldItemNode;
     for (I = 0; I < Node.ChildNodes.Count; I++)
     {
         BlockFieldItemNode = Node.ChildNodes[I];
         BFI = new TBlockFieldItem();
         BFI.DataField = BlockFieldItemNode.Attributes["DataField"].Value;
         BFI.Description = BlockFieldItemNode.Attributes["Description"].Value;
         BFI.Length = int.Parse(BlockFieldItemNode.Attributes["Length"].Value.ToString());
         foreach (XmlNode RefNode in BlockFieldItemNode.ChildNodes)
         {
             BFI.RefField = new TRefField();
             BFI.RefField.SelectCommand = RefNode.Attributes["SelectCommand"].Value;
             BFI.RefField.ValueMember = RefNode.Attributes["ValueMember"].Value;
             BFI.RefField.DisplayMember = RefNode.Attributes["DisplayMember"].Value;
             foreach (XmlNode ColumnNode in RefNode.ChildNodes)
             {
                 RefColumns aColumn = new RefColumns();
                 aColumn.Column = ColumnNode.Attributes["Column"].Value;
                 aColumn.HeaderText = ColumnNode.Attributes["HeaderText"].Value;
                 aColumn.Width = int.Parse(ColumnNode.Attributes["Width"].Value);
                 BFI.RefField.LookupColumns.Add(aColumn);
             }
         }
         //IPC保留缺口
         //BlockFieldItem.CheckNull = DR["CHECK_NULL"].ToString();
         //BlockFieldItem.DefaultValue = DR["DEFAULT_VALUE"].ToString();
         BlockFieldItems.Add(BFI);
     }
 }
コード例 #3
0
ファイル: fmSLClientWizard.cs プロジェクト: san90279/UK_OAS
        private String ComposeSLCardToolTipXML(TBlockFieldItems BlockItems)
        {
            String tooltipField = String.Empty;
            String tooltipFormat = String.Empty;
            foreach (TBlockFieldItem BlockItem in BlockItems)
            {
                if (BlockItem.IsKey)
                {
                    tooltipField = String.Format("TooltipField=\"{0}\" ", BlockItem.DataField);
                    tooltipFormat = "TooltipFormat=\"此筆記錄為'{0}'的" + BlockItem.Description + "\"";
                    break;
                }
            }

            return tooltipField + tooltipFormat;
        }
コード例 #4
0
ファイル: fmSLClientWizard.cs プロジェクト: san90279/UK_OAS
        private String ComposeValidatorXML(TBlockFieldItems BlockItems, String validatorName, String dataObjectID)
        {
            XmlDocument xmlTemplate = new XmlDocument();
            XmlNode xnTemplate = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLValidator", "infolight");
            XmlAttribute xaName = xmlTemplate.CreateAttribute("x", "Name", "infolight");
            xaName.Value = validatorName;
            xnTemplate.Attributes.Append(xaName);

            XmlAttribute xaDataObjectID = xmlTemplate.CreateAttribute("DataObjectID");
            xaDataObjectID.Value = dataObjectID;
            xnTemplate.Attributes.Append(xaDataObjectID);

            if (BlockItems.Count > 0)
            {
                XmlNode xnDefaultValues = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLValidator.Validates", "infolight");
                foreach (TBlockFieldItem BlockItem in BlockItems)
                {
                    if (BlockItem.CheckNull != null && BlockItem.CheckNull != String.Empty && BlockItem.CheckNull != "N")
                    {
                        XmlNode xnSLDefaultItem = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLValidateItem", "infolight");
                        XmlAttribute xaCheckNull = xmlTemplate.CreateAttribute("CheckNull", "");
                        if (BlockItem.CheckNull.ToUpper() == "Y")
                            xaCheckNull.Value = "True";
                        else
                            xaCheckNull.Value = "False";
                        xnSLDefaultItem.Attributes.Append(xaCheckNull);

                        XmlAttribute xaFieldName = xmlTemplate.CreateAttribute("FieldName");
                        xaFieldName.Value = BlockItem.DataField;
                        xnSLDefaultItem.Attributes.Append(xaFieldName);

                        XmlAttribute xaCaptionControlName = xmlTemplate.CreateAttribute("CaptionControlName");
                        xaCaptionControlName.Value = BlockItem.DataField;
                        xnSLDefaultItem.Attributes.Append(xaCaptionControlName);

                        xnDefaultValues.AppendChild(xnSLDefaultItem);
                    }
                }
                if (xnDefaultValues.ChildNodes.Count > 0)
                    xnTemplate.AppendChild(xnDefaultValues);
            }
            String returnValue = xnTemplate.OuterXml;

            //FSLComboDataSource.Add(dataSourcrName);
            return returnValue.Replace("xmlns:SLTools=\"infolight\"", String.Empty).Replace("xmlns:x=\"infolight\"", String.Empty);
        }
コード例 #5
0
ファイル: fmSLClientWizard.cs プロジェクト: san90279/UK_OAS
        private String ComposeGridViewXML(TBlockFieldItems BlockFieldItems)
        {
            XmlDocument xmlTemplate = new XmlDocument();
            XmlNode xnTemplate = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLDataGrid.Columns", "infolight");

            foreach (TBlockFieldItem BFI in BlockFieldItems)
            {
                String ControlTypeOldValue = BFI.ControlType;
                if (String.IsNullOrEmpty(BFI.ControlType) || String.IsNullOrEmpty(BFI.ComboRemoteName))
                    BFI.ControlType = "TextBox";

                if (FClientData.BaseFormName != "SL3DCardMasterDetail" || FClientData.BaseFormName == "SLFormListMasterDetail")
                {
                    BFI.ControlType = "TextBox";
                }

                XmlNode xnFiels = null;

                if (BFI.ControlType == "ComboBox")
                {
                    xnFiels = xmlTemplate.CreateNode(XmlNodeType.Element, "data", "DataGridTemplateColumn", "infolight");
                    XmlNode xnDataGridTemplateColumnCellTemplate = xmlTemplate.CreateNode(XmlNodeType.Element, "data", "DataGridTemplateColumn.CellTemplate", "infolight");
                    XmlNode xnDataTemplate = xmlTemplate.CreateNode(XmlNodeType.Element, "DataTemplate", "");
                    XmlNode xnGrid = xmlTemplate.CreateNode(XmlNodeType.Element, "Grid", "");
                    XmlNode xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "TextBlock", "");
                    XmlAttribute xaName = xmlTemplate.CreateAttribute("Name");
                    xaName.Value = "TextBlock" + BFI.DataField;
                    xnFieldControl.Attributes.Append(xaName);

                    XmlAttribute xaText = xmlTemplate.CreateAttribute("Text");
                    xaText.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "TwoWay");
                    xaText.Value = "{" + xaText.Value + "}";
                    xnFieldControl.Attributes.Append(xaText);

                    XmlAttribute xaWidth = xmlTemplate.CreateAttribute("Width");
                    xaWidth.Value = "180";
                    xnFieldControl.Attributes.Append(xaWidth);

                    xnGrid.AppendChild(xnFieldControl);
                    xnDataTemplate.AppendChild(xnGrid);
                    xnDataGridTemplateColumnCellTemplate.AppendChild(xnDataTemplate);
                    xnFiels.AppendChild(xnDataGridTemplateColumnCellTemplate);

                    XmlNode xnDataGridTemplateColumnCellEditingTemplate = xmlTemplate.CreateNode(XmlNodeType.Element, "data", "DataGridTemplateColumn.CellEditingTemplate", "infolight");
                    xnDataTemplate = xmlTemplate.CreateNode(XmlNodeType.Element, "DataTemplate", "");
                    xnGrid = xmlTemplate.CreateNode(XmlNodeType.Element, "Grid", "");
                    String serviceDataSourceName = "combo" + BFI.ComboEntityName;
                    String collectionViewSourceName = "category" + serviceDataSourceName + "Source";

                    if (!FSLComboDataSource.Contains(serviceDataSourceName))
                    {
                        String xmlServiceDataSource = ComposeServiceDataSourceXML(serviceDataSourceName, BFI.ComboRemoteName, BFI.IsInfoCommand);
                        WriteToXaml(FClientData.FullXamlName, "</Grid.Resources>", "</Grid.Resources>" + xmlServiceDataSource);

                        String xmlComboCollectionSource = ComposeCollectionSourceXML(collectionViewSourceName, serviceDataSourceName);
                        WriteToXaml(FClientData.FullXamlName, "</Grid.Resources>", xmlComboCollectionSource + "</Grid.Resources>");
                    }

                    xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLComboBox", "infolight");
                    xaName = xmlTemplate.CreateAttribute("Name");
                    xaName.Value = "Combo" + BFI.DataField;
                    xnFieldControl.Attributes.Append(xaName);

                    XmlAttribute xaSelectedValuePath = xmlTemplate.CreateAttribute("SelectedValuePath");
                    xaSelectedValuePath.Value = BFI.ComboValueField;
                    xnFieldControl.Attributes.Append(xaSelectedValuePath);

                    XmlAttribute xaDisplayMemberPath = xmlTemplate.CreateAttribute("DisplayMemberPath");
                    xaDisplayMemberPath.Value = BFI.ComboTextField;
                    xnFieldControl.Attributes.Append(xaDisplayMemberPath);

                    XmlAttribute xaDataSourceID = xmlTemplate.CreateAttribute("DataSourceID");
                    xaDataSourceID.Value = serviceDataSourceName;
                    xnFieldControl.Attributes.Append(xaDataSourceID);

                    XmlAttribute xaItemsSource = xmlTemplate.CreateAttribute("ItemsSource");
                    xaItemsSource.Value = "{Binding Source={StaticResource " + collectionViewSourceName + "}}";
                    xnFieldControl.Attributes.Append(xaItemsSource);

                    xaWidth = xmlTemplate.CreateAttribute("Width");
                    xaWidth.Value = "180";
                    xnFieldControl.Attributes.Append(xaWidth);

                    //XmlAttribute xaBindingField = xmlTemplate.CreateAttribute("BindingField");
                    //xaBindingField.Value = BFI.DataField;
                    //xnFieldControl.Attributes.Append(xaBindingField);

                    XmlAttribute xaSelectedValue = xmlTemplate.CreateAttribute("SelectedValue");
                    xaSelectedValue.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "TwoWay");
                    xaSelectedValue.Value = "{" + xaSelectedValue.Value + "}";
                    xnFieldControl.Attributes.Append(xaSelectedValue);

                    XmlAttribute xaHorizontalAlignment = xmlTemplate.CreateAttribute("HorizontalAlignment");
                    xaHorizontalAlignment.Value = "Left";
                    xnFieldControl.Attributes.Append(xaHorizontalAlignment);

                    xnGrid.AppendChild(xnFieldControl);
                    xnDataTemplate.AppendChild(xnGrid);
                    xnDataGridTemplateColumnCellEditingTemplate.AppendChild(xnDataTemplate);
                    xnFiels.AppendChild(xnDataGridTemplateColumnCellEditingTemplate);
                }
                else if (BFI.ControlType == "RefValBox")
                {
                    xnFiels = xmlTemplate.CreateNode(XmlNodeType.Element, "data", "DataGridTemplateColumn", "infolight");
                    XmlNode xnDataGridTemplateColumnCellTemplate = xmlTemplate.CreateNode(XmlNodeType.Element, "data", "DataGridTemplateColumn.CellTemplate", "infolight");
                    XmlNode xnDataTemplate = xmlTemplate.CreateNode(XmlNodeType.Element, "DataTemplate", "");
                    XmlNode xnGrid = xmlTemplate.CreateNode(XmlNodeType.Element, "Grid", "");
                    XmlNode xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "TextBlock", "");
                    XmlAttribute xaName = xmlTemplate.CreateAttribute("Name");
                    xaName.Value = "TextBlock" + BFI.DataField;
                    xnFieldControl.Attributes.Append(xaName);

                    XmlAttribute xaText = xmlTemplate.CreateAttribute("Text");
                    xaText.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "OneWay");
                    xaText.Value = "{" + xaText.Value + "}";
                    xnFieldControl.Attributes.Append(xaText);

                    XmlAttribute xaWidth = xmlTemplate.CreateAttribute("Width");
                    xaWidth.Value = "180";
                    xnFieldControl.Attributes.Append(xaWidth);

                    xnGrid.AppendChild(xnFieldControl);
                    xnDataTemplate.AppendChild(xnGrid);
                    xnDataGridTemplateColumnCellTemplate.AppendChild(xnDataTemplate);
                    xnFiels.AppendChild(xnDataGridTemplateColumnCellTemplate);

                    XmlNode xnDataGridTemplateColumnCellEditingTemplate = xmlTemplate.CreateNode(XmlNodeType.Element, "data", "DataGridTemplateColumn.CellEditingTemplate", "infolight");
                    xnDataTemplate = xmlTemplate.CreateNode(XmlNodeType.Element, "DataTemplate", "");
                    xnGrid = xmlTemplate.CreateNode(XmlNodeType.Element, "Grid", "");

                    String serviceDataSourceName = "refval" + BFI.ComboEntityName;
                    String collectionViewSourceName = "category" + serviceDataSourceName + "Source";

                    if (!FSLComboDataSource.Contains(serviceDataSourceName))
                    {
                        String xmlServiceDataSource = ComposeServiceDataSourceXML(serviceDataSourceName, BFI.ComboRemoteName, BFI.IsInfoCommand);
                        WriteToXaml(FClientData.FullXamlName, "</Grid.Resources>", "</Grid.Resources>" + xmlServiceDataSource);

                        String xmlComboCollectionSource = ComposeCollectionSourceXML(collectionViewSourceName, serviceDataSourceName);
                        WriteToXaml(FClientData.FullXamlName, "</Grid.Resources>", xmlComboCollectionSource + "</Grid.Resources>");
                    }

                    xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLRefval", "infolight");
                    xaName = xmlTemplate.CreateAttribute("Name");
                    xaName.Value = "Refval" + BFI.DataField;
                    xnFieldControl.Attributes.Append(xaName);

                    XmlAttribute xaMode = xmlTemplate.CreateAttribute("Mode");
                    xaMode.Value = "PopupWindow";
                    xnFieldControl.Attributes.Append(xaMode);

                    xaWidth = xmlTemplate.CreateAttribute("Width");
                    xaWidth.Value = "180";
                    xnFieldControl.Attributes.Append(xaWidth);

                    XmlAttribute xaSelectedValue = xmlTemplate.CreateAttribute("SelectedValue");
                    xaSelectedValue.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "TwoWay");
                    xaSelectedValue.Value = "{" + xaSelectedValue.Value + "}";
                    xnFieldControl.Attributes.Append(xaSelectedValue);

                    XmlAttribute xaValueMemberPath = xmlTemplate.CreateAttribute("ValueMemberPath");
                    xaValueMemberPath.Value = BFI.ComboValueField;
                    xnFieldControl.Attributes.Append(xaValueMemberPath);

                    XmlAttribute xaDisplayMemberPath = xmlTemplate.CreateAttribute("DisplayMemberPath");
                    xaDisplayMemberPath.Value = BFI.ComboTextField;
                    xnFieldControl.Attributes.Append(xaDisplayMemberPath);

                    XmlAttribute xaItemsSource = xmlTemplate.CreateAttribute("ItemsSource");
                    xaItemsSource.Value = "{Binding Source={StaticResource " + collectionViewSourceName + "}}";
                    xnFieldControl.Attributes.Append(xaItemsSource);

                    XmlAttribute xaDataSourceID = xmlTemplate.CreateAttribute("DataSourceID");
                    xaDataSourceID.Value = serviceDataSourceName;
                    xnFieldControl.Attributes.Append(xaDataSourceID);

                    XmlAttribute xaOpenSize = xmlTemplate.CreateAttribute("OpenSize");
                    xaOpenSize.Value = "500,400";
                    xnFieldControl.Attributes.Append(xaOpenSize);

                    XmlNode xnSLRefvalColumns = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLRefval.Columns", "infolight");
                    //ValueMember
                    XmlNode xnRefvalColumnValueMember = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "RefvalColumn", "infolight");
                    XmlAttribute xaValueMemberFieldName = xmlTemplate.CreateAttribute("FieldName");
                    xaValueMemberFieldName.Value = BFI.ComboValueField;
                    xnRefvalColumnValueMember.Attributes.Append(xaValueMemberFieldName);

                    XmlAttribute xaValueMemberHeadText = xmlTemplate.CreateAttribute("HeadText");
                    xaValueMemberHeadText.Value = String.IsNullOrEmpty(BFI.ComboValueFieldCaption) ? BFI.ComboValueField : BFI.ComboValueFieldCaption;
                    xnRefvalColumnValueMember.Attributes.Append(xaValueMemberHeadText);

                    XmlAttribute xaValueMemberWidth = xmlTemplate.CreateAttribute("Width");
                    xaValueMemberWidth.Value = "100";
                    xnRefvalColumnValueMember.Attributes.Append(xaValueMemberWidth);
                    xnSLRefvalColumns.AppendChild(xnRefvalColumnValueMember);
                    xnFieldControl.AppendChild(xnSLRefvalColumns);

                    if (BFI.ComboValueField != BFI.ComboTextField)
                    {
                        //DisplayMember
                        XmlNode xnRefvalColumnDisplayMember = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "RefvalColumn", "infolight");
                        XmlAttribute xaDisplayMemberFieldName = xmlTemplate.CreateAttribute("FieldName");
                        xaDisplayMemberFieldName.Value = BFI.ComboTextField;
                        xnRefvalColumnDisplayMember.Attributes.Append(xaDisplayMemberFieldName);

                        XmlAttribute xaDisplayMemberHeadText = xmlTemplate.CreateAttribute("HeadText");
                        xaDisplayMemberHeadText.Value = String.IsNullOrEmpty(BFI.ComboTextFieldCaption) ? BFI.ComboTextField : BFI.ComboTextFieldCaption;
                        xnRefvalColumnDisplayMember.Attributes.Append(xaDisplayMemberHeadText);

                        XmlAttribute xaDisplayMemberWidth = xmlTemplate.CreateAttribute("Width");
                        xaDisplayMemberWidth.Value = "100";
                        xnRefvalColumnDisplayMember.Attributes.Append(xaDisplayMemberWidth);
                        xnSLRefvalColumns.AppendChild(xnRefvalColumnDisplayMember);
                    }

                    //OtherFields
                    if (BFI.ComboOtherFields != null)
                    {
                        foreach (OtherField item in BFI.ComboOtherFields)
                        {
                            XmlNode xnRefvalColumnOtherField = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "RefvalColumn", "infolight");
                            XmlAttribute xaDisplayMemberFieldName = xmlTemplate.CreateAttribute("FieldName");
                            xaDisplayMemberFieldName.Value = item.FieldName;
                            xnRefvalColumnOtherField.Attributes.Append(xaDisplayMemberFieldName);

                            XmlAttribute xaDisplayMemberHeadText = xmlTemplate.CreateAttribute("HeadText");
                            xaDisplayMemberHeadText.Value = String.IsNullOrEmpty(item.FieldCaption) ? item.FieldName : item.FieldCaption;
                            xnRefvalColumnOtherField.Attributes.Append(xaDisplayMemberHeadText);

                            XmlAttribute xaDisplayMemberWidth = xmlTemplate.CreateAttribute("Width");
                            xaDisplayMemberWidth.Value = "100";
                            xnRefvalColumnOtherField.Attributes.Append(xaDisplayMemberWidth);
                            xnSLRefvalColumns.AppendChild(xnRefvalColumnOtherField);
                        }
                    }

                    XmlAttribute xaHorizontalAlignment = xmlTemplate.CreateAttribute("HorizontalAlignment");
                    xaHorizontalAlignment.Value = "Left";
                    xnFieldControl.Attributes.Append(xaHorizontalAlignment);

                    xnGrid.AppendChild(xnFieldControl);
                    xnDataTemplate.AppendChild(xnGrid);
                    xnDataGridTemplateColumnCellEditingTemplate.AppendChild(xnDataTemplate);
                    xnFiels.AppendChild(xnDataGridTemplateColumnCellEditingTemplate);
                }
                else
                {
                    xnFiels = xmlTemplate.CreateNode(XmlNodeType.Element, "data", "DataGridTextColumn", "infolight");

                    XmlAttribute xaBinding = xmlTemplate.CreateAttribute("Binding");
                    xaBinding.Value = "{Binding " + BFI.DataField + "}";
                    xnFiels.Attributes.Append(xaBinding);
                }

                XmlAttribute xaCanUserReorder = xmlTemplate.CreateAttribute("CanUserReorder");
                xaCanUserReorder.Value = "True";
                xnFiels.Attributes.Append(xaCanUserReorder);

                XmlAttribute xaCanUserResize = xmlTemplate.CreateAttribute("CanUserResize");
                xaCanUserResize.Value = "True";
                xnFiels.Attributes.Append(xaCanUserResize);

                XmlAttribute xaCanUserSort = xmlTemplate.CreateAttribute("CanUserSort");
                xaCanUserSort.Value = "True";
                xnFiels.Attributes.Append(xaCanUserSort);

                XmlAttribute xaHeader = xmlTemplate.CreateAttribute("Header");
                if (BFI.Description == null || BFI.Description == String.Empty || BFI.Description == " ")
                    xaHeader.Value = BFI.DataField;
                else
                    xaHeader.Value = BFI.Description;
                xnFiels.Attributes.Append(xaHeader);

                XmlAttribute xaWidth2 = xmlTemplate.CreateAttribute("Width");
                xaWidth2.Value = "Auto";
                xnFiels.Attributes.Append(xaWidth2);

                if (FClientData.BaseFormName == "SLSingle" || FClientData.BaseFormName == "SLMasterDetail2"
                    || FClientData.BaseFormName == "SLMasterDetail3")
                {
                    XmlAttribute xaIsReadOnly = xmlTemplate.CreateAttribute("IsReadOnly");
                    xaIsReadOnly.Value = "True";
                    xnFiels.Attributes.Append(xaIsReadOnly);
                }
                xnTemplate.AppendChild(xnFiels);

                BFI.ControlType = ControlTypeOldValue;
            }
            String returnValue = xnTemplate.OuterXml.Replace("xmlns:data=\"infolight\"", String.Empty).Replace("xmlns:SLTools=\"infolight\"", String.Empty);
            return returnValue;
        }
コード例 #6
0
ファイル: fmSLClientWizard.cs プロジェクト: san90279/UK_OAS
        private String ComposeFormViewXML(TBlockFieldItems BlockFieldItems, String mode, int columnCount)
        {
            XmlDocument xmlTemplate = new XmlDocument();
            XmlNode xnTemplate = xmlTemplate.CreateNode(XmlNodeType.Element, "Grid", "");
            XmlNode xdGridRowDefinitions = xmlTemplate.CreateNode(XmlNodeType.Element, "Grid.RowDefinitions", "");
            for (int i = 0; i < (BlockFieldItems.Count + 1) / columnCount; i++)
            {
                XmlNode xmlRowDefinition = xmlTemplate.CreateNode(XmlNodeType.Element, "RowDefinition", "");
                xdGridRowDefinitions.AppendChild(xmlRowDefinition);
            }
            xnTemplate.AppendChild(xdGridRowDefinitions);

            XmlNode xdGridColumnDefinitions = xmlTemplate.CreateNode(XmlNodeType.Element, "Grid.ColumnDefinitions", "");
            for (int i = 0; i < columnCount; i++)
            {
                XmlNode xmlColumnDefinition = xmlTemplate.CreateNode(XmlNodeType.Element, "ColumnDefinition", "");
                xdGridColumnDefinitions.AppendChild(xmlColumnDefinition);
            }
            xnTemplate.AppendChild(xdGridColumnDefinitions);

            int X = 0;
            foreach (TBlockFieldItem BFI in BlockFieldItems)
            {
                if (String.IsNullOrEmpty(BFI.ControlType))
                    BFI.ControlType = "TextBox";

                XmlNode xnFiels = xmlTemplate.CreateNode(XmlNodeType.Element, "toolkit", "DataField", "infolight");
                XmlAttribute xaGridRow = xmlTemplate.CreateAttribute("Grid.Row");
                xaGridRow.Value = (X / columnCount).ToString();
                xnFiels.Attributes.Append(xaGridRow);

                XmlAttribute xaGridColumn = xmlTemplate.CreateAttribute("Grid.Column");
                xaGridColumn.Value = (X % columnCount).ToString();
                xnFiels.Attributes.Append(xaGridColumn);

                XmlAttribute xaLabelStyle = xmlTemplate.CreateAttribute("LabelStyle");
                xaLabelStyle.Value = "{StaticResource FieldCaptionStyle}";
                xnFiels.Attributes.Append(xaLabelStyle);

                XmlAttribute xaForegroundStyle = xmlTemplate.CreateAttribute("Style");
                xaForegroundStyle.Value = "{StaticResource FieldForegroundStyle}";
                xnFiels.Attributes.Append(xaForegroundStyle);

                XmlAttribute xaLabel = xmlTemplate.CreateAttribute("Label");
                if (BFI.Description == null || BFI.Description == String.Empty || BFI.Description == " ")
                    xaLabel.Value = BFI.DataField;
                else
                    xaLabel.Value = BFI.Description;
                xnFiels.Attributes.Append(xaLabel);

                XmlAttribute xaLabelName = xmlTemplate.CreateAttribute("Name");
                xaLabelName.Value = BFI.DataField;
                xnFiels.Attributes.Append(xaLabelName);

                XmlNode xnFieldControl = null;

                if (BFI.ControlType == "CheckBox")
                {
                    if (mode == "ReadOnlyTemplate")
                    {
                        xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLCheckBox", "infolight");
                        XmlAttribute xaBindingField = xmlTemplate.CreateAttribute("BindingField");
                        xaBindingField.Value = BFI.DataField;
                        xnFieldControl.Attributes.Append(xaBindingField);

                        //XmlAttribute xaText = xmlTemplate.CreateAttribute("Text");
                        //xaText.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "OneWay");
                        //xaText.Value = "{" + xaText.Value + "}";
                        //xnFieldControl.Attributes.Append(xaText);

                        XmlAttribute xaWidth = xmlTemplate.CreateAttribute("Width");
                        xaWidth.Value = "180";
                        xnFieldControl.Attributes.Append(xaWidth);

                        XmlAttribute xaHorizontalAlignment = xmlTemplate.CreateAttribute("HorizontalAlignment");
                        xaHorizontalAlignment.Value = "Left";
                        xnFieldControl.Attributes.Append(xaHorizontalAlignment);

                        XmlAttribute xaName = xmlTemplate.CreateAttribute("Name");
                        xaName.Value = "CheckBox" + BFI.DataField;
                        xnFieldControl.Attributes.Append(xaName);
                    }
                    else if (mode == "NewItemTemplate" || mode == "EditTemplate")
                    {
                        xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLCheckBox", "infolight");
                        XmlAttribute xaBindingField = xmlTemplate.CreateAttribute("BindingField");
                        xaBindingField.Value = BFI.DataField;
                        xnFieldControl.Attributes.Append(xaBindingField);

                        //xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "TextBox", "");
                        //XmlAttribute xaText = xmlTemplate.CreateAttribute("Text");
                        //xaText.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "TwoWay");
                        //xaText.Value = "{" + xaText.Value + "}";
                        //xnFieldControl.Attributes.Append(xaText);

                        XmlAttribute xaWidth = xmlTemplate.CreateAttribute("Width");
                        xaWidth.Value = "180";
                        xnFieldControl.Attributes.Append(xaWidth);

                        XmlAttribute xaHorizontalAlignment = xmlTemplate.CreateAttribute("HorizontalAlignment");
                        xaHorizontalAlignment.Value = "Left";
                        xnFieldControl.Attributes.Append(xaHorizontalAlignment);

                        XmlAttribute xaName = xmlTemplate.CreateAttribute("Name");
                        xaName.Value = "CheckBox" + BFI.DataField;
                        xnFieldControl.Attributes.Append(xaName);
                    }
                }
                else if (BFI.ControlType == "DateTimeBox")
                {
                    if (mode == "ReadOnlyTemplate")
                    {
                        xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLTextBox", "infolight");
                        XmlAttribute xaBindingField = xmlTemplate.CreateAttribute("BindingField");
                        xaBindingField.Value = BFI.DataField;
                        xnFieldControl.Attributes.Append(xaBindingField);

                        //xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "TextBox", "");
                        //XmlAttribute xaText = xmlTemplate.CreateAttribute("Text");
                        //xaText.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "OneWay");
                        //xaText.Value = "{" + xaText.Value + "}";
                        //xnFieldControl.Attributes.Append(xaText);

                        XmlAttribute xaWidth = xmlTemplate.CreateAttribute("Width");
                        xaWidth.Value = "180";
                        xnFieldControl.Attributes.Append(xaWidth);

                        XmlAttribute xaHorizontalAlignment = xmlTemplate.CreateAttribute("HorizontalAlignment");
                        xaHorizontalAlignment.Value = "Left";
                        xnFieldControl.Attributes.Append(xaHorizontalAlignment);

                        XmlAttribute xaName = xmlTemplate.CreateAttribute("Name");
                        xaName.Value = "DateTime" + BFI.DataField;
                        xnFieldControl.Attributes.Append(xaName);
                    }
                    else if (mode == "NewItemTemplate" || mode == "EditTemplate")
                    {
                        xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "controls", "DatePicker", "infolight");
                        XmlAttribute xaSelectedDate = xmlTemplate.CreateAttribute("SelectedDate");
                        xaSelectedDate.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "TwoWay");
                        xaSelectedDate.Value = "{" + xaSelectedDate.Value + "}";
                        xnFieldControl.Attributes.Append(xaSelectedDate);

                        XmlAttribute xaStyle = xmlTemplate.CreateAttribute("Style");
                        xaStyle.Value = "{StaticResource FieldEditor}";
                        xnFieldControl.Attributes.Append(xaStyle);

                        XmlAttribute xaWidth = xmlTemplate.CreateAttribute("Width");
                        xaWidth.Value = "180";
                        xnFieldControl.Attributes.Append(xaWidth);

                        XmlAttribute xaHorizontalAlignment = xmlTemplate.CreateAttribute("HorizontalAlignment");
                        xaHorizontalAlignment.Value = "Left";
                        xnFieldControl.Attributes.Append(xaHorizontalAlignment);

                        XmlAttribute xaName = xmlTemplate.CreateAttribute("Name");
                        xaName.Value = "DateTime" + BFI.DataField;
                        xnFieldControl.Attributes.Append(xaName);
                    }
                }
                else if (BFI.ControlType == "ComboBox")
                {
                    if (String.IsNullOrEmpty(BFI.ComboRemoteName) || String.IsNullOrEmpty(BFI.ComboEntityName))
                        BFI.ControlType = "TextBox";
                    else
                    {
                        if (mode == "ReadOnlyTemplate")
                        {
                            String serviceDataSourceName = "combo" + BFI.ComboEntityName;
                            String collectionViewSourceName = "category" + serviceDataSourceName + "Source";

                            if (!FSLComboDataSource.Contains(serviceDataSourceName))
                            {
                                String xmlServiceDataSource = ComposeServiceDataSourceXML(serviceDataSourceName, BFI.ComboRemoteName, BFI.IsInfoCommand);
                                WriteToXaml(FClientData.FullXamlName, "</Grid.Resources>", "</Grid.Resources>" + xmlServiceDataSource);

                                String xmlComboCollectionSource = ComposeCollectionSourceXML(collectionViewSourceName, serviceDataSourceName);
                                WriteToXaml(FClientData.FullXamlName, "</Grid.Resources>", xmlComboCollectionSource + "</Grid.Resources>");
                            }

                            xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLComboBox", "infolight");
                            XmlAttribute xaName = xmlTemplate.CreateAttribute("Name");
                            xaName.Value = "Combo" + BFI.DataField;
                            xnFieldControl.Attributes.Append(xaName);

                            //XmlAttribute xaSelectedValue = xmlTemplate.CreateAttribute("SelectedValue");
                            //xaSelectedValue.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "OneWay");
                            //xaSelectedValue.Value = "{" + xaSelectedValue.Value + "}";
                            //xnFieldControl.Attributes.Append(xaSelectedValue);

                            XmlAttribute xaSelectedValuePath = xmlTemplate.CreateAttribute("SelectedValuePath");
                            xaSelectedValuePath.Value = BFI.ComboValueField;
                            xnFieldControl.Attributes.Append(xaSelectedValuePath);

                            XmlAttribute xaDisplayMemberPath = xmlTemplate.CreateAttribute("DisplayMemberPath");
                            xaDisplayMemberPath.Value = BFI.ComboTextField;
                            xnFieldControl.Attributes.Append(xaDisplayMemberPath);

                            XmlAttribute xaItemsSource = xmlTemplate.CreateAttribute("ItemsSource");
                            xaItemsSource.Value = "{Binding Source={StaticResource " + collectionViewSourceName + "}}";
                            xnFieldControl.Attributes.Append(xaItemsSource);

                            XmlAttribute xaDataSourceID = xmlTemplate.CreateAttribute("DataSourceID");
                            xaDataSourceID.Value = serviceDataSourceName;
                            xnFieldControl.Attributes.Append(xaDataSourceID);

                            XmlAttribute xaWidth = xmlTemplate.CreateAttribute("Width");
                            xaWidth.Value = "180";
                            xnFieldControl.Attributes.Append(xaWidth);

                            XmlAttribute xaBindingField = xmlTemplate.CreateAttribute("BindingField");
                            xaBindingField.Value = BFI.DataField;
                            xnFieldControl.Attributes.Append(xaBindingField);

                            XmlAttribute xaHorizontalAlignment = xmlTemplate.CreateAttribute("HorizontalAlignment");
                            xaHorizontalAlignment.Value = "Left";
                            xnFieldControl.Attributes.Append(xaHorizontalAlignment);
                            //xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "TextBox", "");
                            //XmlAttribute xaText = xmlTemplate.CreateAttribute("Text");
                            //xaText.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "OneWay");
                            //xaText.Value = "{" + xaText.Value + "}";
                            //xnFieldControl.Attributes.Append(xaText);

                            //XmlAttribute xaWidth = xmlTemplate.CreateAttribute("Width");
                            //xaWidth.Value = "180";
                            //xnFieldControl.Attributes.Append(xaWidth);

                            //XmlAttribute xaHorizontalAlignment = xmlTemplate.CreateAttribute("HorizontalAlignment");
                            //xaHorizontalAlignment.Value = "Left";
                            //xnFieldControl.Attributes.Append(xaHorizontalAlignment);
                        }
                        else if (mode == "NewItemTemplate" || mode == "EditTemplate")
                        {
                            String serviceDataSourceName = "combo" + BFI.ComboEntityName;
                            String collectionViewSourceName = "category" + serviceDataSourceName + "Source";

                            if (!FSLComboDataSource.Contains(serviceDataSourceName))
                            {
                                String xmlServiceDataSource = ComposeServiceDataSourceXML(serviceDataSourceName, BFI.ComboRemoteName, BFI.IsInfoCommand);
                                WriteToXaml(FClientData.FullXamlName, "</Grid.Resources>", "</Grid.Resources>" + xmlServiceDataSource);

                                String xmlComboCollectionSource = ComposeCollectionSourceXML(collectionViewSourceName, serviceDataSourceName);
                                WriteToXaml(FClientData.FullXamlName, "</Grid.Resources>", xmlComboCollectionSource + "</Grid.Resources>");
                            }

                            xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLComboBox", "infolight");
                            XmlAttribute xaName = xmlTemplate.CreateAttribute("Name");
                            xaName.Value = "Combo" + BFI.DataField;
                            xnFieldControl.Attributes.Append(xaName);

                            //XmlAttribute xaSelectedValue = xmlTemplate.CreateAttribute("SelectedValue");
                            //xaSelectedValue.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "TwoWay");
                            //xaSelectedValue.Value = "{" + xaSelectedValue.Value + "}";
                            //xnFieldControl.Attributes.Append(xaSelectedValue);

                            XmlAttribute xaSelectedValuePath = xmlTemplate.CreateAttribute("SelectedValuePath");
                            xaSelectedValuePath.Value = BFI.ComboValueField;
                            xnFieldControl.Attributes.Append(xaSelectedValuePath);

                            XmlAttribute xaDisplayMemberPath = xmlTemplate.CreateAttribute("DisplayMemberPath");
                            xaDisplayMemberPath.Value = BFI.ComboTextField;
                            xnFieldControl.Attributes.Append(xaDisplayMemberPath);

                            XmlAttribute xaItemsSource = xmlTemplate.CreateAttribute("ItemsSource");
                            xaItemsSource.Value = "{Binding Source={StaticResource " + collectionViewSourceName + "}}";
                            xnFieldControl.Attributes.Append(xaItemsSource);

                            XmlAttribute xaDataSourceID = xmlTemplate.CreateAttribute("DataSourceID");
                            xaDataSourceID.Value = serviceDataSourceName;
                            xnFieldControl.Attributes.Append(xaDataSourceID);

                            XmlAttribute xaWidth = xmlTemplate.CreateAttribute("Width");
                            xaWidth.Value = "180";
                            xnFieldControl.Attributes.Append(xaWidth);

                            XmlAttribute xaBindingField = xmlTemplate.CreateAttribute("BindingField");
                            xaBindingField.Value = BFI.DataField;
                            xnFieldControl.Attributes.Append(xaBindingField);

                            XmlAttribute xaHorizontalAlignment = xmlTemplate.CreateAttribute("HorizontalAlignment");
                            xaHorizontalAlignment.Value = "Left";
                            xnFieldControl.Attributes.Append(xaHorizontalAlignment);
                        }
                    }
                }
                else if (BFI.ControlType == "RefValBox")
                {
                    if (String.IsNullOrEmpty(BFI.ComboRemoteName) || String.IsNullOrEmpty(BFI.ComboEntityName))
                        BFI.ControlType = "TextBox";
                    else
                    {
                        if (mode == "ReadOnlyTemplate")
                        {
                            //xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "TextBox", "");
                            //XmlAttribute xaText = xmlTemplate.CreateAttribute("Text");
                            //xaText.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "OneWay");
                            //xaText.Value = "{" + xaText.Value + "}";
                            //xnFieldControl.Attributes.Append(xaText);

                            //XmlAttribute xaWidth = xmlTemplate.CreateAttribute("Width");
                            //xaWidth.Value = "180";
                            //xnFieldControl.Attributes.Append(xaWidth);

                            //XmlAttribute xaHorizontalAlignment = xmlTemplate.CreateAttribute("HorizontalAlignment");
                            //xaHorizontalAlignment.Value = "Left";
                            //xnFieldControl.Attributes.Append(xaHorizontalAlignment);

                            String serviceDataSourceName = "refval" + BFI.ComboEntityName;
                            String collectionViewSourceName = "category" + serviceDataSourceName + "Source";

                            if (!FSLComboDataSource.Contains(serviceDataSourceName))
                            {
                                String xmlServiceDataSource = ComposeServiceDataSourceXML(serviceDataSourceName, BFI.ComboRemoteName, BFI.IsInfoCommand);
                                WriteToXaml(FClientData.FullXamlName, "</Grid.Resources>", "</Grid.Resources>" + xmlServiceDataSource);

                                String xmlComboCollectionSource = ComposeCollectionSourceXML(collectionViewSourceName, serviceDataSourceName);
                                WriteToXaml(FClientData.FullXamlName, "</Grid.Resources>", xmlComboCollectionSource + "</Grid.Resources>");
                            }

                            xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLRefval", "infolight");
                            XmlAttribute xaName = xmlTemplate.CreateAttribute("Name");
                            xaName.Value = "Refval" + BFI.DataField;
                            xnFieldControl.Attributes.Append(xaName);

                            XmlAttribute xaSelectedValue = xmlTemplate.CreateAttribute("SelectedValue");
                            xaSelectedValue.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "OneWay");
                            xaSelectedValue.Value = "{" + xaSelectedValue.Value + "}";
                            xnFieldControl.Attributes.Append(xaSelectedValue);

                            XmlAttribute xaValueMemberPath = xmlTemplate.CreateAttribute("ValueMemberPath");
                            xaValueMemberPath.Value = BFI.ComboValueField;
                            xnFieldControl.Attributes.Append(xaValueMemberPath);

                            XmlAttribute xaDisplayMemberPath = xmlTemplate.CreateAttribute("DisplayMemberPath");
                            xaDisplayMemberPath.Value = BFI.ComboTextField;
                            xnFieldControl.Attributes.Append(xaDisplayMemberPath);

                            XmlAttribute xaItemsSource = xmlTemplate.CreateAttribute("ItemsSource");
                            xaItemsSource.Value = "{Binding Source={StaticResource " + collectionViewSourceName + "}}";
                            xnFieldControl.Attributes.Append(xaItemsSource);

                            XmlAttribute xaDataSourceID = xmlTemplate.CreateAttribute("DataSourceID");
                            xaDataSourceID.Value = serviceDataSourceName;
                            xnFieldControl.Attributes.Append(xaDataSourceID);

                            XmlAttribute xaWidth = xmlTemplate.CreateAttribute("Width");
                            xaWidth.Value = "180";
                            xnFieldControl.Attributes.Append(xaWidth);

                            XmlAttribute xaOpenSize = xmlTemplate.CreateAttribute("OpenSize");
                            xaOpenSize.Value = "500,400";
                            xnFieldControl.Attributes.Append(xaOpenSize);

                            XmlNode xnSLRefvalColumns = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLRefval.Columns", "infolight");
                            //ValueMember
                            XmlNode xnRefvalColumnValueMember = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "RefvalColumn", "infolight");
                            XmlAttribute xaValueMemberFieldName = xmlTemplate.CreateAttribute("FieldName");
                            xaValueMemberFieldName.Value = BFI.ComboValueField;
                            xnRefvalColumnValueMember.Attributes.Append(xaValueMemberFieldName);

                            XmlAttribute xaValueMemberHeadText = xmlTemplate.CreateAttribute("HeadText");
                            xaValueMemberHeadText.Value = String.IsNullOrEmpty(BFI.ComboValueFieldCaption) ? BFI.ComboValueField : BFI.ComboValueFieldCaption;
                            xnRefvalColumnValueMember.Attributes.Append(xaValueMemberHeadText);

                            XmlAttribute xaValueMemberWidth = xmlTemplate.CreateAttribute("Width");
                            xaValueMemberWidth.Value = "100";
                            xnRefvalColumnValueMember.Attributes.Append(xaValueMemberWidth);
                            xnSLRefvalColumns.AppendChild(xnRefvalColumnValueMember);
                            xnFieldControl.AppendChild(xnSLRefvalColumns);

                            if (BFI.ComboValueField != BFI.ComboTextField)
                            {
                                //DisplayMember
                                XmlNode xnRefvalColumnDisplayMember = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "RefvalColumn", "infolight");
                                XmlAttribute xaDisplayMemberFieldName = xmlTemplate.CreateAttribute("FieldName");
                                xaDisplayMemberFieldName.Value = BFI.ComboTextField;
                                xnRefvalColumnDisplayMember.Attributes.Append(xaDisplayMemberFieldName);

                                XmlAttribute xaDisplayMemberHeadText = xmlTemplate.CreateAttribute("HeadText");
                                xaDisplayMemberHeadText.Value = String.IsNullOrEmpty(BFI.ComboTextFieldCaption) ? BFI.ComboTextField : BFI.ComboTextFieldCaption;
                                xnRefvalColumnDisplayMember.Attributes.Append(xaDisplayMemberHeadText);

                                XmlAttribute xaDisplayMemberWidth = xmlTemplate.CreateAttribute("Width");
                                xaDisplayMemberWidth.Value = "100";
                                xnRefvalColumnDisplayMember.Attributes.Append(xaDisplayMemberWidth);
                                xnSLRefvalColumns.AppendChild(xnRefvalColumnDisplayMember);
                            }

                            //OtherFields
                            if (BFI.ComboOtherFields != null)
                            {
                                foreach (OtherField item in BFI.ComboOtherFields)
                                {
                                    XmlNode xnRefvalColumnOtherField = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "RefvalColumn", "infolight");
                                    XmlAttribute xaDisplayMemberFieldName = xmlTemplate.CreateAttribute("FieldName");
                                    xaDisplayMemberFieldName.Value = item.FieldName;
                                    xnRefvalColumnOtherField.Attributes.Append(xaDisplayMemberFieldName);

                                    XmlAttribute xaDisplayMemberHeadText = xmlTemplate.CreateAttribute("HeadText");
                                    xaDisplayMemberHeadText.Value = String.IsNullOrEmpty(item.FieldCaption) ? item.FieldName : item.FieldCaption;
                                    xnRefvalColumnOtherField.Attributes.Append(xaDisplayMemberHeadText);

                                    XmlAttribute xaDisplayMemberWidth = xmlTemplate.CreateAttribute("Width");
                                    xaDisplayMemberWidth.Value = "100";
                                    xnRefvalColumnOtherField.Attributes.Append(xaDisplayMemberWidth);
                                    xnSLRefvalColumns.AppendChild(xnRefvalColumnOtherField);
                                }
                            }

                            XmlAttribute xaHorizontalAlignment = xmlTemplate.CreateAttribute("HorizontalAlignment");
                            xaHorizontalAlignment.Value = "Left";
                            xnFieldControl.Attributes.Append(xaHorizontalAlignment);
                        }
                        else if (mode == "NewItemTemplate" || mode == "EditTemplate")
                        {
                            String serviceDataSourceName = "refval" + BFI.ComboEntityName;
                            String collectionViewSourceName = "category" + serviceDataSourceName + "Source";

                            if (!FSLComboDataSource.Contains(serviceDataSourceName))
                            {
                                String xmlServiceDataSource = ComposeServiceDataSourceXML(serviceDataSourceName, BFI.ComboRemoteName, BFI.IsInfoCommand);
                                WriteToXaml(FClientData.FullXamlName, "</Grid.Resources>", "</Grid.Resources>" + xmlServiceDataSource);

                                String xmlComboCollectionSource = ComposeCollectionSourceXML(collectionViewSourceName, serviceDataSourceName);
                                WriteToXaml(FClientData.FullXamlName, "</Grid.Resources>", xmlComboCollectionSource + "</Grid.Resources>");
                            }

                            xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLRefval", "infolight");
                            XmlAttribute xaName = xmlTemplate.CreateAttribute("Name");
                            xaName.Value = "Refval" + BFI.DataField;
                            xnFieldControl.Attributes.Append(xaName);

                            XmlAttribute xaSelectedValue = xmlTemplate.CreateAttribute("SelectedValue");
                            xaSelectedValue.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "TwoWay");
                            xaSelectedValue.Value = "{" + xaSelectedValue.Value + "}";
                            xnFieldControl.Attributes.Append(xaSelectedValue);

                            XmlAttribute xaValueMemberPath = xmlTemplate.CreateAttribute("ValueMemberPath");
                            xaValueMemberPath.Value = BFI.ComboValueField;
                            xnFieldControl.Attributes.Append(xaValueMemberPath);

                            XmlAttribute xaDisplayMemberPath = xmlTemplate.CreateAttribute("DisplayMemberPath");
                            xaDisplayMemberPath.Value = BFI.ComboTextField;
                            xnFieldControl.Attributes.Append(xaDisplayMemberPath);

                            XmlAttribute xaItemsSource = xmlTemplate.CreateAttribute("ItemsSource");
                            xaItemsSource.Value = "{Binding Source={StaticResource " + collectionViewSourceName + "}}";
                            xnFieldControl.Attributes.Append(xaItemsSource);

                            XmlAttribute xaDataSourceID = xmlTemplate.CreateAttribute("DataSourceID");
                            xaDataSourceID.Value = serviceDataSourceName;
                            xnFieldControl.Attributes.Append(xaDataSourceID);

                            XmlAttribute xaWidth = xmlTemplate.CreateAttribute("Width");
                            xaWidth.Value = "180";
                            xnFieldControl.Attributes.Append(xaWidth);

                            XmlAttribute xaOpenSize = xmlTemplate.CreateAttribute("OpenSize");
                            xaOpenSize.Value = "500,400";
                            xnFieldControl.Attributes.Append(xaOpenSize);

                            XmlNode xnSLRefvalColumns = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLRefval.Columns", "infolight");
                            //ValueMember
                            XmlNode xnRefvalColumnValueMember = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "RefvalColumn", "infolight");
                            XmlAttribute xaValueMemberFieldName = xmlTemplate.CreateAttribute("FieldName");
                            xaValueMemberFieldName.Value = BFI.ComboValueField;
                            xnRefvalColumnValueMember.Attributes.Append(xaValueMemberFieldName);

                            XmlAttribute xaValueMemberHeadText = xmlTemplate.CreateAttribute("HeadText");
                            xaValueMemberHeadText.Value = String.IsNullOrEmpty(BFI.ComboValueFieldCaption) ? BFI.ComboValueField : BFI.ComboValueFieldCaption;
                            xnRefvalColumnValueMember.Attributes.Append(xaValueMemberHeadText);

                            XmlAttribute xaValueMemberWidth = xmlTemplate.CreateAttribute("Width");
                            xaValueMemberWidth.Value = "100";
                            xnRefvalColumnValueMember.Attributes.Append(xaValueMemberWidth);
                            xnSLRefvalColumns.AppendChild(xnRefvalColumnValueMember);
                            xnFieldControl.AppendChild(xnSLRefvalColumns);

                            if (BFI.ComboValueField != BFI.ComboTextField)
                            {
                                //DisplayMember
                                XmlNode xnRefvalColumnDisplayMember = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "RefvalColumn", "infolight");
                                XmlAttribute xaDisplayMemberFieldName = xmlTemplate.CreateAttribute("FieldName");
                                xaDisplayMemberFieldName.Value = BFI.ComboTextField;
                                xnRefvalColumnDisplayMember.Attributes.Append(xaDisplayMemberFieldName);

                                XmlAttribute xaDisplayMemberHeadText = xmlTemplate.CreateAttribute("HeadText");
                                xaDisplayMemberHeadText.Value = String.IsNullOrEmpty(BFI.ComboTextFieldCaption) ? BFI.ComboTextField : BFI.ComboTextFieldCaption;
                                xnRefvalColumnDisplayMember.Attributes.Append(xaDisplayMemberHeadText);

                                XmlAttribute xaDisplayMemberWidth = xmlTemplate.CreateAttribute("Width");
                                xaDisplayMemberWidth.Value = "100";
                                xnRefvalColumnDisplayMember.Attributes.Append(xaDisplayMemberWidth);
                                xnSLRefvalColumns.AppendChild(xnRefvalColumnDisplayMember);
                            }

                            //OtherFields
                            if (BFI.ComboOtherFields != null)
                            {
                                foreach (OtherField item in BFI.ComboOtherFields)
                                {
                                    XmlNode xnRefvalColumnOtherField = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "RefvalColumn", "infolight");
                                    XmlAttribute xaDisplayMemberFieldName = xmlTemplate.CreateAttribute("FieldName");
                                    xaDisplayMemberFieldName.Value = item.FieldName;
                                    xnRefvalColumnOtherField.Attributes.Append(xaDisplayMemberFieldName);

                                    XmlAttribute xaDisplayMemberHeadText = xmlTemplate.CreateAttribute("HeadText");
                                    xaDisplayMemberHeadText.Value = String.IsNullOrEmpty(item.FieldCaption) ? item.FieldName : item.FieldCaption;
                                    xnRefvalColumnOtherField.Attributes.Append(xaDisplayMemberHeadText);

                                    XmlAttribute xaDisplayMemberWidth = xmlTemplate.CreateAttribute("Width");
                                    xaDisplayMemberWidth.Value = "100";
                                    xnRefvalColumnOtherField.Attributes.Append(xaDisplayMemberWidth);
                                    xnSLRefvalColumns.AppendChild(xnRefvalColumnOtherField);
                                }
                            }

                            XmlAttribute xaHorizontalAlignment = xmlTemplate.CreateAttribute("HorizontalAlignment");
                            xaHorizontalAlignment.Value = "Left";
                            xnFieldControl.Attributes.Append(xaHorizontalAlignment);
                        }
                    }
                }

                if (BFI.ControlType == "TextBox")
                {
                    if (mode == "ReadOnlyTemplate")
                    {
                        xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLTextBox", "infolight");
                        XmlAttribute xaBindingField = xmlTemplate.CreateAttribute("BindingField");
                        xaBindingField.Value = BFI.DataField;
                        xnFieldControl.Attributes.Append(xaBindingField);

                        //XmlAttribute xaText = xmlTemplate.CreateAttribute("Text");
                        //xaText.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "OneWay");
                        //xaText.Value = "{" + xaText.Value + "}";
                        //xnFieldControl.Attributes.Append(xaText);

                        XmlAttribute xaWidth = xmlTemplate.CreateAttribute("Width");
                        xaWidth.Value = "180";
                        xnFieldControl.Attributes.Append(xaWidth);

                        XmlAttribute xaHorizontalAlignment = xmlTemplate.CreateAttribute("HorizontalAlignment");
                        xaHorizontalAlignment.Value = "Left";
                        xnFieldControl.Attributes.Append(xaHorizontalAlignment);

                        XmlAttribute xaName = xmlTemplate.CreateAttribute("Name");
                        xaName.Value = "TextBox" + BFI.DataField;
                        xnFieldControl.Attributes.Append(xaName);
                    }
                    else if (mode == "NewItemTemplate" || mode == "EditTemplate")
                    {
                        xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLTextBox", "infolight");
                        XmlAttribute xaBindingField = xmlTemplate.CreateAttribute("BindingField");
                        xaBindingField.Value = BFI.DataField;
                        xnFieldControl.Attributes.Append(xaBindingField);

                        //xnFieldControl = xmlTemplate.CreateNode(XmlNodeType.Element, "TextBox", "");
                        //XmlAttribute xaText = xmlTemplate.CreateAttribute("Text");
                        //xaText.Value = String.Format("Binding {0}, Mode={1}", BFI.DataField, "TwoWay");
                        //xaText.Value = "{" + xaText.Value + "}";
                        //xnFieldControl.Attributes.Append(xaText);

                        XmlAttribute xaStyle = xmlTemplate.CreateAttribute("Style");
                        xaStyle.Value = "{StaticResource FieldEditor}";
                        xnFieldControl.Attributes.Append(xaStyle);

                        XmlAttribute xaWidth = xmlTemplate.CreateAttribute("Width");
                        xaWidth.Value = "180";
                        xnFieldControl.Attributes.Append(xaWidth);

                        XmlAttribute xaHorizontalAlignment = xmlTemplate.CreateAttribute("HorizontalAlignment");
                        xaHorizontalAlignment.Value = "Left";
                        xnFieldControl.Attributes.Append(xaHorizontalAlignment);

                        XmlAttribute xaName = xmlTemplate.CreateAttribute("Name");
                        xaName.Value = "TextBox" + BFI.DataField;
                        xnFieldControl.Attributes.Append(xaName);
                    }
                }

                xnFiels.AppendChild(xnFieldControl);
                xnTemplate.AppendChild(xnFiels);
                X++;
            }
            return xnTemplate.OuterXml.Replace("xmlns:toolkit=\"infolight\"", String.Empty).Replace("xmlns:controls=\"infolight\"", String.Empty).Replace("xmlns:SLTools=\"infolight\"", String.Empty);
        }
コード例 #7
0
ファイル: fmSLClientWizard.cs プロジェクト: san90279/UK_OAS
        private String ComposeDefaultXML(TBlockFieldItems BlockItems, String defaultName, String dataObjectID)
        {
            XmlDocument xmlTemplate = new XmlDocument();
            XmlNode xnTemplate = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLDefault", "infolight");
            XmlAttribute xaName = xmlTemplate.CreateAttribute("x", "Name", "infolight");
            xaName.Value = defaultName;
            xnTemplate.Attributes.Append(xaName);

            XmlAttribute xaDataObjectID = xmlTemplate.CreateAttribute("DataObjectID");
            xaDataObjectID.Value = dataObjectID;
            xnTemplate.Attributes.Append(xaDataObjectID);

            if (BlockItems.Count > 0)
            {
                XmlNode xnDefaultValues = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLDefault.DefaultValues", "infolight");
                foreach (TBlockFieldItem BlockItem in BlockItems)
                {
                    if (!String.IsNullOrEmpty(BlockItem.DefaultValue))
                    {
                        XmlNode xnSLDefaultItem = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLDefaultItem", "infolight");
                        XmlAttribute xaDefaultValue = xmlTemplate.CreateAttribute("DefaultValue", "");
                        xaDefaultValue.Value = BlockItem.DefaultValue;
                        xnSLDefaultItem.Attributes.Append(xaDefaultValue);

                        XmlAttribute xaFieldName = xmlTemplate.CreateAttribute("FieldName");
                        xaFieldName.Value = BlockItem.DataField;
                        xnSLDefaultItem.Attributes.Append(xaFieldName);

                        xnDefaultValues.AppendChild(xnSLDefaultItem);
                    }
                }
                if (xnDefaultValues.ChildNodes.Count > 0)
                    xnTemplate.AppendChild(xnDefaultValues);
            }

            String returnValue = xnTemplate.OuterXml;

            //FSLComboDataSource.Add(dataSourcrName);
            return returnValue.Replace("xmlns:SLTools=\"infolight\"", String.Empty).Replace("xmlns:x=\"infolight\"", String.Empty);
        }
コード例 #8
0
ファイル: fmSLClientWizard.cs プロジェクト: san90279/UK_OAS
        private String ComposeClientQueryXML(TBlockFieldItems BlockItems, String clientQueryName, String dataControlID)
        {
            String returnValue = String.Empty;

            XmlDocument xmlTemplate = new XmlDocument();
            //XmlNode xnTemplate = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLClientQuery", "infolight");
            //XmlAttribute xaName = xmlTemplate.CreateAttribute("x", "Name", "infolight");
            //xaName.Value = clientQueryName;
            //xnTemplate.Attributes.Append(xaName);

            //XmlAttribute xaDataObjectID = xmlTemplate.CreateAttribute("DataControlID");
            //xaDataObjectID.Value = dataControlID;
            //xnTemplate.Attributes.Append(xaDataObjectID);

            if (BlockItems.Count > 0)
            {
                XmlNode xnClientQueryColumns = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "SLClientQuery.Columns", "infolight");
                foreach (TBlockFieldItem BlockItem in BlockItems)
                {
                    if (!String.IsNullOrEmpty(BlockItem.QueryMode) && BlockItem.QueryMode != "None")
                    {
                        if (BlockItem.QueryMode == "Normal")
                        {
                            XmlNode xnSLQueryColumns = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "QueryColumns", "infolight");
                            XmlAttribute xaFName = xmlTemplate.CreateAttribute("ColumnName", "");
                            xaFName.Value = BlockItem.DataField;
                            xnSLQueryColumns.Attributes.Append(xaFName);

                            XmlAttribute xaFieldName = xmlTemplate.CreateAttribute("FieldName", "");
                            xaFieldName.Value = BlockItem.DataField;
                            xnSLQueryColumns.Attributes.Append(xaFieldName);

                            XmlAttribute xaCondition = xmlTemplate.CreateAttribute("Condition");
                            if (BlockItem.DataType == typeof(String))
                                xaCondition.Value = "%";
                            else
                                xaCondition.Value = "=";
                            xnSLQueryColumns.Attributes.Append(xaCondition);

                            XmlAttribute xaCaption = xmlTemplate.CreateAttribute("Caption", "");
                            xaCaption.Value = BlockItem.Description;
                            xnSLQueryColumns.Attributes.Append(xaCaption);

                            if (FClientData.BaseFormName == "SLQuery")
                            {
                                XmlAttribute xaDefaultValue = xmlTemplate.CreateAttribute("DefaultValue", "");
                                xaDefaultValue.Value = BlockItem.DefaultValue;
                                xnSLQueryColumns.Attributes.Append(xaDefaultValue);
                            }

                            XmlAttribute xaColumnType = xmlTemplate.CreateAttribute("ColumnType", "");
                            if (!String.IsNullOrEmpty(BlockItem.ControlType) && BlockItem.ControlType != "ValidateBox")
                                xaColumnType.Value = BlockItem.ControlType;
                            else
                                xaColumnType.Value = "TextBox";

                            xnSLQueryColumns.Attributes.Append(xaColumnType);

                            xnClientQueryColumns.AppendChild(xnSLQueryColumns);

                            if (BlockItem.ControlType == "ComboBox")
                            {
                                XmlAttribute xaComboItemSource = xmlTemplate.CreateAttribute("ComboItemSource", "");
                                xaComboItemSource.Value = "combo" + BlockItem.ComboEntityName;
                                xnSLQueryColumns.Attributes.Append(xaComboItemSource);

                                XmlAttribute xaComboDisplayMember = xmlTemplate.CreateAttribute("ComboDisplayMember", "");
                                xaComboDisplayMember.Value = BlockItem.ComboTextField;
                                xnSLQueryColumns.Attributes.Append(xaComboDisplayMember);

                                XmlAttribute xaComboValueMember = xmlTemplate.CreateAttribute("ComboValueMember", "");
                                xaComboValueMember.Value = BlockItem.ComboValueField;
                                xnSLQueryColumns.Attributes.Append(xaComboValueMember);
                            }
                            else if (BlockItem.ControlType == "RefValBox")
                            {
                                XmlAttribute xaComboItemSource = xmlTemplate.CreateAttribute("ComboItemSource", "");
                                xaComboItemSource.Value = "refval" + BlockItem.ComboEntityName;
                                xnSLQueryColumns.Attributes.Append(xaComboItemSource);

                                XmlAttribute xaComboDisplayMember = xmlTemplate.CreateAttribute("ComboDisplayMember", "");
                                xaComboDisplayMember.Value = BlockItem.ComboTextField;
                                xnSLQueryColumns.Attributes.Append(xaComboDisplayMember);

                                XmlAttribute xaComboDisplayMemberCaption = xmlTemplate.CreateAttribute("ComboDisplayMemberCaption", "");
                                xaComboDisplayMemberCaption.Value = String.IsNullOrEmpty(BlockItem.ComboTextFieldCaption) ? BlockItem.ComboTextField : BlockItem.ComboTextFieldCaption;
                                xnSLQueryColumns.Attributes.Append(xaComboDisplayMemberCaption);

                                XmlAttribute xaComboValueMember = xmlTemplate.CreateAttribute("ComboValueMember", "");
                                xaComboValueMember.Value = BlockItem.ComboValueField;
                                xnSLQueryColumns.Attributes.Append(xaComboValueMember);

                                XmlAttribute xaComboValueMemberCaption = xmlTemplate.CreateAttribute("ComboValueMemberCaption", "");
                                xaComboValueMemberCaption.Value = String.IsNullOrEmpty(BlockItem.ComboValueFieldCaption) ? BlockItem.ComboValueField : BlockItem.ComboValueFieldCaption;
                                xnSLQueryColumns.Attributes.Append(xaComboValueMemberCaption);

                                if (BlockItem.ComboOtherFields != null)
                                {
                                    String strOtherFields = String.Empty;
                                    String strOtherFieldsCaption = String.Empty;
                                    foreach (OtherField of in BlockItem.ComboOtherFields)
                                    {
                                        strOtherFields += of.FieldName + ";";
                                        strOtherFieldsCaption += of.FieldCaption + ";";
                                    }
                                    XmlAttribute xaComboOtherFields = xmlTemplate.CreateAttribute("ComboOtherFields", "");
                                    xaComboOtherFields.Value = strOtherFields;
                                    xnSLQueryColumns.Attributes.Append(xaComboOtherFields);

                                    XmlAttribute xaComboOtherFieldsCaption = xmlTemplate.CreateAttribute("ComboOtherFieldsCaption", "");
                                    xaComboOtherFieldsCaption.Value = strOtherFieldsCaption;
                                    xnSLQueryColumns.Attributes.Append(xaComboOtherFieldsCaption);
                                }
                            }
                        }
                        else if (BlockItem.QueryMode == "Range")
                        {
                            XmlNode xnQueryColumnsG = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "QueryColumns", "infolight");
                            XmlAttribute xaFNameG = xmlTemplate.CreateAttribute("ColumnName", "");
                            xaFNameG.Value = BlockItem.DataField + "G";
                            xnQueryColumnsG.Attributes.Append(xaFNameG);

                            XmlAttribute xaFieldNameG = xmlTemplate.CreateAttribute("FieldName", "");
                            xaFieldNameG.Value = BlockItem.DataField;
                            xnQueryColumnsG.Attributes.Append(xaFieldNameG);

                            XmlAttribute xaConditionG = xmlTemplate.CreateAttribute("Condition");
                            xaConditionG.Value = ">=";
                            xnQueryColumnsG.Attributes.Append(xaConditionG);

                            XmlAttribute xaCaption = xmlTemplate.CreateAttribute("Caption", "");
                            xaCaption.Value = BlockItem.Description;
                            xnQueryColumnsG.Attributes.Append(xaCaption);

                            XmlAttribute xaDefaultValueG = xmlTemplate.CreateAttribute("DefaultValue", "");
                            xaDefaultValueG.Value = BlockItem.DefaultValue;
                            xnQueryColumnsG.Attributes.Append(xaDefaultValueG);

                            XmlAttribute xaColumnTypeG = xmlTemplate.CreateAttribute("ColumnType", "");
                            if (!String.IsNullOrEmpty(BlockItem.ControlType) && BlockItem.ControlType != "ValidateBox")
                                xaColumnTypeG.Value = BlockItem.ControlType;
                            else
                                xaColumnTypeG.Value = "TextBox";
                            xnQueryColumnsG.Attributes.Append(xaColumnTypeG);

                            xnClientQueryColumns.AppendChild(xnQueryColumnsG);

                            if (BlockItem.ControlType == "ComboBox")
                            {
                                XmlAttribute xaComboItemSource = xmlTemplate.CreateAttribute("ComboItemSource", "");
                                xaComboItemSource.Value = "combo" + BlockItem.ComboEntityName;
                                xnQueryColumnsG.Attributes.Append(xaComboItemSource);

                                XmlAttribute xaComboDisplayMember = xmlTemplate.CreateAttribute("ComboDisplayMember", "");
                                xaComboDisplayMember.Value = BlockItem.ComboTextField;
                                xnQueryColumnsG.Attributes.Append(xaComboDisplayMember);

                                XmlAttribute xaComboValueMember = xmlTemplate.CreateAttribute("ComboValueMember", "");
                                xaComboValueMember.Value = BlockItem.ComboValueField;
                                xnQueryColumnsG.Attributes.Append(xaComboValueMember);
                            }
                            else if (BlockItem.ControlType == "RefValBox")
                            {
                                XmlAttribute xaComboItemSource = xmlTemplate.CreateAttribute("ComboItemSource", "");
                                xaComboItemSource.Value = "refval" + BlockItem.ComboEntityName;
                                xnQueryColumnsG.Attributes.Append(xaComboItemSource);

                                XmlAttribute xaComboDisplayMember = xmlTemplate.CreateAttribute("ComboDisplayMember", "");
                                xaComboDisplayMember.Value = BlockItem.ComboTextField;
                                xnQueryColumnsG.Attributes.Append(xaComboDisplayMember);

                                XmlAttribute xaComboDisplayMemberCaption = xmlTemplate.CreateAttribute("ComboDisplayMemberCaption", "");
                                xaComboDisplayMemberCaption.Value = String.IsNullOrEmpty(BlockItem.ComboTextFieldCaption) ? BlockItem.ComboTextField : BlockItem.ComboTextFieldCaption;
                                xnQueryColumnsG.Attributes.Append(xaComboDisplayMemberCaption);

                                XmlAttribute xaComboValueMember = xmlTemplate.CreateAttribute("ComboValueMember", "");
                                xaComboValueMember.Value = BlockItem.ComboValueField;
                                xnQueryColumnsG.Attributes.Append(xaComboValueMember);

                                XmlAttribute xaComboValueMemberCaption = xmlTemplate.CreateAttribute("ComboValueMemberCaption", "");
                                xaComboValueMemberCaption.Value = String.IsNullOrEmpty(BlockItem.ComboValueFieldCaption) ? BlockItem.ComboValueField : BlockItem.ComboValueFieldCaption;
                                xnQueryColumnsG.Attributes.Append(xaComboValueMemberCaption);

                                if (BlockItem.ComboOtherFields != null)
                                {
                                    String strOtherFields = String.Empty;
                                    String strOtherFieldsCaption = String.Empty;
                                    foreach (OtherField of in BlockItem.ComboOtherFields)
                                    {
                                        strOtherFields += of.FieldName + ";";
                                        strOtherFieldsCaption += of.FieldCaption + ";";
                                    }
                                    XmlAttribute xaComboOtherFieldsG = xmlTemplate.CreateAttribute("ComboOtherFields", "");
                                    xaComboOtherFieldsG.Value = strOtherFields;
                                    xnQueryColumnsG.Attributes.Append(xaComboOtherFieldsG);

                                    XmlAttribute xaComboOtherFieldsCaption = xmlTemplate.CreateAttribute("ComboOtherFieldsCaption", "");
                                    xaComboOtherFieldsCaption.Value = strOtherFields;
                                    xnQueryColumnsG.Attributes.Append(xaComboOtherFieldsCaption);
                                }
                            }

                            XmlNode xnQueryColumnsL = xmlTemplate.CreateNode(XmlNodeType.Element, "SLTools", "QueryColumns", "infolight");
                            XmlAttribute xaFNameL = xmlTemplate.CreateAttribute("ColumnName", "");
                            xaFNameL.Value = BlockItem.DataField + "L";
                            xnQueryColumnsL.Attributes.Append(xaFNameL);

                            XmlAttribute xaFieldNameL = xmlTemplate.CreateAttribute("FieldName", "");
                            xaFieldNameL.Value = BlockItem.DataField;
                            xnQueryColumnsL.Attributes.Append(xaFieldNameL);

                            XmlAttribute xaConditionL = xmlTemplate.CreateAttribute("Condition");
                            xaConditionL.Value = "<=";
                            xnQueryColumnsL.Attributes.Append(xaConditionL);

                            XmlAttribute xaCaptionL = xmlTemplate.CreateAttribute("Caption", "");
                            xaCaptionL.Value = BlockItem.Description;
                            xnQueryColumnsL.Attributes.Append(xaCaptionL);

                            XmlAttribute xaDefaultValueL = xmlTemplate.CreateAttribute("DefaultValue", "");
                            xaDefaultValueL.Value = BlockItem.DefaultValue;
                            xnQueryColumnsL.Attributes.Append(xaDefaultValueL);

                            XmlAttribute xaColumnTypeL = xmlTemplate.CreateAttribute("ColumnType", "");
                            if (!String.IsNullOrEmpty(BlockItem.ControlType) && BlockItem.ControlType != "ValidateBox")
                                xaColumnTypeL.Value = BlockItem.ControlType;
                            else
                                xaColumnTypeL.Value = "TextBox";
                            xnQueryColumnsL.Attributes.Append(xaColumnTypeL);

                            XmlAttribute xaNewLineL = xmlTemplate.CreateAttribute("NewLine", "");
                            xaNewLineL.Value = "False";
                            xnQueryColumnsL.Attributes.Append(xaNewLineL);

                            xnClientQueryColumns.AppendChild(xnQueryColumnsL);

                            if (BlockItem.ControlType == "ComboBox")
                            {
                                XmlAttribute xaComboItemSource = xmlTemplate.CreateAttribute("ComboItemSource", "");
                                xaComboItemSource.Value = "combo" + BlockItem.ComboEntityName;
                                xnQueryColumnsL.Attributes.Append(xaComboItemSource);

                                XmlAttribute xaComboDisplayMember = xmlTemplate.CreateAttribute("ComboDisplayMember", "");
                                xaComboDisplayMember.Value = BlockItem.ComboTextField;
                                xnQueryColumnsL.Attributes.Append(xaComboDisplayMember);

                                XmlAttribute xaComboValueMember = xmlTemplate.CreateAttribute("ComboValueMember", "");
                                xaComboValueMember.Value = BlockItem.ComboValueField;
                                xnQueryColumnsL.Attributes.Append(xaComboValueMember);
                            }
                            else if (BlockItem.ControlType == "RefValBox")
                            {
                                XmlAttribute xaComboItemSource = xmlTemplate.CreateAttribute("ComboItemSource", "");
                                xaComboItemSource.Value = "refval" + BlockItem.ComboEntityName;
                                xnQueryColumnsL.Attributes.Append(xaComboItemSource);

                                XmlAttribute xaComboDisplayMember = xmlTemplate.CreateAttribute("ComboDisplayMember", "");
                                xaComboDisplayMember.Value = BlockItem.ComboTextField;
                                xnQueryColumnsL.Attributes.Append(xaComboDisplayMember);

                                XmlAttribute xaComboDisplayMemberCaption = xmlTemplate.CreateAttribute("ComboDisplayMemberCaption", "");
                                xaComboDisplayMemberCaption.Value = String.IsNullOrEmpty(BlockItem.ComboTextFieldCaption) ? BlockItem.ComboTextField : BlockItem.ComboTextFieldCaption;
                                xnQueryColumnsL.Attributes.Append(xaComboDisplayMemberCaption);

                                XmlAttribute xaComboValueMember = xmlTemplate.CreateAttribute("ComboValueMember", "");
                                xaComboValueMember.Value = BlockItem.ComboValueField;
                                xnQueryColumnsL.Attributes.Append(xaComboValueMember);

                                XmlAttribute xaComboValueMemberCaption = xmlTemplate.CreateAttribute("ComboValueMemberCaption", "");
                                xaComboValueMemberCaption.Value = String.IsNullOrEmpty(BlockItem.ComboValueFieldCaption) ? BlockItem.ComboValueField : BlockItem.ComboValueFieldCaption;
                                xnQueryColumnsL.Attributes.Append(xaComboValueMemberCaption);

                                if (BlockItem.ComboOtherFields != null)
                                {
                                    String strOtherFields = String.Empty;
                                    String strOtherFieldsCaption = String.Empty;
                                    foreach (OtherField of in BlockItem.ComboOtherFields)
                                    {
                                        strOtherFields += of.FieldName + ";";
                                        strOtherFieldsCaption += of.FieldCaption + ";";
                                    }
                                    XmlAttribute xaComboOtherFieldsL = xmlTemplate.CreateAttribute("ComboOtherFields", "");
                                    xaComboOtherFieldsL.Value = strOtherFields;
                                    xnQueryColumnsL.Attributes.Append(xaComboOtherFieldsL);

                                    XmlAttribute xaComboOtherFieldsCaption = xmlTemplate.CreateAttribute("ComboOtherFieldsCaption", "");
                                    xaComboOtherFieldsCaption.Value = strOtherFieldsCaption;
                                    xnQueryColumnsL.Attributes.Append(xaComboOtherFieldsCaption);
                                }
                            }
                        }
                    }
                }

                if (xnClientQueryColumns.OuterXml != "<SLTools:SLClientQuery.Columns xmlns:SLTools=\"infolight\" />")
                    returnValue = xnClientQueryColumns.OuterXml;
                //if (xnClientQueryColumns.ChildNodes.Count > 0)
                //    xnTemplate.AppendChild(xnClientQueryColumns);
            }
            //String returnValue = xnTemplate.OuterXml;

            //FSLComboDataSource.Add(dataSourcrName);
            return returnValue.Replace("xmlns:SLTools=\"infolight\"", String.Empty).Replace("xmlns:x=\"infolight\"", String.Empty);
        }
コード例 #9
0
ファイル: fmEEPWCFWebWizard.cs プロジェクト: san90279/UK_OAS
 public TWCFDetailItem()
 {
     FBlockFieldItems = new TBlockFieldItems(this);
 }