本文整理汇总了C#中DevComponents.DotNetBar.BaseItem类的典型用法代码示例。如果您正苦于以下问题:C# BaseItem类的具体用法?C# BaseItem怎么用?C# BaseItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseItem类属于DevComponents.DotNetBar命名空间,在下文中一共展示了BaseItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CopyToItem
protected override void CopyToItem(BaseItem copy)
{
ControlContainerItem objCopy=copy as ControlContainerItem;
base.CopyToItem(objCopy);
objCopy.ContainerLoadControl=this.ContainerLoadControl;
objCopy.InitControl();
}
示例2: RecalcSize
/// <summary>
/// Recalcualtes the size of the container. Assumes that DisplayRectangle.Location is set to the upper left location of this container.
/// </summary>
public override void RecalcSize()
{
if(this.SuspendLayout)
return;
if(this.SubItems.Count==0)
{
if(this.DesignMode && !this.SystemContainer)
{
m_Rect.Size=m_EmptyDesignTimeSize;
if(m_LayoutOrientation==eOrientation.Horizontal)
m_Rect.Width+=12;
else
m_Rect.Height+=12;
}
else
{
m_Rect=Rectangle.Empty;
}
return;
}
IContentLayout layout=this.GetContentLayout();
BlockLayoutManager blockLayout=this.GetBlockLayoutManager();
BaseItem[] elements=new BaseItem[this.SubItems.Count];
this.SubItems.CopyTo(elements,0);
if(m_Rect.Width==0)
m_Rect.Width=16;
if(m_Rect.Height==0)
m_Rect.Height=16;
m_Rect=layout.Layout(m_Rect,elements,blockLayout);
base.RecalcSize();
}
示例3: CreateItemContainer
public static ItemContainer CreateItemContainer(IDesignerServices designer, BaseItem parent, eOrientation containerOrientation)
{
IDesignerHost dh=designer.GetService(typeof(IDesignerHost)) as IDesignerHost;
IComponentChangeService cc=designer.GetService(typeof(IComponentChangeService)) as IComponentChangeService;
if(dh==null || parent==null || cc==null)
return null;
ItemContainer c=null;
DesignerTransaction trans=dh.CreateTransaction("New DotNetBar Item Container");
try
{
c=dh.CreateComponent(typeof(ItemContainer)) as ItemContainer;
TypeDescriptor.GetProperties(c)["LayoutOrientation"].SetValue(c,containerOrientation);
cc.OnComponentChanging(parent,TypeDescriptor.GetProperties(c)["SubItems"]);
parent.SubItems.Add(c);
cc.OnComponentChanged(parent,TypeDescriptor.GetProperties(c)["SubItems"],null,null);
}
finally
{
if(!trans.Canceled)
trans.Commit();
}
return c;
}
示例4: Add
public int Add(BaseItem item)
{
item.SetOwner(m_Owner);
item.Visible=false;
item.Displayed=false;
return List.Add(item);
}
示例5: CopyToItem
protected override void CopyToItem(BaseItem copy)
{
ColorItem ci = copy as ColorItem;
base.CopyToItem(ci);
ci.DesiredSize = this.DesiredSize;
ci.Color = this.Color;
ci.Border = this.Border;
}
示例6: RecordSetting
public override void RecordSetting(BaseItem item)
{
if (this.SettingsRecorded)
return;
ItemContainer cont = item as ItemContainer;
m_MultiLine = cont.MultiLine;
m_LayoutOrientation = cont.LayoutOrientation;
base.RecordSetting(item);
}
示例7: BaseItemController
/// <summary>
/// Initializes a new instance of the BaseItemController class.
/// </summary>
/// <param name="item"></param>
/// <param name="parentControl"></param>
public BaseItemController(BaseItem item, Control parentControl)
{
_Item = item;
_ParentControl = parentControl;
_ParentControl.MouseDown += new MouseEventHandler(ParentControlMouseDown);
_ParentControl.MouseEnter += new EventHandler(ParentControlMouseEnter);
_ParentControl.MouseMove += new MouseEventHandler(ParentControlMouseMove);
_ParentControl.MouseUp += new MouseEventHandler(ParentControlMouseUp);
_ParentControl.MouseLeave += new EventHandler(ParentControlMouseLeave);
_ParentControl.Paint += new PaintEventHandler(ParentControlPaint);
_Item.ContainerControl = _ParentControl;
}
示例8: AddSubMenu
/// <summary>
/// 加载子菜单
/// </summary>
/// <param name="menuId">父菜单Id</param>
/// <param name="patientItem">父菜单控件</param>
/// <param name="menuData">菜单数据</param>
private void AddSubMenu(int menuId, BaseItem patientItem, List<BaseMenu> allmenus)
{
List<BaseMenu> mainMenu = allmenus.FindAll(x => x.PMenuId == menuId).OrderBy(x => x.SortId).ToList();
foreach (BaseMenu menu in mainMenu)
{
AddToolMenu(menu);
BaseItem bottonItem = new ButtonItem(menu.MenuId.ToString(), menu.Name);
bottonItem.Tag = menu;
AddSubMenu(menu.MenuId, bottonItem, allmenus);
patientItem.SubItems.Add(bottonItem);
}
}
示例9: OnItemAdded
protected internal override void OnItemAdded(BaseItem objItem)
{
base.OnItemAdded(objItem);
ImageItem objImageItem=objItem as ImageItem;
if(objImageItem!=null)
{
Size newSize = m_SubItemsImageSize;
if(objImageItem.ImageSize.Width>m_SubItemsImageSize.Width)
newSize.Width = objImageItem.ImageSize.Width;
if(objImageItem.ImageSize.Height>m_SubItemsImageSize.Height)
newSize.Height = objImageItem.ImageSize.Height;
this.SubItemsImageSize = newSize;
}
}
示例10: AddCopy
public void AddCopy(BaseItem objItem)
{
if(objItem==null)
throw new System.ArgumentNullException("Item must be valid value");
if(objItem.Name==null || objItem.Name=="")
{
// Auto assign item name
objItem.Name="item_"+objItem.Id.ToString();
}
if(m_Items.ContainsKey(objItem.Name))
throw new System.InvalidOperationException("Item with this name already exists");
BaseItem objCopy=objItem.Copy();
objCopy.SetOwner(m_Owner);
objCopy.GlobalItem=true;
m_Items.Add(objCopy.Name,objCopy);
}
示例11: _Add
internal int _Add(BaseItem item)
{
m_IgnoreEvents=true;
m_AllowParentRemove=false;
int i=0;
try
{
i=List.Add(item);
}
finally
{
m_IgnoreEvents=false;
m_AllowParentRemove=true;
}
return i;
}
示例12: Paint
public void Paint(BaseItem container, ItemPaintArgs p)
{
foreach (BaseItem item in container.SubItems)
{
if (item.Visible && item.Displayed)
{
if (p.ClipRectangle.IsEmpty || p.ClipRectangle.IntersectsWith(item.DisplayRectangle))
{
Region oldClip = p.Graphics.Clip; //.Clone() as Region;
p.Graphics.SetClip(item.DisplayRectangle, CombineMode.Intersect);
item.Paint(p);
p.Graphics.Clip = oldClip;
if (oldClip != null)
oldClip.Dispose();
}
}
}
}
示例13: Remove
public void Remove(BaseItem objItemToRemove)
{
if(m_Items.ContainsKey(objItemToRemove.Name))
{
m_Items.Remove(objItemToRemove.Name);
objItemToRemove.SetOwner(null);
((IOwner)m_Owner).RemoveShortcutsFromItem(objItemToRemove);
//objItemToRemove.GlobalItem=false;
return;
}
string sItemName=objItemToRemove.Name;
foreach(DictionaryEntry o in m_Items)
{
BaseItem objItem=o.Value as BaseItem;
// Name out of sync case
if(objItem==objItemToRemove)
{
m_Items.RemoveAt(m_Items.IndexOfValue(objItem));
objItemToRemove.SetOwner(null);
((IOwner)m_Owner).RemoveShortcutsFromItem(objItemToRemove);
return;
}
if(objItem.SubItems.Count>0)
{
if(RemoveItem(sItemName,objItem))
{
//objItemToRemove.GlobalItem=false;
return;
}
}
}
// This will throw exception...
m_Items.Remove(objItemToRemove.Name);
objItemToRemove.SetOwner(null);
}
示例14: GetContainerControl
private Control GetContainerControl(BaseItem item)
{
object container = item.ContainerControl;
if (container is BaseItem)
container = ((BaseItem)container).ContainerControl;
return container as Control;
}
示例15: CollapseRecursively
private void CollapseRecursively(BaseItem item)
{
foreach (BaseItem sub in item.SubItems)
{
sub.Expanded = false;
CollapseRecursively(sub);
}
}