Example #1
0
        public static BaseCollection<GridPropertieElement> MergeGridProperties(GridPropertiesElement props,HPatternSettings sett)
        {
            BaseCollection<GridPropertieElement> ret = null;
            if (props == null)
            {
                ret = new BaseCollection<GridPropertieElement>();
            }
            else
            {
                ret = new BaseCollection<GridPropertieElement>(props);
            }
            if (sett.Grid.GridProperties != null && sett.Grid.GridProperties.GridProperties != null)
            {
                foreach (SettingsGridPropertieElement prop in sett.Grid.GridProperties.GridProperties)
                {
                    // Vamos verificar se já tem
                    bool tem = false;
                    foreach (GridPropertieElement prope in ret)
                    {
                        if (prope.Name == prop.Name)
                        {
                            tem = true;
                            break;
                        }
                    }

                    // Não tem
                    if (tem == false)
                    {
                        GridPropertieElement propi = new GridPropertieElement(prop.Name);
                        propi.Valor = prop.Valor;
                        ret.Add(propi);
                    }
                }
            }
            return ret;
        }
Example #2
0
 public DolphinStyleMenu(Code.ITabsObject tabs, Artech.Architecture.Common.Objects.KBObject Object)
 {
     mObject = Object;
     form = tabs;
     sett = tabs.Instance.Settings;
 }
Example #3
0
 public DolphinStyleMenuTab(Code.ITabObject tab, Artech.Architecture.Common.Objects.KBObject Object)
 {
     mObject = Object;
     mTab = tab;
     sett = tab.Instance.Settings;
 }
Example #4
0
    public static void ApplyRow(StringBuilder atts, RowElement row, Transaction transaction, Boolean geraBC, String sigla, HPatternSettings settings)
    {
        atts.AppendLine("<tr>");

        foreach (ColumnElement col in row.Columns)
        {
            atts.AppendLine("<td colspan='" + col.ColSpan.ToString() + "' rowspan='" + col.RowSpan.ToString() + "'>");

            foreach (Object obj in col.Items)
            {
                if (obj is AttributeElement)
                {
                    AttributeElement att = (AttributeElement)obj;
                    if (geraBC)
                    {
                        Dictionary<string, object> properties = new Dictionary<string, object>();
                        properties[Properties.HTMLATT.FieldSpecifier] = att.AttributeName;
                        TransactionAttribute ta = transaction.Structure.Root.GetAttribute(att.AttributeName);
                        bool vreadonly = false;
                        if (ta == null)
                        {
                            vreadonly = true;
                        }
                        else
                        {
                            if (ta.IsInferred)
                            {
                                vreadonly = true;
                            }
                        }

                        if (att.Readonly)
                        {
                            vreadonly = true;
                        }

                        if (vreadonly)
                        {
                            properties[Properties.HTMLATT.ReadOnly] = true;
                        }

                        string themeClass = "Attribute";
                        if (att.ThemeClass != String.Empty)
                            themeClass = att.ThemeClass;

                        if (vreadonly)
                        {
                            if (att.Format.ToLower() == "text")
                                properties[Properties.HTMLATT.Format] = Properties.HTMLATT.Format_Values.Text;

                            if (att.Format.ToLower() == "html")
                                properties[Properties.HTMLATT.Format] = Properties.HTMLATT.Format_Values.Html;

                            if (att.Format.ToLower() == "raw html")
                                properties[Properties.HTMLATT.Format] = Properties.HTMLATT.Format_Values.RawHtml;

                            if (att.Format.ToLower() == "text with meaningful spaces")
                                properties[Properties.HTMLATT.Format] = Properties.HTMLATT.Format_Values.TextWithMeaningfulSpaces;

                        }

                        atts.AppendLine(WebForm.Variable(transaction.Name + sigla, themeClass, null, properties));
                    }
                    else
                    {
                        Dictionary<string, object> properties = new Dictionary<string, object>();
                        if (att.Readonly)
                        {
                            properties[Properties.HTMLATT.ReadOnly] = true;
                        }
                        atts.AppendLine(WebForm.Attribute(att.AttributeName, null, null, properties));
                    }
                }
                if (obj is VariableElement)
                {
                    VariableElement var = (VariableElement)obj;

                    string themeClass = "Attribute";
                    if (var.ThemeClass != String.Empty)
                        themeClass = var.ThemeClass;

                    atts.AppendLine(WebForm.Variable(var.Name, themeClass));
                }
                if (obj is TextElement)
                {
                    TextElement text = (TextElement)obj;
                    //contaAtts++;
                    atts.AppendLine(WebForm.TextBlock(text.Name, settings.Theme.PlainText, text.Caption));
                }
            }

            atts.AppendLine("</td>");
        }

        atts.AppendLine("</tr>");
    }
Example #5
0
 public TabDefault(Code.ITabsObject tabs, Artech.Architecture.Common.Objects.KBObject Object)
 {
     mObject = Object;
     view = tabs;
     sett = tabs.Instance.Settings;
 }
