Ejemplo n.º 1
0
 private void CopyTechnicalDetails()
 {
     using (new ControlWaitCursor(this))
     {
         WinformsHelper.SetDataObjectToClipboard(this.TechnicalDetails, true);
     }
 }
Ejemplo n.º 2
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());
        }
Ejemplo n.º 3
0
        public static bool IsEmptyValue(object propertyValue)
        {
            bool result = false;

            if (propertyValue == null)
            {
                result = true;
            }
            else if (DBNull.Value.Equals(propertyValue))
            {
                result = true;
            }
            else if (propertyValue is IEnumerable && WinformsHelper.IsEmptyCollection(propertyValue as IEnumerable))
            {
                result = true;
            }
            else if (propertyValue is Guid && Guid.Empty.Equals(propertyValue))
            {
                result = true;
            }
            else if (string.IsNullOrEmpty(propertyValue.ToString()))
            {
                result = true;
            }
            return(result);
        }
Ejemplo n.º 4
0
        public static FilteredDataTableLoaderView SetFilteredDataSource(ObjectList objectList, UIPresentationProfile uiPresentationProfile, DataTableLoader dataTableLoader)
        {
            FilteredDataTableLoaderView filteredDataTableLoaderView = (dataTableLoader == null) ? null : FilteredDataTableLoaderView.Create(dataTableLoader);

            WinformsHelper.SetDataSource(objectList, uiPresentationProfile, filteredDataTableLoaderView);
            return(filteredDataTableLoaderView);
        }
Ejemplo n.º 5
0
 public static void SetDataSource(ObjectList objectList, UIPresentationProfile uiPresentationProfile, DataTableLoaderView dataTableLoaderView)
 {
     if (objectList == null)
     {
         throw new ArgumentNullException("objectList");
     }
     if (!WinformsHelper.CheckDataSource(objectList.DataSource))
     {
         throw new ArgumentException("objectList");
     }
     if (objectList.DataSource != null)
     {
         DataTableLoaderView dataTableLoaderView2 = (objectList.DataSource as AdvancedBindingSource).DataSource as DataTableLoaderView;
         objectList.DataSource = null;
         if (dataTableLoaderView2 != null)
         {
             dataTableLoaderView2.Dispose();
         }
     }
     if (dataTableLoaderView != null)
     {
         WinformsHelper.SyncSortSupportDescriptions(objectList.ListView, uiPresentationProfile, dataTableLoaderView);
         objectList.DataSource = new AdvancedBindingSource
         {
             DataSource = dataTableLoaderView
         };
     }
 }
        private SelectionCommandVisibilityBindingUtil.PropertyStatus GetPropertyStatus()
        {
            SelectionCommandVisibilityBindingUtil.PropertyStatus result = SelectionCommandVisibilityBindingUtil.PropertyStatus.None;
            IEnumerator enumerator = this.DataListViewResultPane.SelectedObjects.GetEnumerator();

            if (enumerator.MoveNext())
            {
                PropertyDescriptor propertyDescriptor = TypeDescriptor.GetProperties(enumerator.Current)[this.PropertyName];
                if (propertyDescriptor != null)
                {
                    object propertyValue = WinformsHelper.GetPropertyValue(enumerator.Current, propertyDescriptor);
                    result = (object.Equals(propertyValue, this.TrueValue) ? SelectionCommandVisibilityBindingUtil.PropertyStatus.True : SelectionCommandVisibilityBindingUtil.PropertyStatus.False);
                    while (enumerator.MoveNext())
                    {
                        object component      = enumerator.Current;
                        object propertyValue2 = WinformsHelper.GetPropertyValue(component, propertyDescriptor);
                        if (!object.Equals(propertyValue, propertyValue2))
                        {
                            result = SelectionCommandVisibilityBindingUtil.PropertyStatus.None;
                            break;
                        }
                    }
                }
            }
            return(result);
        }
Ejemplo n.º 7
0
        public static DataTableLoaderView SetDataSource(DataListView dataListView, UIPresentationProfile uiPresentationProfile, DataTableLoader dataTableLoader)
        {
            DataTableLoaderView dataTableLoaderView = (dataTableLoader == null) ? null : DataTableLoaderView.Create(dataTableLoader);

            WinformsHelper.SetDataSource(dataListView, uiPresentationProfile, dataTableLoaderView);
            return(dataTableLoaderView);
        }
 private void ExportListCommand_Execute(object sender, EventArgs e)
 {
     if (this.ListControl != null)
     {
         WinformsHelper.ShowExportDialog(this, this.ListControl, base.ShellUI);
     }
 }
