Esempio n. 1
0
        public bool IsValid(object caller, Condition condition)
        {
            string openWindow = condition.Properties["openwindow"];

            Type openWindowType = condition.AddIn.FindType(openWindow);

            if (openWindowType == null)
            {
                SD.Log.WarnFormatted("WindowOpenCondition: cannot find Type {0}", openWindow);
                return(false);
            }

            if (SD.GetActiveViewContentService(openWindowType) != null)
            {
                return(true);
            }

            if (openWindow == "*")
            {
                return(SD.Workbench.ActiveWorkbenchWindow != null);
            }

            foreach (IViewContent view in SD.Workbench.ViewContentCollection)
            {
                Type currentType = view.GetType();
                if (currentType.ToString() == openWindow)
                {
                    return(true);
                }
                foreach (Type i in currentType.GetInterfaces())
                {
                    if (i.ToString() == openWindow)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
 public virtual void FixtureTearDown()
 {
     SD.TearDownForUnitTests();
 }
 public virtual void FixtureSetUp()
 {
     SD.InitializeForUnitTests();
 }