コード例 #1
0
        public void GetAttributeModifierTest()
        {
            FieldElement fieldElement = new FieldElement();

            fieldElement.Name            = "TestField";
            fieldElement.Access          = CodeAccess.Protected;
            fieldElement.Type            = "int";
            fieldElement.MemberModifiers = MemberModifiers.Static;

            string attribute = ElementUtilities.GetAttribute(ElementAttributeType.Modifier, fieldElement);

            Assert.AreEqual("Static", attribute, "Unexpected attribute.");

            TypeElement typeElement = new TypeElement();

            typeElement.TypeModifiers = TypeModifiers.Sealed;

            attribute = ElementUtilities.GetAttribute(ElementAttributeType.Modifier, typeElement);
            Assert.AreEqual("Sealed", attribute, "Unexpected attribute.");

            UsingElement usingElement = new UsingElement();

            usingElement.Name = "System";

            attribute = ElementUtilities.GetAttribute(ElementAttributeType.Modifier, usingElement);
            Assert.AreEqual(string.Empty, attribute, "Unexpected attribute.");
        }
コード例 #2
0
        //Transforme un groupe sous la forme Element, dElement
        public override Element Déconstruire()
        {
            TypeElement type = Acces.type_BUDGET_NOMENCLATURE;

            Element  e = new Element();
            dElement d;
            string   CodeAttribut = "";

            e.ID           = ID;
            e.Code         = Code;
            e.Libelle      = Libelle;
            e.Element_Type = type.ID;
            e.Type_Element = Enveloppe;
            e.Actif        = Actif;

            //Période
            {
                CodeAttribut = "PERIODE";
                d            = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, Periode.ToString());
                e.Liste.Add(d);
            }

            //TypeFlux
            {
                CodeAttribut = "TYPE_FLUX";
                d            = new dElement(ID, Acces.Trouver_Attribut(type, CodeAttribut).ID, CodeAttribut, ((int)TypeFlux).ToString());
                e.Liste.Add(d);
            }
            return(e);
        }
コード例 #3
0
        public void GetSet()
        {
            TypeElement el = new TypeElement();

            el.Type = typeof(string);
            Assert.AreEqual(typeof(string), el.Type, "A1");
        }
コード例 #4
0
 public TypeElement()
 {
     EnumValues    = new Models.EnumValue[] {};
     Interfaces    = new TypeElement[] {};
     PossibleTypes = new TypeElement[] {};
     InputFields   = new InputValue[] {};
 }
コード例 #5
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as ResourceReference;

            if (dest == null)
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }

            base.CopyTo(dest);
            if (ReferenceElement != null)
            {
                dest.ReferenceElement = (Hl7.Fhir.Model.FhirString)ReferenceElement.DeepCopy();
            }
            if (TypeElement != null)
            {
                dest.TypeElement = (Hl7.Fhir.Model.FhirUri)TypeElement.DeepCopy();
            }
            if (Identifier != null)
            {
                dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy();
            }
            if (DisplayElement != null)
            {
                dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy();
            }
            return(dest);
        }
コード例 #6
0
        private List <TypeElement> GenerateTypes(int typeCount, int fieldCount, int methodCount, int parameterCount)
        {
            List <TypeElement> result = new List <TypeElement>();

            for (int i = 0; i < typeCount; i++)
            {
                TypeElement te = new TypeElement();
                te.Name      = String.Format("Type_{0}", i);
                te.Namespace = "";
                te.BaseType  = String.Format("BaseTypeOfType_{0}", i);

                te.IsClass     = true;
                te.IsInterface = false;
                te.IsPublic    = true;
                if (randomizer.Next(0, 3) == 0)
                {
                    te.IsSealed = true;
                }

                te.Fields  = GenerateFields(fieldCount);
                te.Methods = GenerateMethods(methodCount, parameterCount);

                result.Add(te);
            }

            return(result);
        }
コード例 #7
0
        //###############################################################################
        //#		                   Panel Habilete (Pokemon)                             #
        //###############################################################################

        // Affiche la liste habileté en fonction de la sélection du joueur
        private void button_afficher_habilete_Click(object sender, RoutedEventArgs e)
        {
            string choix = comboBox_liste_habilete_element.Text;

            Habilete[]  liste   = new Habilete[25];
            TypeElement element = new TypeElement();

            switch (choix)
            {
            case "Eau":
                element = TypeElement.Eau;
                break;

            case "Electricite":
                element = TypeElement.Electricite;
                break;

            case "Feu":
                element = TypeElement.Feu;
                break;

            case "Vegetation":
                element = TypeElement.Vegetation;
                break;

            default:
                element = TypeElement.Eau;
                break;
            }
            afficher_habilete(element);
        }
コード例 #8
0
        // Affiche le panel des habileté (affiche les habiletés de type eau par défaut)
        private void button_help_Click(object sender, RoutedEventArgs e)
        {
            panel_habilete.Visibility = System.Windows.Visibility.Visible;
            TypeElement element = TypeElement.Eau;

            afficher_habilete(element);
        }
コード例 #9
0
        /// <summary>
        /// Writes the code element body text.
        /// </summary>
        /// <param name="element">The element.</param>
        private void WriteBody(TextCodeElement element)
        {
            MemberElement memberElement     = element as MemberElement;
            TypeElement   parentTypeElement = GetTypeParent(element);

            bool isAbstract = memberElement != null &&
                              (memberElement.MemberModifiers & MemberModifiers.Abstract) == MemberModifiers.Abstract;
            bool inInterface = memberElement != null &&
                               parentTypeElement != null && parentTypeElement.Type == TypeElementType.Interface;

            if (!(isAbstract || inInterface))
            {
                WriteBeginBlock();

                Writer.WriteLine();
                if (element.BodyText != null && element.BodyText.Trim().Length > 0)
                {
                    WriteTextBlock(element.BodyText);
                    Writer.WriteLine();
                    WriteEndBlock(element);
                    WriteClosingComment(element, VBSymbol.BeginComment.ToString());
                }
                else
                {
                    WriteEndBlock(element);
                }
            }
        }
コード例 #10
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as DataRequirement;

            if (dest == null)
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }

            base.CopyTo(dest);
            if (TypeElement != null)
            {
                dest.TypeElement = (Code <Hl7.Fhir.Model.FHIRAllTypes>)TypeElement.DeepCopy();
            }
            if (ProfileElement != null)
            {
                dest.ProfileElement = new List <Hl7.Fhir.Model.FhirUri>(ProfileElement.DeepCopy());
            }
            if (MustSupportElement != null)
            {
                dest.MustSupportElement = new List <Hl7.Fhir.Model.FhirString>(MustSupportElement.DeepCopy());
            }
            if (CodeFilter != null)
            {
                dest.CodeFilter = new List <Hl7.Fhir.Model.DataRequirement.CodeFilterComponent>(CodeFilter.DeepCopy());
            }
            if (DateFilter != null)
            {
                dest.DateFilter = new List <Hl7.Fhir.Model.DataRequirement.DateFilterComponent>(DateFilter.DeepCopy());
            }
            return(dest);
        }
コード例 #11
0
        public override string ToString()
        {
            var typeElement    = TypeElement?.ToString() ?? "null";
            var typeParameters = PrintTypeParameters();

            return($"{GetType().Name}:{ShortName}{typeParameters}->{typeElement}");
        }
コード例 #12
0
        public override HybridCollection <IMethod> FindExtensionMethod(ExtensionMethodInfo info)
        {
            if (!TypeElement.HasAttributeInstance(PredefinedType.EXTENSION_ATTRIBUTE_CLASS, false))
            {
                return(HybridCollection <IMethod> .Empty);
            }

            var declaration = GetDeclaration();

            if (declaration == null)
            {
                return(HybridCollection <IMethod> .Empty);
            }

            var result = HybridCollection <IMethod> .Empty;

            foreach (var memberDeclaration in declaration.MemberDeclarations)
            {
                if (info.ShortName == memberDeclaration.DeclaredName &&
                    info.Hash == memberDeclaration.GetTreeStartOffset().Offset&&
                    memberDeclaration.DeclaredElement is IMethod method)
                {
                    result = result.Add(method);
                }
            }

            return(result);
        }
コード例 #13
0
        public virtual Stream <VariableElement> GetFields(Type type)
        {
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            TypeElement procedure = _elements.getTypeElement(type.FullName);

            return(fieldsIn(procedure.EnclosedElements).stream());
        }
コード例 #14
0
 public override void Read(SignatureReader rdr)
 {
     Element = rdr.ReadElementType();
     mods    = new CustomModifierCollection();
     mods.Read(rdr);
     t = TypeElement.ReadType(rdr);
 }
