Пример #1
0
        private static void BuildTypeDescriptorVariables(ITypeSymbol type, CCodeUnit unit)
        {
            if (!type.IsAtomicType())
            {
                var namedTypeSymbol = (INamedTypeSymbol)type;

                // add type descriptor
                // add call flag for static constructor
                var typeDescriptorHolderField = new FieldImpl
                {
                    Name = "__type_descriptor",
                    Type =
                        new NamedTypeImpl
                    {
                        Name     = "GC_descr",
                        TypeKind = TypeKind.TypeParameter
                    },
                    ContainingType      = namedTypeSymbol,
                    ContainingNamespace = type.ContainingNamespace,
                    IsStatic            = true,
                    HasConstantValue    = true,
                    ConstantValue       = 0
                };

                unit.Declarations.Add(new CCodeFieldDeclaration(typeDescriptorHolderField)
                {
                    DoNotWrapStatic = true
                });
                unit.Definitions.Add(new CCodeFieldDefinition(typeDescriptorHolderField)
                {
                    DoNotWrapStatic = true
                });
            }
        }
 public static void AddGroupNameValuePair(OnDemandProcessingContext odpContext, AspNetCore.ReportingServices.ReportIntermediateFormat.Grouping grouping, Dictionary <string, object> nameValuePairs)
 {
     if (grouping != null)
     {
         Global.Tracer.Assert(grouping.GroupExpressions != null && 0 < grouping.GroupExpressions.Count);
         AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo = grouping.GroupExpressions[0];
         if (expressionInfo.Type == AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Field)
         {
             try
             {
                 FieldImpl fieldImpl = odpContext.ReportObjectModel.FieldsImpl[expressionInfo.IntValue];
                 if (fieldImpl.FieldDef != null)
                 {
                     object value = fieldImpl.Value;
                     if (!nameValuePairs.ContainsKey(fieldImpl.FieldDef.DataField))
                     {
                         nameValuePairs.Add(fieldImpl.FieldDef.DataField, (value is DBNull) ? null : value);
                     }
                 }
             }
             catch (Exception e)
             {
                 if (!AsynchronousExceptionDetection.IsStoppingException(e))
                 {
                     goto end_IL_0097;
                 }
                 throw;
                 end_IL_0097 :;
             }
         }
     }
 }
Пример #3
0
        private static void BuildMethodTableVariables(ITypeSymbol type, CCodeUnit unit)
        {
            // add methods table
            unit.Declarations.Add(new CCodeClassDeclaration(new CCodeMethodsTableClass((INamedTypeSymbol)type)));

            var tableMethodsField = new FieldImpl
            {
                Name = "_methods_table",
                Type =
                    new NamedTypeImpl
                {
                    Name             = "__type_methods_table",
                    ContainingSymbol = type,
                    TypeKind         = TypeKind.Unknown,
                    ContainingType   = (INamedTypeSymbol)type
                },
                ContainingType      = (INamedTypeSymbol)type,
                ContainingNamespace = type.ContainingNamespace,
                IsStatic            = true
            };

            unit.Declarations.Add(new CCodeFieldDeclaration(tableMethodsField)
            {
                DoNotWrapStatic = true
            });
            unit.Definitions.Add(new CCodeFieldDefinition(tableMethodsField)
            {
                DoNotWrapStatic = true
            });
        }
Пример #4
0
        private static void BuildRuntimeInfoVariables(ITypeSymbol type, ITypeSymbol runtimeInfoType, CCodeUnit unit)
        {
            // add runtimeinfo
            var namedTypeSymbol  = (INamedTypeSymbol)type;
            var runtimeInfoField = new FieldImpl
            {
                Name = "__rt_info",
                Type = new NamedTypeImpl {
                    Name = "__runtimetype_info", TypeKind = TypeKind.Unknown,
                },
                ContainingType      = namedTypeSymbol,
                ContainingNamespace = type.ContainingNamespace,
                IsStatic            = true,
                HasConstantValue    = true,
                ConstantValue       = CreateRuntimeInfoInitialization((INamedTypeSymbol)runtimeInfoType)
            };

            unit.Declarations.Add(new CCodeFieldDeclaration(runtimeInfoField)
            {
                DoNotWrapStatic = true
            });
            unit.Definitions.Add(new CCodeFieldDefinition(runtimeInfoField)
            {
                DoNotWrapStatic = true
            });
        }
        public bool ShouldSkipCurrentRow()
        {
            FieldsImpl fieldsImpl = this.m_odpContext.ReportObjectModel.FieldsImpl;
            bool       flag       = true;

            for (int i = 0; i < this.m_expressions.Count; i++)
            {
                if (!flag)
                {
                    break;
                }
                AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo = this.m_expressions[i];
                if (expressionInfo.FieldIndex < 0)
                {
                    flag = false;
                }
                else
                {
                    FieldImpl fieldImpl = fieldsImpl[expressionInfo.FieldIndex];
                    if (fieldImpl.FieldStatus != 0)
                    {
                        return(false);
                    }
                    int num = this.m_odpContext.CompareAndStopOnError(this.m_values[i], fieldImpl.Value, this.m_scope.DataScopeObjectType, this.m_scope.Name, "GroupExpression", false);
                    flag = (num == 0);
                }
            }
            return(flag);
        }
