private bool EmitApplyMethod(IDesignerSerializationManager manager, object owner) { ApplyMethodTable context = (ApplyMethodTable) manager.Context[typeof(ApplyMethodTable)]; if (context == null) { context = new ApplyMethodTable(); manager.Context.Append(context); } if (!context.Contains(owner)) { context.Add(owner); return true; } return false; }
private bool EmitApplyMethod(IDesignerSerializationManager manager, object owner) { ApplyMethodTable context = (ApplyMethodTable)manager.Context[typeof(ApplyMethodTable)]; if (context == null) { context = new ApplyMethodTable(); manager.Context.Append(context); } if (!context.Contains(owner)) { context.Add(owner); return(true); } return(false); }
/// <summary> /// Returns true if we should emit an ApplyResources method for this object. We only emit /// this method once during serialization, and we track this by appending an object to /// the context stack. /// </summary> private static bool EmitApplyMethod(IDesignerSerializationManager manager, object owner) { ApplyMethodTable table = (ApplyMethodTable)manager.Context[typeof(ApplyMethodTable)]; if (table is null) { table = new ApplyMethodTable(); manager.Context.Append(table); } if (!table.Contains(owner)) { table.Add(owner); return(true); } return(false); }