コード例 #15
0
 public ObjConsumable(string nomObjet, TypeConsumable typeConsumable, TypeElement typeElement, int puissance)
 {
     NomObjet       = nomObjet;
     TypeConsumable = typeConsumable;
     TypeElement    = typeElement;
     Puissance      = puissance;
 }
コード例 #16
0
        public void ToElementForTypeReturnsTheCorrectElement()
        {
            Type        expected = typeof(TypeWithAllElements);
            TypeElement actual   = expected.ToElement();

            Assert.Equal(new TypeElement(expected), actual);
        }
コード例 #17
0
        public void EvaluateElementParentAttributesContainsTest()
        {
            IConditionExpression expression = new BinaryOperatorExpression(
                BinaryExpressionOperator.Contains,
                new ElementAttributeExpression(ElementAttributeType.Attributes, ElementAttributeScope.Parent),
                new StringExpression("Attribute2"));

            FieldElement element = new FieldElement();

            element.Name = "Test";

            TypeElement typeElement = new TypeElement();

            typeElement.Type = TypeElementType.Structure;
            typeElement.Name = "TestType";
            typeElement.AddChild(element);

            typeElement.AddAttribute(new AttributeElement("Attribute1"));
            typeElement.AddAttribute(new AttributeElement("Attribute24"));

            bool result = ConditionExpressionEvaluator.Instance.Evaluate(
                expression, element);

            Assert.IsTrue(result, "Unexpected expression evaluation result.");

            typeElement.ClearAttributes();
            result = ConditionExpressionEvaluator.Instance.Evaluate(
                expression, element);
            Assert.IsFalse(result, "Unexpected expression evaluation result.");
        }
コード例 #18
0
ファイル: Trimmer.cs プロジェクト: mlacouture/buildtools
        public override void RewriteChildren(NamespaceTypeDefinition namespaceTypeDefinition)
        {
            string  typeName       = Util.FullyQualifiedTypeNameFromType(namespaceTypeDefinition);
            Element currentElement = null;

            // Unlike all other types that visited from either a namespace or a parent,
            // the module type is visited from the containing module
            if (_systemTypes.Contains(typeName))
            {
                currentElement = new SpecialTrimType(typeName);
                _trimElements.Push(currentElement);
            }

            this.RewriteChildren((NamedTypeDefinition)namespaceTypeDefinition);
            //namespaceTypeDefinition.ContainingUnitNamespace = this.GetCurrentNamespace();

            if (!_systemTypes.Contains(typeName))
            {
                TypeElement type = _currentTrimAssembly.GetTypeElement(typeName);
                MutateType(namespaceTypeDefinition, type);
            }
            if (currentElement != null)
            {
                _trimElements.Pop();
            }
        }
コード例 #19
0
            public override ErrorList Validate()
            {
                var result = new ErrorList();

                result.AddRange(base.Validate());

                if (TypeElement != null)
                {
                    result.AddRange(TypeElement.Validate());
                }
                if (UnitsElement != null)
                {
                    result.AddRange(UnitsElement.Validate());
                }
                if (UcumElement != null)
                {
                    result.AddRange(UcumElement.Validate());
                }
                if (Template != null)
                {
                    result.AddRange(Template.Validate());
                }
                if (SystemElement != null)
                {
                    result.AddRange(SystemElement.Validate());
                }

                return(result);
            }
コード例 #20
0
 public Sort(string nomSort, TypeElement typeElement, int puissance, int coutMp)
 {
     NomSort     = nomSort;
     TypeElement = typeElement;
     Puissance   = puissance;
     CoutMp      = coutMp;
 }
コード例 #21
0
        public string FormatName(CommandElement command, TypeElement handleType)
        {
            var methodNameParts = command.NameParts;

            int verbPrefixLength = 1;

            if (methodNameParts.First() != command.Verb)
            {
                verbPrefixLength = 0;
            }

            if (handleType.NameParts
                .Zip(methodNameParts.Skip(verbPrefixLength), (x, y) => x == y)
                .All(x => x))
            {
                methodNameParts = methodNameParts.Take(verbPrefixLength).Concat(methodNameParts.Skip(handleType.NameParts.Count() + verbPrefixLength)).ToArray();
            }
            else if (handleType.VkName == "VkDeviceMemory" && methodNameParts.Skip(verbPrefixLength).First() == "memory")
            {
                methodNameParts = methodNameParts.Take(verbPrefixLength).Concat(methodNameParts.Skip(verbPrefixLength + 1)).ToArray();
            }
            else if (handleType.VkName == "VkCommandBuffer" && methodNameParts.First() == "cmd")
            {
                methodNameParts = methodNameParts.Skip(1).ToArray();
            }

            return(JoinNameParts(methodNameParts));
        }