Пример #6
0
        private void field(XmlElement fieldElement, FieldImpl field, ProcessBlockImpl processBlock)
        {
            String attributeName = fieldElement.GetProperty("attribute");

            this.addUnresolvedReference(field, attributeName, processBlock, "attribute", typeof(IAttribute));
            String accessText = xmlElement.GetProperty("access");

            field.Access = FieldAccessHelper.fromText(accessText);
        }
Пример #7
0
 public RecordField(FieldImpl field)
 {
     this.m_fieldStatus = field.FieldStatus;
     this.m_properties  = field.Properties;
     if (this.m_fieldStatus == DataFieldStatus.None)
     {
         this.m_fieldValue         = field.Value;
         this.m_isAggregationField = field.IsAggregationField;
     }
 }
Пример #8
0
 internal RecordField(FieldImpl field)
 {
     m_fieldStatus = field.FieldStatus;
     m_properties  = field.Properties;
     if (m_fieldStatus == DataFieldStatus.None)
     {
         m_fieldValue         = field.Value;
         m_isAggregationField = field.IsAggregationField;
     }
 }
        internal static FieldImpl GetInstance([CallerMemberName] string callerName = "")
        {
            JToken json = new JObject();

            JsonSource(ref json);
            var instance = (FieldImpl)FieldImpl.FromToken(json);

            InstanceFactory(ref instance, callerName);
            return(instance);
        }
Пример #10
0
        public static FieldValue getFieldValue(string value,
                                               java.lang.Integer valueTypeObj)
        {
            int valueType = valueTypeObj.intValue();
            FieldValue field = null;
            if ( value == null ) {
                valueType = Evaluator.__Fields.NULL_TYPE;
            }

            switch ( valueType ) {
                case Evaluator.__Fields.NULL_TYPE :
                    field = new FieldImpl( null );
                    break;
                case Evaluator.__Fields.CHAR_TYPE :
                    field = new FieldImpl(char.Parse(value));
                    break;
                case Evaluator.__Fields.BYTE_TYPE :
                    //byte b = Encoding.UTF8.GetBytes(value)[0];
                    field = new FieldImpl(byte.Parse(value));
                    break;
                case Evaluator.__Fields.SHORT_TYPE :
                    field = new FieldImpl( short.Parse(value ) );
                    break;
                case Evaluator.__Fields.INTEGER_TYPE :
                    field = new FieldImpl( int.Parse( value ) );
                    break;
                case Evaluator.__Fields.LONG_TYPE :
                    field = new FieldImpl( long.Parse( value ) );
                    break;
                case Evaluator.__Fields.FLOAT_TYPE :
                    field = new FieldImpl( float.Parse( value ) );
                    break;
                case Evaluator.__Fields.DOUBLE_TYPE :
                    field = new FieldImpl( double.Parse( value ) );
                    break;
                case Evaluator.__Fields.BOOLEAN_TYPE :
                    field = new FieldImpl( bool.Parse ( value ) );
                    break;
                case Evaluator.__Fields.STRING_TYPE :
                    field = new FieldImpl( value );
                    break;
                case Evaluator.__Fields.DATE_TYPE :
                    //MN: I think its fine like this, seems to work !
                    field = new FieldImpl( DateTime.Parse(value) );
                    break;
                case Evaluator.__Fields.ARRAY_TYPE :
                    //MN: I think its fine like this.
                    field = new FieldImpl( value );
                    break;
                case Evaluator.__Fields.OBJECT_TYPE :
                    field = new FieldImpl( value );
                    break;
            }
            return field;
        }
Пример #11
0
        private void state(XmlElement stateElement, StateImpl state, ProcessBlockImpl processBlock)
        {
            this.node(stateElement, state, processBlock);

            IEnumerator iter = xmlElement.GetChildElements("field").GetEnumerator();

            while (iter.MoveNext())
            {
                FieldImpl field = state.CreateField();
                this.field((XmlElement)iter.Current, field, processBlock);
            }
        }
Пример #12
0
 public RecordField(FieldImpl field, FieldInfo fieldInfo)
 {
     this.m_fieldStatus = field.FieldStatus;
     if (this.m_fieldStatus == DataFieldStatus.None)
     {
         this.m_fieldValue         = field.Value;
         this.m_isAggregationField = field.IsAggregationField;
     }
     if (fieldInfo != null && 0 < fieldInfo.PropertyCount)
     {
         this.m_fieldPropertyValues = new List <object>(fieldInfo.PropertyCount);
         for (int i = 0; i < fieldInfo.PropertyCount; i++)
         {
             object property = field.GetProperty(fieldInfo.PropertyNames[i]);
             this.m_fieldPropertyValues.Add(property);
         }
     }
 }
