コード例 #1
0
        public ExtendedServiceBusNamespace(
            ServiceBusNamespace serviceBusNamespace,
            IList <NamespaceDescription> descriptions)
        {
            Name = serviceBusNamespace.Name;

            Region = serviceBusNamespace.Region;

            Status = serviceBusNamespace.Status;

            CreatedAt = serviceBusNamespace.CreatedAt;

            AcsManagementEndpoint = serviceBusNamespace.AcsManagementEndpoint != null?serviceBusNamespace.AcsManagementEndpoint.ToString() : string.Empty;

            ServiceBusEndpoint = serviceBusNamespace.ServiceBusEndpoint != null?serviceBusNamespace.ServiceBusEndpoint.ToString() : string.Empty;

            if (descriptions != null && descriptions.Count != 0)
            {
                NamespaceDescription desc = descriptions.FirstOrDefault();
                DefaultKey       = this.GetKeyFromConnectionString(desc.ConnectionString);
                ConnectionString = desc.ConnectionString;
            }
            else
            {
                DefaultKey       = string.Empty;
                ConnectionString = string.Empty;
            }
        }
コード例 #2
0
        private void AddType(Type type)
        {
            string namespaceName = type.Namespace; // TODO: case namespaceName is null
            NamespaceDescription namespaceDescription = GetNamespaceDescription(namespaceName);

            namespaceDescription.Types.Add(new TypeDescription(type));
        }
コード例 #3
0
        private NamespaceDescription AddNamespace(string name)
        {
            var namespaceDescription = new NamespaceDescription(name);

            _namespaceDescriptions.Add(name, namespaceDescription);

            return(namespaceDescription);
        }
コード例 #4
0
            public void ContainsClassLibraryNamespace()
            {
                NamespaceDescription classLibrary = GetItemByName("ClassLibrary", _result);

                Assert.NotNull(classLibrary);

                TypeDescription class1 = GetItemByName("Class1", classLibrary.Types);

                Assert.NotNull(class1);

                AssertMemberType("Field1", typeof(string), class1.Fields);
                AssertMemberType("Field2", typeof(long), class1.Fields);
                AssertMemberType("Prop1", typeof(int), class1.Properties);
                AssertMemberType("Prop2", typeof(string), class1.Properties);

                AssertMethod(
                    "PrivateMethod",
                    typeof(void),
                    MethodDescription.VisibilityType.Private,
                    false, false, false,
                    class1.Methods
                    );
                AssertMethod(
                    "PrivateStaticMethod",
                    typeof(int),
                    MethodDescription.VisibilityType.Private,
                    true, false, false,
                    class1.Methods
                    );
                AssertMethod(
                    "PublicMethod",
                    typeof(char),
                    MethodDescription.VisibilityType.Public,
                    false, false, false,
                    class1.Methods
                    );
                AssertMethod(
                    "PublicStaticMethod",
                    typeof(bool),
                    MethodDescription.VisibilityType.Public,
                    true, false, false,
                    class1.Methods
                    );
                AssertMethod(
                    "InternalMethod",
                    typeof(string),
                    MethodDescription.VisibilityType.Internal,
                    false, false, false,
                    class1.Methods
                    );
                AssertMethod(
                    "InternalStaticMethod",
                    typeof(short),
                    MethodDescription.VisibilityType.Internal,
                    true, false, false,
                    class1.Methods
                    );
                AssertMethod(
                    "ProtectedMethod",
                    typeof(double),
                    MethodDescription.VisibilityType.Protected,
                    false, false, false,
                    class1.Methods
                    );
                AssertMethod(
                    "ProtectedStatic",
                    typeof(float),
                    MethodDescription.VisibilityType.Protected,
                    true, false, false,
                    class1.Methods
                    );
                AssertMethod(
                    "ProtectedInternalMethod",
                    typeof(uint),
                    MethodDescription.VisibilityType.ProtectedInternal,
                    false, false, false,
                    class1.Methods
                    );
                AssertMethod(
                    "ProtectedInternalStaticMethod",
                    typeof(long),
                    MethodDescription.VisibilityType.ProtectedInternal,
                    true, false, false,
                    class1.Methods
                    );
            }