コード例 #22
0
        public LanguageType GetLanguageType(string database, string language, string dbDataTypeName)
        {
            database       = database.ToLower();
            language       = language.ToLower();
            dbDataTypeName = dbDataTypeName.ToLower();
            string name = String.Format("{0}-{1}", database.ToLower(), language.ToLower());
            TypeMappingElementCollection mappings = ConfigManager.TypeMappingSection.Mappings;

            if (mappings[name] == null)
            {
                logger.Warning(string.Format(Resources.NotFoundDataTypeMapping, database, language));
                return(null);
                //throw new ArgumentNullException(displayName, string.Format("Not Found {0} To {1} Data Type Mapping", database, language));
            }

            TypeElement dbType = null;

            if (mappings[name].Types[dbDataTypeName] == null)
            {
                dbType = mappings[name].Types["default"];
                logger.Warning(string.Format(YeahTools.Properties.Resources.NotFoundDataTypeItem, database, dbDataTypeName));
                //throw new ArgumentNullException(displayName, string.Format("Not Found {0} {1} Data Type Item", database, dbDataTypeName));
            }
            else
            {
                dbType = mappings[name].Types[dbDataTypeName];
            }

            return(new LanguageType(dbType.LanguageType, dbType.DefaultValue, dbType.Alias));
        }
コード例 #23
0
 /// <summary>
 /// mapped types are in GQL form e.g. [int!]!
 /// this could be a lot better
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 private static TypeElement ConvertGqlRequiredOrList(TypeElement type)
 {
     if (type.Name.EndsWith("!"))
     {
         return(new TypeElement
         {
             Kind = "NON_NULL",
             Name = null,
             OfType = ConvertGqlRequiredOrList(new TypeElement
             {
                 Kind = type.Kind,
                 Name = type.Name.TrimEnd('!')
             })
         });
     }
     else if (type.Name.EndsWith("]"))
     {
         return(new TypeElement
         {
             Kind = "LIST",
             Name = null,
             OfType = ConvertGqlRequiredOrList(new TypeElement
             {
                 Kind = type.Kind,
                 Name = type.Name.TrimStart('[').TrimEnd(']')
             })
         });
     }
     return(type);
 }
コード例 #24
0
        /// <summary>
        /// Build INPUT Type to be used by Mutations
        /// </summary>
        /// <param name="schema"></param>
        /// <remarks>
        /// Since Types and Inputs cannot have the same name, camelCase the name to prevent duplicates.
        /// </remarks>
        /// <returns></returns>
        private static List <TypeElement> BuildInputTypes(ISchemaProvider schema)
        {
            var types = new List <TypeElement>();

            foreach (ISchemaType schemaType in schema.GetNonContextTypes().Where(s => s.IsInput))
            {
                if (schemaType.Name.StartsWith("__"))
                {
                    continue;
                }

                var inputValues = new List <InputValue>();
                foreach (Field field in schemaType.GetFields())
                {
                    if (field.Name.StartsWith("__"))
                    {
                        continue;
                    }

                    // Skip any property with special attribute
                    var property = schemaType.ContextType.GetProperty(field.Name);
                    if (property != null && GraphQLIgnoreAttribute.ShouldIgnoreMemberFromInput(property))
                    {
                        continue;
                    }

                    // Skipping custom fields added to schema
                    if (field.Resolve.NodeType == System.Linq.Expressions.ExpressionType.Call)
                    {
                        continue;
                    }

                    // Skipping ENUM type
                    if (field.ReturnType.TypeDotnet.GetTypeInfo().IsEnum)
                    {
                        continue;
                    }

                    inputValues.Add(new InputValue
                    {
                        Name        = field.Name,
                        Description = field.Description,
                        Type        = BuildType(schema, field.ReturnType, field.ReturnType.TypeDotnet, true)
                    });
                }

                var typeElement = new TypeElement
                {
                    Kind        = "INPUT_OBJECT",
                    Name        = schemaType.Name,
                    Description = schemaType.Description,
                    InputFields = inputValues.ToArray()
                };

                types.Add(typeElement);
            }

            return(types);
        }
コード例 #25
0
        public void CreateInstance_WithType()
        {
            TypeElement <SampleType> typeElement = new TypeElement <SampleType>();

            typeElement.Type = typeof(DerivedSampleType);

            Assert.IsInstanceOf(typeof(DerivedSampleType), typeElement.CreateInstance());
        }
コード例 #26
0
        public override IDeclaredType GetBaseClassType()
        {
            var typeElement = TypeElement.GetContainingType();

            return(typeElement != null
        ? TypeFactory.CreateType(typeElement)
        : null);
        }
コード例 #27
0
 public IList <Internal> GetInternalsByTypeElement(TypeElement typeElement)
 {
     if (_internalsByTypeElement.ContainsKey(typeElement))
     {
         return(_internalsByTypeElement[typeElement]);
     }
     return(new List <Internal>());
 }
コード例 #28
0
 public override Stream <CompilationMessage> VisitType(TypeElement extensionClass, Void ignored)
 {
     if (IsFirstVisit(extensionClass))
     {
         return(Stream.concat(ValidateFields(extensionClass), ValidateConstructor(extensionClass)));
     }
     return(Stream.empty());
 }
コード例 #29
0
        public void InsertByTypeElementTypeDescendingTest()
        {
            SortBy sortBy = new SortBy();

            sortBy.By        = ElementAttributeType.Type;
            sortBy.Direction = SortDirection.Descending;

            SortedInserter sortedInserter = new SortedInserter(ElementType.Type, sortBy);

            //
            // Create a parent element
            //
            RegionElement regionElement = new RegionElement();

            Assert.AreEqual(0, regionElement.Children.Count, "Parent element should not have any children.");

            //
            // Insert an element with a mid value.
            //
            TypeElement type1 = new TypeElement();

            type1.Name = "Type1";
            type1.Type = TypeElementType.Structure;
            sortedInserter.InsertElement(regionElement, type1);

            //
            // Insert an element that should be sorted toward the end
            //
            TypeElement type2 = new TypeElement();

            type2.Name = "Type2";
            type2.Type = TypeElementType.Class;
            sortedInserter.InsertElement(regionElement, type2);

            //
            // Insert an element that should be sorted toward the middle
            //
            TypeElement type3 = new TypeElement();

            type3.Name = "Type3";
            type3.Type = TypeElementType.Interface;
            sortedInserter.InsertElement(regionElement, type3);

            //
            // Insert an element that should be sorted toward the beginning
            //
            TypeElement type4 = new TypeElement();

            type4.Name = "Type4";
            type4.Type = TypeElementType.Enum;
            sortedInserter.InsertElement(regionElement, type4);

            Assert.AreEqual(4, regionElement.Children.Count, "Element was not inserted into the parent.");
            Assert.AreEqual(0, regionElement.Children.IndexOf(type4), "Element is not at the correct index.");
            Assert.AreEqual(1, regionElement.Children.IndexOf(type3), "Element is not at the correct index.");
            Assert.AreEqual(2, regionElement.Children.IndexOf(type1), "Element is not at the correct index.");
            Assert.AreEqual(3, regionElement.Children.IndexOf(type2), "Element is not at the correct index.");
        }
コード例 #30
0
ファイル: TypeElementTests.cs プロジェクト: tleviathan/Albedo
 public void SutIsReflectionElement()
 {
     // Fixture setup
     // Exercise system
     var sut = new TypeElement(this.GetType());
     // Verify outcome
     Assert.IsAssignableFrom<IReflectionElement>(sut);
     // Teardown
 }
コード例 #31
0
ファイル: Combat.xaml.cs プロジェクト: Lion001/INF1035
 public Combat(Aventure parti, TypeElement element)
 {
     InitializeComponent();
     fenetre_difficulty.Visibility = System.Windows.Visibility.Visible;
     this.parti   = parti;
     this.element = element;
     selectionne  = parti.joueur.equipe[0];
     init_interface();
 }
コード例 #32
0
ファイル: TypeElementTests.cs プロジェクト: tleviathan/Albedo
        public void SutEqualsOtherIdenticalInstance()
        {
            var t = this.GetType();
            var sut = new TypeElement(t);
            var other = new TypeElement(t);

            var actual = sut.Equals(other);

            Assert.True(actual);
        }
コード例 #33
0
ファイル: TypeElementTests.cs プロジェクト: tleviathan/Albedo
 public void AcceptNullVisitorThrows()
 {
     // Fixture setup
     var sut = new TypeElement(this.GetType());
     // Exercise system
     // Verify outcome
     Assert.Throws<ArgumentNullException>(() =>
         sut.Accept((IReflectionVisitor<object>)null));
     // Teardown
 }
