/// <summary> /// Checks that templates are valid for nodes. /// </summary> /// <param name="nodeTemplateTable">Table of templates.</param> public virtual bool IsValid(FrameTemplateReadOnlyDictionary nodeTemplateTable) { Contract.RequireNotNull(nodeTemplateTable, out FrameTemplateReadOnlyDictionary NodeTemplateTable); FrameTemplateDictionary DefaultDictionary = CreateDefaultTemplateDictionary(); bool IsValid = true; foreach (KeyValuePair <Type, IFrameTemplate> Entry in DefaultDictionary) { IsValid &= NodeTemplateTable.ContainsKey(Entry.Key); } foreach (KeyValuePair <Type, IFrameTemplate> Entry in NodeTemplateTable) { Type NodeType = Entry.Key; IFrameTemplate Template = Entry.Value; int CommentFrameCount = 0; IsValid &= Template.IsValid; IsValid &= IsValidNodeType(NodeType, Template.NodeType); IsValid &= Template.Root.IsValid(NodeType, NodeTemplateTable, ref CommentFrameCount); IsValid &= CommentFrameCount == 1; Debug.Assert(IsValid); } Debug.Assert(IsValid); return(IsValid); }
/// <summary> /// Update the reference to the parent frame. /// </summary> /// <param name="parentTemplate">The parent template.</param> /// <param name="parentFrame">The parent frame.</param> public override void UpdateParent(IFrameTemplate parentTemplate, IFrameFrame parentFrame) { base.UpdateParent(parentTemplate, parentFrame); Debug.Assert(ParentTemplate == parentTemplate); Debug.Assert(ParentFrame == parentFrame); }
/// <summary> /// Checks that templates are valid for blocks. /// </summary> /// <param name="blockTemplateTable">Table of templates.</param> /// <param name="nodeTemplateTable">Table of templates with all frames.</param> public virtual bool IsBlockValid(FrameTemplateReadOnlyDictionary blockTemplateTable, FrameTemplateReadOnlyDictionary nodeTemplateTable) { Contract.RequireNotNull(blockTemplateTable, out FrameTemplateReadOnlyDictionary BlockTemplateTable); Contract.RequireNotNull(nodeTemplateTable, out FrameTemplateReadOnlyDictionary NodeTemplateTable); IList <Type> BlockKeys = NodeHelper.GetNodeKeys(); FrameTemplateDictionary DefaultDictionary = CreateEmptyTemplateDictionary(); foreach (Type Key in BlockKeys) { AddBlockNodeTypes(DefaultDictionary, Key); } bool IsValid = true; foreach (KeyValuePair <Type, IFrameTemplate> Entry in DefaultDictionary) { IsValid &= BlockTemplateTable.ContainsKey(Entry.Key); } foreach (KeyValuePair <Type, IFrameTemplate> Entry in BlockTemplateTable) { Type NodeType = Entry.Key; IFrameTemplate Template = Entry.Value; int CommentFrameCount = 0; IsValid &= NodeTreeHelper.IsBlockInterfaceType(NodeType); IsValid &= Template.IsValid; IsValid &= Template.Root.IsValid(NodeType, NodeTemplateTable, ref CommentFrameCount); } Debug.Assert(IsValid); return(IsValid); }
bool IReadOnlyDictionary <Type, IFrameTemplate> .TryGetValue(Type key, out IFrameTemplate value) { bool Result = TryGetValue(key, out IFocusTemplate Value); value = Value; return(Result); }
/// <summary> /// Checks that templates are valid for blocks. /// </summary> /// <param name="blockTemplateTable">Table of templates.</param> /// <param name="nodeTemplateTable">Table of templates with all frames.</param> public virtual bool IsBlockValid(IFrameTemplateReadOnlyDictionary blockTemplateTable, IFrameTemplateReadOnlyDictionary nodeTemplateTable) { Debug.Assert(blockTemplateTable != null); List <Type> BlockKeys = new List <Type>(NodeHelper.CreateNodeDictionary <object>().Keys); IFrameTemplateDictionary DefaultDictionary = CreateEmptyTemplateDictionary(); foreach (Type Key in BlockKeys) { AddBlockNodeTypes(DefaultDictionary, Key); } bool IsValid = true; foreach (KeyValuePair <Type, IFrameTemplate> Entry in DefaultDictionary) { IsValid &= blockTemplateTable.ContainsKey(Entry.Key); } foreach (KeyValuePair <Type, IFrameTemplate> Entry in blockTemplateTable) { Type NodeType = Entry.Key; IFrameTemplate Template = Entry.Value; int CommentFrameCount = 0; IsValid &= NodeTreeHelper.IsBlockType(NodeType); IsValid &= Template.IsValid; IsValid &= Template.Root.IsValid(NodeType, nodeTemplateTable, ref CommentFrameCount); } Debug.Assert(IsValid); return(IsValid); }
bool IDictionary <Type, IFrameTemplate> .TryGetValue(Type key, out IFrameTemplate value) { bool Result = TryGetValue(key, out ILayoutTemplate Value); value = Value; return(Result); }
private void HandleCustomGetMinSizeEvent(IFrameTemplate frameTemplate) { PopupForm popupForm = frameTemplate as PopupForm; if (popupForm != null) { popupForm.CustomizeClientSize += new EventHandler<CustomSizeEventArgs>(popupForm_CustomizeClientSize); } }
private void Window_TemplateChanged(object sender, EventArgs e) { IFrameTemplate template = Window.Template; DocumentManager docManager = ((IDocumentsHostWindow)template).DocumentManager; docManager.ViewChanged += docManager_ViewChanged; CustomizeDocumentManagerView(docManager.View); }
/// <summary> /// Update the reference to the parent frame. /// </summary> /// <param name="parentTemplate">The parent template.</param> /// <param name="parentFrame">The parent frame.</param> public override void UpdateParent(IFrameTemplate parentTemplate, IFrameFrame parentFrame) { base.UpdateParent(parentTemplate, parentFrame); foreach (IFrameKeywordFrame Item in Items) { Item.UpdateParent(parentTemplate, this); } }
/// <summary> /// Update the reference to the parent frame. /// </summary> /// <param name="parentTemplate">The parent template.</param> /// <param name="parentFrame">The parent frame.</param> public virtual void UpdateParent(IFrameTemplate parentTemplate, IFrameFrame parentFrame) { Contract.RequireNotNull(parentTemplate, out IFrameTemplate ParentTemplate); Contract.RequireNotNull(parentFrame, out IFrameFrame ParentFrame); Debug.Assert(this.ParentTemplate == null); this.ParentTemplate = ParentTemplate; Debug.Assert(this.ParentFrame == null); this.ParentFrame = ParentFrame; }
/// <summary> /// Update the reference to the parent frame. /// </summary> /// <param name="parentTemplate">The parent template.</param> /// <param name="parentFrame">The parent frame.</param> public virtual void UpdateParent(IFrameTemplate parentTemplate, IFrameFrame parentFrame) { Debug.Assert(parentTemplate != null); Debug.Assert(parentFrame != null); Debug.Assert(ParentTemplate == null); ParentTemplate = parentTemplate; Debug.Assert(ParentFrame == null); ParentFrame = parentFrame; }
/// <summary> /// Update the reference to the parent frame. /// </summary> /// <param name="parentTemplate">The parent template.</param> /// <param name="parentFrame">The parent frame.</param> public override void UpdateParent(IFrameTemplate parentTemplate, IFrameFrame parentFrame) { base.UpdateParent(parentTemplate, parentFrame); Debug.Assert(ParentTemplate == parentTemplate); Debug.Assert(ParentFrame == parentFrame); foreach (IFocusSelectableFrame Item in Items) { Item.UpdateParent(parentTemplate, this); } }
/// <summary> /// Update the reference to the parent frame. /// </summary> /// <param name="parentTemplate">The parent template.</param> /// <param name="parentFrame">The parent frame.</param> public virtual void UpdateParent(IFrameTemplate parentTemplate, IFrameFrame parentFrame) { Debug.Assert(parentTemplate is IFocusTemplate); Debug.Assert(parentFrame is IFocusFrame); Debug.Assert(ParentTemplate == null); ParentTemplate = (IFocusTemplate)parentTemplate; Debug.Assert(ParentFrame == null); ParentFrame = (IFocusFrame)parentFrame; Content.UpdateParent(parentTemplate, this); }
public override IModelTemplate GetTemplateCustomizationModel(IFrameTemplate template) { var applicationBase = ((ModelApplicationBase)Model); if (applicationBase.Id == "Application") { var list = new List <ModelApplicationBase>(); while (applicationBase.LastLayer.Id != "UserDiff" && applicationBase.LastLayer.Id != AfterSetupLayerId && applicationBase.LastLayer.Id != "Unchanged Master Part") { list.Add(applicationBase.LastLayer); ModelApplicationHelper.RemoveLayer(applicationBase); } var modelTemplate = base.GetTemplateCustomizationModel(template); foreach (var modelApplicationBase in list) { ModelApplicationHelper.AddLayer((ModelApplicationBase)Model, modelApplicationBase); } return(modelTemplate); } return(base.GetTemplateCustomizationModel(template)); }
public static IObservable <IWindowsForm> WhenWindowsForm(this IFrameTemplate frameTemplate) => frameTemplate.ReturnObservable().Where(_ => frameTemplate != null && frameTemplate.GetType().InheritsFrom("System.Windows.Forms.Form")).WhenNotDefault() .Select(template => new WindowsForm(template));
public WindowsForm(IFrameTemplate template) { Template = template; }
public override IModelTemplate GetTemplateCustomizationModel(IFrameTemplate template) { var applicationBase = ((ModelApplicationBase)Model); if (applicationBase.Id == "Application") { var list = new List<ModelApplicationBase>(); while (applicationBase.LastLayer.Id != "UserDiff" && applicationBase.LastLayer.Id != AfterSetupLayerId && applicationBase.LastLayer.Id != "Unchanged Master Part") { list.Add(applicationBase.LastLayer); ModelApplicationHelper.RemoveLayer(applicationBase); } var modelTemplate = base.GetTemplateCustomizationModel(template); foreach (var modelApplicationBase in list) { ModelApplicationHelper.AddLayer((ModelApplicationBase)Model, modelApplicationBase); } return modelTemplate; } return base.GetTemplateCustomizationModel(template); }
bool ICollection <IFrameTemplate> .Remove(IFrameTemplate item) { return(Remove((ILayoutTemplate)item)); }
public void UpdateParent(IFrameTemplate parentTemplate, IFrameFrame parentFrame) { }
/// <summary> /// Initializes a new instance of the <see cref="FrameBlockStateView"/> class. /// </summary> /// <param name="controllerView">The controller view to which this object belongs.</param> /// <param name="blockState">The block state.</param> /// <param name="template">The frame template.</param> protected FrameBlockStateView(FrameControllerView controllerView, IFrameBlockState blockState, IFrameTemplate template) : base(controllerView, blockState) { Template = template; }
void ICollection <IFrameTemplate> .Add(IFrameTemplate item) { Add((IFocusTemplate)item); }
/// <summary> /// Update the reference to the parent frame. /// </summary> /// <param name="parentTemplate">The parent template.</param> /// <param name="parentFrame">The parent frame.</param> public override void UpdateParent(IFrameTemplate parentTemplate, IFrameFrame parentFrame) { base.UpdateParent(parentTemplate, parentFrame); UpdateInterfaceType(parentTemplate.NodeType); }
void ICollection <IFrameTemplate> .Add(IFrameTemplate item) { Add((ILayoutTemplate)item); }
bool ICollection <IFrameTemplate> .Contains(IFrameTemplate value) { return(Contains((ILayoutTemplate)value)); }
void IList <IFrameTemplate> .Insert(int index, IFrameTemplate item) { Insert(index, (ILayoutTemplate)item); }
int IList <IFrameTemplate> .IndexOf(IFrameTemplate value) { return(IndexOf((ILayoutTemplate)value)); }
void IDictionary <Type, IFrameTemplate> .Add(Type key, IFrameTemplate value) { Add(key, (IFocusTemplate)value); }
public static Form ToForm(this IFrameTemplate frameTemplate) { return((Form)frameTemplate); }
public override IModelTemplate GetTemplateCustomizationModel(IFrameTemplate template) { var list = new List<ModelApplicationBase>(); while (((ModelApplicationBase)Model).LastLayer.Id != "UserDiff" && ((ModelApplicationBase)Model).LastLayer.Id != AfterSetupLayerId) { var modelApplicationBase = ((ModelApplicationBase)Model).LastLayer; list.Add(modelApplicationBase); ((ModelApplicationBase)Model).RemoveLayer(modelApplicationBase); } var modelTemplate = base.GetTemplateCustomizationModel(template); foreach (var modelApplicationBase in list) { ((ModelApplicationBase)Model).AddLayer(modelApplicationBase); } return modelTemplate; }
void IList <IFrameTemplate> .Insert(int index, IFrameTemplate item) { Insert(index, (IFocusTemplate)item); }