示例#1
0
 internal void ConditionalRemove(IIntermediateTypeParent parent)
 {
     this._RemoveSet(from element in this
                     let intermediateItem = element.Value.Entry as IIntermediateType
                                            where intermediateItem != null && intermediateItem.Parent == parent
                                            select element.Key);
 }
 /// <summary>
 /// Creates a new <see cref="IntermediateTypeBase{TTypeIdentifier, TType, TIntermediateType}"/>
 /// with the <paramref name="parent"/>
 /// provided.
 /// </summary>
 /// <param name="parent">The <see cref="IIntermediateTypeParent"/>
 /// which conatins the <see cref="IntermediateTypeBase{TTypeIdentifier, TType, TIntermediateType}"/></param>
 /// <exception cref="System.ArgumentNullException">thrown when <paramref name="parent"/>
 /// is null.</exception>
 public IntermediateTypeBase(IIntermediateTypeParent parent)
 {
     if (parent == null)
     {
         throw new ArgumentNullException("parent");
     }
     this.parent = parent;
 }
示例#3
0
 public MyComputerClass(IIntermediateTypeParent parent)
     : base("MyComputer", parent)
 {
     this.Metadata.Add(new MetadatumDefinitionParameterValueCollection(CommonVBTypeRefs.GetCommonTypeRefs((ICliManager)this.IdentityManager).GeneratedCodeAttribute)
     {
         "MyTemplate", this.Assembly.Provider.Version.GetStringVersion()
     });
 }
示例#4
0
 protected void TranslateTypeParent(IIntermediateTypeParent parent)
 {
     this.TranslateTypes(parent.Classes);
     this.TranslateTypes(parent.Delegates);
     this.TranslateTypes(parent.Enums);
     this.TranslateTypes(parent.Interfaces);
     this.TranslateTypes(parent.Structs);
 }
示例#5
0
        public int GetCountFor(IIntermediateTypeParent parent)
        {
            int result = 0;

            foreach (var element in this.Values)
            {
                if (element.Parent == parent)
                {
                    result++;
                }
            }
            return(result);
        }
 /// <summary>
 /// Creates a new <see cref="IntermediateTypeBase{TTypeIdentifier, TType, TIntermediateType}"/>
 /// with the <paramref name="name"/> and <paramref name="parent"/>
 /// provided.
 /// </summary>
 /// <param name="name">The <see cref="String"/> representing the type's name.</param>
 /// <param name="parent">The <see cref="IIntermediateTypeParent"/>
 /// which conatins the <see cref="IntermediateTypeBase{TTypeIdentifier, TType, TIntermediateType}"/></param>
 /// <exception cref="System.ArgumentNullException">thrown when <paramref name="name"/>
 /// or <paramref name="parent"/> is null.</exception>
 /// <exception cref="System.ArgumentException">thrown when <paramref name="name"/> is
 /// <see cref="String.Empty"/>.</exception>
 public IntermediateTypeBase(string name, IIntermediateTypeParent parent)
     : this(parent)
 {
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     if (name == string.Empty)
     {
         throw new ArgumentException("name");
     }
     this.name = name;
 }
 private void VisitTypeParent(IIntermediateTypeParent typeParent, DefaultAssemblyFilenameVisitorContext context)
 {
     if (context.CurrentResult != null)
     {
         return;
     }
     foreach (var @class in typeParent.Classes.ExclusivelyOnParent())
     {
         if (context.CurrentResult != null)
         {
             return;
         }
         @class.Value.Accept(this, context);
     }
     foreach (var @delegate in typeParent.Delegates.ExclusivelyOnParent())
     {
         if (context.CurrentResult != null)
         {
             return;
         }
         @delegate.Value.Accept(this, context);
     }
     foreach (var @enum in typeParent.Enums.ExclusivelyOnParent())
     {
         if (context.CurrentResult != null)
         {
             return;
         }
         @enum.Value.Accept(this, context);
     }
     foreach (var @interface in typeParent.Interfaces.ExclusivelyOnParent())
     {
         if (context.CurrentResult != null)
         {
             return;
         }
         @interface.Value.Accept(this, context);
     }
     foreach (var @struct in typeParent.Structs.ExclusivelyOnParent())
     {
         if (context.CurrentResult != null)
         {
             return;
         }
         @struct.Value.Accept(this, context);
     }
 }
 public override void Dispose()
 {
     try
     {
         if (this._metadata != null)
         {
             this._metadata.Dispose();
             this._metadata = null;
         }
         this.parent          = null;
         this.name            = null;
         this.declaringModule = null;
     }
     finally
     {
         this.isDisposed = 1;
         base.Dispose();
     }
 }
        public static CharStreamClass CreateBitStream(IIntermediateTypeParent parent, IIntermediateCliManager identityManager)
        {
            IIntermediateClassType result = parent.Classes.Add("CharStream");

            result.AccessLevel = AccessLevelModifiers.Internal;
            IIntermediateClassFieldMember charBuffer = result.Fields.Add(new TypedName("buffer", identityManager.ObtainTypeReference(RuntimeCoreType.Char).MakeArray()));

            charBuffer.AccessLevel = AccessLevelModifiers.Internal;
            IIntermediateClassFieldMember charBufferSize = result.Fields.Add(new TypedName("actualSize", identityManager.ObtainTypeReference(RuntimeCoreType.Int32)));

            charBufferSize.AccessLevel = AccessLevelModifiers.Internal;
            charBufferSize.InitializationExpression = IntermediateGateway.NumberZero;
            var purgeMethod      = AddPurgeMethod(result, charBufferSize, identityManager);
            var growBufferMethod = AddGrowBufferMethod(result, charBufferSize, charBuffer, identityManager);
            var pushStringMethod = AddPushStringMethod(result, charBufferSize, charBuffer, growBufferMethod, identityManager);
            var toStringMethod   = AddToStringMethod(result, charBufferSize, charBuffer, identityManager);
            var pushCharMethod   = AddPushMethod(result, charBufferSize, charBuffer, growBufferMethod, identityManager);

            return(new CharStreamClass(result, charBuffer, charBufferSize, purgeMethod, pushStringMethod, pushCharMethod, toStringMethod, growBufferMethod));
        }
示例#10
0
        public int GetCountFor(IIntermediateTypeParent parent)
        {
            int result = 0;

            foreach (var element in this.Values)
            {
                if (element.Entry.Parent == parent)
                {
                    result++;
                }
                else if (element.Entry is IIntermediateSegmentableType)
                {
                    IIntermediateSegmentableType segType = (IIntermediateSegmentableType)element.Entry;
                    foreach (IIntermediateType part in segType.Parts)
                    {
                        if (part.Parent == parent)
                        {
                            result++;
                        }
                    }
                }
            }
            return(result);
        }
 /// <summary>
 /// Creates a new <see cref="IntermediateEnumType"/> with the
 /// <paramref name="name"/> and <paramref name="parent"/>
 /// provided.
 /// </summary>
 /// <param name="name">The <see cref="String"/> value denoting
 /// the unique name of the <see cref="IntermediateEnumType"/>.</param>
 /// <param name="parent">The <see cref="IIntermediateTypeParent"/> which
 /// contains the <see cref="IntermediateEnumType"/>.</param>
 /// <exception cref="System.ArgumentNullException">thrown when <paramref name="name"/>
 /// or <paramref name="parent"/> is null.</exception>
 /// <exception cref="System.ArgumentException">thrown when <paramref name="name"/> is
 /// <see cref="String.Empty"/>.</exception>
 protected internal IntermediateEnumType(string name, IIntermediateTypeParent parent)
     : base(name, parent)
 {
 }
示例#12
0
 public IntermediateInterfaceTypeDictionary(IIntermediateTypeParent parent, IntermediateFullTypeDictionary master, IntermediateInterfaceTypeDictionary root)
     : base(parent, master, root)
 {
 }
示例#13
0
 public IIntermediateStructType New(string name, IIntermediateTypeParent parent)
 {
     return(new IntermediateCliStructType(name, parent));
 }
示例#14
0
 public IIntermediateDelegateType New(string name, IIntermediateTypeParent parent)
 {
     return(new IntermediateCliDelegateType(name, parent));
 }
示例#15
0
 internal protected IntermediateCliClassType(IIntermediateTypeParent parent)
     : base(parent)
 {
 }
示例#16
0
 internal protected IntermediateCliStructType(TInstanceIntermediateType root, IIntermediateTypeParent parent)
     : base(root, parent)
 {
 }