コード例 #34
0
ファイル: TypeElementTests.cs プロジェクト: tleviathan/Albedo
 public void TypeIsCorrect()
 {
     // Fixture setup
     var expected = this.GetType();
     var sut = new TypeElement(expected);
     // Exercise system
     Type actual = sut.Type;
     // Verify outcome
     Assert.Equal(expected, actual);
     // Teardown
 }
コード例 #35
0
ファイル: FilenameProvider.cs プロジェクト: ngeor/IglooCastle
 private string FilenamePartForParameter(TypeElement parameterType)
 {
     if (parameterType.IsGenericType)
     {
         TypeElement[] genericArguments = parameterType.GetGenericArguments();
         // FIX: do not use Member here
         string genericType = parameterType.GetGenericTypeDefinition().Member.FullName.Split('`')[0];
         return genericType + "`" + string.Join(",", genericArguments.Select(FilenamePartForParameter));
     }
     else
     {
         // FIX: do not use Member here
         return SystemTypes.Alias(parameterType) ?? parameterType.Member.FullName;
     }
 }
コード例 #36
0
ファイル: TypeElementTests.cs プロジェクト: tleviathan/Albedo
        public void AcceptCallsTheCorrectVisitorMethodAndReturnsTheCorrectInstance()
        {
            // Fixture setup
            var expected = new DelegatingReflectionVisitor<int>();
            var sut = new TypeElement(this.GetType());
            var visitor = new DelegatingReflectionVisitor<int>
            {
                OnVisitTypeElement = e =>
                    e == sut ? expected : new DelegatingReflectionVisitor<int>()
            };

            // Exercise system
            var actual = sut.Accept(visitor);
            // Verify outcome
            Assert.Same(expected, actual);
            // Teardown
        }
コード例 #37
0
 public int IndexOf(TypeElement element)
 {
 }
コード例 #38
0
ファイル: TypeElementTests.cs プロジェクト: tleviathan/Albedo
 public void SutDoesNotEqualAnonymousObject(object other)
 {
     var sut = new TypeElement(this.GetType());
     var actual = sut.Equals(other);
     Assert.False(actual);
 }
コード例 #39
0
ファイル: FilenameProvider.cs プロジェクト: ngeor/IglooCastle
 public string Filename(TypeElement type, string prefix = "T", string suffix = ".html")
 {
     return Filename(type.Member, prefix, suffix);
 }
コード例 #40
0
ファイル: TypeElementTests.cs プロジェクト: tleviathan/Albedo
        public void GetHashCodeReturnsCorrectResult(Type t)
        {
            var sut = new TypeElement(t);

            var actual = sut.GetHashCode();

            var expected = t.GetHashCode();
            Assert.Equal(expected, actual);
        }
コード例 #41
0
ファイル: TypeElementTests.cs プロジェクト: tleviathan/Albedo
        public void SutDoesNotEqualDifferentInstanceOfSameType()
        {
            var sut = new TypeElement(this.GetType());
            var other = new TypeElement(typeof(Version));

            var actual = sut.Equals(other);

            Assert.False(actual);
        }
コード例 #42
0
ファイル: Documentation.cs プロジェクト: ngeor/IglooCastle
        /// <summary>
        /// Normalizes the given type element.
        /// </summary>
        public TypeElement Normalize(TypeElement type)
        {
            if (type.IsGenericType && !type.IsGenericTypeDefinition)
            {
                return type.GetGenericTypeDefinition();
            }

            return type;
        }
コード例 #43
0
 public void CopyTo(TypeElement[] array, int index)
 {
 }
コード例 #44
0
ファイル: SystemTypes.cs プロジェクト: ngeor/IglooCastle
 public static string Alias(TypeElement type)
 {
     return Alias(type.Member);
 }
コード例 #45
0
 // Methods
 public void Add(TypeElement element)
 {
 }
コード例 #46
0
	// Get or create a cache element for a type.
	private static TypeElement GetOrCreateElement(Type type)
			{
				TypeElement element = (TypeElement)(typeTable[type]);
				if(element == null)
				{
					element = new TypeElement();
					typeTable[element] = element;
				}
				return element;
			}
コード例 #47
0
 public void Remove(TypeElement element)
 {
 }