Ejemplo n.º 9
0
 public override void UpdateWorkUnits(DataRow row)
 {
     this.DataHandler.UpdateWorkUnits();
     if (!string.IsNullOrEmpty(base.WorkUnitTextColumn))
     {
         this.DataHandler.WorkUnit.Text = row[base.WorkUnitTextColumn].ToString();
     }
     else if (!string.IsNullOrEmpty(this.CommandTextLambdaExpression))
     {
         this.DataHandler.WorkUnit.Text = this.DataHandler.CommandText;
     }
     if (string.IsNullOrEmpty(this.WorkUnitDescriptionColumn))
     {
         this.DataHandler.WorkUnit.Description = this.workUnitDescription;
     }
     else
     {
         this.DataHandler.WorkUnit.Description = row[this.WorkUnitDescriptionColumn].ToString();
     }
     if (!string.IsNullOrEmpty(base.WorkUnitIconColumn))
     {
         this.DataHandler.WorkUnit.Icon = WinformsHelper.GetIconFromIconLibrary(row[base.WorkUnitIconColumn].ToString());
     }
     this.DataHandler.ResetCancel();
 }
Ejemplo n.º 10
0
 private void CopyContentToClipBoard()
 {
     using (new ControlWaitCursor(this))
     {
         WinformsHelper.SetDataObjectToClipboard(this.GetContent(), true);
     }
 }
Ejemplo n.º 11
0
        public static IList GetRemovedFederatedDomains(object originalAccountNS, object accountNS, object federatedDomains)
        {
            SmtpDomain smtpDomain = originalAccountNS as SmtpDomain;
            SmtpDomain objB       = accountNS as SmtpDomain;
            MultiValuedProperty <FederatedDomain> multiValuedProperty = federatedDomains as MultiValuedProperty <FederatedDomain>;
            List <SmtpDomain> list = new List <SmtpDomain>();

            if (multiValuedProperty != null && smtpDomain != null)
            {
                foreach (FederatedDomain federatedDomain in multiValuedProperty.Removed)
                {
                    if (!federatedDomain.Domain.Equals(smtpDomain))
                    {
                        list.Add(federatedDomain.Domain);
                    }
                }
                if (!object.Equals(smtpDomain, objB))
                {
                    foreach (FederatedDomain federatedDomain2 in multiValuedProperty)
                    {
                        if (!federatedDomain2.Domain.Equals(smtpDomain) && !WinformsHelper.FederatedDomainsContains(multiValuedProperty.Added, federatedDomain2.Domain))
                        {
                            list.Add(federatedDomain2.Domain);
                        }
                    }
                    list.Add(smtpDomain);
                }
            }
            return(list.ToArray());
        }
Ejemplo n.º 12
0
 public static bool IsIDCRLNotReady()
 {
     if (WinformsHelper.IsWin7OrLater())
     {
         string keyPath = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSOIdentityCRL";
         return(null == WinformsHelper.GetRegistryKeyValue(keyPath, "MSOIDCRLVersion"));
     }
     return(false);
 }
Ejemplo n.º 13
0
 protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
 {
     if (keyData == (Keys)131139)
     {
         WinformsHelper.SetDataObjectToClipboard(this.Content, true);
         return(true);
     }
     return(base.ProcessCmdKey(ref msg, keyData));
 }
Ejemplo n.º 14
0
 protected override void OnProfileUpdated()
 {
     base.OnProfileUpdated();
     if (base.ResultPane != null && base.Command != null && WinformsHelper.IsCurrentOrganizationAllowed(base.OrganizationTypes))
     {
         base.ResultPane.SelectionChanged += this.ResultPane_SelectionChanged;
         this.ResultPane_SelectionChanged(base.ResultPane, EventArgs.Empty);
     }
 }
Ejemplo n.º 15
0
        public override List <string> Validate(object target, PageConfigurableProfile profile)
        {
            List <string> list = new List <string>();

            if (WinformsHelper.IsEmptyValue(target))
            {
                list.Add("cannot be null or empty");
            }
            return(list);
        }
Ejemplo n.º 16
0
 public override void UpdateWorkUnits(DataRow row)
 {
     if (!string.IsNullOrEmpty(base.WorkUnitTextColumn))
     {
         this.workUnit.Text = row[base.WorkUnitTextColumn].ToString();
     }
     if (!string.IsNullOrEmpty(base.WorkUnitIconColumn))
     {
         this.workUnit.Icon = WinformsHelper.GetIconFromIconLibrary(row[base.WorkUnitIconColumn].ToString());
     }
 }