Пример #13
0
        private static void BuildTypeHolderVariables(ITypeSymbol type, CCodeUnit unit)
        {
            // add call flag for static constructor
            var namedTypeSymbol = (INamedTypeSymbol)type;
            var runtimeType     = "RuntimeType".ToSystemType(true);
            var typeHolderField = new FieldImpl
            {
                Name = "__type",
                Type =
                    runtimeType,
                ContainingType      = namedTypeSymbol,
                ContainingNamespace = type.ContainingNamespace,
                IsStatic            = true,
                HasConstantValue    = true,
                ConstantValue       = new ObjectCreationExpression
                {
                    Type      = runtimeType,
                    Arguments =
                    {
                        new AddressOfOperator {
                            Operand = new FieldAccess{
                                Field = new FieldImpl{
                                    ContainingType = namedTypeSymbol, Name = "__rt_info", IsStatic = true
                                }
                            }
                        }
                    },
                    CppClassInitialization = true
                }
            };

            unit.Declarations.Add(new CCodeFieldDeclaration(typeHolderField)
            {
                DoNotWrapStatic = true
            });
            unit.Definitions.Add(new CCodeFieldDefinition(typeHolderField)
            {
                DoNotWrapStatic = true
            });
        }
Пример #14
0
        private void resolveReferences()
        {
            IEnumerator iter = unresolvedReferences.GetEnumerator();

            while (iter.MoveNext())
            {
                UnresolvedReference unresolvedReference = (UnresolvedReference)iter.Current;

                Object           referencingObject        = unresolvedReference.ReferencingObject;
                String           referenceDestinationName = unresolvedReference.DestinationName;
                ProcessBlockImpl scope    = unresolvedReference.DestinationScope;
                String           property = unresolvedReference.Property;

                Object referencedObject = FindInScope(unresolvedReference, unresolvedReference.DestinationScope);
                if (referencedObject == null)
                {
                    //AddError("failed to deploy process archive : couldn't resolve " + property + "=\"" + referenceDestinationName + "\" from " + referencingObject + " in scope " + scope);
                }
                else
                {
                    if (referencingObject is TransitionImpl)
                    {
                        if (property.Equals("to"))
                        {
                            TransitionImpl transition = (TransitionImpl)referencingObject;
                            transition.To = (NodeImpl)referencedObject;
                        }
                    }
                    if (referencingObject is FieldImpl)
                    {
                        if (property.Equals("attribute"))
                        {
                            FieldImpl field = (FieldImpl)referencingObject;
                            field.Attribute = (AttributeImpl)referencedObject;
                        }
                    }
                }
            }
        }
        public bool ShouldSkipCurrentRow()
        {
            FieldsImpl fieldsImpl = m_odpContext.ReportObjectModel.FieldsImpl;
            bool       flag       = true;

            for (int i = 0; i < m_expressions.Count && flag; i++)
            {
                Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo = m_expressions[i];
                if (expressionInfo.FieldIndex < 0)
                {
                    flag = false;
                    continue;
                }
                FieldImpl fieldImpl = fieldsImpl[expressionInfo.FieldIndex];
                if (fieldImpl.FieldStatus != 0)
                {
                    return(false);
                }
                flag = (m_odpContext.CompareAndStopOnError(m_values[i], fieldImpl.Value, m_scope.DataScopeObjectType, m_scope.Name, "GroupExpression", extendedTypeComparisons: false) == 0);
            }
            return(flag);
        }
Пример #16
0
        //private const String queryFieldsByState = "select f from f in class NetBpm.Workflow.Definition.Impl.FieldImpl " +
        //    "where f.State.Id = ? " +
        //    "order by f.Index";

        public IActivityForm GetStartForm(String authenticatedActorId, Int64 processDefinitionId, DbSession dbSession, IOrganisationService organisationComponent)
        {
            IActivityForm activityForm = null;

            // First check if the actor is allowed to get this form
            authorizationHelper.CheckGetStartForm(authenticatedActorId, processDefinitionId, dbSession);

            ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl)dbSession.Load(typeof(ProcessDefinitionImpl), processDefinitionId);
            StartStateImpl        startState        = (StartStateImpl)processDefinition.StartState;

            // create a convenient map from the attribute-names to the fields
            IList       fields          = fieldRepository.FindFieldsByState(startState.Id, dbSession);
            IDictionary attributeValues = new Hashtable();
            IEnumerator iter            = fields.GetEnumerator();

            while (iter.MoveNext())
            {
                FieldImpl field = (FieldImpl)iter.Current;

                // if the attribute has an initial value
                AttributeImpl attribute     = (AttributeImpl)field.Attribute;
                String        attributeName = attribute.Name;
                String        initialValue  = attribute.InitialValue;
                if ((Object)initialValue != null && (FieldAccessHelper.IsReadable(field.Access) || FieldAccessHelper.IsWritable(field.Access)))
                {
                    // start form contains only fields that are readable or writable

                    // get it and store it in the attributeValues
                    AttributeInstanceImpl attributeInstance = new AttributeInstanceImpl();
                    attributeInstance.Attribute    = attribute;
                    attributeInstance.ValueText    = initialValue;
                    attributeValues[attributeName] = attributeInstance.GetValue();
                }
            }

            activityForm = new ActivityFormImpl(processDefinition, fields, attributeValues);

            return(activityForm);
        }
