Esempio n. 1
0
            private Operation.Grouping.IMergeAlgorithm BuildOrGetMergeAlgo(ViewColumn vc, Type columnValueType, Database.MetaColumn metaColumn)
            {
                Operation.Grouping.IMergeAlgorithm mergeAlgo = null;
                if (mergeAlgoE != Operation.Grouping.MergeAlgo.none)
                {
                    mergeAlgo = Operation.Grouping.GetMergeAlgo(mergeAlgoE, columnValueType);
                    if (metaColumn != null)
                    {
                        metaColumn.DefaultMergeAlgorithm = mergeAlgo;
                    }
                }
                else
                {
                    if (metaColumn != null)
                    {
                        mergeAlgo = metaColumn.DefaultMergeAlgorithm;
                    }
                }

                if (vc != null && mergeAlgo != null && mergeAlgo.IsDisplayMergedRowsOnly())
                {
                    vc.m_IsDisplayMergedOnly = true;
                }
                return(mergeAlgo);
            }
Esempio n. 2
0
 public MetaColumn(string name, string displayName, Type type, bool isPrimaryKey, Operation.Grouping.IGroupAlgorithm groupAlgo, Operation.Grouping.IMergeAlgorithm mergeAlgo, int displayDefaultWidth = k_DefaultDisplayWidth)
 {
     Index                 = 0;
     Name                  = name;
     DisplayName           = displayName;
     Type                  = type;
     IsPrimaryKey          = isPrimaryKey;
     DefaultMergeAlgorithm = mergeAlgo;
     DefaultGroupAlgorithm = groupAlgo;
     DefaultDisplayWidth   = displayDefaultWidth;
 }
Esempio n. 3
0
 public MetaColumn(string name, string displayName, Type type, ColumnRef reference, Operation.Grouping.IGroupAlgorithm groupAlgo, Operation.Grouping.IMergeAlgorithm mergeAlgo, int displayDefaultWidth = k_DefaultDisplayWidth)
 {
     Index                 = 0;
     Name                  = name;
     DisplayName           = displayName;
     Type                  = type;
     IsReference           = true;
     Reference             = reference;
     DefaultMergeAlgorithm = mergeAlgo;
     DefaultGroupAlgorithm = groupAlgo;
     DefaultDisplayWidth   = displayDefaultWidth;
 }
Esempio n. 4
0
 public MetaColumn(MetaColumn mc)
 {
     Index                 = 0;
     Name                  = mc.Name;
     IsPrimaryKey          = mc.IsPrimaryKey;
     DisplayName           = mc.DisplayName;
     Type                  = mc.Type;
     IsReference           = mc.IsReference;
     Reference             = mc.Reference;
     DefaultMergeAlgorithm = mc.DefaultMergeAlgorithm;
     DefaultGroupAlgorithm = mc.DefaultGroupAlgorithm;
     DefaultDisplayWidth   = mc.DefaultDisplayWidth;
 }
Esempio n. 5
0
 private MetaColumn BuildOrUpdateMetaColumn(ref MetaColumn metaColumn, Type columnValueType, Operation.Grouping.IMergeAlgorithm mergeAlgo)
 {
     if (metaColumn == null)
     {
         metaColumn = new MetaColumn(name, name, columnValueType, isPrimaryKey, groupAlgo, mergeAlgo, displayDefaultWidth);
     }
     else
     {
         if (metaColumn.Type == null)
         {
             metaColumn.Type = columnValueType;
         }
         else if (columnValueType != null && metaColumn.Type != columnValueType)
         {
             DebugUtility.LogError("Cannot redefine column type as '" + columnValueType + "'. Was already defined as '" + metaColumn.Type + "'");
         }
     }
     return(metaColumn);
 }
            private MetaColumn BuildOrUpdateMetaColumn(ViewTable.Builder.BuildingData buildingData, ref MetaColumn metaColumn, Type columnValueType, Operation.Grouping.IMergeAlgorithm mergeAlgo)
            {
                var typeComparisonMethod = typeof(string) == columnValueType ? DataMatchMethod.AsString : DataMatchMethod.AsNumber;

                if (metaColumn == null)
                {
                    var metaType = new MetaType()
                    {
                        scriptingType = columnValueType, comparisonMethod = typeComparisonMethod
                    };
                    metaColumn = new MetaColumn(name, name, metaType, isPrimaryKey, groupAlgo, mergeAlgo, FormatName, displayDefaultWidth);
                    buildingData.MetaTable.AddColumn(metaColumn);
                }
                else
                {
                    if (metaColumn.Type.scriptingType == null)
                    {
                        metaColumn.Type = new MetaType()
                        {
                            scriptingType = columnValueType, comparisonMethod = typeComparisonMethod
                        };
                    }
                    else if (columnValueType != null && metaColumn.Type.scriptingType != columnValueType)
                    {
                        Debug.LogError("Cannot redefine column type as '" + columnValueType + "'. Was already defined as '" + metaColumn.Type + "'");
                    }
                    if (!String.IsNullOrEmpty(FormatName))
                    {
                        if (String.IsNullOrEmpty(metaColumn.FormatName) || metaColumn.FormatName == FormatName)
                        {
                            metaColumn.FormatName = FormatName;
                        }
                        else
                        {
                            Debug.LogWarning("Format already defined as '" + metaColumn.FormatName + "'. Trying to redefined it as '" + FormatName + "'");
                        }
                    }
                }
                return(metaColumn);
            }
Esempio n. 7
0
 private MetaColumn BuildOrUpdateMetaColumn(ViewTable.Builder.BuildingData buildingData, ref MetaColumn metaColumn, Type columnValueType, Operation.Grouping.IMergeAlgorithm mergeAlgo)
 {
     if (metaColumn == null)
     {
         metaColumn = new MetaColumn(name, name, columnValueType, isPrimaryKey, groupAlgo, mergeAlgo, FormatName, displayDefaultWidth);
         buildingData.MetaTable.AddColumn(metaColumn);
     }
     else
     {
         if (metaColumn.Type == null)
         {
             metaColumn.Type = columnValueType;
         }
         else if (columnValueType != null && metaColumn.Type != columnValueType)
         {
             DebugUtility.LogError("Cannot redefine column type as '" + columnValueType + "'. Was already defined as '" + metaColumn.Type + "'");
         }
         if (!String.IsNullOrEmpty(FormatName))
         {
             if (String.IsNullOrEmpty(metaColumn.FormatName) || metaColumn.FormatName == FormatName)
             {
                 metaColumn.FormatName = FormatName;
             }
             else
             {
                 DebugUtility.LogWarning("Format already defined as '" + metaColumn.FormatName + "'. Trying to redefined it as '" + FormatName + "'");
             }
         }
     }
     return(metaColumn);
 }