private string GetFullTemplateName(string templateName) { List <string> list = new List <string> { templateName }; OptionsOwnerBuilder optionsOwnerBuilder = this; while (optionsOwnerBuilder.Owner != null) { string text = optionsOwnerBuilder.JsName; ICollectionItem collectionItem = optionsOwnerBuilder as ICollectionItem; if (collectionItem != null) { int num = collectionItem.Index; IDictionary <string, object> options = optionsOwnerBuilder.Owner.Options; if (options.ContainsKey(text)) { num += (options[text] as ICollection).Count; } text += num.ToString(); } list.Insert(0, text); optionsOwnerBuilder = optionsOwnerBuilder.Owner; } WidgetBuilder widgetBuilder = (WidgetBuilder)optionsOwnerBuilder; list.Insert(0, widgetBuilder.InternalID.GetStatic()); return(string.Join("-", list)); }
/// <summary> /// 选中该项 /// </summary> public void Selected() { ICollectionItem pCollectionItem = this.pOwner as ICollectionItem; if (pCollectionItem == null) { return; } foreach (ITabButtonItem one in pCollectionItem.BaseItems) { if (one == null || !one.Visible) { continue; } // if (one == this) { ((ISetTabButtonItemHelper)one).SetIsSelected(true); } else { ((ISetTabButtonItemHelper)one).SetIsSelected(false); } } }
public override void Initialize(IComponent component) { base.Initialize(component); // this.m_pCollectionItem = base.Component as ICollectionItem; this.m_pRibbonApplicationObjectDesignHelper = base.Component as IRibbonApplicationObjectDesignHelper; this.m_pObjectDesignHelper = base.Component as IObjectDesignHelper; this.m_pCollectionObjectDesignHelper = base.Component as ICollectionObjectDesignHelper; this.m_pPopupObjectDesignHelper = base.Component as IPopupObjectDesignHelper; // this.m_pRibbonControl = base.Component as IRibbonControl; this.m_pRibbonPageItem = base.Component as IRibbonPageItem; this.m_pButtonGroupItem = base.Component as IButtonGroupItem; this.m_pGalleryItem = base.Component as IGalleryItem; this.m_RibbonGalleryRowItem = base.Component as RibbonGalleryRowItem; // if (this.m_pRibbonControl != null) { IDesignerHost host = GetService(typeof(IDesignerHost)) as IDesignerHost; if (host != null) { if (host.RootComponent is System.Windows.Forms.Form) { System.Windows.Forms.Form form = (System.Windows.Forms.Form)host.RootComponent; form.MainMenuStrip = this.m_pRibbonControl.MenuStrip; this.m_pRibbonControl.ParentForm = form; if (form is WFNew.RibbonForm) { ((WFNew.RibbonForm)form).RibbonControl = this.m_pRibbonControl; } } } } }
internal ICollectionItem AddItem(ICollectionItem item) { if (List.Contains(item) && item.Collection == this) { return(item); } List.Add(item); return(item); }
protected override void OnRemoveComplete(int index, object item) { base.OnRemoveComplete(index, item); ICollectionItem colItem = item as ICollectionItem; colItem.SetCollection(null); colItem.ItemChanged -= new EventHandler(Collection_CollectionItemChanged); RaiseOnCollectionChanged(new CollectionChangeEventArgs(CollectionChangeAction.Remove, item)); }
protected override void OnInsertComplete(int index, object item) { base.OnInsertComplete(index, item); ICollectionItem colItem = item as ICollectionItem; colItem.SetCollection(this); colItem.ItemChanged += new EventHandler(Collection_CollectionItemChanged); RaiseOnCollectionChanged(new CollectionChangeEventArgs(CollectionChangeAction.Add, item)); }
protected ICollectionItem this[string name] { get { for (int n = Count - 1; n >= 0; n--) { ICollectionItem item = List[n] as ICollectionItem; if (item.ItemName == name) { return(item); } } return(null); } }
protected override void OnInsert(int index, object item) { base.OnInsert(index, item); ICollectionItem colItem = item as ICollectionItem; if (colItem == null) { throw new ArgumentException("invalid collectionItem"); } if (colItem.Collection != null) { if (colItem.Collection == this && !List.Contains(item)) { return; } throw new ArgumentException("already in collection"); } }
public virtual int IndexOf(ICollectionItem item) { return List.IndexOf(item); }
public virtual void Add(ICollectionItem item) { AddItem(item); }
internal void RemoveItem(ICollectionItem item) { List.Remove(item); }
internal ICollectionItem AddItem(ICollectionItem item) { if (List.Contains(item) && item.Collection == this) return item; List.Add(item); return item; }
public virtual void Remove(ICollectionItem item) { RemoveItem(item); }
/// <summary> /// 移除成員 /// </summary> /// <param name="item">成員。</param> public void Remove(ICollectionItem item) { this.Remove((T)item); }
public virtual int IndexOf(ICollectionItem item) { return(List.IndexOf(item)); }
public virtual object Insert(int index, ICollectionItem item) { List.Insert(index, item); return item; }
protected virtual ICollectionItem Add() { ICollectionItem item = CreateItem(); return(item); }
public virtual object Insert(int index, ICollectionItem item) { List.Insert(index, item); return(item); }