Пример #17
0
        private static void BuildStaticConstructorVariables(ITypeSymbol type, CCodeUnit unit)
        {
            // add call flag for static constructor
            var cctorCalledField = new FieldImpl
            {
                Name = "_cctor_called",
                Type = new TypeImpl {
                    SpecialType = SpecialType.System_Boolean
                },
                ContainingType      = (INamedTypeSymbol)type,
                ContainingNamespace = type.ContainingNamespace,
                IsStatic            = true
            };

            unit.Declarations.Add(new CCodeFieldDeclaration(cctorCalledField)
            {
                DoNotWrapStatic = true
            });
            unit.Definitions.Add(new CCodeFieldDefinition(cctorCalledField)
            {
                DoNotWrapStatic = true
            });
        }
Пример #18
0
        public IActivityForm GetActivityForm(String authenticatedActorId, Int64 flowId, DbSession dbSession, IOrganisationService organisationComponent)
        {
            IActivityForm activityForm = null;

            // First check if the actor is allowed to get this form
            authorizationHelper.CheckGetActivityForm(authenticatedActorId, flowId, dbSession);

            FlowImpl  flow  = (FlowImpl)dbSession.Load(typeof(FlowImpl), flowId);
            StateImpl state = (StateImpl)flow.Node;

            // create an executionContext for easy attributeValue retrieval
            ExecutionContextImpl executionContext = new ExecutionContextImpl(null, flow, dbSession, organisationComponent);

            // create a convenient map from the attribute-names to the fields
            IList       fields          = fieldRepository.FindFieldsByState(state.Id, dbSession);
            IDictionary attributeValues = new Hashtable();
            IEnumerator iter            = fields.GetEnumerator();

            while (iter.MoveNext())
            {
                FieldImpl field = (FieldImpl)iter.Current;
                if (FieldAccessHelper.IsReadable(field.Access) || FieldAccessHelper.IsWritable(field.Access))
                {
                    // activity form contains only readable or writeable fields
                    String attributeName = field.Attribute.Name;
                    if (executionContext.GetAttribute(attributeName) != null)
                    {
                        // attribute might not exist (this will cause a warning already being logged previusly)
                        attributeValues[attributeName] = executionContext.GetAttribute(attributeName);
                    }
                }
            }

            activityForm = new ActivityFormImpl(flow, fields, attributeValues);

            return(activityForm);
        }
Пример #19
0
        private static void BuildTypeHolderVariables(ITypeSymbol type, CCodeUnit unit)
        {
            // add call flag for static constructor
            var typeHolderField = new FieldImpl
            {
                Name = "__type",
                Type =
                    new NamedTypeImpl
                {
                    Name = "RuntimeType",
                    ContainingNamespace =
                        new NamespaceImpl
                    {
                        MetadataName        = "System",
                        ContainingNamespace = new NamespaceImpl {
                            IsGlobalNamespace = true, ContainingAssembly = new AssemblySymbolImpl {
                                MetadataName = "CoreLib"
                            }
                        }
                    },
                    TypeKind = TypeKind.Struct
                },
                ContainingType      = (INamedTypeSymbol)type,
                ContainingNamespace = type.ContainingNamespace,
                IsStatic            = true
            };

            unit.Declarations.Add(new CCodeFieldDeclaration(typeHolderField)
            {
                DoNotWrapStatic = true
            });
            unit.Definitions.Add(new CCodeFieldDefinition(typeHolderField)
            {
                DoNotWrapStatic = true
            });
        }
Пример #20
0
        private static void BuildStaticConstructorVariables(ITypeSymbol type, CCodeUnit unit)
        {
            // add call flag for static constructor
            var cctorBeingCalledField = new FieldImpl
            {
                Name = "_cctor_being_called",
                Type = new NamedTypeImpl {
                    SpecialType = SpecialType.System_Boolean
                },
                ContainingType      = (INamedTypeSymbol)type,
                ContainingNamespace = type.ContainingNamespace,
                IsStatic            = true,
                HasConstantValue    = true,
                ConstantValue       = "false"
            };

            unit.Declarations.Add(new CCodeFieldDeclaration(cctorBeingCalledField)
            {
                DoNotWrapStatic = true
            });
            unit.Definitions.Add(new CCodeFieldDefinition(cctorBeingCalledField)
            {
                DoNotWrapStatic = true
            });

            // add call flag for static constructor
            var cctorCalledField = new FieldImpl
            {
                Name = "_cctor_called",
                Type = new NamedTypeImpl {
                    SpecialType = SpecialType.System_Boolean
                },
                ContainingType      = (INamedTypeSymbol)type,
                ContainingNamespace = type.ContainingNamespace,
                IsStatic            = true,
                HasConstantValue    = true,
                ConstantValue       = "false"
            };

            unit.Declarations.Add(new CCodeFieldDeclaration(cctorCalledField)
            {
                DoNotWrapStatic = true
            });
            unit.Definitions.Add(new CCodeFieldDefinition(cctorCalledField)
            {
                DoNotWrapStatic = true
            });

            var cctorCalledLock = new FieldImpl
            {
                Name = "_cctor_lock",
                Type = new NamedTypeImpl {
                    Name = "recursive_mutex", TypeKind = TypeKind.Struct, ContainingNamespace = new NamespaceImpl {
                        MetadataName = "std"
                    }
                },
                ContainingType      = (INamedTypeSymbol)type,
                ContainingNamespace = type.ContainingNamespace,
                IsStatic            = true
            };

            unit.Declarations.Add(new CCodeFieldDeclaration(cctorCalledLock)
            {
                DoNotWrapStatic = true
            });
            unit.Definitions.Add(new CCodeFieldDefinition(cctorCalledLock)
            {
                DoNotWrapStatic = true
            });
        }
        private static List <Declaration> BuildDeclarations()
        {
            List <Declaration> list = new List <Declaration>(83);

            list.Add(Aggregate.GetDeclaration());
            list.Add(AggregateRow.GetDeclaration());
            list.Add(Avg.GetDeclaration());
            list.Add(BTree.GetDeclaration());
            list.Add(BTreeNode.GetDeclaration());
            list.Add(BTreeNodeTuple.GetDeclaration());
            list.Add(BTreeNodeTupleList.GetDeclaration());
            list.Add(BTreeNodeHierarchyObj.GetDeclaration());
            list.Add(CalculatedFieldWrapperImpl.GetDeclaration());
            list.Add(ChildLeafInfo.GetDeclaration());
            list.Add(Count.GetDeclaration());
            list.Add(CountDistinct.GetDeclaration());
            list.Add(CountRows.GetDeclaration());
            list.Add(DataAggregateObj.GetDeclaration());
            list.Add(DataAggregateObjResult.GetDeclaration());
            list.Add(DataRegionMemberInstance.GetDeclaration());
            list.Add(DataFieldRow.GetDeclaration());
            list.Add(FieldImpl.GetDeclaration());
            list.Add(First.GetDeclaration());
            list.Add(Last.GetDeclaration());
            list.Add(Max.GetDeclaration());
            list.Add(Min.GetDeclaration());
            list.Add(Previous.GetDeclaration());
            list.Add(RuntimeCell.GetDeclaration());
            list.Add(RuntimeCells.GetDeclaration());
            list.Add(RuntimeCellWithContents.GetDeclaration());
            list.Add(RuntimeChartCriCell.GetDeclaration());
            list.Add(RuntimeChartCriGroupLeafObj.GetDeclaration());
            list.Add(RuntimeChartCriObj.GetDeclaration());
            list.Add(RuntimeChartObj.GetDeclaration());
            list.Add(RuntimeCriObj.GetDeclaration());
            list.Add(RuntimeDataRegionObj.GetDeclaration());
            list.Add(RuntimeDataTablixObj.GetDeclaration());
            list.Add(RuntimeDataTablixGroupLeafObj.GetDeclaration());
            list.Add(RuntimeDataTablixGroupRootObj.GetDeclaration());
            list.Add(RuntimeDataTablixMemberObj.GetDeclaration());
            list.Add(RuntimeDataTablixWithScopedItemsObj.GetDeclaration());
            list.Add(RuntimeDataTablixWithScopedItemsGroupLeafObj.GetDeclaration());
            list.Add(RuntimeDetailObj.GetDeclaration());
            list.Add(RuntimeExpressionInfo.GetDeclaration());
            list.Add(RuntimeGroupLeafObj.GetDeclaration());
            list.Add(RuntimeGroupObj.GetDeclaration());
            list.Add(RuntimeGroupRootObj.GetDeclaration());
            list.Add(RuntimeGroupingObj.GetDeclaration());
            list.Add(RuntimeHierarchyObj.GetDeclaration());
            list.Add(RuntimeMemberObj.GetDeclaration());
            list.Add(RuntimeRDLDataRegionObj.GetDeclaration());
            list.Add(RuntimeRICollection.GetDeclaration());
            list.Add(RuntimeSortDataHolder.GetDeclaration());
            list.Add(RuntimeSortFilterEventInfo.GetDeclaration());
            list.Add(RuntimeSortFilterEventInfo.SortExpressionScopeInstanceHolder.GetDeclaration());
            list.Add(RuntimeSortFilterEventInfo.SortFilterExpressionScopeObj.GetDeclaration());
            list.Add(RuntimeSortFilterEventInfo.SortScopeValuesHolder.GetDeclaration());
            list.Add(RuntimeSortHierarchyObj.GetDeclaration());
            list.Add(RuntimeSortHierarchyObj.SortHierarchyStructure.GetDeclaration());
            list.Add(RuntimeDataRowSortHierarchyObj.GetDeclaration());
            list.Add(RuntimeTablixCell.GetDeclaration());
            list.Add(RuntimeTablixGroupLeafObj.GetDeclaration());
            list.Add(RuntimeTablixObj.GetDeclaration());
            list.Add(RuntimeUserSortTargetInfo.GetDeclaration());
            list.Add(ScopeInstance.GetDeclaration());
            list.Add(ScopeLookupTable.GetDeclaration());
            list.Add(StDev.GetDeclaration());
            list.Add(StDevP.GetDeclaration());
            list.Add(Sum.GetDeclaration());
            list.Add(Var.GetDeclaration());
            list.Add(VarBase.GetDeclaration());
            list.Add(VarP.GetDeclaration());
            list.Add(Filters.FilterKey.GetDeclaration());
            list.Add(RuntimeGaugePanelObj.GetDeclaration());
            list.Add(LookupMatches.GetDeclaration());
            list.Add(LookupMatchesWithRows.GetDeclaration());
            list.Add(LookupTable.GetDeclaration());
            list.Add(RuntimeMapDataRegionObj.GetDeclaration());
            list.Add(DataScopeInfo.GetDeclaration());
            list.Add(BucketedDataAggregateObjs.GetDeclaration());
            list.Add(DataAggregateObjBucket.GetDeclaration());
            list.Add(RuntimeGroupingObjHash.GetDeclaration());
            list.Add(RuntimeGroupingObjTree.GetDeclaration());
            list.Add(RuntimeGroupingObjDetail.GetDeclaration());
            list.Add(RuntimeGroupingObjDetailUserSort.GetDeclaration());
            list.Add(RuntimeGroupingObjLinkedList.GetDeclaration());
            list.Add(RuntimeGroupingObjNaturalGroup.GetDeclaration());
            return(list);
        }
        public bool TryCreateObject(ObjectType objectType, out IPersistable persistObj)
        {
            switch (objectType)
            {
            case ObjectType.Aggregate:
                persistObj = new Aggregate();
                break;

            case ObjectType.AggregateRow:
                persistObj = new AggregateRow();
                break;

            case ObjectType.Avg:
                persistObj = new Avg();
                break;

            case ObjectType.BTree:
                persistObj = new BTree();
                break;

            case ObjectType.BTreeNode:
                persistObj = new BTreeNode();
                break;

            case ObjectType.BTreeNodeTupleList:
                persistObj = new BTreeNodeTupleList();
                break;

            case ObjectType.BTreeNodeTuple:
                persistObj = new BTreeNodeTuple();
                break;

            case ObjectType.BTreeNodeHierarchyObj:
                persistObj = new BTreeNodeHierarchyObj();
                break;

            case ObjectType.CalculatedFieldWrapperImpl:
                persistObj = new CalculatedFieldWrapperImpl();
                break;

            case ObjectType.ChildLeafInfo:
                persistObj = new ChildLeafInfo();
                break;

            case ObjectType.Count:
                persistObj = new Count();
                break;

            case ObjectType.CountDistinct:
                persistObj = new CountDistinct();
                break;

            case ObjectType.CountRows:
                persistObj = new CountRows();
                break;

            case ObjectType.DataAggregateObj:
                persistObj = new DataAggregateObj();
                break;

            case ObjectType.DataAggregateObjResult:
                persistObj = new DataAggregateObjResult();
                break;

            case ObjectType.DataFieldRow:
                persistObj = new DataFieldRow();
                break;

            case ObjectType.DataRegionMemberInstance:
                persistObj = new DataRegionMemberInstance();
                break;

            case ObjectType.FieldImpl:
                persistObj = new FieldImpl();
                break;

            case ObjectType.First:
                persistObj = new First();
                break;

            case ObjectType.Last:
                persistObj = new Last();
                break;

            case ObjectType.Max:
                persistObj = new Max();
                break;

            case ObjectType.Min:
                persistObj = new Min();
                break;

            case ObjectType.Previous:
                persistObj = new Previous();
                break;

            case ObjectType.RuntimeCells:
                persistObj = new RuntimeCells();
                break;

            case ObjectType.RuntimeChartCriCell:
                persistObj = new RuntimeChartCriCell();
                break;

            case ObjectType.RuntimeChartCriGroupLeafObj:
                persistObj = new RuntimeChartCriGroupLeafObj();
                break;

            case ObjectType.RuntimeChartObj:
                persistObj = new RuntimeChartObj();
                break;

            case ObjectType.RuntimeGaugePanelObj:
                persistObj = new RuntimeGaugePanelObj();
                break;

            case ObjectType.RuntimeCriObj:
                persistObj = new RuntimeCriObj();
                break;

            case ObjectType.RuntimeDataTablixGroupRootObj:
                persistObj = new RuntimeDataTablixGroupRootObj();
                break;

            case ObjectType.RuntimeDataTablixMemberObj:
                persistObj = new RuntimeDataTablixMemberObj();
                break;

            case ObjectType.RuntimeExpressionInfo:
                persistObj = new RuntimeExpressionInfo();
                break;

            case ObjectType.RuntimeHierarchyObj:
                persistObj = new RuntimeHierarchyObj();
                break;

            case ObjectType.RuntimeRICollection:
                persistObj = new RuntimeRICollection();
                break;

            case ObjectType.RuntimeSortDataHolder:
                persistObj = new RuntimeSortDataHolder();
                break;

            case ObjectType.RuntimeSortFilterEventInfo:
                persistObj = new RuntimeSortFilterEventInfo();
                break;

            case ObjectType.RuntimeSortHierarchyObj:
                persistObj = new RuntimeSortHierarchyObj();
                break;

            case ObjectType.RuntimeDataRowSortHierarchyObj:
                persistObj = new RuntimeDataRowSortHierarchyObj();
                break;

            case ObjectType.RuntimeTablixCell:
                persistObj = new RuntimeTablixCell();
                break;

            case ObjectType.RuntimeTablixGroupLeafObj:
                persistObj = new RuntimeTablixGroupLeafObj();
                break;

            case ObjectType.RuntimeTablixObj:
                persistObj = new RuntimeTablixObj();
                break;

            case ObjectType.RuntimeUserSortTargetInfo:
                persistObj = new RuntimeUserSortTargetInfo();
                break;

            case ObjectType.ScopeLookupTable:
                persistObj = new ScopeLookupTable();
                break;

            case ObjectType.SortExpressionScopeInstanceHolder:
                persistObj = new RuntimeSortFilterEventInfo.SortExpressionScopeInstanceHolder();
                break;

            case ObjectType.SortFilterExpressionScopeObj:
                persistObj = new RuntimeSortFilterEventInfo.SortFilterExpressionScopeObj();
                break;

            case ObjectType.SortHierarchyStruct:
                persistObj = new RuntimeSortHierarchyObj.SortHierarchyStructure();
                break;

            case ObjectType.SortScopeValuesHolder:
                persistObj = new RuntimeSortFilterEventInfo.SortScopeValuesHolder();
                break;

            case ObjectType.StDev:
                persistObj = new StDev();
                break;

            case ObjectType.StDevP:
                persistObj = new StDevP();
                break;

            case ObjectType.StorageItem:
                persistObj = new StorageItem();
                break;

            case ObjectType.Sum:
                persistObj = new Sum();
                break;

            case ObjectType.Var:
                persistObj = new Var();
                break;

            case ObjectType.VarP:
                persistObj = new VarP();
                break;

            case ObjectType.FilterKey:
                persistObj = new Filters.FilterKey();
                break;

            case ObjectType.LookupMatches:
                persistObj = new LookupMatches();
                break;

            case ObjectType.LookupMatchesWithRows:
                persistObj = new LookupMatchesWithRows();
                break;

            case ObjectType.LookupTable:
                persistObj = new LookupTable();
                break;

            case ObjectType.Union:
                persistObj = new Union();
                break;

            case ObjectType.RuntimeMapDataRegionObj:
                persistObj = new RuntimeMapDataRegionObj();
                break;

            case ObjectType.DataScopeInfo:
                persistObj = new DataScopeInfo();
                break;

            case ObjectType.BucketedDataAggregateObjs:
                persistObj = new BucketedDataAggregateObjs();
                break;

            case ObjectType.DataAggregateObjBucket:
                persistObj = new DataAggregateObjBucket();
                break;

            case ObjectType.RuntimeGroupingObjHash:
                persistObj = new RuntimeGroupingObjHash();
                break;

            case ObjectType.RuntimeGroupingObjTree:
                persistObj = new RuntimeGroupingObjTree();
                break;

            case ObjectType.RuntimeGroupingObjDetail:
                persistObj = new RuntimeGroupingObjDetail();
                break;

            case ObjectType.RuntimeGroupingObjDetailUserSort:
                persistObj = new RuntimeGroupingObjDetailUserSort();
                break;

            case ObjectType.RuntimeGroupingObjLinkedList:
                persistObj = new RuntimeGroupingObjLinkedList();
                break;

            case ObjectType.RuntimeGroupingObjNaturalGroup:
                persistObj = new RuntimeGroupingObjNaturalGroup();
                break;

            default:
                persistObj = null;
                return(false);
            }
            return(true);
        }
Пример #23
0
        public static FieldValue getFieldValue(string value,
                                               java.lang.Integer valueTypeObj)
        {
            int        valueType = valueTypeObj.intValue();
            FieldValue field     = null;

            if (value == null)
            {
                valueType = Evaluator.__Fields.NULL_TYPE;
            }

            switch (valueType)
            {
            case Evaluator.__Fields.NULL_TYPE:
                field = new FieldImpl(null);
                break;

            case Evaluator.__Fields.CHAR_TYPE:
                field = new FieldImpl(char.Parse(value));
                break;

            case Evaluator.__Fields.BYTE_TYPE:
                //byte b = Encoding.UTF8.GetBytes(value)[0];
                field = new FieldImpl(byte.Parse(value));
                break;

            case Evaluator.__Fields.SHORT_TYPE:
                field = new FieldImpl(short.Parse(value));
                break;

            case Evaluator.__Fields.INTEGER_TYPE:
                field = new FieldImpl(int.Parse(value));
                break;

            case Evaluator.__Fields.LONG_TYPE:
                field = new FieldImpl(long.Parse(value));
                break;

            case Evaluator.__Fields.FLOAT_TYPE:
                field = new FieldImpl(float.Parse(value));
                break;

            case Evaluator.__Fields.DOUBLE_TYPE:
                field = new FieldImpl(double.Parse(value));
                break;

            case Evaluator.__Fields.BOOLEAN_TYPE:
                field = new FieldImpl(bool.Parse(value));
                break;

            case Evaluator.__Fields.STRING_TYPE:
                field = new FieldImpl(value);
                break;

            case Evaluator.__Fields.DATE_TYPE:
                //MN: I think its fine like this, seems to work !
                field = new FieldImpl(DateTime.Parse(value));
                break;

            case Evaluator.__Fields.ARRAY_TYPE:
                //MN: I think its fine like this.
                field = new FieldImpl(value);
                break;

            case Evaluator.__Fields.OBJECT_TYPE:
                field = new FieldImpl(value);
                break;
            }
            return(field);
        }