Ejemplo n.º 17
0
        public static bool IsValidRegKey(string path)
        {
            bool        result      = false;
            RegistryKey registryKey = WinformsHelper.GetRegistryKey(Registry.LocalMachine, path);

            if (registryKey != null)
            {
                result = true;
                registryKey.Close();
            }
            return(result);
        }
Ejemplo n.º 18
0
        public static bool IsMailToShellCommandAvailable()
        {
            bool        result      = false;
            RegistryKey registryKey = WinformsHelper.GetRegistryKey(Registry.ClassesRoot, "mailto");

            if (registryKey != null)
            {
                result = (registryKey.GetValue("URL Protocol", null) != null);
                registryKey.Close();
            }
            return(result);
        }
Ejemplo n.º 19
0
        public IList <ParameterProfile> GetEffectiveParameters()
        {
            IList <ParameterProfile> list = new List <ParameterProfile>();

            foreach (ParameterProfile parameterProfile in this.ParameterProfileList)
            {
                if (WinformsHelper.IsCurrentOrganizationAllowed(parameterProfile.OrganizationTypes))
                {
                    list.Add(parameterProfile);
                }
            }
            return(list);
        }
Ejemplo n.º 20
0
 private void PrepareMenuStripItems()
 {
     this.exportListCommand.Execute += delegate(object param0, EventArgs param1)
     {
         WinformsHelper.ShowExportDialog(this, this.resultListView, base.ShellUI);
     };
     this.closeToolStripMenuItem.Click += delegate(object param0, EventArgs param1)
     {
         base.Close();
     };
     this.switchCommandLoggingToolStripMenuItem.Click += delegate(object param0, EventArgs param1)
     {
         if (CommandLoggingSession.GetInstance().CommandLoggingEnabled)
         {
             CommandLoggingSession.GetInstance().CommandLoggingEnabled = false;
             if (CommandLoggingDialog.GlobalSettings != null)
             {
                 CommandLoggingDialog.GlobalSettings.IsCommandLoggingEnabled = false;
             }
             CommandLoggingDialog.StartDateTime = string.Empty;
             this.startLoggingDate.Text         = Strings.CommandLoggingStopped;
             this.switchCommandLoggingToolStripMenuItem.Text = Strings.StartCommandLogging;
             return;
         }
         CommandLoggingSession.GetInstance().CommandLoggingEnabled = true;
         if (CommandLoggingDialog.GlobalSettings != null)
         {
             CommandLoggingDialog.GlobalSettings.IsCommandLoggingEnabled = true;
         }
         CommandLoggingDialog.StartDateTime = ((DateTime)ExDateTime.Now).ToString();
         this.startLoggingDate.Text         = Strings.StartLoggingDate(CommandLoggingDialog.StartDateTime);
         this.switchCommandLoggingToolStripMenuItem.Text = Strings.StopCommandLogging;
     };
     this.clearLogToolStripMenuItem.Click += delegate(object param0, EventArgs param1)
     {
         if (base.ShellUI.ShowMessage(Strings.ConfirmClearText, UIService.DefaultCaption, MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             CommandLoggingSession.GetInstance().Clear();
         }
     };
     this.copyCommandsToolStripMenuItem.Click += delegate(object param0, EventArgs param1)
     {
         StringBuilder stringBuilder = new StringBuilder();
         foreach (object obj in this.resultListView.SelectedObjects)
         {
             DataRowView row = (DataRowView)obj;
             stringBuilder.AppendLine(this.RetrieveValueFromRow(row, CommandLoggingSession.command));
         }
         Clipboard.SetText(stringBuilder.ToString());
     };
 }
Ejemplo n.º 21
0
        public bool OverrideCorruptedValuesWithDefault()
        {
            bool flag = false;

            foreach (string key in this.store.Keys)
            {
                ADObject adobject = this.store[key].DataObject as ADObject;
                if (adobject != null)
                {
                    flag |= WinformsHelper.OverrideCorruptedValuesWithDefault(adobject);
                }
            }
            return(flag);
        }
Ejemplo n.º 22
0
        internal static string GetCurrentConnectedServerName()
        {
            string result = string.Empty;

            if (WinformsHelper.IsRemoteEnabled())
            {
                result = PSConnectionInfoSingleton.GetInstance().ServerName;
            }
            else
            {
                result = EnvironmentAnalyzer.GetLocalServerName();
            }
            return(result);
        }
Ejemplo n.º 23
0
        public virtual UITypeEditor CreateEditor(PropertyDescriptor property)
        {
            UITypeEditor result = null;

            if (this.Type2UIEditor != null && property != null)
            {
                Type nullableTypeArgument = WinformsHelper.GetNullableTypeArgument(property.PropertyType);
                Type type = this.Type2UIEditor[nullableTypeArgument] as Type;
                if (typeof(UITypeEditor).IsAssignableFrom(type))
                {
                    result = (Activator.CreateInstance(type) as UITypeEditor);
                }
            }
            return(result);
        }
Ejemplo n.º 24
0
        public ObjectSchemaLoader(DataDrivenCategory dataDrivenCategory, string xPath, string schema)
        {
            Stream          manifestResource = WinformsHelper.GetManifestResource(dataDrivenCategory);
            SafeXmlDocument safeXmlDocument  = new SafeXmlDocument();

            safeXmlDocument.Load(manifestResource);
            foreach (object obj in safeXmlDocument.SelectNodes(xPath))
            {
                XmlNode xmlNode   = (XmlNode)obj;
                XmlNode namedItem = xmlNode.Attributes.GetNamedItem("Name");
                if (namedItem.Value.Equals(schema))
                {
                    this.objectDefinition = xmlNode;
                    break;
                }
            }
        }
Ejemplo n.º 25
0
        internal static void ShowNonFileUrl(object sender, LinkLabelLinkClickedEventArgs e)
        {
            string uriString = e.Link.LinkData as string;

            try
            {
                Uri uri = new Uri(uriString);
                if (uri.IsFile)
                {
                    throw new InvalidOperationException(Strings.NonFileUrlError);
                }
                WinformsHelper.OpenUrl(uri);
            }
            catch (UriFormatException)
            {
            }
        }
 protected override void Dispose(bool disposing)
 {
     base.Dispose(disposing);
     if (disposing)
     {
         if (this.ObjectList != null)
         {
             WinformsHelper.SetDataSource(this.ObjectList, null, null);
         }
         else if (this.ListControl != null)
         {
             WinformsHelper.SetDataSource(this.ListControl, null, null);
         }
         this.FilterControl = null;
         this.ListControl   = null;
     }
 }
Ejemplo n.º 27
0
 protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
 {
     if ((Keys)131139 == keyData)
     {
         TridentsWizardPage tridentsWizardPage = this.CurrentPage as TridentsWizardPage;
         if (tridentsWizardPage != null)
         {
             WinformsHelper.SetDataObjectToClipboard(tridentsWizardPage.GetSummaryText(), false);
             return(true);
         }
     }
     if ((Keys)262259 == keyData)
     {
         this.Cancel();
         return(true);
     }
     return(base.ProcessCmdKey(ref msg, keyData));
 }
 protected override void OnSetActive(EventArgs e)
 {
     if (this.RefreshableDataSource == null && base.ResultsLoaderProfile != null)
     {
         this.RefreshableDataSource = new DataTableLoader(base.ResultsLoaderProfile);
     }
     if (base.DataTableLoader != null && this.ListControl.DataSource == null)
     {
         if (this.ObjectList != null)
         {
             WinformsHelper.SetDataSource(this.ObjectList, (base.ResultsLoaderProfile == null) ? null : base.ResultsLoaderProfile.UIPresentationProfile, base.DataTableLoader);
         }
         else if (this.ListControl != null)
         {
             WinformsHelper.SetDataSource(this.ListControl, (base.ResultsLoaderProfile == null) ? null : base.ResultsLoaderProfile.UIPresentationProfile, base.DataTableLoader);
         }
     }
     base.OnSetActive(e);
 }
Ejemplo n.º 29
0
        public virtual ValidationError[] Validate()
        {
            List <ValidationError> list = new List <ValidationError>();

            if (this.Used)
            {
                PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(this.DataSource);
                foreach (string text in this.EditingProperties.Keys)
                {
                    PropertyDescriptor propertyDescriptor = properties[text];
                    object             propertyValue      = (propertyDescriptor != null) ? propertyDescriptor.GetValue(this.DataSource) : null;
                    if (WinformsHelper.IsEmptyValue(propertyValue))
                    {
                        list.Add(new StrongTypeValidationError(Strings.InvalidPhraseValues(text), text));
                    }
                }
            }
            return(list.ToArray());
        }
 protected override void OnCancel(CancelEventArgs e)
 {
     base.OnCancel(e);
     if (!e.Cancel && this.worker.IsBusy)
     {
         this.closeOnFinish = this.scenario.CloseWizardIfCancelled;
         if (base.CanCancel)
         {
             base.CanCancel = false;
             if (base.DataHandler != null)
             {
                 WinformsHelper.InvokeAsync(delegate
                 {
                     base.DataHandler.Cancel();
                 }, this);
             }
         }
         e.Cancel = (this.worker.IsBusy || !this.closeOnFinish);
     }
 }