Example #6
0
 public TreeViewAnchorTab(Code.ITabObject tab, Artech.Architecture.Common.Objects.KBObject Object)
 {
     mObject = Object;
     mTab = tab;
     sett = tab.Instance.Settings;
 }
Example #7
0
 public TreeViewAnchor(Code.ITabsObject tabs, Artech.Architecture.Common.Objects.KBObject Object)
 {
     mObject = Object;
     viewtabs = tabs;
     sett = tabs.Instance.Settings;
 }
Example #8
0
        private static SettingsCaptionElement IdentifyRule(RowElement row, Transaction transaction, HPatternSettings settings)
        {
            SettingsCaptionElement rule = null;

            bool achou = false;
            foreach (ColumnElement col2 in row.Columns)
            {
                foreach (IHPatternInstanceElement obj2 in col2.Items)
                {
                    if (obj2 is AttributeElement)
                    {
                        AttributeElement att2 = (AttributeElement)obj2;
                        bool ipk = false;
                        bool ifk = false;
                        bool inull = false;
                        bool ireq = att2.getRequired(transaction);
                        if (transaction != null)
                        {
                            TransactionAttribute ta = transaction.Structure.Root.GetAttribute(att2.AttributeName);
                            if (ta != null) {
                                ipk = ta.IsKey;
                                ifk = ta.IsForeignKey;
                                inull = ta.IsNullable == TableAttribute.IsNullableValue.True;
                            }
                        }
                        foreach (SettingsCaptionElement cap in settings.CustomCaptions)
                        {
                            bool isValido = true;
                            if (cap.SetPrimaryKey && !ipk)
                            {
                                continue;
                            }
                            if (cap.SetForeignKey && !ifk)
                            {
                                continue;
                            }
                            if (cap.SetNullable == SettingsCaptionElement.SetNullableValue.Null && !inull)
                            {
                                continue;
                            }
                            if (cap.SetNullable == SettingsCaptionElement.SetNullableValue.NotNull && inull)
                            {
                                continue;
                            }
                            if (cap.SetEditable == SettingsCaptionElement.SetEditableValue.Editable && (att2.Readonly || !att2.Visible))
                            {
                                continue;
                            }
                            if (cap.SetEditable == SettingsCaptionElement.SetEditableValue.ReadOnly && !att2.Readonly)
                            {
                                continue;
                            }
                            if (cap.SetRequired == SettingsCaptionElement.SetRequiredValue.Required && !ireq)
                            {
                                continue;
                            }
                            if (cap.SetRequired == SettingsCaptionElement.SetRequiredValue.NotRequired && ireq)
                            {
                                continue;
                            }

                            if (isValido)
                            {
                                rule = cap;
                                achou = true;
                                break;
                            }
                        }

                    }
                    if (achou) break;
                }
                if (achou) break;

            }
            return rule;
        }
Example #9
0
 internal static IBaseCollection<SettingsCodeElement> GetCodes(CodeType type, HPatternSettings settings)
 {
     return settings.Codes.FindAll(delegate(SettingsCodeElement code)
     {
         return code.Enabled && ((code.ApplyProcedure && type == CodeType.Procedure) ||
         (code.ApplyTransaction && type == CodeType.Transaction) ||
         (code.ApplyWebPanel && type == CodeType.WebPanel));
     });
 }
Example #10
0
        public static void AddFilterRow(FRowElement row, StringBuilder rows,HPatternSettings settings)
        {
            rows.AppendLine("<tr>");

            foreach (FColElement col in row.Columns)
            {
                string align = col.Align;
                if (col.Align == FColElement.AlignValue.Default)
                {
                    align = settings.Template.CollumnTextAlign.ToLower();
                }
                else
                {
                    align = align.ToLower();
                }

                rows.AppendLine("<td align=\"" + align + "\" colspan='" + col.ColSpan.ToString() + "' rowspan='" + col.RowSpan.ToString() + "'>");

                foreach (IHPatternInstanceElement item in col.Items)
                {
                    if (item is TextElement)
                    {
                        TextElement text = (item as TextElement);
                        RenderText(text, null, rows, null);
                    }
                    if (item is FilterAttributeElement)
                    {
                        FilterAttributeElement filterVar = item as FilterAttributeElement;
                        if (filterVar.AllValue)
                        {
                            Dictionary<string, object> props = new Dictionary<string, object>();
                            Template.GetControlInfo(filterVar, props, true);
                            rows.AppendLine(WebForm.Variable(filterVar.Name, null, null, props));
                        }
                        else
                        {
                            Dictionary<string, object> props = new Dictionary<string, object>();
                            Template.GetControlSize(filterVar, props);
                            rows.AppendLine(WebForm.Variable(filterVar.Name,null,null,props));
                        }

                        if (filterVar.Link != null)
                        {
                            StringBuilder textob = new StringBuilder();
                            Template.LinkImage(textob, filterVar.Link, filterVar.Name, settings);
                            rows.AppendLine(textob.ToString());
                        }

                    }
                    if (item is FGroupElement)
                    {
                        FGroupElement gobj = item as FGroupElement;

                        contaGroup++;
                        string name = "Group" + contaGroup.ToString().Trim();

                        string tema = settings.Theme.Group;
                        if (String.IsNullOrEmpty(tema)) tema = "Group";
                        if (!String.IsNullOrEmpty(gobj.Class)) tema = gobj.Class;

                        rows.AppendLine(WebForm.BeginGroup(name, tema, gobj.Caption));
                        rows.AppendLine(WebForm.BeginTable("Table"+name,null));
                        foreach (FRowElement row2 in gobj.Rows)
                        {
                            AddFilterRow(row2, rows, settings);
                        }
                        rows.AppendLine(WebForm.EndTable());
                        rows.AppendLine(WebForm.EndGroup());

                    }

                }

                rows.AppendLine("</td>");

            }

            rows.AppendLine("</tr>");
        }