Пример #24
0
        public void CheckAccess(IDictionary attributeValues, StateImpl state)
        {
            IDictionary fields = new Hashtable();

            // first we check if a value is supplied for all required fields
            IEnumerator iter = state.Fields.GetEnumerator();

            log.Debug(iter);
            while (iter.MoveNext())
            {
                FieldImpl field         = (FieldImpl)iter.Current;
                String    attributeName = field.Attribute.Name;
                fields[attributeName] = field;

                // if a field is found required and no attribute value is supplied throw
                // RequiredFieldException
                log.Debug(field);
                log.Debug(field.Access);
                if ((FieldAccessHelper.IsRequired(field.Access)) && (attributeValues == null))
                {
                    throw new RequiredFieldException(field);
                }
                // OR
                // if field is found required and attribute value of it is not available
                // throw RequiredFieldException
                if ((FieldAccessHelper.IsRequired(field.Access)) && (attributeValues != null) && (!attributeValues.Contains(attributeName)))
                {
                    throw new RequiredFieldException(field);
                }
            }

            // then we check if the access of all supplied values is writable
            IList attributeNamesToBeRemoved = new ArrayList();             // store attribute name of attribute to be removed

            if (attributeValues != null)
            {
                iter = attributeValues.GetEnumerator();
                while (iter.MoveNext())
                {
                    DictionaryEntry entry         = (DictionaryEntry)iter.Current;
                    String          attributeName = (String)entry.Key;

                    FieldImpl field = (FieldImpl)fields[attributeName];
                    if ((field != null) && (!FieldAccessHelper.IsWritable(field.Access)))
                    {
                        log.Warn("ignoring attributeValue for unwritable attribute '" + attributeName + "'");
                        // commented out cause will result in ConcurrentModificationException
                        // instead copy its attribute name and remove later OR do a deep copy of the
                        // attributeValues so there is one set that gets iterated and another that
                        //gets deleted???
                        //attributeValues.remove( attributeName );
                        attributeNamesToBeRemoved.Add(attributeName);
                    }
                }
                // now removed collected to be removed attribute
                IEnumerator itr = attributeNamesToBeRemoved.GetEnumerator();
                while (itr.MoveNext())
                {
                    String an = (String)itr.Current;
                    attributeValues.Remove(an);
                }
            }
        }
 static partial void InstanceFactory(ref FieldImpl instance, [CallerMemberName] string callerName = "");