public override Sage.Platform.Application.UI.ISmartPartInfo GetSmartPartInfo(Type smartPartInfoType) { ToolsSmartPartInfo tinfo = new ToolsSmartPartInfo(); if (_mode == "EDIT") { tinfo.Description = GetLocalResourceObject("DialogTitleEdit").ToString(); tinfo.Title = GetLocalResourceObject("DialogTitleEdit").ToString(); } else { tinfo.Description = GetLocalResourceObject("DialogTitleAdd").ToString(); tinfo.Title = GetLocalResourceObject("DialogTitleAdd").ToString(); } foreach (Control c in Controls) { SmartPartToolsContainer cont = c as SmartPartToolsContainer; if (cont != null) { switch (cont.ToolbarLocation) { case SmartPartToolsLocation.Right: foreach (Control tool in cont.Controls) { tinfo.RightTools.Add(tool); } break; case SmartPartToolsLocation.Center: foreach (Control tool in cont.Controls) { tinfo.CenterTools.Add(tool); } break; case SmartPartToolsLocation.Left: foreach (Control tool in cont.Controls) { tinfo.LeftTools.Add(tool); } break; } } } return(tinfo); }
/// <summary> /// Tries to retrieve smart part information compatible with type /// smartPartInfoType. /// </summary> /// <param name="smartPartInfoType">Type of information to retrieve.</param> /// <returns> /// The <see cref="T:Sage.Platform.Application.UI.ISmartPartInfo"/> instance or null if none exists in the smart part. /// </returns> public override ISmartPartInfo GetSmartPartInfo(Type smartPartInfoType) { ToolsSmartPartInfo tinfo = new ToolsSmartPartInfo(); if (BindingSource != null) { if (BindingSource.Current != null) { tinfo.Description = BindingSource.Current.ToString(); tinfo.Title = BindingSource.Current.ToString(); } } foreach (Control c in Controls) { SmartPartToolsContainer cont = c as SmartPartToolsContainer; if (cont != null) { switch (cont.ToolbarLocation) { case SmartPartToolsLocation.Right: foreach (Control tool in cont.Controls) { tinfo.RightTools.Add(tool); } break; case SmartPartToolsLocation.Center: foreach (Control tool in cont.Controls) { tinfo.CenterTools.Add(tool); } break; case SmartPartToolsLocation.Left: foreach (Control tool in cont.Controls) { tinfo.LeftTools.Add(tool); } break; } } } return(tinfo); }
/// <summary> /// Gets the smart part info. /// </summary> /// <param name="smartPartInfoType">Type of the smart part info.</param> /// <returns></returns> public override ISmartPartInfo GetSmartPartInfo(Type smartPartInfoType) { ToolsSmartPartInfo tinfo = new ToolsSmartPartInfo(); foreach (Control c in Controls) { SmartPartToolsContainer cont = c as SmartPartToolsContainer; if (cont != null) { switch (cont.ToolbarLocation) { case SmartPartToolsLocation.Right: foreach (Control tool in cont.Controls) { tinfo.RightTools.Add(tool); } break; case SmartPartToolsLocation.Center: foreach (Control tool in cont.Controls) { tinfo.CenterTools.Add(tool); } break; case SmartPartToolsLocation.Left: foreach (Control tool in cont.Controls) { tinfo.LeftTools.Add(tool); } break; } } } return(tinfo); }
/// <summary> /// Gets the smart part info. /// </summary> /// <param name="smartPartInfoType">Type of the smart part info.</param> /// <returns></returns> public override Sage.Platform.Application.UI.ISmartPartInfo GetSmartPartInfo(Type smartPartInfoType) { ToolsSmartPartInfo tinfo = new ToolsSmartPartInfo(); foreach (Control c in Controls) { SmartPartToolsContainer cont = c as SmartPartToolsContainer; if (cont != null) { switch (cont.ToolbarLocation) { case SmartPartToolsLocation.Right: foreach (Control tool in cont.Controls) { tinfo.RightTools.Add(tool); } break; case SmartPartToolsLocation.Center: foreach (Control tool in cont.Controls) { tinfo.CenterTools.Add(tool); } break; case SmartPartToolsLocation.Left: foreach (Control tool in cont.Controls) { tinfo.LeftTools.Add(tool); } break; } } } return(tinfo); //tinfo.ImagePath = Page.ResolveClientUrl("ImageResource.axd?scope=global&type=Global_Images&key=Companies_24x24"); return tinfo; }