private static void MenuOpening(object sender, CancelEventArgs e) { GenericWrapper w = GetInstance <GenericWrapper>(); _menu.Items[2].Enabled = w.PrevNode != null; _menu.Items[3].Enabled = w.NextNode != null; }
internal protected virtual void OnMovedDown(ResourceNode node, bool select) { GenericWrapper res = this.FindResource(node, false) as GenericWrapper; res.MoveDown(select); res.EnsureVisible(); //res.TreeView.SelectedNode = res; }
private static void MenuOpening(object sender, CancelEventArgs e) { GenericWrapper w = GetInstance <GenericWrapper>(); _menu.Items[1].Enabled = _menu.Items[8].Enabled = w.Parent != null; _menu.Items[2].Enabled = ((w._resource.IsDirty) || (w._resource.IsBranch)); _menu.Items[4].Enabled = w.PrevNode != null; _menu.Items[5].Enabled = w.NextNode != null; }
public static BaseWrapper Wrap(IWin32Window owner, ResourceNode node) { _owner = owner; BaseWrapper w; if (!NodeWrapperAttribute.Wrappers.ContainsKey(node.ResourceType)) { w = new GenericWrapper(); } else { w = Activator.CreateInstance(NodeWrapperAttribute.Wrappers[node.ResourceType]) as BaseWrapper; } w.Link(node); return(w); }