• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# CodeGeneration.TFormWriter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Ict.Tools.CodeGeneration.TFormWriter的典型用法代码示例。如果您正苦于以下问题:C# TFormWriter类的具体用法?C# TFormWriter怎么用?C# TFormWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TFormWriter类属于Ict.Tools.CodeGeneration命名空间,在下文中一共展示了TFormWriter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GenerateDeclaration

 /// <summary>
 /// declare the control
 /// </summary>
 /// <param name="writer"></param>
 /// <param name="ctrl"></param>
 public override void GenerateDeclaration(TFormWriter writer, TControlDef ctrl)
 {
     if (!IsMniFilterFindClickAndIgnore(writer, ctrl, false))
     {
         base.GenerateDeclaration(writer, ctrl);
     }
 }
开发者ID:Davincier,项目名称:openpetra,代码行数:12,代码来源:ControlGeneratorBars.cs


示例2: SetControlProperties

        /// <summary>write the code for the designer file where the properties of the control are written</summary>
        public override ProcessTemplate SetControlProperties(TFormWriter writer, TControlDef ctrl)
        {
            // don't call base, because it should not have size, location, or name
            writer.Template.AddToCodelet("CONTROLINITIALISATION",
                "//" + Environment.NewLine + "// " + ctrl.controlName + Environment.NewLine + "//" + Environment.NewLine);

            return writer.FTemplate;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:9,代码来源:ControlGeneratorProvider.cs


示例3: SetControlProperties

        /// <summary>write the code for the designer file where the properties of the control are written</summary>
        public override ProcessTemplate SetControlProperties(TFormWriter writer, TControlDef ctrl)
        {
            // TODO this does not work yet. see EventRole Maintain screen
            if ((!ctrl.HasAttribute("Align"))
                && (!ctrl.HasAttribute("Width")))
            {
                ctrl.SetAttribute("Stretch", "horizontally");
            }

            base.SetControlProperties(writer, ctrl);

            // stretch at design time, but do not align to the right
            writer.SetControlProperty(ctrl, "Anchor",
                "((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)))");

            string labelText = "";

            if (TYml2Xml.HasAttribute(ctrl.xmlNode, "Text"))
            {
                labelText = TYml2Xml.GetAttribute(ctrl.xmlNode, "Text");
            }
            else
            {
                labelText = ctrl.Label + ":";
            }

            if (ctrl.HasAttribute("Width"))
            {
                ctrl.SetAttribute("Width", ctrl.GetAttribute("Width"));
            }
            else
            {
                ctrl.SetAttribute("Width", (PanelLayoutGenerator.MeasureTextWidth(labelText) + 5).ToString());
            }

            if (ctrl.HasAttribute("Height"))
            {
                ctrl.SetAttribute("Height", ctrl.GetAttribute("Height"));
            }

            writer.SetControlProperty(ctrl, "Text", "\"" + labelText + "\"");
            writer.SetControlProperty(ctrl, "Padding", "new System.Windows.Forms.Padding(0, 5, 0, 0)");

            if (FRightAlign)
            {
                writer.SetControlProperty(ctrl, "TextAlign", "System.Drawing.ContentAlignment.TopRight");
            }

            return writer.FTemplate;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:51,代码来源:ControlGenerator.cs


示例4: SetControlProperties

        /// <summary>write the code for the designer file where the properties of the control are written</summary>
        public override ProcessTemplate SetControlProperties(TFormWriter writer, TControlDef ctrl)
        {
            ProcessTemplate snippetRowDefinition = writer.FTemplate.GetSnippet(FControlDefinitionSnippetName);

            ((TExtJsFormsWriter)writer).AddResourceString(snippetRowDefinition, "LABEL", ctrl, ctrl.Label);

            StringCollection Controls = FindContainedControls(writer, ctrl.xmlNode);

            snippetRowDefinition.AddToCodelet("ITEMS", "");

            if (Controls.Count > 0)
            {
                // used for radiogroupbox
                foreach (string ChildControlName in Controls)
                {
                    TControlDef childCtrl = FCodeStorage.FindOrCreateControl(ChildControlName, ctrl.controlName);
                    IControlGenerator ctrlGen = writer.FindControlGenerator(childCtrl);
                    ProcessTemplate ctrlSnippet = ctrlGen.SetControlProperties(writer, childCtrl);

                    ctrlSnippet.SetCodelet("COLUMNWIDTH", "");

                    ctrlSnippet.SetCodelet("ITEMNAME", ctrl.controlName);
                    ctrlSnippet.SetCodelet("ITEMID", childCtrl.controlName);

                    if (ctrl.GetAttribute("hideLabel") == "true")
                    {
                        ctrlSnippet.SetCodelet("HIDELABEL", "true");
                    }
                    else if (ChildControlName == Controls[0])
                    {
                        ((TExtJsFormsWriter)writer).AddResourceString(ctrlSnippet, "LABEL", ctrl, ctrl.Label);
                    }

                    snippetRowDefinition.InsertSnippet("ITEMS", ctrlSnippet, ",");
                }
            }
            else
            {
                // used for GroupBox, and Composite
                TExtJsFormsWriter.InsertControl(ctrl, snippetRowDefinition, "ITEMS", "HiddenValues", writer);
                TExtJsFormsWriter.InsertControl(ctrl, snippetRowDefinition, "ITEMS", "Controls", writer);
            }

            return snippetRowDefinition;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:46,代码来源:ControlGroupGenerator.cs


示例5: SetControlProperties

        /// <summary>write the code for the designer file where the properties of the control are written</summary>
        public override ProcessTemplate SetControlProperties(TFormWriter writer, TControlDef ctrl)
        {
            base.SetControlProperties(writer, ctrl);

            if (ctrl.GetAttribute("AutoComplete").EndsWith("History"))
            {
                writer.SetControlProperty(ctrl, "AcceptNewValues", "true");
                writer.SetEventHandlerToControl(ctrl.controlName,
                    "AcceptNewEntries",
                    "TAcceptNewEntryEventHandler",
                    "FPetraUtilsObject.AddComboBoxHistory");
                writer.CallControlFunction(ctrl.controlName, "SetDataSourceStringList(\"\")");
                writer.Template.AddToCodelet("INITUSERCONTROLS",
                    "FPetraUtilsObject.LoadComboBoxHistory(" + ctrl.controlName + ");" + Environment.NewLine);
            }

            return writer.FTemplate;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:19,代码来源:ControlGeneratorComboboxes.cs


示例6: GenerateReadSetControls

        /// <summary>
        /// write the code for reading and writing the controls with the parameters
        /// </summary>
        public static void GenerateReadSetControls(TFormWriter writer, XmlNode curNode, ProcessTemplate ATargetTemplate, string ATemplateControlType)
        {
            string controlName = curNode.Name;

            // check if this control is already part of an optional group of controls depending on a radiobutton
            TControlDef ctrl = writer.CodeStorage.GetControl(controlName);

            if (ctrl.GetAttribute("DependsOnRadioButton") == "true")
            {
                return;
            }

            if (ctrl.GetAttribute("NoParameter") == "true")
            {
                return;
            }

            string paramName = ReportControls.GetParameterName(curNode);

            if (paramName == null)
            {
                return;
            }

            bool clearIfSettingEmpty = ReportControls.GetClearIfSettingEmpty(curNode);

            ProcessTemplate snippetReadControls = writer.Template.GetSnippet(ATemplateControlType + "READCONTROLS");
            snippetReadControls.SetCodelet("CONTROLNAME", controlName);
            snippetReadControls.SetCodelet("PARAMNAME", paramName);
            ATargetTemplate.InsertSnippet("READCONTROLS", snippetReadControls);

            ProcessTemplate snippetWriteControls = writer.Template.GetSnippet(ATemplateControlType + "SETCONTROLS");
            snippetWriteControls.SetCodelet("CONTROLNAME", controlName);
            snippetWriteControls.SetCodelet("PARAMNAME", paramName);

            if (clearIfSettingEmpty)
            {
                snippetWriteControls.SetCodelet("CLEARIFSETTINGEMPTY", clearIfSettingEmpty.ToString().ToLower());
            }

            ATargetTemplate.InsertSnippet("SETCONTROLS", snippetWriteControls);
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:45,代码来源:ReportControlGenerator.cs


示例7: ProcessChildren

        /// <summary>
        /// process the children
        /// </summary>
        public override void ProcessChildren(TFormWriter writer, TControlDef container)
        {
            // usually, the toolbar buttons are direct children of the toolbar control
            List <XmlNode>childrenlist = TYml2Xml.GetChildren(container.xmlNode, true);

            foreach (XmlNode childNode in childrenlist)
            {
                /* Get unique name if we need it
                 * at the moment we need it only for menu separators
                 */
                String UniqueChildName = childNode.Name;
                TControlDef childCtrl = container.FCodeStorage.GetControl(childNode.Name);

                if (childCtrl == null)
                {
                    UniqueChildName = TYml2Xml.GetAttribute(childNode, "UniqueName");
                    childCtrl = container.FCodeStorage.GetControl(UniqueChildName);
                }

                container.Children.Add(childCtrl);
                IControlGenerator ctrlGenerator = writer.FindControlGenerator(childCtrl);
                ctrlGenerator.GenerateControl(writer, childCtrl);
            }
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:27,代码来源:ControlGeneratorBars.cs


示例8: AddChildUserControlExtraCalls

 private static void AddChildUserControlExtraCalls(TFormWriter writer, TControlDef ctrl)
 {
     Console.WriteLine("adding to codelet: UserControl-specific extensions");
     writer.Template.AddToCodelet("USERCONTROLSRUNONCEONACTIVATION", ctrl.controlName + ".RunOnceOnParentActivation();" + Environment.NewLine);
     writer.Template.AddToCodelet("SAVEDATA", ctrl.controlName + ".GetDataFromControls();" + Environment.NewLine);
     writer.Template.AddToCodelet("PRIMARYKEYCONTROLSREADONLY", ctrl.controlName + ".SetPrimaryKeyReadOnly(AReadOnly);" + Environment.NewLine);
     writer.Template.AddToCodelet("USERCONTROLVALIDATION",
         ctrl.controlName + ".ValidateAllData(false, TErrorProcessingMode.Epm_None);" + Environment.NewLine);
     writer.Template.SetCodelet("PERFORMUSERCONTROLVALIDATION", "true");
 }
开发者ID:Davincier,项目名称:openpetra,代码行数:10,代码来源:ControlGeneratorBase.cs


示例9: AssignEventHandlerToControl

        /// <summary>
        /// assign event handler to control
        /// </summary>
        public void AssignEventHandlerToControl(TFormWriter writer, TControlDef ctrl, string AEvent, string AEventHandlerType, string ActionToPerform)
        {
            if ((AEvent == null) || (AEvent.Length == 0))
            {
                return;
            }

            if (ActionToPerform.StartsWith("act"))
            {
                TActionHandler ActionHandler = writer.CodeStorage.FActionList[ActionToPerform];

                if (ActionHandler.actionId.Length > 0)
                {
                    // actionId is managed by FPetraUtilsObject
                    // need a special function that wraps calls to FPetraUtilsObject, otherwise problems in designer
                    ActionToPerform = ActionHandler.actionName;
                }
                else if (ActionHandler.actionClick.Length > 0)
                {
                    if (ActionHandler.actionClick.StartsWith("FPetraUtilsObject"))
                    {
                        // need a special function that wraps calls to FPetraUtilsObject, otherwise problems in designer
                        ActionToPerform = ActionHandler.actionName;
                    }
                    else
                    {
                        // direct call
                        ActionToPerform = ActionHandler.actionClick;
                    }
                }
                else
                {
                    ActionToPerform = "";
                }
            }
            else
            {
                // direct call: use ActionToPerform
            }

            if (ActionToPerform.Length > 0)
            {
                writer.SetEventHandlerToControl(ctrl.controlName, AEvent, AEventHandlerType, ActionToPerform);
            }
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:48,代码来源:ControlGeneratorBase.cs


示例10: ProcessChildren

 /// <summary>
 /// generate the children, and write the size of this control
 /// </summary>
 public virtual void ProcessChildren(TFormWriter writer, TControlDef ctrl)
 {
 }
开发者ID:Davincier,项目名称:openpetra,代码行数:6,代码来源:ControlGeneratorBase.cs


示例11: GenerateDeclaration

        /// <summary>
        /// declaration and code creation in the designer file
        /// </summary>
        /// <param name="writer"></param>
        /// <param name="ctrl"></param>
        public virtual void GenerateDeclaration(TFormWriter writer, TControlDef ctrl)
        {
            string localControlType = ControlType;

            if (ctrl.controlType.Length > 0)
            {
                localControlType = ctrl.controlType;
            }

            writer.Template.AddToCodelet("CONTROLDECLARATION", "private " + localControlType + " " + ctrl.controlName + ";" + Environment.NewLine);
            writer.Template.AddToCodelet("CONTROLCREATION", "this." + ctrl.controlName + " = new " + localControlType + "();" + Environment.NewLine);

            // TODO generate a property that can be accessed from outside
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:19,代码来源:ControlGeneratorBase.cs


示例12: SetControlProperties

        /// add and install event handler for change of selection
        public override ProcessTemplate SetControlProperties(TFormWriter writer, TControlDef ctrl)
        {
            base.SetControlProperties(writer, ctrl);

            writer.Template.AddToCodelet("CHECKEDCHANGED_" + ctrl.controlName, string.Empty);

            foreach (TControlDef ChildCtrl in ctrl.Children)
            {
                // make sure the control is enabled/disabled depending on the selection of the radiobutton
                writer.Template.AddToCodelet("CHECKEDCHANGED_" + ctrl.controlName,
                    ChildCtrl.controlName + ".Enabled = " + ctrl.controlName + ".Checked;" + Environment.NewLine);
            }

            writer.CodeStorage.FEventHandlersImplementation += "void " + ctrl.controlName + "CheckedChanged(object sender, System.EventArgs e)" +
                                                               Environment.NewLine + "{" + Environment.NewLine + "  {#CHECKEDCHANGED_" +
                                                               ctrl.controlName + "}" + Environment.NewLine +
                                                               "}" + Environment.NewLine + Environment.NewLine;
            writer.Template.AddToCodelet("INITIALISESCREEN", ctrl.controlName + "CheckedChanged(null, null);" + Environment.NewLine);
            writer.Template.AddToCodelet("CONTROLINITIALISATION",
                "this." + ctrl.controlName +
                ".CheckedChanged += new System.EventHandler(this." +
                ctrl.controlName +
                "CheckedChanged);" + Environment.NewLine);
            writer.Template.AddToCodelet("INITACTIONSTATE", ctrl.controlName + "CheckedChanged(null, null);" + Environment.NewLine);

            return writer.Template;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:28,代码来源:ControlGeneratorBase.cs


示例13: ApplyDerivedFunctionality

 /// e.g. used for controls on Reports (readparameter, etc)
 public virtual void ApplyDerivedFunctionality(TFormWriter writer, TControlDef control)
 {
 }
开发者ID:Davincier,项目名称:openpetra,代码行数:4,代码来源:ControlGeneratorBase.cs


示例14: AddColumnToGrid

        private void AddColumnToGrid(TFormWriter writer, string AGridControlName, string AColumnType, string ALabel,
            string AHeaderTooltip, string ATableName, string AColumnName)
        {
            string ColumnType = "Text";
            string PotentialDecimalPrecision;
            string TrueString = string.Empty;
            string FalseString = string.Empty;
            string HeaderTooltip = (AHeaderTooltip == string.Empty) ? ALabel : AHeaderTooltip;

            if (AColumnType.Contains("DateTime"))
            {
                ColumnType = "Date";
            }
            else if (AColumnType.Contains("Currency"))
            {
                ColumnType = "Currency";

                if (AColumnType.Contains("Currency("))
                {
                    PotentialDecimalPrecision = AColumnType.Substring(AColumnType.IndexOf('(') + 1,
                        AColumnType.IndexOf(')') - AColumnType.IndexOf('(') - 1);

//Console.WriteLine("AddColumnToGrid: PotentialDecimalPrecision: " + PotentialDecimalPrecision);

                    if (PotentialDecimalPrecision != String.Empty)
                    {
                        try
                        {
                            FDecimalPrecision = Convert.ToInt16(PotentialDecimalPrecision);
                        }
                        catch (System.FormatException)
                        {
                            throw new ApplicationException(
                                "Grid Column with currency formatting: The specifier for the currency precision '" + PotentialDecimalPrecision +
                                "' is not a number!");
                        }
                        catch (Exception)
                        {
                            throw;
                        }
                    }
                }
            }
            else if (AColumnType.Contains("Boolean"))
            {
                if (AColumnType.Contains("("))
                {
                    string BooleanNames = AColumnType.Substring(AColumnType.IndexOf('(') + 1,
                        AColumnType.IndexOf(')') - AColumnType.IndexOf('(') - 1);
                    TrueString = BooleanNames.Split(',')[0];
                    FalseString = BooleanNames.Split(',')[1];
                }

                if ((TrueString.Length > 0) || (FalseString.Length > 0))
                {
                    ColumnType = "Boolean";
                }
                else
                {
                    ColumnType = "CheckBox";
                }
            }
            else if (AColumnType.Contains("PartnerKey"))
            {
                ColumnType = "PartnerKey";
            }
            else if (AColumnType.Contains("Time"))
            {
                ColumnType = AColumnType;
            }

            if (ColumnType == "Boolean")
            {
                writer.Template.AddToCodelet("INITMANUALCODE",
                    AGridControlName + ".Add" + ColumnType + "Column(Catalog.GetString(\"" + ALabel + "\"), " +
                    "FMainDS." +
                    ATableName + ".Column" +
                    AColumnName + ", Catalog.GetString(\"" + TrueString + "\"), Catalog.GetString(\"" + FalseString + "\"));" + Environment.NewLine);
            }
            else if ((ColumnType != "Currency")
                     || ((ColumnType == "Currency") && (FDecimalPrecision == 2)))
            {
                writer.Template.AddToCodelet("INITMANUALCODE",
                    AGridControlName + ".Add" + ColumnType + "Column(Catalog.GetString(\"" + ALabel + "\"), " +
                    "FMainDS." +
                    ATableName + ".Column" +
                    AColumnName + ");" + Environment.NewLine);
            }
            else if (ColumnType == "PartnerKey")
            {
                writer.Template.AddToCodelet("INITMANUALCODE",
                    AGridControlName + ".Add" + ColumnType + "Column(Catalog.GetString(\"" + ALabel + "\"), " +
                    "FMainDS." +
                    ATableName + ".Column" +
                    AColumnName + ");" + Environment.NewLine);
            }
            else
            {
                writer.Template.AddToCodelet("INITMANUALCODE",
                    AGridControlName + ".Add" + ColumnType + "Column(Catalog.GetString(\"" + ALabel + "\"), " +
//.........这里部分代码省略.........
开发者ID:js1987,项目名称:openpetragit,代码行数:101,代码来源:ControlGeneratorGrids.cs


示例15: SetControlProperties

        /// <summary>write the code for the designer file where the properties of the control are written</summary>
        public override ProcessTemplate SetControlProperties(TFormWriter writer, TControlDef ctrl)
        {
            base.SetControlProperties(writer, ctrl);

            if (TYml2Xml.HasAttribute(ctrl.xmlNode, "SelectedRowActivates"))
            {
                // TODO: this function needs to be called by the manual code at the moment when eg a search finishes
                // TODO: call "Activate" + TYml2Xml.GetAttribute(ctrl.xmlNode, "SelectedRowActivates")
            }

            StringCollection Columns = TYml2Xml.GetElements(ctrl.xmlNode, "Columns");

            if (Columns.Count > 0)
            {
                writer.Template.AddToCodelet("INITMANUALCODE", ctrl.controlName + ".Columns.Clear();" + Environment.NewLine);

                foreach (string ColumnFieldName in Columns)
                {
                    bool IsDetailNotMaster;
                    TTableField field = null;

                    // customfield, eg. UC_GLTransactions, ATransaction.DateEntered and ATransaction.AnalysisAttributes
                    // there needs to be a list of CustomColumns
                    XmlNode CustomColumnsNode = TYml2Xml.GetChild(ctrl.xmlNode, "CustomColumns");
                    XmlNode CustomColumnNode = null;

                    if (CustomColumnsNode != null)
                    {
                        CustomColumnNode = TYml2Xml.GetChild(CustomColumnsNode, ColumnFieldName);
                    }

                    if (CustomColumnNode != null)
                    {
                        //string ColumnType = "System.String";

                        /* TODO DateTime (tracker: #58)
                         * if (TYml2Xml.GetAttribute(CustomColumnNode, "Type") == "System.DateTime")
                         * {
                         *  ColumnType = "DateTime";
                         * }
                         */

                        // TODO: different behaviour for double???
                        if (TYml2Xml.GetAttribute(CustomColumnNode, "Type") == "Boolean")
                        {
                            //ColumnType = "CheckBox";
                        }

                        writer.Template.AddToCodelet("INITMANUALCODE", ctrl.controlName + ".Columns.Add(" +
                            "FMainDS." + ctrl.GetAttribute("TableName") + ".Get" + ColumnFieldName + "DBName(), \"" +
                            TYml2Xml.GetAttribute(CustomColumnNode, "Label") + "\");" + Environment.NewLine);
                    }
                    else if (ctrl.HasAttribute("TableName"))
                    {
                        field =
                            TDataBinding.GetTableField(null, ctrl.GetAttribute("TableName") + "." + ColumnFieldName,
                                out IsDetailNotMaster,
                                true);
                    }
                    else
                    {
                        field = TDataBinding.GetTableField(null, ColumnFieldName, out IsDetailNotMaster, true);
                    }

                    if (field != null)
                    {
                        //string ColumnType = "System.String";

                        /* TODO DateTime (tracker: #58)
                         * if (field.GetDotNetType() == "System.DateTime")
                         * {
                         *  ColumnType = "DateTime";
                         * }
                         */

                        // TODO: different behaviour for double???
                        if (field.GetDotNetType() == "Boolean")
                        {
                            //ColumnType = "CheckBox";
                        }

                        writer.Template.AddToCodelet("INITMANUALCODE", ctrl.controlName + ".Columns.Add(" +
                            TTable.NiceTableName(field.strTableName) + "Table.Get" +
                            TTable.NiceFieldName(field.strName) + "DBName(), \"" +
                            field.strLabel + "\");" + Environment.NewLine);
                    }
                }
            }

            if (ctrl.HasAttribute("ActionLeavingRow"))
            {
                AssignEventHandlerToControl(writer, ctrl, "Selection.FocusRowLeaving", "SourceGrid.RowCancelEventHandler",
                    ctrl.GetAttribute("ActionLeavingRow"));
            }

            if (ctrl.HasAttribute("ActionFocusRow"))
            {
// TODO                AssignEventHandlerToControl(writer, ctrl, "Selection.FocusRowEntered", "SourceGrid.RowEventHandler",
//                    ctrl.GetAttribute("ActionFocusRow"));
//.........这里部分代码省略.........
开发者ID:js1987,项目名称:openpetragit,代码行数:101,代码来源:ControlGeneratorGrids.cs


示例16: OnChangeDataType

 /// <summary>
 /// write code for on change event
 /// </summary>
 public virtual void OnChangeDataType(TFormWriter writer, XmlNode curNode)
 {
     OnChangeDataType(writer, curNode, curNode.Name);
 }
开发者ID:Davincier,项目名称:openpetra,代码行数:7,代码来源:ControlGeneratorBase.cs


示例17: GenerateDataValidationCode

        private bool GenerateDataValidationCode(TFormWriter writer, TControlDef ctrl, out bool AAutomDataValidation,
            out string AReasonForAutomValidation)
        {
            AAutomDataValidation = false;
            AReasonForAutomValidation = String.Empty;

            if ((ctrl.HasAttribute("Validation"))
                && (ctrl.GetAttribute("Validation").ToLower() != "false"))
            {
                return true;
            }

            if (TDataValidation.GenerateAutoValidationCodeForControl(ctrl,
                    ctrl.HasAttribute("DataField"),
                    (writer.CodeStorage.HasAttribute("MasterTable")
                     || writer.CodeStorage.HasAttribute("DetailTable")),
                    !((this is LabelGenerator) || (this is LinkLabelGenerator)),
                    TDataValidation.TAutomDataValidationScope.advsAll, out AReasonForAutomValidation)
                )
            {
                AAutomDataValidation = true;

                return true;
            }
            else
            {
                return false;
            }
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:29,代码来源:ControlGeneratorBase.cs


示例18: LinkControlPartnerShortNameLookup

        /// <summary>
        /// fetch the partner short name from the server;
        /// this control is readonly, therefore we don't need statusbar help
        /// </summary>
        /// <param name="writer"></param>
        /// <param name="ctrl"></param>
        private void LinkControlPartnerShortNameLookup(TFormWriter writer, TControlDef ctrl)
        {
            string PartnerShortNameLookup = ctrl.GetAttribute("PartnerShortNameLookup");
            bool IsDetailNotMaster;

            TTableField field = TDataBinding.GetTableField(ctrl, PartnerShortNameLookup, out IsDetailNotMaster, true);

            string showData = "TPartnerClass partnerClass;" + Environment.NewLine;
            string RowName = "FMainDS." + TTable.NiceTableName(field.strTableName) + "[0]";

            if ((TTable.NiceTableName(field.strTableName) == writer.CodeStorage.GetAttribute("DetailTable"))
                || (TTable.NiceTableName(field.strTableName) == writer.CodeStorage.GetAttribute("MasterTable")))
            {
                RowName = "ARow";
            }

            showData += "string partnerShortName;" + Environment.NewLine;
            showData += "TRemote.MPartner.Partner.ServerLookups.WebConnectors.GetPartnerShortName(" + Environment.NewLine;
            showData += "    " + RowName + "." + TTable.NiceFieldName(field.strName) + "," +
                        Environment.NewLine;
            showData += "    out partnerShortName," + Environment.NewLine;
            showData += "    out partnerClass);" + Environment.NewLine;
            showData += ctrl.controlName + ".Text = partnerShortName;" + Environment.NewLine;

            writer.Template.AddToCodelet("SHOWDATA", showData);
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:32,代码来源:ControlGeneratorBase.cs


示例19: GenerateControl

 /// <summary>
 /// generate all code for the control
 /// </summary>
 public void GenerateControl(TFormWriter writer, TControlDef ctrl)
 {
     GenerateDeclaration(writer, ctrl);
     ProcessChildren(writer, ctrl);
     SetControlProperties(writer, ctrl);
     OnChangeDataType(writer, ctrl.xmlNode, ctrl.controlName);
     writer.InitialiseDataSource(ctrl.xmlNode, ctrl.controlName);
     writer.ApplyDerivedFunctionality(this, ctrl);
     AddChildren(writer, ctrl);
 }
开发者ID:Davincier,项目名称:openpetra,代码行数:13,代码来源:ControlGeneratorBase.cs


示例20: DataFieldUndoCapability

        private void DataFieldUndoCapability(TFormWriter writer, TControlDef ctrl, TTableField AField, bool AIsDetailNotMaster)
        {
            if (AField == null)
            {
                return;
            }

            string tablename = TTable.NiceTableName(AField.strTableName);
            string fieldname = TTable.NiceFieldName(AField);
            string TestForNullTable = "FMainDS." + tablename;

            if ((tablename == writer.CodeStorage.GetAttribute("DetailTable")) || (tablename == writer.CodeStorage.GetAttribute("MasterTable")))
            {
                TestForNullTable = "";
            }

            string targetCodelet = "UNDODATA";

            ProcessTemplate snippetShowData = GenerateUndoDataSnippetCode(ref tablename, ref fieldname, ref TestForNullTable, writer, ctrl, AField);

            writer.Template.InsertSnippet(targetCodelet, snippetShowData);
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:22,代码来源:ControlGeneratorBase.cs



注:本文中的Ict.Tools.CodeGeneration.TFormWriter类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Client.TokenClient类代码示例发布时间:2022-05-26
下一篇:
C# MReporting.TParameterList类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap