• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ComponentModel.Component类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.ComponentModel.Component的典型用法代码示例。如果您正苦于以下问题:C# Component类的具体用法?C# Component怎么用?C# Component使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Component类属于System.ComponentModel命名空间,在下文中一共展示了Component类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: PerformComponentMapping

		public static IRawElementProviderFragment PerformComponentMapping (Component component)
		{
			ScrollBar scb = component as ScrollBar;
			if (scb == null) {
				return null;
			}

			//TODO:
			//   We need to add here a ScrollableControlProvider and then verify
			//   if the internal scrollbar instances are matching this one,
			//   if so, then we return a scrollbar, otherwise we return a pane.
#pragma warning disable 219
			ScrollableControl scrollable;
			//ScrollableControlProvider scrollableProvider;
			if ((scrollable = scb.Parent as ScrollableControl) != null
			    || scb.Parent == null) {
#pragma warning restore 219
			//	scrollableProvider = (ScrollableControlProvider) GetProvider (scrollable);
			//	if (scrollableProvider.ScrollBarExists (scb) == true)
					return new ScrollBarProvider (scb);
			//	else 
			//		provider = new PaneProvider (scb);
			}

			return new PaneProvider (scb);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:26,代码来源:ScrollBarProvider.cs


示例2: CheckAssociatedControl

 private bool CheckAssociatedControl(Component c, Glyph childGlyph, GlyphCollection glyphs)
 {
     bool flag = false;
     ToolStripDropDownItem dropDownItem = c as ToolStripDropDownItem;
     if (dropDownItem != null)
     {
         flag = this.CheckDropDownBounds(dropDownItem, childGlyph, glyphs);
     }
     if (flag)
     {
         return flag;
     }
     Control associatedControl = this.GetAssociatedControl(c);
     if (((associatedControl == null) || (associatedControl == this.toolStripContainer)) || System.Design.UnsafeNativeMethods.IsChild(new HandleRef(this.toolStripContainer, this.toolStripContainer.Handle), new HandleRef(associatedControl, associatedControl.Handle)))
     {
         return flag;
     }
     Rectangle bounds = childGlyph.Bounds;
     Rectangle rect = base.BehaviorService.ControlRectInAdornerWindow(associatedControl);
     if ((c == this.designerHost.RootComponent) || !bounds.IntersectsWith(rect))
     {
         glyphs.Insert(0, childGlyph);
     }
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:25,代码来源:ToolStripContainerDesigner.cs


示例3: ClearEvent

        public static void ClearEvent(Component component)
        {
            if (component == null)
            {
                return;
            }

            BindingFlags flag = BindingFlags.NonPublic | BindingFlags.Instance;
            EventHandlerList evList = typeof(Component).GetField("events", flag).GetValue(component) as EventHandlerList;
            if (evList == null)
            {
                return;
            }

            object evEntryData = evList.GetType().GetField("head", flag).GetValue(evList);
            if (evEntryData == null)
            {
                return;
            }
            do
            {
                object key = evEntryData.GetType().GetField("key", flag).GetValue(evEntryData);
                if (key == null)
                {
                    break;
                }
                evList[key] = null;
                evEntryData = evEntryData.GetType().GetField("next", flag).GetValue(evEntryData);

            }
            while (evEntryData != null);
        }
开发者ID:KentaKomai,项目名称:HMF2014,代码行数:32,代码来源:UtilService.cs


示例4: InternalAddTarget

 internal void InternalAddTarget(Component extendee)
 {
     targets.Add(extendee);
     refreshState(extendee);
     AddHandler(extendee);
     OnAddingTarget(extendee);
 }
开发者ID:divyang4481,项目名称:lextudio,代码行数:7,代码来源:Action.cs


示例5: GetAction

 public Action GetAction(Component cmp)
 {
     if (ActionDictionary.ContainsKey(cmp))
         return ActionDictionary[cmp];
     else
         return null;
 }
开发者ID:djpnewton,项目名称:ddraw,代码行数:7,代码来源:ActionListProvider.cs


示例6: GetMenuItem

        ///<summary>
        /// Return the MenuItem that is assigned to each ToolBarButton
        ///</summary>
        public MenuCommand GetMenuItem( Component pComponent )
        {
            if( m_Dictionary.Contains( pComponent ))
                return (MenuCommand) m_Dictionary[ pComponent ];

            return null;
        }
开发者ID:NeuroRoboticTech,项目名称:AnimatLabVersion1,代码行数:10,代码来源:ButtonManager.cs


示例7: GetUICommand

 /// <summary>
 /// This gets the UICommand instance (possibly null) for the specified control.
 /// <param name="control"></param>
 public UICommand GetUICommand(Component control)
 {
     // Return null if there is no entry for the control in the dictionary.
     UICommand ret = null;
     _dict.TryGetValue(control, out ret);
     return ret;
 }
开发者ID:Stoner19,项目名称:Memory-Lifter,代码行数:10,代码来源:UICommandProvider.cs


示例8: RemoveCommandBinding

 public void RemoveCommandBinding(Component component)
 {
     if (component == null) { throw new ArgumentNullException("component"); }
     CommandBindingBase binding = bindings.FirstOrDefault(b => b.Component == component);
     if (binding == null) { throw new ArgumentException("The binding to remove wasn't found."); }
     bindings.Remove(binding);
 }
开发者ID:keremkusmezer,项目名称:baldursgatepartygold,代码行数:7,代码来源:CommandAdapter.cs


示例9: Create

 public CommandBindingBase Create(Component component, ICommand command, Func<object> commandParameterCallback)
 {
     if (component == null) { throw new ArgumentNullException("component"); }
     if (command == null) { throw new ArgumentNullException("command"); }
     if (commandParameterCallback == null) { throw new ArgumentNullException("commandParameterCallback"); }
     return CreateCore(component, command, commandParameterCallback);
 }
开发者ID:keremkusmezer,项目名称:baldursgatepartygold,代码行数:7,代码来源:CommandBindingFactory.cs


示例10: SetStatusInformation

 public void SetStatusInformation(Component selectedComponent, Point location)
 {
     if (selectedComponent != null)
     {
         Rectangle empty = Rectangle.Empty;
         Control control = selectedComponent as Control;
         if (control != null)
         {
             empty = control.Bounds;
         }
         else
         {
             PropertyDescriptor descriptor = TypeDescriptor.GetProperties(selectedComponent)["Bounds"];
             if ((descriptor != null) && typeof(Rectangle).IsAssignableFrom(descriptor.PropertyType))
             {
                 empty = (Rectangle) descriptor.GetValue(selectedComponent);
             }
         }
         if (location != Point.Empty)
         {
             empty.X = location.X;
             empty.Y = location.Y;
         }
         if (this.StatusRectCommand != null)
         {
             this.StatusRectCommand.Invoke(empty);
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:29,代码来源:StatusCommandUI.cs


示例11: ApplyResources

 protected override void ApplyResources(Component component, string componentName, CultureInfo culture)
 {
     foreach (PropertyDescriptor descriptor in this.GetLocalizableStringProperties(component.GetType()))
     {
         string str = this.GetString(string.Format("{0}.{1}", componentName, descriptor.Name), culture);
         if (str != null)
         {
             descriptor.SetValue(component, str);
         }
     }
     ComboBox box = component as ComboBox;
     if ((box != null) && (box.DataSource == null))
     {
         string item = this.GetString(string.Format("{0}.Items", box.Name), culture);
         if (item != null)
         {
             int selectedIndex = box.SelectedIndex;
             box.BeginUpdate();
             box.Items.Clear();
             int num2 = 1;
             while (item != null)
             {
                 box.Items.Add(item);
                 item = this.GetString(string.Format("{0}.Items{1}", box.Name, num2++), culture);
             }
             if (selectedIndex < box.Items.Count)
             {
                 box.SelectedIndex = selectedIndex;
             }
             box.EndUpdate();
         }
     }
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:33,代码来源:BasicFormStringLocalizer.cs


示例12: IsComponentVisible

		protected override bool IsComponentVisible (Component component)
		{
			// Ensure that even though the TabPages will have
			// Visible = False when they're not selected, they stay
			// in the A11y hierarchy.  This is to model Vista's
			// behavior.
			return true;
		}
开发者ID:mono,项目名称:uia2atk,代码行数:8,代码来源:TabControlProvider.cs


示例13: AddTo

 public void AddTo()
 {
     var collection = new DisposableCollection();
     var disposable = new Component();
     disposable.AddTo(collection);
     Assert.AreEqual(1, collection.Count);
     Assert.IsTrue(collection.Contains(disposable));
 }
开发者ID:jjeffery,项目名称:Cesto,代码行数:8,代码来源:DisposableExtensionsTests.cs


示例14: DisposeWith

		/// <summary>
		/// Causes this object to be disposed when the <see cref="Component"/> is disposed.
		/// </summary>
		/// <param name="disposable">
		///		The <see cref="IDisposable"/> object that</param> should be disposed when
		///		the <paramref name="component"/> is disposed.
		/// <param name="component">
		///		When this component is disposed, the <paramref name="disposable"/> object
		///		should be disposed.
		/// </param>
		/// <remarks>
		///		This is useful for ensuring that objects are disposed when a Windows Forms
		///		control is disposed.
		/// </remarks>
		public static void DisposeWith(this IDisposable disposable, Component component)
		{
			if (disposable == null)
			{
				return;
			}
			Verify.ArgumentNotNull(component, "component");
			component.Disposed += (sender, args) => DisposeOf(disposable);
		}
开发者ID:matthewc-mps-aust,项目名称:quokka,代码行数:23,代码来源:DisposableExtensions.cs


示例15: Load

 public void Load(Component component)
 {
     var source = (InfoComponent)component;
      Id = source.Id;
      Name = source.Name;
      Authors = source.Authors;
      Website = source.Website;
      Targets = source.Targets;
 }
开发者ID:ItzWarty,项目名称:the-dargon-project,代码行数:9,代码来源:InfoComponent.cs


示例16: IsComponentVisible

		protected override bool IsComponentVisible (Component component)
		{
			// Hide the TabPage's children if it's not visible.
			// This is to sweep under the rug the fact that SWF
			// seems to keep a TabPages' children visible even if
			// the TabPage isn't.  This is to model Vista's
			// behavior.
			return Control.Visible;
		}
开发者ID:mono,项目名称:uia2atk,代码行数:9,代码来源:TabPageProvider.cs


示例17: CreateCore

 protected override CommandBindingBase CreateCore(Component component, ICommand command, Func<object> commandParameterCallback)
 {
     TreeView treeView = component as TreeView;
     if (treeView == null)
     {
         throw new ArgumentException("This factory cannot create a CommandBindingBase for the passed component.");
     }
     return new TreeViewBinding(treeView, command, commandParameterCallback);
 }
开发者ID:Blind-Striker,项目名称:infinityfiction,代码行数:9,代码来源:TreeViewCommandBindingFactory.cs


示例18: CommandBindingBase

        /// <summary>
        /// コンストラクタ
        /// </summary>
        protected CommandBindingBase(Component component, ICommand command,
                                     Func<object> commandParameterCallback)
        {
            Component = component;
            Command = command;
            CommandParameterCallback = commandParameterCallback;

            Component.Disposed += event_Dispose;
            Command.CanExecuteChanged += CanExecuteChanged;
        }
开发者ID:leontius,项目名称:Ragnarok,代码行数:13,代码来源:CommandBindingBase.cs


示例19: OnCustomModelSynchronizer

 IModelSynchronizer IModelSynchronizersHolder.GetSynchronizer(Component component) {
     IModelSynchronizer result = null;
     if (component != null) {
         result = OnCustomModelSynchronizer(component);
         if (result == null) {
             ColumnsInfoCache.TryGetValue(component, out result);
         }
     }
     return result;
 }
开发者ID:derjabkin,项目名称:eXpand,代码行数:10,代码来源:AdvBandedListEditor.cs


示例20: OnGenerateIngresDataSet

        public void OnGenerateIngresDataSet(
			Component component, object sender, EventArgs e)
        {
            IServiceProvider sp = component.Site;
            EnvDTE._DTE dte = (EnvDTE._DTE)sp.GetService(typeof(EnvDTE._DTE));

            Form dlg = new GenDataSetForm(
                component.Site,                   // IServiceProvider
                (DbDataAdapter)component, dte);
            DialogResult result = dlg.ShowDialog();
        }
开发者ID:JordanChin,项目名称:Ingres,代码行数:11,代码来源:vsgendataset.cs



注:本文中的System.ComponentModel.Component类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ComponentModel.ComponentResourceManager类代码示例发布时间:2022-05-26
下一篇:
C# ComponentModel.CollectionChangeEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap