private static ObjectExplorerNodeDescriptorBase GetObjectDescriptor(ObjectExplorerNodeDescriptorBase node)
        {
            IOeNode oeNode = node as IOeNode;

            if (oeNode == null)
            {
                return(node);
            }
            return(oeNode.GetLegacyObjectDescriptor());
        }
 public override bool AppliesTo(ObjectExplorerNodeDescriptorBase oeNode)
 {
     foreach (var child in m_Children)
     {
         if (child.AppliesTo(oeNode))
         {
             return(true);
         }
     }
     return(false);
 }
        public static string SerializeToTempFile(ObjectExplorerNodeDescriptorBase node)
        {
            node = GetObjectDescriptor(node);

            string tempFile = GetTempName();

            using (FileStream stream = new FileStream(tempFile, FileMode.CreateNew))
            {
                XmlSerializer xs = new XmlSerializer(node.GetType());
                xs.Serialize(stream, node);
                stream.Flush();
                stream.Close();
            }
            return(tempFile);
        }
 public SimpleOeMenuItemBase[] GetApplicableChildren(ObjectExplorerNodeDescriptorBase oeNode)
 {
     return(Array.FindAll(m_Children, c => c.AppliesTo(oeNode)));
 }
Beispiel #5
0
 // TODO this should be IEnumerable, because that's covariant.
 abstract public SimpleOeMenuItemBase[] GetApplicableChildren(ObjectExplorerNodeDescriptorBase oeNode);
Beispiel #6
0
 public abstract bool AppliesTo(ObjectExplorerNodeDescriptorBase oeNode);