I have derived from DockableGroupPane & DockableControlPane classes & implemented
public override bool ShouldSerialize() { return base.ShouldSerialize(); }
Ex:
[Serializable] public class DummyPane : DockableControlPane, ITabItem {
}
but ShouldSerialize function was never called. I do not want to serialize some of my derived classes..
How to do this?
Hi Andrew,
Thanks for asking. I am glad to provide more information if you didn't get much information on problem.
Here is summary:We are developping Windows Form application using .NET 3.5 with Smart Client & CAB functionalities.We added dockable feature to the project by using UltraDockWorkspace. We are happy with UltraDockWorkspace except one issues. i.e docking of Group Pane (DockableGroupPane). Our customer wants to have dockable window so that they can drag windows & make them floating & compare two different windows side by side. Each child pane added to the DockableGroupPane must be dockable & can be floated by draging them out or by double clicking it. Its works well.Here is detailed summary:In the bottom dock area, we have placed Dockable windows, Dockable Group panes. Customer wants to see them as it is whether we add any dockable pane into DockableGroupPane or not. But the current nature of the Infragistics DockManager, it is cleaning up empty(no child) DockArea & DockableGroupPane. Due to this, when we launch the application, the user cannot see two tabs which are type of DockableGroupPane. They are vanished. When we try to place a smart part (View/window in CAB) & in UltraDockWorkspace, it creates a Group pane some where else.My suggesstion is to add additional property to the DockableGroupPane & DockArea to prevent closing DockableGroupPane which has no child. Let user to mention whether to close or not. Docking of DockableGroupPane is not quite smooth. When you double-click the DockableGroupPane or Any child, it becomes floating but when you double click the floating DockableGroupPane, it is not attaching to parent (previous state).To present this issue, we added some workaround but its not smooth. When we create a DockableGroupPane, I created a empty dockable pane & added to the DockableGroupPane. This solution makes DockableGroupPane to alive but creates immense of trouble while docking the group pane. I try inheriting DockableGroupPane to solve the problem by using overrides. But Inheritance hurt saving app layout to file & loading it back due to serialization behaviour.Also We get routine pop-up message on the inherited class with some serializtion issue.Here is the code.namespace MyNameSpace{ [Serializable] public class DummyPane : DockableControlPane, ITabItem { public DummyPane(Control ctrl) : base(ctrl) { } public override bool ShouldSerialize() { return false; } public override bool ShouldSerializeKey() { return false; } public DummyPane(SerializationInfo info, StreamingContext context) : base(info, context) { } #region ITabItem Members //bool ITabItem.Enabled //{ // get { throw new NotImplementedException(); } //} int ITabItem.FixedWidth { get { return 1; } } #endregion } public class MyDockableGroupPane : DockableGroupPane { DummyPane _BasePane; public MyDockableGroupPane() : base() { } public MyDockableGroupPane(string key) : base(key) { } protected override void InitControl(UltraDockManager manager) { base.InitControl(manager); ChildPaneStyle = ChildPaneStyle.TabGroup; GroupSettings.TabLocation = Infragistics.Win.UltraWinDock.Location.Top; GroupSettings.TabStyle = TabStyle.PropertyPage2003; GroupSettings.TabSizing = TabSizing.AutoSize; Settings.AllowDockBottom = Infragistics.Win.DefaultableBoolean.True; Settings.AllowDockLeft = Infragistics.Win.DefaultableBoolean.False; Settings.AllowDockRight = Infragistics.Win.DefaultableBoolean.False; Settings.AllowDockTop = Infragistics.Win.DefaultableBoolean.False; Settings.AllowDockAsTab = Infragistics.Win.DefaultableBoolean.False; Settings.AllowFloating = Infragistics.Win.DefaultableBoolean.False; Control control = new Control(); _BasePane = new DummyPane(control); _BasePane.Settings.ShowCaption = Infragistics.Win.DefaultableBoolean.False; _BasePane.Settings.TabAppearance = null; _BasePane.Settings.SlidingGroupAppearance = null; _BasePane.Settings.TabWidth = 0; _BasePane.Settings.AllowDockBottom = Infragistics.Win.DefaultableBoolean.True; _BasePane.Settings.AllowDockLeft = Infragistics.Win.DefaultableBoolean.False; _BasePane.Settings.AllowDockRight = Infragistics.Win.DefaultableBoolean.False; _BasePane.Settings.AllowDockTop = Infragistics.Win.DefaultableBoolean.False; _BasePane.Settings.AllowDockAsTab = Infragistics.Win.DefaultableBoolean.False; _BasePane.Settings.AllowFloating = Infragistics.Win.DefaultableBoolean.False; //_BasePane.MinimumSize = new System.Drawing.Size(0, 0); //_BasePane.Minimized = true; //_BasePane.Text = Text; Panes.Add(_BasePane); //Dock(true); } public override bool Activate() { return base.Activate(); } public override void Show() { base.Show(); try { Dock(true); } catch (Exception e) { } } public MyDockableGroupPane(string key, string text) : base(key, text) { } public MyDockableGroupPane(SerializationInfo info, StreamingContext context) : base(info, context) { } private void SetPaneCaption() { if (Panes.Count == 1 && Panes[0] == _BasePane) { Settings.ShowCaption = Infragistics.Win.DefaultableBoolean.True; } else { Settings.ShowCaption = Infragistics.Win.DefaultableBoolean.False; } int count = 0; foreach (DockablePaneBase pane in Panes) { if (pane.IsVisible) { count++; } } if (count == 1) { Settings.ShowCaption = Infragistics.Win.DefaultableBoolean.True; } else { Settings.ShowCaption = Infragistics.Win.DefaultableBoolean.False; } } protected override void ItemAdded(DockablePaneBase pane) { base.ItemAdded(pane); DockableControlPane p = pane as DockableControlPane; if (p != null) { if (p.Control != null) { p.Control.VisibleChanged += new EventHandler(Control_VisibleChanged); } } if (!Panes.Contains(_BasePane)) { _BasePane.RepositionToGroup(this, 0); return; } SetPaneCaption(); } void Control_VisibleChanged(object sender, EventArgs e) { Control ctrl = sender as Control; if (ctrl != null) { SetPaneCaption(); } } public override bool ShouldSerialize() { return false; } public override bool ShouldSerializeKey() { return false; } protected override void ItemRemoved(DockablePaneBase pane) { base.ItemRemoved(pane); SetPaneCaption(); } } The final code is mess due to so much of restructing. All our problem shall be fixed if you can make DockableAreaPane & DockableGroupPane to alive with no child added. Our requirements may not make sense for other application. So we need OPTION to close/retain the group pane. If the option is set to true, you can close the group pane or keep it alive.
Since it is dockable now, our customer are not able to restore the default window layout after a mess in UI. Docking is not smooth. Hence our customer are not happy, we are. Since we are not happy, we are troubling you guys :-).
I hope, you can give me better solution.
Krishgy,
I own the Windows Forms Product Backlog list and I'm going to add your request to the list. That being said, I need a little bit more infromation. Can you give me a quick use-case about what you're trying to solve? We're thinking that you want some of your panes to not be saved in the layout file by your description, but we want to make absolutely sure. Let me know and I'll be happy to write it up in our list of features requests.
Cheers,
Andrew M. FlickProduct Manager, Windows Client
Thanks for reply. Is it not obvious/responsibilities for Infragistics employees who are in this forum to take the issues/feature request themself? The issues are very well discussed in the forum. I will post the request through our customer support, that is not a problem. We are in frustrated state with couple of infragistics issues. In fact, we did refer to customer to continue with Infragistics.
I will post my request through support group. We will explore other possibilities & tools.
If you have a need for immediate support, then yes, contacting the support group is the best way to get support: http://ko.infragistics.com/gethelp. The forums are for peer to peer support and it may take time to get a response to a post.
In regards to your question, the ShouldSerialize method is called at design-time to determine whether the pane should be serialized out to the InitializeComponent code. To prevent the pane from serializing at run-time, you would have to use a derived DockablePanesCollection and re-implement ISerializable.GetObjectData on the collection. However, this is currently not possible because the collection has an internal constructor and the code which creates it cannot be overridden. You can submit a feature request for the ability to use a derived panes collection in your UltraDockManager: http://devcenter.infragistics.com/Protected/RequestFeature.aspx. You can also submit a feature request for a property on individual panes which says whether the panes are serialized out.
Should I post these queries through our paid support email account? No one ready from Infragistcis to answer questions.. I feel Shame