示例#17
0
 internal protected IntermediateCliStructType(IIntermediateTypeParent parent)
     : base(parent)
 {
 }
示例#18
0
 /// <summary>
 /// Creates a new <see cref="IntermediateClassType"/> with the
 /// <paramref name="root"/> and <paramref name="parent"/> provided.
 /// </summary>
 /// <param name="root">The <see cref="IntermediateClassType"/> which is the root instance
 /// of the series of <see cref="IntermediateClassType"/>.</param>
 /// <param name="parent">The <see cref="IntermediateClassType"/> which contains the
 /// newly created <see cref="IntermediateClassType"/> instance.</param>
 /// <returns>A new <see cref="IntermediateClassType"/> as a partial of the <paramref name="root"/>
 /// instance and a child of the <paramref name="parent"/>.</returns>
 protected override IntermediateClassType GetNewPartial(IntermediateClassType root, IIntermediateTypeParent parent)
 {
     return(new IntermediateClassType(root, parent));
 }
示例#19
0
 /// <summary>
 /// Creates a new <see cref="IntermediateClassType"/> with the
 /// <see cref="IIntermediateTypeParent"/>.
 /// </summary>
 /// <param name="parent">The <see cref="IIntermediateTypeParent"/></param>
 public IntermediateClassType(IIntermediateTypeParent parent)
     : base(parent)
 {
 }
示例#20
0
 /// <summary>
 /// Creates a new <see cref="IntermediateClassType"/> partial instance with the
 /// <paramref name="root"/> instance and the <paramref name="parent"/> which contains
 /// the new partial instance.
 /// </summary>
 /// <param name="root">The <see cref="IntermediateClassType"/> which roots the
 /// <see cref="IntermediateClassType"/>.</param>
 /// <param name="parent">The <see cref="IIntermediateTypeParent"/> which contains the new
 /// partial instance.</param>
 public IntermediateClassType(IntermediateClassType root, IIntermediateTypeParent parent)
     : base(root, parent)
 {
 }
示例#21
0
 /// <summary>
 /// Creates a new <see cref="IntermediateClassType"/> with the
 /// <paramref name="name"/> and <paramref name="parent"/>
 /// provided.
 /// </summary>
 /// <param name="name">The <see cref="System.String"/> which represents the
 /// <see cref="IntermediateClassType"/>'s name.</param>
 /// <param name="parent">The <see cref="IIntermediateTypeParent"/> which contains the
 /// <see cref="IntermediateClassType"/>.</param>
 public IntermediateClassType(string name, IIntermediateTypeParent parent)
     : base(name, parent)
 {
 }
示例#22
0
 internal protected IntermediateDelegateType(string name, IIntermediateTypeParent parent)
     : base(name, parent)
 {
     this.returnType = this.Parent.IdentityManager.ObtainTypeReference(RuntimeCoreType.VoidType);
 }
示例#23
0
 internal protected IntermediateCliStructType(string name, IIntermediateTypeParent parent)
     : base(name, parent)
 {
 }
示例#24
0
 public IntermediateTypeDictionary(IIntermediateTypeParent parent, IntermediateFullTypeDictionary master, IntermediateTypeDictionary <TTypeIdentifier, TType, TIntermediateType> root)
     : base(master, root)
 {
     this.parent = parent;
 }
示例#25
0
 public IIntermediateClassType New(string name, IIntermediateTypeParent parent)
 {
     return(new MyVisualBasicClass(name, parent));
 }
示例#26
0
 private MyComputerClass(MyComputerClass root, IIntermediateTypeParent parent)
     : base(root, parent)
 {
 }
示例#27
0
 public IntermediateTypeDictionary(IIntermediateTypeParent parent, IntermediateFullTypeDictionary master)
     : base(master)
 {
     this.parent = parent;
 }
示例#28
0
 private MyApplicationClass(MyApplicationClass root, IIntermediateTypeParent parent)
     : base(root, parent)
 {
 }
示例#29
0
 protected override AnonymousType GetNewPartial(AnonymousType root, IIntermediateTypeParent parent)
 {
     return(null);
 }
示例#30
0
 protected override MyApplicationClass GetNewPartial(MyApplicationClass root, IIntermediateTypeParent parent)
 {
     return(new MyApplicationClass(root, parent));
 }