You've already forked linux-packaging-mono
Imported Upstream version 5.0.0.42
Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
parent
1190d13a04
commit
6bdd276d05
66
external/corefx/src/System.ComponentModel.Primitives/System.ComponentModel.Primitives.sln
vendored
Normal file
66
external/corefx/src/System.ComponentModel.Primitives/System.ComponentModel.Primitives.sln
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||

|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.31101.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.ComponentModel.Primitives.Tests", "tests\System.ComponentModel.Primitives.Tests.csproj", "{C9534425-93FB-494F-8DD8-1E4E3E626FDE}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{F620F382-30D1-451E-B125-2A612F92068B} = {F620F382-30D1-451E-B125-2A612F92068B}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{47919FF5-DA40-4D99-AF2D-F560282AA913}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
..\.nuget\packages.Windows_NT.config = ..\.nuget\packages.Windows_NT.config
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.ComponentModel.Primitives", "src\System.ComponentModel.Primitives.csproj", "{F620F382-30D1-451E-B125-2A612F92068B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU = DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU
|
||||
ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU = ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU
|
||||
DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU = DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU
|
||||
ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU = ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU
|
||||
DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU = DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU
|
||||
ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU = ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU
|
||||
DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU = DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU
|
||||
ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU = ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{C9534425-93FB-494F-8DD8-1E4E3E626FDE}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
|
||||
{C9534425-93FB-494F-8DD8-1E4E3E626FDE}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
|
||||
{C9534425-93FB-494F-8DD8-1E4E3E626FDE}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
|
||||
{C9534425-93FB-494F-8DD8-1E4E3E626FDE}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
|
||||
{C9534425-93FB-494F-8DD8-1E4E3E626FDE}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
|
||||
{C9534425-93FB-494F-8DD8-1E4E3E626FDE}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
|
||||
{C9534425-93FB-494F-8DD8-1E4E3E626FDE}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
|
||||
{C9534425-93FB-494F-8DD8-1E4E3E626FDE}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
|
||||
{C9534425-93FB-494F-8DD8-1E4E3E626FDE}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
|
||||
{C9534425-93FB-494F-8DD8-1E4E3E626FDE}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
|
||||
{C9534425-93FB-494F-8DD8-1E4E3E626FDE}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
|
||||
{C9534425-93FB-494F-8DD8-1E4E3E626FDE}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
|
||||
{C9534425-93FB-494F-8DD8-1E4E3E626FDE}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
|
||||
{C9534425-93FB-494F-8DD8-1E4E3E626FDE}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
|
||||
{C9534425-93FB-494F-8DD8-1E4E3E626FDE}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
|
||||
{C9534425-93FB-494F-8DD8-1E4E3E626FDE}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
|
||||
{F620F382-30D1-451E-B125-2A612F92068B}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = net463-Windows_NT-Debug|Any CPU
|
||||
{F620F382-30D1-451E-B125-2A612F92068B}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = net463-Windows_NT-Debug|Any CPU
|
||||
{F620F382-30D1-451E-B125-2A612F92068B}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = net463-Windows_NT-Release|Any CPU
|
||||
{F620F382-30D1-451E-B125-2A612F92068B}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = net463-Windows_NT-Release|Any CPU
|
||||
{F620F382-30D1-451E-B125-2A612F92068B}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = net463-Windows_NT-Debug|Any CPU
|
||||
{F620F382-30D1-451E-B125-2A612F92068B}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = net463-Windows_NT-Debug|Any CPU
|
||||
{F620F382-30D1-451E-B125-2A612F92068B}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = net463-Windows_NT-Release|Any CPU
|
||||
{F620F382-30D1-451E-B125-2A612F92068B}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = net463-Windows_NT-Release|Any CPU
|
||||
{F620F382-30D1-451E-B125-2A612F92068B}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
|
||||
{F620F382-30D1-451E-B125-2A612F92068B}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
|
||||
{F620F382-30D1-451E-B125-2A612F92068B}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
|
||||
{F620F382-30D1-451E-B125-2A612F92068B}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
|
||||
{F620F382-30D1-451E-B125-2A612F92068B}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
|
||||
{F620F382-30D1-451E-B125-2A612F92068B}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
|
||||
{F620F382-30D1-451E-B125-2A612F92068B}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
|
||||
{F620F382-30D1-451E-B125-2A612F92068B}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
8
external/corefx/src/System.ComponentModel.Primitives/dir.props
vendored
Normal file
8
external/corefx/src/System.ComponentModel.Primitives/dir.props
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\dir.props" />
|
||||
<PropertyGroup>
|
||||
<AssemblyVersion>4.2.0.0</AssemblyVersion>
|
||||
<IsNETCoreApp>true</IsNETCoreApp>
|
||||
</PropertyGroup>
|
||||
</Project>
|
9
external/corefx/src/System.ComponentModel.Primitives/ref/Configurations.props
vendored
Normal file
9
external/corefx/src/System.ComponentModel.Primitives/ref/Configurations.props
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<BuildConfigurations>
|
||||
netcoreapp;
|
||||
uap;
|
||||
</BuildConfigurations>
|
||||
</PropertyGroup>
|
||||
</Project>
|
272
external/corefx/src/System.ComponentModel.Primitives/ref/System.ComponentModel.Primitives.cs
vendored
Normal file
272
external/corefx/src/System.ComponentModel.Primitives/ref/System.ComponentModel.Primitives.cs
vendored
Normal file
@@ -0,0 +1,272 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
// ------------------------------------------------------------------------------
|
||||
// Changes to this file must follow the http://aka.ms/api-review process.
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace System.ComponentModel
|
||||
{
|
||||
public partial interface ISynchronizeInvoke
|
||||
{
|
||||
bool InvokeRequired { get; }
|
||||
System.IAsyncResult BeginInvoke(System.Delegate method, object[] args);
|
||||
object EndInvoke(System.IAsyncResult result);
|
||||
object Invoke(System.Delegate method, object[] args);
|
||||
}
|
||||
public sealed partial class BrowsableAttribute : System.Attribute
|
||||
{
|
||||
public static readonly System.ComponentModel.BrowsableAttribute Default;
|
||||
public static readonly System.ComponentModel.BrowsableAttribute No;
|
||||
public static readonly System.ComponentModel.BrowsableAttribute Yes;
|
||||
public BrowsableAttribute(bool browsable) { }
|
||||
public bool Browsable { get; }
|
||||
public override bool Equals(object obj) { throw null; }
|
||||
public override int GetHashCode() { throw null; }
|
||||
public override bool IsDefaultAttribute() { throw null; }
|
||||
}
|
||||
public partial class CategoryAttribute : System.Attribute
|
||||
{
|
||||
public CategoryAttribute() { }
|
||||
public CategoryAttribute(string category) { }
|
||||
public static System.ComponentModel.CategoryAttribute Action { get; }
|
||||
public static System.ComponentModel.CategoryAttribute Appearance { get; }
|
||||
public static System.ComponentModel.CategoryAttribute Asynchronous { get; }
|
||||
public static System.ComponentModel.CategoryAttribute Behavior { get; }
|
||||
public string Category { get; }
|
||||
public static System.ComponentModel.CategoryAttribute Data { get; }
|
||||
public static System.ComponentModel.CategoryAttribute Default { get; }
|
||||
public static System.ComponentModel.CategoryAttribute Design { get; }
|
||||
public static System.ComponentModel.CategoryAttribute DragDrop { get; }
|
||||
public static System.ComponentModel.CategoryAttribute Focus { get; }
|
||||
public static System.ComponentModel.CategoryAttribute Format { get; }
|
||||
public static System.ComponentModel.CategoryAttribute Key { get; }
|
||||
public static System.ComponentModel.CategoryAttribute Layout { get; }
|
||||
public static System.ComponentModel.CategoryAttribute Mouse { get; }
|
||||
public static System.ComponentModel.CategoryAttribute WindowStyle { get; }
|
||||
public override bool Equals(object obj) { throw null; }
|
||||
public override int GetHashCode() { throw null; }
|
||||
protected virtual string GetLocalizedString(string value) { throw null; }
|
||||
public override bool IsDefaultAttribute() { throw null; }
|
||||
}
|
||||
[System.ComponentModel.DesignerCategoryAttribute("Component")]
|
||||
public partial class Component : System.MarshalByRefObject, System.ComponentModel.IComponent, System.IDisposable
|
||||
{
|
||||
public Component() { }
|
||||
protected virtual bool CanRaiseEvents { get { throw null; } }
|
||||
[System.ComponentModel.BrowsableAttribute(false)]
|
||||
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
|
||||
public System.ComponentModel.IContainer Container { get { throw null; } }
|
||||
[System.ComponentModel.BrowsableAttribute(false)]
|
||||
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
|
||||
protected bool DesignMode { get { throw null; } }
|
||||
protected System.ComponentModel.EventHandlerList Events { get { throw null; } }
|
||||
[System.ComponentModel.BrowsableAttribute(false)]
|
||||
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
|
||||
public virtual System.ComponentModel.ISite Site { get { throw null; } set { } }
|
||||
[System.ComponentModel.BrowsableAttribute(false)]
|
||||
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(2))]
|
||||
public event System.EventHandler Disposed { add { } remove { } }
|
||||
public void Dispose() { }
|
||||
protected virtual void Dispose(bool disposing) { }
|
||||
~Component() { }
|
||||
protected virtual object GetService(System.Type service) { throw null; }
|
||||
public override string ToString() { throw null; }
|
||||
}
|
||||
public partial class ComponentCollection : System.Collections.ReadOnlyCollectionBase
|
||||
{
|
||||
internal ComponentCollection() { }
|
||||
public ComponentCollection(System.ComponentModel.IComponent[] components) { }
|
||||
public virtual System.ComponentModel.IComponent this[int index] { get { throw null; } }
|
||||
public virtual System.ComponentModel.IComponent this[string name] { get { throw null; } }
|
||||
public void CopyTo(System.ComponentModel.IComponent[] array, int index) { }
|
||||
}
|
||||
public partial class DescriptionAttribute : System.Attribute
|
||||
{
|
||||
public static readonly System.ComponentModel.DescriptionAttribute Default;
|
||||
public DescriptionAttribute() { }
|
||||
public DescriptionAttribute(string description) { }
|
||||
public virtual string Description { get; }
|
||||
protected string DescriptionValue { get; set; }
|
||||
public override bool Equals(object obj) { throw null; }
|
||||
public override int GetHashCode() { throw null; }
|
||||
public override bool IsDefaultAttribute() { throw null; }
|
||||
}
|
||||
public sealed partial class DesignerCategoryAttribute : Attribute
|
||||
{
|
||||
public static readonly DesignerCategoryAttribute Component;
|
||||
public static readonly DesignerCategoryAttribute Default;
|
||||
public static readonly DesignerCategoryAttribute Form;
|
||||
public static readonly DesignerCategoryAttribute Generic;
|
||||
public DesignerCategoryAttribute() { }
|
||||
public DesignerCategoryAttribute(string category) { }
|
||||
public string Category { get; }
|
||||
public override bool Equals(object obj) { throw null; }
|
||||
public override int GetHashCode() { throw null; }
|
||||
public override bool IsDefaultAttribute() { throw null; }
|
||||
public override object TypeId { get { throw null; } }
|
||||
}
|
||||
public enum DesignerSerializationVisibility
|
||||
{
|
||||
Content = 2,
|
||||
Hidden = 0,
|
||||
Visible = 1,
|
||||
}
|
||||
public sealed partial class DesignerSerializationVisibilityAttribute : System.Attribute
|
||||
{
|
||||
public static readonly System.ComponentModel.DesignerSerializationVisibilityAttribute Content;
|
||||
public static readonly System.ComponentModel.DesignerSerializationVisibilityAttribute Default;
|
||||
public static readonly System.ComponentModel.DesignerSerializationVisibilityAttribute Hidden;
|
||||
public static readonly System.ComponentModel.DesignerSerializationVisibilityAttribute Visible;
|
||||
public DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility visibility) { }
|
||||
public override bool Equals(object obj) { throw null; }
|
||||
public override int GetHashCode() { throw null; }
|
||||
public System.ComponentModel.DesignerSerializationVisibility Visibility { get; }
|
||||
public override bool IsDefaultAttribute() { throw null; }
|
||||
}
|
||||
public sealed partial class DesignOnlyAttribute : System.Attribute
|
||||
{
|
||||
public static readonly DesignOnlyAttribute Default;
|
||||
public static readonly DesignOnlyAttribute No;
|
||||
public static readonly DesignOnlyAttribute Yes;
|
||||
public DesignOnlyAttribute(bool isDesignOnly) { }
|
||||
public bool IsDesignOnly { get; }
|
||||
public override bool Equals(object obj) { throw null; }
|
||||
public override int GetHashCode() { throw null; }
|
||||
public override bool IsDefaultAttribute() { throw null; }
|
||||
}
|
||||
public partial class DisplayNameAttribute : System.Attribute
|
||||
{
|
||||
public static readonly System.ComponentModel.DisplayNameAttribute Default;
|
||||
public DisplayNameAttribute() { }
|
||||
public DisplayNameAttribute(string displayName) { }
|
||||
public virtual string DisplayName { get; }
|
||||
protected string DisplayNameValue { get; set; }
|
||||
public override bool Equals(object obj) { throw null; }
|
||||
public override int GetHashCode() { throw null; }
|
||||
public override bool IsDefaultAttribute() { throw null; }
|
||||
}
|
||||
public sealed partial class EventHandlerList : System.IDisposable
|
||||
{
|
||||
public EventHandlerList() { }
|
||||
public System.Delegate this[object key] { get { throw null; } set { } }
|
||||
public void AddHandler(object key, System.Delegate value) { }
|
||||
public void AddHandlers(System.ComponentModel.EventHandlerList listToAddFrom) { }
|
||||
public void Dispose() { }
|
||||
public void RemoveHandler(object key, System.Delegate value) { }
|
||||
}
|
||||
public partial interface IComponent : System.IDisposable
|
||||
{
|
||||
System.ComponentModel.ISite Site { get; set; }
|
||||
event System.EventHandler Disposed;
|
||||
}
|
||||
public partial interface IContainer : System.IDisposable
|
||||
{
|
||||
System.ComponentModel.ComponentCollection Components { get; }
|
||||
void Add(System.ComponentModel.IComponent component);
|
||||
void Add(System.ComponentModel.IComponent component, string name);
|
||||
void Remove(System.ComponentModel.IComponent component);
|
||||
}
|
||||
public sealed partial class ImmutableObjectAttribute : System.Attribute
|
||||
{
|
||||
public static readonly System.ComponentModel.ImmutableObjectAttribute Default;
|
||||
public static readonly System.ComponentModel.ImmutableObjectAttribute No;
|
||||
public static readonly System.ComponentModel.ImmutableObjectAttribute Yes;
|
||||
public ImmutableObjectAttribute(bool immutable) { }
|
||||
public bool Immutable { get; }
|
||||
public override bool Equals(object obj) { throw null; }
|
||||
public override int GetHashCode() { throw null; }
|
||||
public override bool IsDefaultAttribute() { throw null; }
|
||||
}
|
||||
public sealed partial class InitializationEventAttribute : System.Attribute
|
||||
{
|
||||
public InitializationEventAttribute(string eventName) { }
|
||||
public string EventName { get; }
|
||||
}
|
||||
public partial interface ISite : System.IServiceProvider
|
||||
{
|
||||
System.ComponentModel.IComponent Component { get; }
|
||||
System.ComponentModel.IContainer Container { get; }
|
||||
bool DesignMode { get; }
|
||||
string Name { get; set; }
|
||||
}
|
||||
public partial interface ISupportInitialize
|
||||
{
|
||||
void BeginInit();
|
||||
void EndInit();
|
||||
}
|
||||
public sealed partial class LocalizableAttribute : System.Attribute
|
||||
{
|
||||
public static readonly System.ComponentModel.LocalizableAttribute Default;
|
||||
public static readonly System.ComponentModel.LocalizableAttribute No;
|
||||
public static readonly System.ComponentModel.LocalizableAttribute Yes;
|
||||
public LocalizableAttribute(bool isLocalizable) { }
|
||||
public bool IsLocalizable { get; }
|
||||
public override bool Equals(object obj) { throw null; }
|
||||
public override int GetHashCode() { throw null; }
|
||||
public override bool IsDefaultAttribute() { throw null; }
|
||||
}
|
||||
public sealed partial class MergablePropertyAttribute : System.Attribute
|
||||
{
|
||||
public static readonly System.ComponentModel.MergablePropertyAttribute Default;
|
||||
public static readonly System.ComponentModel.MergablePropertyAttribute No;
|
||||
public static readonly System.ComponentModel.MergablePropertyAttribute Yes;
|
||||
public MergablePropertyAttribute(bool allowMerge) { }
|
||||
public bool AllowMerge { get; }
|
||||
public override bool Equals(object obj) { throw null; }
|
||||
public override int GetHashCode() { throw null; }
|
||||
public override bool IsDefaultAttribute() { throw null; }
|
||||
}
|
||||
|
||||
public sealed partial class NotifyParentPropertyAttribute : System.Attribute
|
||||
{
|
||||
public static readonly System.ComponentModel.NotifyParentPropertyAttribute Default;
|
||||
public static readonly System.ComponentModel.NotifyParentPropertyAttribute No;
|
||||
public static readonly System.ComponentModel.NotifyParentPropertyAttribute Yes;
|
||||
public NotifyParentPropertyAttribute(bool notifyParent) { }
|
||||
public bool NotifyParent { get; }
|
||||
public override bool Equals(object obj) { throw null; }
|
||||
public override int GetHashCode() { throw null; }
|
||||
public override bool IsDefaultAttribute() { throw null; }
|
||||
}
|
||||
public sealed partial class ParenthesizePropertyNameAttribute : System.Attribute
|
||||
{
|
||||
public static readonly System.ComponentModel.ParenthesizePropertyNameAttribute Default;
|
||||
public ParenthesizePropertyNameAttribute() { }
|
||||
public ParenthesizePropertyNameAttribute(bool needParenthesis) { }
|
||||
public bool NeedParenthesis { get; }
|
||||
public override bool Equals(object o) { throw null; }
|
||||
public override int GetHashCode() { throw null; }
|
||||
public override bool IsDefaultAttribute() { throw null; }
|
||||
}
|
||||
public sealed partial class ReadOnlyAttribute : System.Attribute
|
||||
{
|
||||
public static readonly System.ComponentModel.ReadOnlyAttribute Default;
|
||||
public static readonly System.ComponentModel.ReadOnlyAttribute No;
|
||||
public static readonly System.ComponentModel.ReadOnlyAttribute Yes;
|
||||
public ReadOnlyAttribute(bool isReadOnly) { }
|
||||
public bool IsReadOnly { get; }
|
||||
public override bool Equals(object value) { throw null; }
|
||||
public override int GetHashCode() { throw null; }
|
||||
public override bool IsDefaultAttribute() { throw null; }
|
||||
}
|
||||
public enum RefreshProperties
|
||||
{
|
||||
All = 1,
|
||||
None = 0,
|
||||
Repaint = 2,
|
||||
}
|
||||
public sealed partial class RefreshPropertiesAttribute : System.Attribute
|
||||
{
|
||||
public static readonly System.ComponentModel.RefreshPropertiesAttribute All;
|
||||
public static readonly System.ComponentModel.RefreshPropertiesAttribute Default;
|
||||
public static readonly System.ComponentModel.RefreshPropertiesAttribute Repaint;
|
||||
public RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties refresh) { }
|
||||
public System.ComponentModel.RefreshProperties RefreshProperties { get; }
|
||||
public override bool Equals(object value) { throw null; }
|
||||
public override int GetHashCode() { throw null; }
|
||||
public override bool IsDefaultAttribute() { throw null; }
|
||||
}
|
||||
}
|
||||
|
17
external/corefx/src/System.ComponentModel.Primitives/ref/System.ComponentModel.Primitives.csproj
vendored
Normal file
17
external/corefx/src/System.ComponentModel.Primitives/ref/System.ComponentModel.Primitives.csproj
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Release|AnyCPU'" />
|
||||
<ItemGroup>
|
||||
<Compile Include="System.ComponentModel.Primitives.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
|
||||
<ProjectReference Include="..\..\System.Collections.NonGeneric\ref\System.Collections.NonGeneric.csproj" />
|
||||
<ProjectReference Include="..\..\System.ComponentModel\ref\System.ComponentModel.csproj" />
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
9
external/corefx/src/System.ComponentModel.Primitives/src/Configurations.props
vendored
Normal file
9
external/corefx/src/System.ComponentModel.Primitives/src/Configurations.props
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<BuildConfigurations>
|
||||
net463-Windows_NT;
|
||||
netcoreapp;
|
||||
</BuildConfigurations>
|
||||
</PropertyGroup>
|
||||
</Project>
|
3
external/corefx/src/System.ComponentModel.Primitives/src/FxCopBaseline.cs
vendored
Normal file
3
external/corefx/src/System.ComponentModel.Primitives/src/FxCopBaseline.cs
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ComponentModel.Component.#Dispose(System.Boolean)")]
|
183
external/corefx/src/System.ComponentModel.Primitives/src/Resources/Strings.resx
vendored
Normal file
183
external/corefx/src/System.ComponentModel.Primitives/src/Resources/Strings.resx
vendored
Normal file
@@ -0,0 +1,183 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="PropertyCategoryAction" xml:space="preserve">
|
||||
<value>Action</value>
|
||||
</data>
|
||||
<data name="PropertyCategoryAppearance" xml:space="preserve">
|
||||
<value>Appearance</value>
|
||||
</data>
|
||||
<data name="PropertyCategoryAsynchronous" xml:space="preserve">
|
||||
<value>Asynchronous</value>
|
||||
</data>
|
||||
<data name="PropertyCategoryBehavior" xml:space="preserve">
|
||||
<value>Behavior</value>
|
||||
</data>
|
||||
<data name="PropertyCategoryConfig" xml:space="preserve">
|
||||
<value>Configurations</value>
|
||||
</data>
|
||||
<data name="PropertyCategoryData" xml:space="preserve">
|
||||
<value>Data</value>
|
||||
</data>
|
||||
<data name="PropertyCategoryDDE" xml:space="preserve">
|
||||
<value>DDE</value>
|
||||
</data>
|
||||
<data name="PropertyCategoryDefault" xml:space="preserve">
|
||||
<value>Misc</value>
|
||||
</data>
|
||||
<data name="PropertyCategoryDesign" xml:space="preserve">
|
||||
<value>Design</value>
|
||||
</data>
|
||||
<data name="PropertyCategoryDragDrop" xml:space="preserve">
|
||||
<value>Drag Drop</value>
|
||||
</data>
|
||||
<data name="PropertyCategoryFocus" xml:space="preserve">
|
||||
<value>Focus</value>
|
||||
</data>
|
||||
<data name="PropertyCategoryFont" xml:space="preserve">
|
||||
<value>Font</value>
|
||||
</data>
|
||||
<data name="PropertyCategoryFormat" xml:space="preserve">
|
||||
<value>Format</value>
|
||||
</data>
|
||||
<data name="PropertyCategoryKey" xml:space="preserve">
|
||||
<value>Key</value>
|
||||
</data>
|
||||
<data name="PropertyCategoryLayout" xml:space="preserve">
|
||||
<value>Layout</value>
|
||||
</data>
|
||||
<data name="PropertyCategoryList" xml:space="preserve">
|
||||
<value>List</value>
|
||||
</data>
|
||||
<data name="PropertyCategoryMouse" xml:space="preserve">
|
||||
<value>Mouse</value>
|
||||
</data>
|
||||
<data name="PropertyCategoryPosition" xml:space="preserve">
|
||||
<value>Position</value>
|
||||
</data>
|
||||
<data name="PropertyCategoryScale" xml:space="preserve">
|
||||
<value>Scale</value>
|
||||
</data>
|
||||
<data name="PropertyCategoryText" xml:space="preserve">
|
||||
<value>Text</value>
|
||||
</data>
|
||||
<data name="PropertyCategoryWindowStyle" xml:space="preserve">
|
||||
<value>Window Style</value>
|
||||
</data>
|
||||
</root>
|
61
external/corefx/src/System.ComponentModel.Primitives/src/System.ComponentModel.Primitives.csproj
vendored
Normal file
61
external/corefx/src/System.ComponentModel.Primitives/src/System.ComponentModel.Primitives.csproj
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{F620F382-30D1-451E-B125-2A612F92068B}</ProjectGuid>
|
||||
<RootNamespace>System.ComponentModel.Primitives</RootNamespace>
|
||||
<AssemblyName>System.ComponentModel.Primitives</AssemblyName>
|
||||
<IsPartialFacadeAssembly Condition="'$(TargetGroup)'=='net463'">true</IsPartialFacadeAssembly>
|
||||
</PropertyGroup>
|
||||
<!-- Default configurations to help VS understand the configurations -->
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='net463-Windows_NT-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='net463-Windows_NT-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netcoreapp-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netcoreapp-Release|AnyCPU'" />
|
||||
<ItemGroup Condition="'$(TargetGroup)'=='netcoreapp'">
|
||||
<Compile Include="System\ComponentModel\ISynchronizeInvoke.cs" />
|
||||
<Compile Include="System\ComponentModel\BrowsableAttribute.cs" />
|
||||
<Compile Include="System\ComponentModel\CategoryAttribute.cs" />
|
||||
<Compile Include="System\ComponentModel\ComponentCollection.cs" />
|
||||
<Compile Include="System\ComponentModel\DescriptionAttribute.cs" />
|
||||
<Compile Include="System\ComponentModel\DesignerCategoryAttribute.cs" />
|
||||
<Compile Include="System\ComponentModel\DesignerSerializationVisibility.cs" />
|
||||
<Compile Include="System\ComponentModel\DesignerSerializationVisibilityAttribute.cs" />
|
||||
<Compile Include="System\ComponentModel\DesignOnlyAttribute.cs" />
|
||||
<Compile Include="System\ComponentModel\DisplayNameAttribute.cs" />
|
||||
<Compile Include="System\ComponentModel\EventHandlerList.cs" />
|
||||
<Compile Include="System\ComponentModel\IComponent.cs" />
|
||||
<Compile Include="System\ComponentModel\IContainer.cs" />
|
||||
<Compile Include="System\ComponentModel\ImmutableObjectAttribute.cs" />
|
||||
<Compile Include="System\ComponentModel\InitializationEventAttribute.cs" />
|
||||
<Compile Include="System\ComponentModel\ISite.cs" />
|
||||
<Compile Include="System\ComponentModel\ISupportInitialize.cs" />
|
||||
<Compile Include="System\ComponentModel\LocalizableAttribute.cs" />
|
||||
<Compile Include="System\ComponentModel\MergablePropertyAttribute.cs" />
|
||||
<Compile Include="System\ComponentModel\NotifyParentPropertyAttribute.cs" />
|
||||
<Compile Include="System\ComponentModel\ParenthesizePropertyNameAttribute.cs" />
|
||||
<Compile Include="System\ComponentModel\ReadOnlyAttribute.cs" />
|
||||
<Compile Include="System\ComponentModel\RefreshProperties.cs" />
|
||||
<Compile Include="System\ComponentModel\RefreshPropertiesAttribute.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="FxCopBaseline.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(TargetGroup)'=='netcoreapp'">
|
||||
<Compile Include="System\ComponentModel\Component.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(TargetGroup)'=='net463'">
|
||||
<TargetingPackReference Include="mscorlib" />
|
||||
<TargetingPackReference Include="System" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System.Collections.NonGeneric" />
|
||||
<Reference Include="System.ComponentModel" />
|
||||
<Reference Include="System.Diagnostics.Tools" />
|
||||
<Reference Include="System.Resources.ResourceManager" />
|
||||
<Reference Include="System.Runtime" />
|
||||
<Reference Include="System.Runtime.Extensions" />
|
||||
<Reference Include="System.Threading" />
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
@@ -0,0 +1,80 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace System.ComponentModel
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>Specifies whether a property or event should be displayed in
|
||||
/// a property browsing window.</para>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public sealed class BrowsableAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Specifies that a property or event can be modified at
|
||||
/// design time. This <see langword='static '/>
|
||||
/// field is read-only.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static readonly BrowsableAttribute Yes = new BrowsableAttribute(true);
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Specifies that a property or event cannot be modified at
|
||||
/// design time. This <see langword='static '/>field is read-only.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static readonly BrowsableAttribute No = new BrowsableAttribute(false);
|
||||
|
||||
/// <summary>
|
||||
/// <para>Specifies the default value for the <see cref='System.ComponentModel.BrowsableAttribute'/>,
|
||||
/// which is <see cref='System.ComponentModel.BrowsableAttribute.Yes'/>. This <see langword='static '/>field is read-only.</para>
|
||||
/// </summary>
|
||||
public static readonly BrowsableAttribute Default = Yes;
|
||||
|
||||
private bool _browsable;
|
||||
|
||||
/// <summary>
|
||||
/// <para>Initializes a new instance of the <see cref='System.ComponentModel.BrowsableAttribute'/> class.</para>
|
||||
/// </summary>
|
||||
public BrowsableAttribute(bool browsable)
|
||||
{
|
||||
_browsable = browsable;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Gets a value indicating whether an object is browsable.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public bool Browsable => _browsable;
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == this)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
BrowsableAttribute other = obj as BrowsableAttribute;
|
||||
|
||||
return (other != null) && other.Browsable == _browsable;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return _browsable.GetHashCode();
|
||||
}
|
||||
|
||||
public override bool IsDefaultAttribute()
|
||||
{
|
||||
return Equals(BrowsableAttribute.Default);
|
||||
}
|
||||
}
|
||||
}
|
326
external/corefx/src/System.ComponentModel.Primitives/src/System/ComponentModel/CategoryAttribute.cs
vendored
Normal file
326
external/corefx/src/System.ComponentModel.Primitives/src/System/ComponentModel/CategoryAttribute.cs
vendored
Normal file
@@ -0,0 +1,326 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace System.ComponentModel
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>Specifies the category in which the property or event will be displayed in a
|
||||
/// visual designer.</para>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public class CategoryAttribute : Attribute
|
||||
{
|
||||
private static volatile CategoryAttribute s_action;
|
||||
private static volatile CategoryAttribute s_appearance;
|
||||
private static volatile CategoryAttribute s_asynchronous;
|
||||
private static volatile CategoryAttribute s_behavior;
|
||||
private static volatile CategoryAttribute s_data;
|
||||
private static volatile CategoryAttribute s_design;
|
||||
private static volatile CategoryAttribute s_dragDrop;
|
||||
private static volatile CategoryAttribute s_defAttr;
|
||||
private static volatile CategoryAttribute s_focus;
|
||||
private static volatile CategoryAttribute s_format;
|
||||
private static volatile CategoryAttribute s_key;
|
||||
private static volatile CategoryAttribute s_layout;
|
||||
private static volatile CategoryAttribute s_mouse;
|
||||
private static volatile CategoryAttribute s_windowStyle;
|
||||
|
||||
private bool _localized;
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Provides the actual category name.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
private string _categoryValue;
|
||||
|
||||
/// <summary>
|
||||
/// <para>Gets the action category attribute.</para>
|
||||
/// </summary>
|
||||
public static CategoryAttribute Action
|
||||
{
|
||||
get
|
||||
{
|
||||
if (s_action == null)
|
||||
{
|
||||
s_action = new CategoryAttribute(nameof(Action));
|
||||
}
|
||||
return s_action;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Gets the appearance category attribute.</para>
|
||||
/// </summary>
|
||||
public static CategoryAttribute Appearance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (s_appearance == null)
|
||||
{
|
||||
s_appearance = new CategoryAttribute(nameof(Appearance));
|
||||
}
|
||||
return s_appearance;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Gets the asynchronous category attribute.</para>
|
||||
/// </summary>
|
||||
public static CategoryAttribute Asynchronous
|
||||
{
|
||||
get
|
||||
{
|
||||
if (s_asynchronous == null)
|
||||
{
|
||||
s_asynchronous = new CategoryAttribute(nameof(Asynchronous));
|
||||
}
|
||||
return s_asynchronous;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Gets the behavior category attribute.</para>
|
||||
/// </summary>
|
||||
public static CategoryAttribute Behavior
|
||||
{
|
||||
get
|
||||
{
|
||||
if (s_behavior == null)
|
||||
{
|
||||
s_behavior = new CategoryAttribute(nameof(Behavior));
|
||||
}
|
||||
return s_behavior;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Gets the data category attribute.</para>
|
||||
/// </summary>
|
||||
public static CategoryAttribute Data
|
||||
{
|
||||
get
|
||||
{
|
||||
if (s_data == null)
|
||||
{
|
||||
s_data = new CategoryAttribute(nameof(Data));
|
||||
}
|
||||
return s_data;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Gets the default category attribute.</para>
|
||||
/// </summary>
|
||||
public static CategoryAttribute Default
|
||||
{
|
||||
get
|
||||
{
|
||||
if (s_defAttr == null)
|
||||
{
|
||||
s_defAttr = new CategoryAttribute();
|
||||
}
|
||||
return s_defAttr;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Gets the design category attribute.</para>
|
||||
/// </summary>
|
||||
public static CategoryAttribute Design
|
||||
{
|
||||
get
|
||||
{
|
||||
if (s_design == null)
|
||||
{
|
||||
s_design = new CategoryAttribute(nameof(Design));
|
||||
}
|
||||
return s_design;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Gets the drag and drop category attribute.</para>
|
||||
/// </summary>
|
||||
public static CategoryAttribute DragDrop
|
||||
{
|
||||
get
|
||||
{
|
||||
if (s_dragDrop == null)
|
||||
{
|
||||
s_dragDrop = new CategoryAttribute(nameof(DragDrop));
|
||||
}
|
||||
return s_dragDrop;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Gets the focus category attribute.</para>
|
||||
/// </summary>
|
||||
public static CategoryAttribute Focus
|
||||
{
|
||||
get
|
||||
{
|
||||
if (s_focus == null)
|
||||
{
|
||||
s_focus = new CategoryAttribute(nameof(Focus));
|
||||
}
|
||||
return s_focus;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Gets the format category attribute.</para>
|
||||
/// </summary>
|
||||
public static CategoryAttribute Format
|
||||
{
|
||||
get
|
||||
{
|
||||
if (s_format == null)
|
||||
{
|
||||
s_format = new CategoryAttribute(nameof(Format));
|
||||
}
|
||||
return s_format;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Gets the keyboard category attribute.</para>
|
||||
/// </summary>
|
||||
public static CategoryAttribute Key
|
||||
{
|
||||
get
|
||||
{
|
||||
if (s_key == null)
|
||||
{
|
||||
s_key = new CategoryAttribute(nameof(Key));
|
||||
}
|
||||
return s_key;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Gets the layout category attribute.</para>
|
||||
/// </summary>
|
||||
public static CategoryAttribute Layout
|
||||
{
|
||||
get
|
||||
{
|
||||
if (s_layout == null)
|
||||
{
|
||||
s_layout = new CategoryAttribute(nameof(Layout));
|
||||
}
|
||||
return s_layout;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Gets the mouse category attribute.</para>
|
||||
/// </summary>
|
||||
public static CategoryAttribute Mouse
|
||||
{
|
||||
get
|
||||
{
|
||||
if (s_mouse == null)
|
||||
{
|
||||
s_mouse = new CategoryAttribute(nameof(Mouse));
|
||||
}
|
||||
return s_mouse;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Gets the window style category
|
||||
/// attribute.</para>
|
||||
/// </summary>
|
||||
public static CategoryAttribute WindowStyle
|
||||
{
|
||||
get
|
||||
{
|
||||
if (s_windowStyle == null)
|
||||
{
|
||||
s_windowStyle = new CategoryAttribute(nameof(WindowStyle));
|
||||
}
|
||||
return s_windowStyle;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Initializes a new instance of the <see cref='System.ComponentModel.CategoryAttribute'/>
|
||||
/// class with the default category.</para>
|
||||
/// </summary>
|
||||
public CategoryAttribute() : this(nameof(Default))
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Initializes a new instance of the <see cref='System.ComponentModel.CategoryAttribute'/> class with
|
||||
/// the specified category name.</para>
|
||||
/// </summary>
|
||||
public CategoryAttribute(string category)
|
||||
{
|
||||
_categoryValue = category;
|
||||
_localized = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Gets the name of the category for the property or event
|
||||
/// that this attribute is bound to.</para>
|
||||
/// </summary>
|
||||
public string Category
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!_localized)
|
||||
{
|
||||
_localized = true;
|
||||
string localizedValue = GetLocalizedString(_categoryValue);
|
||||
if (localizedValue != null)
|
||||
{
|
||||
_categoryValue = localizedValue;
|
||||
}
|
||||
}
|
||||
return _categoryValue;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <internalonly/>
|
||||
/// <internalonly/>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == this)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
CategoryAttribute other = obj as CategoryAttribute;
|
||||
return other != null && Category.Equals(other.Category);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>[To be supplied.]</para>
|
||||
/// </summary>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Category.GetHashCode();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Looks up the localized name of a given category.</para>
|
||||
/// </summary>
|
||||
protected virtual string GetLocalizedString(string value)
|
||||
{
|
||||
return SR.GetResourceString("PropertyCategory" + value, null);
|
||||
}
|
||||
|
||||
public override bool IsDefaultAttribute()
|
||||
{
|
||||
return Category.Equals(CategoryAttribute.Default.Category);
|
||||
}
|
||||
}
|
||||
}
|
273
external/corefx/src/System.ComponentModel.Primitives/src/System/ComponentModel/Component.cs
vendored
Normal file
273
external/corefx/src/System.ComponentModel.Primitives/src/System/ComponentModel/Component.cs
vendored
Normal file
@@ -0,0 +1,273 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.ComponentModel
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>Provides the default implementation for the
|
||||
/// <see cref='System.ComponentModel.IComponent'/>
|
||||
/// interface and enables object-sharing between applications.</para>
|
||||
/// </summary>
|
||||
[
|
||||
DesignerCategory("Component")
|
||||
]
|
||||
public class Component : MarshalByRefObject, IComponent
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>Static hask key for the Disposed event. This field is read-only.</para>
|
||||
/// </summary>
|
||||
private static readonly object s_eventDisposed = new object();
|
||||
|
||||
private ISite _site;
|
||||
private EventHandlerList _events;
|
||||
|
||||
~Component()
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This property returns true if the component is in a mode that supports
|
||||
/// raising events. By default, components always support raising their events
|
||||
/// and therefore this method always returns true. You can override this method
|
||||
/// in a deriving class and change it to return false when needed. if the return
|
||||
/// value of this method is false, the EventList collection returned by the Events
|
||||
/// property will always return null for an event. Events can still be added and
|
||||
/// removed from the collection, but retrieving them through the collection's Item
|
||||
/// property will always return null.
|
||||
/// </summary>
|
||||
protected virtual bool CanRaiseEvents
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Internal API that allows the event handler list class to access the
|
||||
/// CanRaiseEvents property.
|
||||
/// </summary>
|
||||
internal bool CanRaiseEventsInternal
|
||||
{
|
||||
get
|
||||
{
|
||||
return CanRaiseEvents;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Adds a event handler to listen to the Disposed event on the component.</para>
|
||||
/// </summary>
|
||||
[
|
||||
Browsable(false),
|
||||
EditorBrowsable(EditorBrowsableState.Advanced)
|
||||
]
|
||||
public event EventHandler Disposed
|
||||
{
|
||||
add
|
||||
{
|
||||
Events.AddHandler(s_eventDisposed, value);
|
||||
}
|
||||
remove
|
||||
{
|
||||
Events.RemoveHandler(s_eventDisposed, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Gets the list of event handlers that are attached to this component.</para>
|
||||
/// </summary>
|
||||
protected EventHandlerList Events
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_events == null)
|
||||
{
|
||||
_events = new EventHandlerList(this);
|
||||
}
|
||||
return _events;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Gets or sets the site of the <see cref='System.ComponentModel.Component'/>
|
||||
/// .
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[
|
||||
Browsable(false),
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
|
||||
]
|
||||
public virtual ISite Site
|
||||
{
|
||||
get { return _site; }
|
||||
set { _site = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Disposes of the <see cref='System.ComponentModel.Component'/>
|
||||
/// .
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Disposes all the resources associated with this component.
|
||||
/// If disposing is false then you must never touch any other
|
||||
/// managed objects, as they may already be finalized. When
|
||||
/// in this state you should dispose any native resources
|
||||
/// that you have a reference to.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// When disposing is true then you should dispose all data
|
||||
/// and objects you have references to. The normal implementation
|
||||
/// of this method would look something like:
|
||||
/// </para>
|
||||
/// <code>
|
||||
/// public void Dispose() {
|
||||
/// Dispose(true);
|
||||
/// GC.SuppressFinalize(this);
|
||||
/// }
|
||||
///
|
||||
/// protected virtual void Dispose(bool disposing) {
|
||||
/// if (disposing) {
|
||||
/// if (myobject != null) {
|
||||
/// myobject.Dispose();
|
||||
/// myobject = null;
|
||||
/// }
|
||||
/// }
|
||||
/// if (myhandle != IntPtr.Zero) {
|
||||
/// NativeMethods.Release(myhandle);
|
||||
/// myhandle = IntPtr.Zero;
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
/// ~MyClass() {
|
||||
/// Dispose(false);
|
||||
/// }
|
||||
/// </code>
|
||||
/// <para>
|
||||
/// For base classes, you should never override the Finalier (~Class in C#)
|
||||
/// or the Dispose method that takes no arguments, rather you should
|
||||
/// always override the Dispose method that takes a bool.
|
||||
/// </para>
|
||||
/// <code>
|
||||
/// protected override void Dispose(bool disposing) {
|
||||
/// if (disposing) {
|
||||
/// if (myobject != null) {
|
||||
/// myobject.Dispose();
|
||||
/// myobject = null;
|
||||
/// }
|
||||
/// }
|
||||
/// if (myhandle != IntPtr.Zero) {
|
||||
/// NativeMethods.Release(myhandle);
|
||||
/// myhandle = IntPtr.Zero;
|
||||
/// }
|
||||
/// base.Dispose(disposing);
|
||||
/// }
|
||||
/// </code>
|
||||
/// </summary>
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
if (_site != null && _site.Container != null)
|
||||
{
|
||||
_site.Container.Remove(this);
|
||||
}
|
||||
if (_events != null)
|
||||
{
|
||||
EventHandler handler = (EventHandler)_events[s_eventDisposed];
|
||||
if (handler != null) handler(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the component's container.
|
||||
//
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Returns the <see cref='System.ComponentModel.IContainer'/>
|
||||
/// that contains the <see cref='System.ComponentModel.Component'/>
|
||||
/// .
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[
|
||||
Browsable(false),
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
|
||||
]
|
||||
public IContainer Container
|
||||
{
|
||||
get
|
||||
{
|
||||
ISite s = _site;
|
||||
return s == null ? null : s.Container;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Returns an object representing a service provided by
|
||||
/// the <see cref='System.ComponentModel.Component'/>
|
||||
/// .
|
||||
/// </para>
|
||||
/// </summary>
|
||||
protected virtual object GetService(Type service)
|
||||
{
|
||||
ISite s = _site;
|
||||
return ((s == null) ? null : s.GetService(service));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Gets a value indicating whether the <see cref='System.ComponentModel.Component'/>
|
||||
/// is currently in design mode.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[
|
||||
Browsable(false),
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
|
||||
]
|
||||
protected bool DesignMode
|
||||
{
|
||||
get
|
||||
{
|
||||
ISite s = _site;
|
||||
return (s == null) ? false : s.DesignMode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <internalonly/>
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Returns a <see cref='System.String'/> containing the name of the <see cref='System.ComponentModel.Component'/> , if any. This method should not be
|
||||
/// overridden. For
|
||||
/// internal use only.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public override String ToString()
|
||||
{
|
||||
ISite s = _site;
|
||||
|
||||
if (s != null)
|
||||
return s.Name + " [" + GetType().FullName + "]";
|
||||
else
|
||||
return GetType().FullName;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,73 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
// Placeholder stub without functionality, here only to support existence of
|
||||
// TypeConverter.
|
||||
// Dependency chain: TypeConverter -> ITypeDescriptorContext -> IContainer -> ComponentCollection
|
||||
|
||||
using System.Collections;
|
||||
|
||||
namespace System.ComponentModel
|
||||
{
|
||||
public class ComponentCollection : ReadOnlyCollectionBase
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>[To be supplied.]</para>
|
||||
/// </summary>
|
||||
public ComponentCollection(IComponent[] components)
|
||||
{
|
||||
InnerList.AddRange(components);
|
||||
}
|
||||
|
||||
/** The component in the container identified by name. */
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Gets a specific <see cref='System.ComponentModel.Component'/> in the <see cref='System.ComponentModel.Container'/>
|
||||
/// .
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public virtual IComponent this[string name]
|
||||
{
|
||||
get
|
||||
{
|
||||
if (name != null)
|
||||
{
|
||||
IList list = InnerList;
|
||||
foreach (IComponent comp in list)
|
||||
{
|
||||
if (comp != null && comp.Site != null && comp.Site.Name != null && string.Equals(comp.Site.Name, name, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return comp;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** The component in the container identified by index. */
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Gets a specific <see cref='System.ComponentModel.Component'/> in the <see cref='System.ComponentModel.Container'/>
|
||||
/// .
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public virtual IComponent this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return (IComponent)InnerList[index];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>[To be supplied.]</para>
|
||||
/// </summary>
|
||||
public void CopyTo(IComponent[] array, int index)
|
||||
{
|
||||
InnerList.CopyTo(array, index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,68 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace System.ComponentModel
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>Specifies a description for a property
|
||||
/// or event.</para>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public class DescriptionAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>Specifies the default value for the <see cref='System.ComponentModel.DescriptionAttribute'/> , which is an
|
||||
/// empty string (""). This <see langword='static'/> field is read-only.</para>
|
||||
/// </summary>
|
||||
public static readonly DescriptionAttribute Default = new DescriptionAttribute();
|
||||
|
||||
/// <summary>
|
||||
/// <para>[To be supplied.]</para>
|
||||
/// </summary>
|
||||
public DescriptionAttribute() : this(string.Empty)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Initializes a new instance of the <see cref='System.ComponentModel.DescriptionAttribute'/> class.</para>
|
||||
/// </summary>
|
||||
public DescriptionAttribute(string description)
|
||||
{
|
||||
DescriptionValue = description;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Gets the description stored in this attribute.</para>
|
||||
/// </summary>
|
||||
public virtual string Description => DescriptionValue;
|
||||
|
||||
/// <summary>
|
||||
/// Read/Write property that directly modifies the string stored
|
||||
/// in the description attribute. The default implementation
|
||||
/// of the Description property simply returns this value.
|
||||
/// </summary>
|
||||
protected string DescriptionValue { get; set; }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == this)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
DescriptionAttribute other = obj as DescriptionAttribute;
|
||||
return (other != null) && other.Description == Description;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Description.GetHashCode();
|
||||
}
|
||||
|
||||
public override bool IsDefaultAttribute()
|
||||
{
|
||||
return Equals(DescriptionAttribute.Default);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,79 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace System.ComponentModel
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>Specifies whether a property can only be set at
|
||||
/// design time.</para>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public sealed class DesignOnlyAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Initializes a new instance of the <see cref='System.ComponentModel.DesignOnlyAttribute'/> class.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public DesignOnlyAttribute(bool isDesignOnly)
|
||||
{
|
||||
IsDesignOnly = isDesignOnly;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Gets a value indicating whether a property
|
||||
/// can be set only at design time.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public bool IsDesignOnly { get; }
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Specifies that a property can be set only at design time. This
|
||||
/// <see langword='static '/>field is read-only.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static readonly DesignOnlyAttribute Yes = new DesignOnlyAttribute(true);
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Specifies
|
||||
/// that a
|
||||
/// property can be set at design time or at run
|
||||
/// time. This <see langword='static '/>field is read-only.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static readonly DesignOnlyAttribute No = new DesignOnlyAttribute(false);
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Specifies the default value for the <see cref='System.ComponentModel.DesignOnlyAttribute'/>, which is <see cref='System.ComponentModel.DesignOnlyAttribute.No'/>. This <see langword='static'/> field is
|
||||
/// read-only.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static readonly DesignOnlyAttribute Default = No;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == this)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
DesignOnlyAttribute other = obj as DesignOnlyAttribute;
|
||||
return (other != null) && other.IsDesignOnly == IsDesignOnly;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return IsDesignOnly.GetHashCode();
|
||||
}
|
||||
|
||||
public override bool IsDefaultAttribute()
|
||||
{
|
||||
return IsDesignOnly == DesignOnlyAttribute.Default.IsDesignOnly;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,103 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace System.ComponentModel
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>Specifies that the designer for a class belongs to a certain category.</para>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
|
||||
public sealed class DesignerCategoryAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Specifies that a component marked with this category uses a
|
||||
/// component designer. This <see langword='static '/>field is read-only.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static readonly DesignerCategoryAttribute Component = new DesignerCategoryAttribute("Component");
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Specifies that a component marked with this category cannot use a visual
|
||||
/// designer. This <see langword='static '/>field is read-only.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static readonly DesignerCategoryAttribute Default = new DesignerCategoryAttribute();
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Specifies that a component marked with this category uses a form designer.
|
||||
/// This <see langword='static '/>field is read-only.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static readonly DesignerCategoryAttribute Form = new DesignerCategoryAttribute("Form");
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Specifies that a component marked with this category uses a generic designer.
|
||||
/// This <see langword='static '/>field is read-only.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static readonly DesignerCategoryAttribute Generic = new DesignerCategoryAttribute("Designer");
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Initializes a new instance of the <see cref='System.ComponentModel.DesignerCategoryAttribute'/> class with the
|
||||
/// default category.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public DesignerCategoryAttribute()
|
||||
{
|
||||
Category = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Initializes a new instance of the <see cref='System.ComponentModel.DesignerCategoryAttribute'/> class with
|
||||
/// the given category name.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public DesignerCategoryAttribute(string category)
|
||||
{
|
||||
Category = category;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Gets the name of the category.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public string Category { get; }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == this)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
DesignerCategoryAttribute other = obj as DesignerCategoryAttribute;
|
||||
return other != null && other.Category == Category;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Category.GetHashCode();
|
||||
}
|
||||
|
||||
public override bool IsDefaultAttribute()
|
||||
{
|
||||
return Category.Equals(DesignerCategoryAttribute.Default.Category);
|
||||
}
|
||||
|
||||
public override object TypeId
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.GetType().FullName + Category;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace System.ComponentModel
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>Specifies the visibility a property has to the design time
|
||||
/// serializer.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public enum DesignerSerializationVisibility
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>The code generator will not produce code for the object.</para>
|
||||
/// </summary>
|
||||
Hidden,
|
||||
|
||||
/// <summary>
|
||||
/// <para>The code generator will produce code for the object.</para>
|
||||
/// </summary>
|
||||
Visible,
|
||||
|
||||
/// <summary>
|
||||
/// <para>The code generator will produce code for the contents of the object, rather than for the object itself.</para>
|
||||
/// </summary>
|
||||
Content
|
||||
}
|
||||
}
|
@@ -0,0 +1,107 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace System.ComponentModel
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Specifies the visibility of this property or method as seen
|
||||
/// by the designer serializer.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Event)]
|
||||
public sealed class DesignerSerializationVisibilityAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Specifies that a visual designer should serialize the contents of this property,
|
||||
/// rather than the property itself.
|
||||
/// This <see langword='static '/>field is read-only.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static readonly DesignerSerializationVisibilityAttribute Content = new DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Content);
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Specifies that a
|
||||
/// visual designer will not serialize the value of this property.
|
||||
/// This <see langword='static '/>field is read-only.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static readonly DesignerSerializationVisibilityAttribute Hidden = new DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden);
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Specifies that a
|
||||
/// visual designer may use default rules when serializing the value of a property.
|
||||
/// This <see langword='static '/>field is read-only.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static readonly DesignerSerializationVisibilityAttribute Visible = new DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible);
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Specifies the default value, which is <see cref='System.ComponentModel.DesignerSerializationVisibilityAttribute.Visible'/>, that is, a visual designer
|
||||
/// uses default rules to generate the value of a property. This
|
||||
/// <see langword='static '/>field is read-only.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static readonly DesignerSerializationVisibilityAttribute Default = Visible;
|
||||
|
||||
private readonly DesignerSerializationVisibility _visibility;
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Initializes a new instance of the System.ComponentModel.PersistContentsAttribute class.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility visibility)
|
||||
{
|
||||
_visibility = visibility;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Gets a value indicating whether a
|
||||
/// visual designer must generate special code to persist the value of a property.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public DesignerSerializationVisibility Visibility
|
||||
{
|
||||
get
|
||||
{
|
||||
return _visibility;
|
||||
}
|
||||
}
|
||||
|
||||
/// <internalonly/>
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == this)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
DesignerSerializationVisibilityAttribute other = obj as DesignerSerializationVisibilityAttribute;
|
||||
return other != null && other.Visibility == _visibility;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Returns the hashcode for this object.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
public override bool IsDefaultAttribute()
|
||||
{
|
||||
return Equals(DesignerSerializationVisibilityAttribute.Default);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,68 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace System.ComponentModel
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>Specifies the display name for a property or event. The default is the name of the property or event.</para>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Event | AttributeTargets.Class | AttributeTargets.Method)]
|
||||
public class DisplayNameAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>Specifies the default value for the <see cref='System.ComponentModel.DisplayNameAttribute'/> , which is an
|
||||
/// empty string (""). This <see langword='static'/> field is read-only.</para>
|
||||
/// </summary>
|
||||
public static readonly DisplayNameAttribute Default = new DisplayNameAttribute();
|
||||
|
||||
/// <summary>
|
||||
/// <para>[To be supplied.]</para>
|
||||
/// </summary>
|
||||
public DisplayNameAttribute() : this(string.Empty)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Initializes a new instance of the <see cref='System.ComponentModel.DisplayNameAttribute'/> class.</para>
|
||||
/// </summary>
|
||||
public DisplayNameAttribute(string displayName)
|
||||
{
|
||||
DisplayNameValue = displayName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Gets the description stored in this attribute.</para>
|
||||
/// </summary>
|
||||
public virtual string DisplayName => DisplayNameValue;
|
||||
|
||||
/// <summary>
|
||||
/// Read/Write property that directly modifies the string stored
|
||||
/// in the description attribute. The default implementation
|
||||
/// of the Description property simply returns this value.
|
||||
/// </summary>
|
||||
protected string DisplayNameValue { get; set; }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == this)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
DisplayNameAttribute other = obj as DisplayNameAttribute;
|
||||
|
||||
return (other != null) && other.DisplayName == DisplayName;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return DisplayName.GetHashCode();
|
||||
}
|
||||
|
||||
public override bool IsDefaultAttribute()
|
||||
{
|
||||
return Equals(DisplayNameAttribute.Default);
|
||||
}
|
||||
}
|
||||
}
|
144
external/corefx/src/System.ComponentModel.Primitives/src/System/ComponentModel/EventHandlerList.cs
vendored
Normal file
144
external/corefx/src/System.ComponentModel.Primitives/src/System/ComponentModel/EventHandlerList.cs
vendored
Normal file
@@ -0,0 +1,144 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace System.ComponentModel
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>Provides a simple list of delegates. This class cannot be inherited.</para>
|
||||
/// </summary>
|
||||
public sealed class EventHandlerList : IDisposable
|
||||
{
|
||||
private ListEntry _head;
|
||||
private Component _parent;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new event handler list. The parent component is used to check the component's
|
||||
/// CanRaiseEvents property.
|
||||
/// </summary>
|
||||
internal EventHandlerList(Component parent)
|
||||
{
|
||||
_parent = parent;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new event handler list.
|
||||
/// </summary>
|
||||
public EventHandlerList()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Gets or sets the delegate for the specified key.</para>
|
||||
/// </summary>
|
||||
public Delegate this[object key]
|
||||
{
|
||||
get
|
||||
{
|
||||
ListEntry e = null;
|
||||
if (_parent == null || _parent.CanRaiseEventsInternal)
|
||||
{
|
||||
e = Find(key);
|
||||
}
|
||||
|
||||
if (e != null)
|
||||
{
|
||||
return e.Handler;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
ListEntry e = Find(key);
|
||||
if (e != null)
|
||||
{
|
||||
e.Handler = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
_head = new ListEntry(key, value, _head);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>[To be supplied.]</para>
|
||||
/// </summary>
|
||||
public void AddHandler(object key, Delegate value)
|
||||
{
|
||||
ListEntry e = Find(key);
|
||||
if (e != null)
|
||||
{
|
||||
e.Handler = Delegate.Combine(e.Handler, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
_head = new ListEntry(key, value, _head);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> allows you to add a list of events to this list </summary>
|
||||
public void AddHandlers(EventHandlerList listToAddFrom)
|
||||
{
|
||||
ListEntry currentListEntry = listToAddFrom._head;
|
||||
while (currentListEntry != null)
|
||||
{
|
||||
AddHandler(currentListEntry.Key, currentListEntry.Handler);
|
||||
currentListEntry = currentListEntry.Next;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>[To be supplied.]</para>
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
_head = null;
|
||||
}
|
||||
|
||||
private ListEntry Find(object key)
|
||||
{
|
||||
ListEntry found = _head;
|
||||
while (found != null)
|
||||
{
|
||||
if (found.Key == key)
|
||||
{
|
||||
break;
|
||||
}
|
||||
found = found.Next;
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>[To be supplied.]</para>
|
||||
/// </summary>
|
||||
public void RemoveHandler(object key, Delegate value)
|
||||
{
|
||||
ListEntry e = Find(key);
|
||||
if (e != null)
|
||||
{
|
||||
e.Handler = Delegate.Remove(e.Handler, value);
|
||||
}
|
||||
// else... no error for removal of non-existant delegate
|
||||
//
|
||||
}
|
||||
|
||||
private sealed class ListEntry
|
||||
{
|
||||
internal ListEntry Next;
|
||||
internal object Key;
|
||||
internal Delegate Handler;
|
||||
|
||||
public ListEntry(object key, Delegate handler, ListEntry next)
|
||||
{
|
||||
Next = next;
|
||||
Key = key;
|
||||
Handler = handler;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user