예제 #1
0
        public ScopeNode[] GetScopeNodes()
        {
            List <ScopeNode> list = new List <ScopeNode>();

            foreach (NodeProfile nodeProfile in this.nodeProfiles)
            {
                if (WinformsHelper.IsCurrentOrganizationAllowed(nodeProfile.OrganizationTypes) && nodeProfile.Type != null)
                {
                    bool flag = false;
                    ExchangeScopeNode exchangeScopeNode = (ExchangeScopeNode)nodeProfile.Type.GetConstructor(new Type[0]).Invoke(new object[0]);
                    ScopeNode[]       scopeNodes        = nodeProfile.GetScopeNodes();
                    if (scopeNodes.Length > 0)
                    {
                        flag = true;
                        exchangeScopeNode.Children.AddRange(scopeNodes);
                    }
                    if (nodeProfile.ResultPaneProfile != null && nodeProfile.ResultPaneProfile.HasPermission())
                    {
                        exchangeScopeNode.ViewDescriptions.Add(ExchangeFormView.CreateViewDescription(nodeProfile.ResultPaneProfile.Type));
                        flag = true;
                    }
                    if (scopeNodes.Length > 0 && exchangeScopeNode.ViewDescriptions.Count == 0)
                    {
                        exchangeScopeNode.ViewDescriptions.Add(ExchangeFormView.CreateViewDescription(typeof(RbacPermissionLockResultPane)));
                    }
                    if (flag)
                    {
                        list.Add(exchangeScopeNode);
                    }
                }
            }
            return(list.ToArray());
        }
예제 #2
0
 public DetailsTemplatesRootNode()
 {
     base.DisplayName = Strings.RootNodeDisplayName;
     base.Icon        = Icons.DetailsTemplate;
     base.ViewDescriptions.Add(ExchangeFormView.CreateViewDescription(typeof(DetailsTemplatesResultPane)));
     base.HelpTopic = HelpId.DetailsTemplateRootNode.ToString();
     if (WinformsHelper.IsRemoteEnabled())
     {
         base.RegisterConnectionToPSServerAction();
     }
 }
예제 #3
0
 public QueueViewerNode()
 {
     base.DisplayName = Strings.QueueViewer;
     base.Icon        = Icons.QueueViewerTool;
     base.ViewDescriptions.Add(ExchangeFormView.CreateViewDescription(typeof(QueueViewerResultPane)));
     base.EnabledStandardVerbs |= 64;
     base.HelpTopic             = HelpId.QueueViewerNode.ToString();
     if (WinformsHelper.IsRemoteEnabled())
     {
         base.RegisterConnectionToPSServerAction();
         return;
     }
     Globals.InitializeMultiPerfCounterInstance("EMC");
 }
예제 #4
0
        public ToolboxNode(bool isEdgeServerRoleOnly) : base(true)
        {
            ToolboxNode < > 4__this = this;
            base.DisplayName        = Strings.Toolbox;
            base.Icon      = Icons.Toolbox;
            base.HelpTopic = HelpId.ToolboxNode.ToString();
            base.ViewDescriptions.Add(ExchangeFormView.CreateViewDescription(typeof(ToolboxResultPane)));
            RefreshableComponent refreshableComponent = new RefreshableComponent();

            base.DataSource = refreshableComponent;
            refreshableComponent.DoRefreshWork += delegate(object sender, RefreshRequestEventArgs e)
            {
                DataList <Tool> dataList     = new DataList <Tool>();
                DataProvider    dataProvider = new RegistryDataProvider(Registry.LocalMachine, "SOFTWARE\\Microsoft\\ExchangeServer\\v15\\AdminTools\\Toolbox", ConfigurationContext.Setup.InstallPath);
                dataProvider.Query();
                for (int i = 0; i < dataProvider.Tools.Count; i++)
                {
                    Tool tool = dataProvider.Tools[i];
                    if (tool.Name != string.Empty && Tool.IsToolDuplicate(dataList, tool))
                    {
                        tool.ValidTool = false;
                        tool.AddErrorMessage(Strings.DuplicateTool(tool.DataSource));
                    }
                    else if (!isEdgeServerRoleOnly || !tool.NonEdgeTool)
                    {
                        dataList.Add(tool);
                    }
                }
                e.Result = dataList;
            };
            refreshableComponent.RefreshCompleted += delegate(object sender, RunWorkerCompletedEventArgs e)
            {
                if (e.Cancelled)
                {
                    return;
                }
                DataList <Tool> dataList = (DataList <Tool>)e.Result;
                this.ValidTools.Clear();
                DataList <Tool> dataList2 = new DataList <Tool>();
                for (int i = 0; i < dataList.Count; i++)
                {
                    if (dataList[i].ValidTool)
                    {
                        this.ValidTools.Add(dataList[i]);
                    }
                    else
                    {
                        dataList2.Add(dataList[i]);
                    }
                }
                if (dataList2.Count > 0)
                {
                    List <WorkUnit> list = new List <WorkUnit>();
                    for (int j = 0; j < dataList2.Count; j++)
                    {
                        WorkUnit workUnit = new WorkUnit();
                        workUnit.Text = dataList2[j].DataSource;
                        Exception ex = new Exception(dataList2[j].ErrorMessage);
                        workUnit.Errors.Add(new ErrorRecord(ex, LocalizedException.GenerateErrorCode(ex).ToString("X"), ErrorCategory.InvalidOperation, null));
                        workUnit.Status = WorkUnitStatus.Failed;
                        list.Add(workUnit);
                    }
                    UIService.ShowError(Strings.ErrorDialogMessage, string.Empty, list.ToArray(), base.ShellUI);
                }
            };
        }