Example #11
0
 public static string RuleCodes(CodeType type,HPatternSettings settings)
 {
     StringBuilder b = new StringBuilder();
     IBaseCollection<SettingsCodeElement> codes = GetCodes(type, settings);
     foreach (SettingsCodeElement code in codes)
     {
         b.Append(Environment.NewLine);
         //b.AppendLine(String.Format("// [Start] Code: {0}", code.Name));
         b.AppendLine(code.RuleCode);
         //b.AppendLine(String.Format("// [End] Code: {0}", code.Name));
     }
     return b.ToString();
 }
Example #12
0
 public static void DocumentationSave(DocumentationPart docp, KBObject obj, HPatternInstance wwInstance, HPatternSettings settings)
 {
     bool atualiza = false;
     if (docp.Page == null)
     {
         atualiza = true;
     }
     else
     {
         if (String.IsNullOrEmpty(docp.Page.EditableContent))
         {
             atualiza = true;
         }
     }
     if (atualiza)
     {
         docp.Page = new WikiPage(wwInstance.Model, obj.Name, TemplateInternal.DocumentationFactory(obj.Name, obj.Description, wwInstance, settings));
     }
 }
Example #13
0
        public static string DocumentationFactory(string objectName, string objectDescription,HPatternInstance instance, HPatternSettings settings)
        {
            HTemplate template = Template.GetDocTemplate(settings);

            string sAuthor = settings.Documentation.Author;
            if (!String.IsNullOrEmpty(instance.Documentation.Author))
                sAuthor = instance.Documentation.Author;

            string sDate = settings.Documentation.Date;
            if (instance.Documentation.Date != DocumentationElement.DateValue.Default)
                sDate = instance.Documentation.Date;
            if (sDate == DocumentationElement.DateValue.Today)
                sDate = DateTime.Today.ToShortDateString();

            string sObjectDescription = instance.Documentation.ObjectDescription;
            if (sObjectDescription == DocumentationElement.ObjectDescriptionValue.Pgmdesc)
                sObjectDescription = objectDescription;

            string sObjectName = instance.Documentation.ObjectName;
            if (sObjectName == DocumentationElement.ObjectNameValue.Pgmname)
                sObjectName = objectName;

            string sObservation = settings.Documentation.Observation;
            if (!String.IsNullOrEmpty(instance.Documentation.Observation))
                sObservation = instance.Documentation.Observation;

            string sRequirement = settings.Documentation.Requirement;
            if (!String.IsNullOrEmpty(instance.Documentation.Requirement))
                sRequirement = instance.Documentation.Requirement;

            string sSystemDescription = settings.Documentation.SystemDescription;
            if (!String.IsNullOrEmpty(instance.Documentation.SystemDescription))
                sSystemDescription = instance.Documentation.SystemDescription;

            if (!String.IsNullOrEmpty(sAuthor))
                template.SetAttribute(SelTemplate.Author, sAuthor);

            if (!String.IsNullOrEmpty(sDate))
                template.SetAttribute(SelTemplate.Date, sDate);

            if (!String.IsNullOrEmpty(sObjectDescription))
                template.SetAttribute(SelTemplate.ObjectDescription, sObjectDescription);

            if (!String.IsNullOrEmpty(sObjectName))
                template.SetAttribute(SelTemplate.ObjectName, sObjectName);

            if (!String.IsNullOrEmpty(sObservation))
                template.SetAttribute(SelTemplate.Observation, sObservation);

            if (!String.IsNullOrEmpty(sRequirement))
                template.SetAttribute(SelTemplate.Requirement, sRequirement);

            if (!String.IsNullOrEmpty(sSystemDescription))
                template.SetAttribute(SelTemplate.SystemDescription, sSystemDescription);

            return template.ToString();
        }