当前位置: 首页>>代码示例>>C#>>正文


C# TFormWriter.ClearControlProperty方法代码示例

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


在下文中一共展示了TFormWriter.ClearControlProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WriteTableLayout


//.........这里部分代码省略.........
                                    if (ParentPadding.IndexOf(',') == -1)
                                    {
                                        ParentPad = new Padding(Convert.ToInt32(ParentPadding));
                                    }
                                    else
                                    {
                                        string[] Paddings = ParentPadding.Split(',');
                                        ParentPad = new Padding(Convert.ToInt32(Paddings[0]), Convert.ToInt32(Paddings[1]),
                                            Convert.ToInt32(Paddings[2]), Convert.ToInt32(Paddings[3]));
                                    }

                                    TLogging.LogAtLevel(1, "ParentControl Padding (parsed): " + ParentPad.ToString());
                                }

                                writer.SetControlProperty(childctrl, "Size",
                                    String.Format("new System.Drawing.Size({0}, {1})", concatenatedColumnWidth -
                                        (ParentPad.HasValue ? ParentPad.Value.Right : 0),
                                        childctrl.Height));
                            }
                        }

                        int ControlTopPosition = CurrentTopPosition;
                        int ControlLeftPosition = CurrentLeftPosition;
                        TLogging.LogAtLevel(1, "WriteTableLayout for Control '" + childctrl.controlName + "'");
                        // add margin or padding
                        string padding = writer.GetControlProperty(childctrl.controlName, "Padding");

                        if (padding.Length > 0)
                        {
                            string[] values = padding.Substring(padding.IndexOf("(") + 1).Replace(")", "").Split(new char[] { ',' });
                            ControlLeftPosition += Convert.ToInt32(values[0]);
                            ControlTopPosition += Convert.ToInt32(values[1]);
                            TLogging.LogAtLevel(1, "Removing Padding Property from Control '" + childctrl.controlName + "'!");
                            writer.ClearControlProperty(childctrl.controlName, "Padding");
                        }

                        string margin = writer.GetControlProperty(childctrl.controlName, "Margin");

                        if (margin.Length > 0)
                        {
                            string[] values = margin.Substring(margin.IndexOf("(") + 1).Replace(")", "").Split(new char[] { ',' });
                            ControlLeftPosition += Convert.ToInt32(values[0]);
                            ControlTopPosition += Convert.ToInt32(values[1]);
                            writer.ClearControlProperty(childctrl.controlName, "Margin");
                        }

                        if ((childctrl.IsOnHorizontalGridButtonPanel)
                            && (columnCounter != 0)
                            && !((childctrl.HasAttribute("StartNewButtonGroup"))
                                 && (childctrl.GetAttribute("StartNewButtonGroup").ToLower() == "true")))
                        {
                            TLogging.LogAtLevel(1,
                                "Adjusted ControlLeftPosition for Control '" + childctrl.controlName +
                                "' as it is on a horizontal Grid Button Panel.");
                            ControlLeftPosition -= 8;
                        }

                        writer.SetControlProperty(childctrl.controlName,
                            "Location",
                            String.Format("new System.Drawing.Point({0},{1})",
                                ControlLeftPosition.ToString(),
                                ControlTopPosition.ToString()),
                            false);
                        writer.CallControlFunction(LayoutCtrl.controlName,
                            "Controls.Add(this." + childctrl.controlName + ")");
开发者ID:Davincier,项目名称:openpetra,代码行数:66,代码来源:ControlGeneratorLayout.cs


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