Exemplo n.º 1
0
        public MethodTreeNode(MethodInfo definition, MethodType mType, Access mAccess) : base(TreeNodeType.Method)
        {
            this.def   = definition;
            this.Text  = NameBuilder.BuildMethodDisplayName(definition);
            this.mType = mType;
            this.acc   = mAccess;
            switch (mType)
            {
            case MethodType.BasicMethod:
            {
                switch (mAccess)
                {
                case Access.Public:
                    this.SelectedImageIndex = Constants.Method_Public;
                    this.ImageIndex         = Constants.Method_Public;
                    break;

                case Access.Private:
                    this.SelectedImageIndex = Constants.Method_Private;
                    this.ImageIndex         = Constants.Method_Private;
                    break;

                case Access.Protected:
                    this.SelectedImageIndex = Constants.Method_Protected;
                    this.ImageIndex         = Constants.Method_Protected;
                    break;

                case Access.Internal:
                    this.SelectedImageIndex = Constants.Method_Internal;
                    this.ImageIndex         = Constants.Method_Internal;
                    break;
                }
            }
            break;

            case MethodType.OverrideMethod:
            {
                switch (mAccess)
                {
                case Access.Public:
                    this.SelectedImageIndex = Constants.MethodOverride_Public;
                    this.ImageIndex         = Constants.MethodOverride_Public;
                    break;

                case Access.Private:
                    this.SelectedImageIndex = Constants.MethodOverride_Private;
                    this.ImageIndex         = Constants.MethodOverride_Private;
                    break;

                case Access.Protected:
                    this.SelectedImageIndex = Constants.MethodOverride_Protected;
                    this.ImageIndex         = Constants.MethodOverride_Protected;
                    break;

                case Access.Internal:
                    this.SelectedImageIndex = Constants.MethodOverride_Internal;
                    this.ImageIndex         = Constants.MethodOverride_Internal;
                    break;
                }
            }
            break;

            case MethodType.VirtualMethod:
            {
                switch (mAccess)
                {
                case Access.Public:
                    this.SelectedImageIndex = Constants.MethodVirtual_Public;
                    this.ImageIndex         = Constants.MethodVirtual_Public;
                    break;

                case Access.Private:
                    this.SelectedImageIndex = Constants.MethodVirtual_Private;
                    this.ImageIndex         = Constants.MethodVirtual_Private;
                    break;

                case Access.Protected:
                    this.SelectedImageIndex = Constants.MethodVirtual_Protected;
                    this.ImageIndex         = Constants.MethodVirtual_Protected;
                    break;

                case Access.Internal:
                    this.SelectedImageIndex = Constants.MethodVirtual_Internal;
                    this.ImageIndex         = Constants.MethodVirtual_Internal;
                    break;
                }
            }
            break;
            }
#if DebugTreeNodeLoading
            Log.WriteLine("Method '" + this.Text + "' was loaded.");
#endif
        }