public WindowSdkMessageProcessingStep(
            IWriteToOutput iWriteToOutput
            , IOrganizationServiceExtented service
            , List <SdkMessageFilter> filters
            , SdkMessageProcessingStep step
            )
        {
            this.IncreaseInit();

            InputLanguageManager.SetInputLanguage(this, CultureInfo.CreateSpecificCulture("en-US"));

            this._iWriteToOutput = iWriteToOutput;
            this._service        = service;
            this._filters        = filters;

            this.Step = step;

            InitializeComponent();

            LoadFromConfig();

            tSSLblConnectionName.Content = _service.ConnectionData.Name;

            FillComboBoxMessages();

            LoadEntityStepProperties();

            this.DecreaseInit();

            FocusOnComboBoxTextBox(cmBMessageName);
        }
        public WindowSolutionSelect(
            IWriteToOutput outputWindow
            , IOrganizationServiceExtented service
            )
        {
            InitializeComponent();

            InputLanguageManager.SetInputLanguage(this, CultureInfo.CreateSpecificCulture("en-US"));

            this._service        = service;
            this._iWriteToOutput = outputWindow;

            this.tSSLblConnectionName.Content = this._service.ConnectionData.Name;

            BindingOperations.EnableCollectionSynchronization(service.ConnectionData.LastSelectedSolutionsUniqueName, _syncObject);

            this._itemsSource = new ObservableCollection <EntityViewItem>();

            this.lstVwSolutions.ItemsSource = _itemsSource;

            cmBFilter.DataContext = this._service.ConnectionData;

            FocusOnComboBoxTextBox(cmBFilter);

            if (_service != null)
            {
                ShowExistingSolutions(this._service.ConnectionData.LastSelectedSolutionsUniqueName.FirstOrDefault());
            }
        }
        public WindowPluginAssembly(
            IWriteToOutput iWriteToOutput
            , IOrganizationServiceExtented service
            , PluginAssembly pluginAssembly
            , string defaultOutputFilePath
            , EnvDTE.Project project
            ) : base(iWriteToOutput, service)
        {
            this.IncreaseInit();

            InitializeComponent();

            SetInputLanguageEnglish();

            this._defaultOutputFilePath = defaultOutputFilePath;
            this._project       = project;
            this.PluginAssembly = pluginAssembly;

            this._imagePluginAssembly   = this.Resources["ImagePluginAssembly"] as BitmapImage;
            this._imagePluginType       = this.Resources["ImagePluginType"] as BitmapImage;
            this._imageWorkflowActivity = this.Resources["ImageWorkflowActivity"] as BitmapImage;

            LoadFromConfig();

            this.trVPluginTreeNew.ItemsSource     = _listLocalAssembly;
            this.trVPluginTreeMissing.ItemsSource = _listMissingCrm;
            this.tSSLblConnectionName.Content     = _service.ConnectionData.Name;

            btnBuildProject.IsEnabled  = this._project != null;
            btnBuildProject.Visibility = btnBuildProject.IsEnabled ? Visibility.Visible : Visibility.Hidden;

            LoadEntityPluginAssemblyProperties();

            this.DecreaseInit();
        }
Beispiel #4
0
 protected WindowWithMessageFilters(
     IWriteToOutput iWriteToOutput
     , CommonConfiguration commonConfig
     , IOrganizationServiceExtented service
     ) : base(iWriteToOutput, commonConfig, service)
 {
 }
Beispiel #5
0
 protected WindowWithEntityMetadata(
     IWriteToOutput iWriteToOutput
     , CommonConfiguration commonConfig
     , ConnectionData connectionData
     ) : base(iWriteToOutput, commonConfig, connectionData)
 {
 }
        public WindowPluginConfigurationPluginTree(
            IWriteToOutput iWriteToOutput
            , CommonConfiguration commonConfig
            , ConnectionData connectionData
            , string filePath
            ) : base(iWriteToOutput, commonConfig, connectionData)
        {
            InitializeComponent();

            SetInputLanguageEnglish();

            LoadFromConfig();

            LoadImages();

            LoadConfiguration();

            txtBEntityName.SelectionLength = 0;
            txtBEntityName.SelectionStart  = txtBEntityName.Text.Length;

            txtBEntityName.Focus();

            cmBCurrentConnection.ItemsSource  = connectionData.ConnectionConfiguration.Connections;
            cmBCurrentConnection.SelectedItem = connectionData;

            if (!string.IsNullOrEmpty(filePath))
            {
                var task = LoadPluginConfiguration(filePath);
            }
        }
Beispiel #7
0
        public WindowSdkMessageProcessingStepImage(
            IWriteToOutput iWriteToOutput
            , IOrganizationServiceExtented service
            , SdkMessageProcessingStepImage image
            , string entityName
            , string messageName
            ) : base(iWriteToOutput, service)
        {
            this.IncreaseInit();

            InitializeComponent();

            SetInputLanguageEnglish();

            this._entityName  = entityName;
            this._messageName = messageName;
            this.Image        = image;

            tSSLblConnectionName.Content = _service.ConnectionData.Name;

            LoadEntityImageProperties();

            this.DecreaseInit();

            txtBName.Focus();
        }
        public WindowStatusSelect(
            IWriteToOutput iWriteToOutput
            , CommonConfiguration commonConfig
            , IOrganizationServiceExtented service
            , string entityName
            ) : base(iWriteToOutput, service)
        {
            IncreaseInit();

            InitializeComponent();

            SetInputLanguageEnglish();

            this.Name             = string.Format("WindowStatusSelect_{0}", entityName);
            lstVwStatusCodes.Name = string.Format("lstVwStatusCodes{0}", entityName);

            this._entityName   = entityName;
            this._commonConfig = commonConfig;

            this.tSSLblConnectionName.Content = this._service.ConnectionData.Name;

            lstVwStatusCodes.ItemsSource = _itemsSource;

            FillExplorersMenuItems();

            DecreaseInit();

            txtBFilter.SelectionStart  = txtBFilter.Text.Length;
            txtBFilter.SelectionLength = 0;
            txtBFilter.Focus();

            var task = RetrieveEntityInformation();
        }
Beispiel #9
0
        public WindowSdkMessageProcessingStepImage(
            IWriteToOutput iWriteToOutput
            , IOrganizationServiceExtented service
            , SdkMessageProcessingStepImage image
            , string entityName
            , string messageName
            )
        {
            this.IncreaseInit();

            InputLanguageManager.SetInputLanguage(this, CultureInfo.CreateSpecificCulture("en-US"));

            this._iWriteToOutput = iWriteToOutput;
            this._entityName     = entityName;
            this._messageName    = messageName;
            this._service        = service;
            this.Image           = image;

            InitializeComponent();

            tSSLblConnectionName.Content = _service.ConnectionData.Name;

            LoadEntityImageProperties();

            this.DecreaseInit();

            txtBName.Focus();
        }
 protected WindowWithEntityAndOtherPrivileges(
     IWriteToOutput iWriteToOutput
     , CommonConfiguration commonConfig
     , IOrganizationServiceExtented service
     ) : base(iWriteToOutput, commonConfig, service)
 {
 }
 protected WindowWithEntityAndOtherPrivileges(
     IWriteToOutput iWriteToOutput
     , CommonConfiguration commonConfig
     , ConnectionData connectionData
     ) : base(iWriteToOutput, commonConfig, connectionData)
 {
 }
        public WindowEntityBulkTransfer(
            IWriteToOutput iWriteToOutput
            , CommonConfiguration commonConfig
            , IOrganizationServiceExtented service
            , EntityMetadata entityMetadata
            , IEnumerable <Entity> entityCollection
            ) : base(iWriteToOutput, service)
        {
            IncreaseInit();

            InitializeComponent();

            SetInputLanguageEnglish();

            this.Name = string.Format("WindowEntityBulkTransfer_{0}", entityMetadata.LogicalName);

            _cacheEntityMetadata.Add(entityMetadata.LogicalName, entityMetadata);

            this._entityMetadata = entityMetadata;
            this._commonConfig   = commonConfig;

            this._entityCollection = new ReadOnlyCollection <Entity>(entityCollection.Where(i => i.Id != Guid.Empty).Distinct().ToList());

            this.tSSLblConnectionName.Content = this._service.ConnectionData.Name;

            FillExplorersMenuItems();

            DecreaseInit();

            this._attributeChecker = a => a.IsValidForUpdate.GetValueOrDefault();

            var task = RetrieveEntityInformation();
        }
        public WindowAttributeSelect(
            IWriteToOutput iWriteToOutput
            , IOrganizationServiceExtented service
            , Guid entityMetadataId
            , IEnumerable <AttributeMetadata> attributeList
            ) : base(iWriteToOutput, service)
        {
            this.IncreaseInit();

            InitializeComponent();

            SetInputLanguageEnglish();

            this._entityMetadataId = entityMetadataId;

            this.tSSLblConnectionName.Content = this._service.ConnectionData.Name;

            foreach (var attr in attributeList.Where(a => string.IsNullOrEmpty(a.AttributeOf)).OrderBy(a => a.LogicalName))
            {
                _source.Add(new AttributeSelectItem(attr));
            }

            foreach (var item in _source.OrderBy(a => a.LogicalName))
            {
                _sourceDataGrid.Add(item);
            }

            lstVwAttributes.ItemsSource = _sourceDataGrid;

            this.DecreaseInit();

            txtBFilter.SelectionStart  = txtBFilter.Text.Length;
            txtBFilter.SelectionLength = 0;
            txtBFilter.Focus();
        }
        public WindowCrmConnectionCard(IWriteToOutput iWriteToOutput, ConnectionData connectionData, ObservableCollection <ConnectionUserData> listUsers)
        {
            InitializeComponent();

            InputLanguageManager.SetInputLanguage(this, CultureInfo.CreateSpecificCulture("en-US"));

            this.ConnectionData  = connectionData;
            this._iWriteToOutput = iWriteToOutput;
            this._listUsers      = listUsers;

            if (this.ConnectionData == null)
            {
                this.ConnectionData = new ConnectionData();
            }

            if (this.ConnectionData.ConnectionId == Guid.Empty)
            {
                this.ConnectionData.ConnectionId = Guid.NewGuid();
            }

            RefreshUserList();

            LoadConnectionData(connectionData);

            txtBName.SelectionLength = 0;
            txtBName.SelectionStart  = txtBName.Text.Length;

            txtBName.Focus();
        }
        public WindowOrganizationComparerWebResources(
            IWriteToOutput iWriteToOutput
            , CommonConfiguration commonConfig
            , ConnectionData connection1
            , ConnectionData connection2
            , string filter
            ) : base(iWriteToOutput, commonConfig, connection1)
        {
            this.IncreaseInit();

            InitializeComponent();

            SetInputLanguageEnglish();

            var child = new ExportXmlOptionsControl(_commonConfig, XmlOptionsControls.WebResourceDependencyXmlOptions);

            child.CloseClicked += Child_CloseClicked;
            this._optionsPopup  = new Popup
            {
                Child = child,

                PlacementTarget = toolBarHeader,
                Placement       = PlacementMode.Bottom,
                StaysOpen       = false,
                Focusable       = true,
            };

            cmBType.ItemsSource = new EnumBindingSourceExtension(typeof(WebResource.Schema.OptionSets.webresourcetype?)).ProvideValue(null) as IEnumerable;

            this.Resources["ConnectionName1"] = connection1.Name;
            this.Resources["ConnectionName2"] = connection2.Name;

            LoadFromConfig();

            if (!string.IsNullOrEmpty(filter))
            {
                txtBFilter.Text = filter;
            }

            txtBFilter.SelectionLength = 0;
            txtBFilter.SelectionStart  = txtBFilter.Text.Length;

            txtBFilter.Focus();

            this._itemsSource = new ObservableCollection <EntityViewItem>();

            this.lstVwWebResources.ItemsSource = _itemsSource;

            cmBConnection1.ItemsSource  = connection1.ConnectionConfiguration.Connections;
            cmBConnection1.SelectedItem = connection1;

            cmBConnection2.ItemsSource  = connection1.ConnectionConfiguration.Connections;
            cmBConnection2.SelectedItem = connection2;

            FillExplorersMenuItems();

            this.DecreaseInit();

            var task = ShowExistingWebResources();
        }
Beispiel #16
0
        public WindowExplorerApplicationRibbon(
            IWriteToOutput iWriteToOutput
            , CommonConfiguration commonConfig
            , IOrganizationServiceExtented service
            ) : base(iWriteToOutput, commonConfig, service)
        {
            this.IncreaseInit();

            InitializeComponent();

            SetInputLanguageEnglish();

            var child = new ExportXmlOptionsControl(_commonConfig, XmlOptionsControls.RibbonXmlOptions);

            child.CloseClicked += Child_CloseClicked;
            this._optionsPopup  = new Popup
            {
                Child = child,

                PlacementTarget = toolBarHeader,
                Placement       = PlacementMode.Bottom,
                StaysOpen       = false,
                Focusable       = true,
            };

            LoadFromConfig();

            cmBCurrentConnection.ItemsSource  = service.ConnectionData.ConnectionConfiguration.Connections;
            cmBCurrentConnection.SelectedItem = service.ConnectionData;

            FillExplorersMenuItems();

            this.DecreaseInit();
        }
Beispiel #17
0
        public WindowEntitySelect(
            IWriteToOutput outputWindow
            , ConnectionData connectionData
            , string entityName
            , IEnumerable <DataGridColumn> columns
            )
        {
            InitializeComponent();

            InputLanguageManager.SetInputLanguage(this, CultureInfo.CreateSpecificCulture("en-US"));

            this.Name          = string.Format("WindowEntitySelect_{0}", entityName);
            lstVwEntities.Name = string.Format("lstVwEntities{0}", entityName);

            this._entityName     = entityName;
            this._connectionData = connectionData;
            this._iWriteToOutput = outputWindow;

            foreach (var column in columns)
            {
                lstVwEntities.Columns.Add(column);
            }

            this.tSSLblConnectionName.Content = this._connectionData.Name;

            txtBFilterEnitity.SelectionStart  = txtBFilterEnitity.Text.Length;
            txtBFilterEnitity.SelectionLength = 0;
            txtBFilterEnitity.Focus();
        }
        public WindowPluginConfigurationPluginType(
            IWriteToOutput iWriteToOutput
            , CommonConfiguration commonConfig
            , string filePath
            )
        {
            InitializeComponent();

            InputLanguageManager.SetInputLanguage(this, CultureInfo.CreateSpecificCulture("en-US"));

            this._iWriteToOutput = iWriteToOutput;
            this._commonConfig   = commonConfig;


            LoadFromConfig();

            txtBFilter.SelectionLength = 0;
            txtBFilter.SelectionStart  = txtBFilter.Text.Length;

            txtBFilter.Focus();

            this._itemsSource = new ObservableCollection <PluginTypeFullInfo>();

            this.lstVwPluginTypes.ItemsSource = _itemsSource;

            if (!string.IsNullOrEmpty(filePath))
            {
                LoadPluginConfiguration(filePath);
            }
        }
Beispiel #19
0
        public WindowCrmConnectionList(IWriteToOutput iWriteToOutput, ConnectionConfiguration crmConfig, bool currentConnectionChoosing = false)
        {
            this._crmConfig                 = crmConfig;
            this._iWriteToOutput            = iWriteToOutput;
            this._currentConnectionChoosing = currentConnectionChoosing;

            BindingOperations.EnableCollectionSynchronization(this._crmConfig.Connections, sysObjectConnections);
            BindingOperations.EnableCollectionSynchronization(this._crmConfig.ArchiveConnections, sysObjectArchiveConnections);
            BindingOperations.EnableCollectionSynchronization(this._crmConfig.Users, sysObjectUsers);

            InitializeComponent();

            InputLanguageManager.SetInputLanguage(this, CultureInfo.CreateSpecificCulture("en-US"));

            var commonConfig = CommonConfiguration.Get();

            WindowCrmConnectionHandler.InitializeConnectionMenuItems(miConnection, this._iWriteToOutput, commonConfig, GetSelectedConnection);

            lstVwConnections.ItemsSource = this._crmConfig.Connections;

            lstVwArchiveConnections.ItemsSource = this._crmConfig.ArchiveConnections;

            lstVwUsers.ItemsSource = this._crmConfig.Users;

            lstVwOrganizations.ItemsSource = this._itemsSource = new ObservableCollection <OrganizationDetailViewItem>();

            UpdateCurrentConnectionInfo();

            LoadConfiguration();

            UpdateButtonsConnection();
            UpdateButtonsConnectionArchive();
            UpdateButtonsUsers();
            UpdateButtonsDiscoveryOrganization();
        }
        public WindowStatusSelect(
            IWriteToOutput outputWindow
            , IOrganizationServiceExtented service
            , CommonConfiguration commonConfig
            , string entityName
            )
        {
            IncreaseInit();

            InitializeComponent();

            InputLanguageManager.SetInputLanguage(this, CultureInfo.CreateSpecificCulture("en-US"));

            this.Name             = string.Format("WindowStatusSelect_{0}", entityName);
            lstVwStatusCodes.Name = string.Format("lstVwStatusCodes{0}", entityName);

            this._iWriteToOutput = outputWindow;
            this._service        = service;
            this._commonConfig   = commonConfig;
            this._entityName     = entityName;

            this.tSSLblConnectionName.Content = this._service.ConnectionData.Name;

            lstVwStatusCodes.ItemsSource = _itemsSource;

            DecreaseInit();

            txtBFilter.SelectionStart  = txtBFilter.Text.Length;
            txtBFilter.SelectionLength = 0;
            txtBFilter.Focus();

            RetrieveEntityInformation();
        }
        public WindowTraceReader(
            IWriteToOutput iWriteToOutput
            , CommonConfiguration commonConfig
            , IOrganizationServiceExtented service
            ) : base(iWriteToOutput, commonConfig, service)
        {
            this.IncreaseInit();

            InitializeComponent();

            SetInputLanguageEnglish();

            BindCollections(service.ConnectionData);

            LoadFromConfig();

            dPFileDate.SelectedDate = DateTime.Today.AddDays(-1);

            this._itemsSource = new ObservableCollection <TraceRecord>();

            BindingOperations.EnableCollectionSynchronization(_itemsSource, sysObjectTraceList);

            this.lstVwTraceRecords.ItemsSource = _itemsSource;

            cmBCurrentConnection.ItemsSource  = service.ConnectionData.ConnectionConfiguration.Connections;
            cmBCurrentConnection.SelectedItem = service.ConnectionData;

            this.DecreaseInit();

            FocusOnComboBoxTextBox(cmBFilter);

            var task = OpenFilesInFoldersAsync();
        }
        public WindowPluginConfigurationPluginTree(
            IWriteToOutput iWriteToOutput
            , ConnectionData connectionData
            , CommonConfiguration commonConfig
            , string filePath
            )
        {
            InputLanguageManager.SetInputLanguage(this, CultureInfo.CreateSpecificCulture("en-US"));

            this._iWriteToOutput = iWriteToOutput;
            this._commonConfig   = commonConfig;

            BindingOperations.EnableCollectionSynchronization(connectionData.ConnectionConfiguration.Connections, sysObjectConnections);

            InitializeComponent();

            LoadFromConfig();

            LoadImages();

            LoadConfiguration();

            txtBEntityName.SelectionLength = 0;
            txtBEntityName.SelectionStart  = txtBEntityName.Text.Length;

            txtBEntityName.Focus();

            cmBCurrentConnection.ItemsSource  = connectionData.ConnectionConfiguration.Connections;
            cmBCurrentConnection.SelectedItem = connectionData;

            if (!string.IsNullOrEmpty(filePath))
            {
                LoadPluginConfiguration(filePath);
            }
        }
Beispiel #23
0
 protected WindowWithEntityMetadata(
     IWriteToOutput iWriteToOutput
     , CommonConfiguration commonConfig
     , IOrganizationServiceExtented service
     ) : base(iWriteToOutput, commonConfig, service)
 {
 }
 protected WindowWithSolutionComponentDescriptor(
     IWriteToOutput iWriteToOutput
     , CommonConfiguration commonConfig
     , IOrganizationServiceExtented service
     ) : base(iWriteToOutput, commonConfig, service)
 {
 }
 public CompareWindowsHelper(
     IWriteToOutput iWriteToOutput
     , CommonConfiguration commonConfig
     , Func <Tuple <ConnectionData, ConnectionData> > getConnections
     , Func <string> getEntityName                  = null
     , Func <string> getGlobalOptionSetName         = null
     , Func <string> getWorkflowName                = null
     , Func <string> getSystemFormName              = null
     , Func <string> getSavedQueryName              = null
     , Func <string> getSavedQueryVisualizationName = null
     , Func <string> getSiteMapName                 = null
     , Func <string> getReportName                  = null
     , Func <string> getWebResourceName             = null
     , Func <string> getPluginAssemblyName          = null
     , Func <string> getRoleName = null
     ) : base(iWriteToOutput, commonConfig
              , getEntityName
              , getGlobalOptionSetName
              , getWorkflowName
              , getSystemFormName
              , getSavedQueryName
              , getSavedQueryVisualizationName
              , getSiteMapName
              , getReportName
              , getWebResourceName
              , getPluginAssemblyName
              , getRoleName
              )
 {
     this.GetConnections = getConnections;
 }
 protected WindowWithSolutionComponentDescriptor(
     IWriteToOutput iWriteToOutput
     , CommonConfiguration commonConfig
     , ConnectionData connectionData
     ) : base(iWriteToOutput, commonConfig, connectionData)
 {
 }
Beispiel #27
0
 protected BaseExplorersHelper(
     IWriteToOutput iWriteToOutput
     , CommonConfiguration commonConfig
     , Func <string> getEntityName
     , Func <string> getGlobalOptionSetName
     , Func <string> getWorkflowName
     , Func <string> getSystemFormName
     , Func <string> getSavedQueryName
     , Func <string> getSavedQueryVisualizationName
     , Func <string> getSiteMapName
     , Func <string> getReportName
     , Func <string> getWebResourceName
     , Func <string> getPluginAssemblyName
     , Func <string> getRoleName
     )
 {
     this._iWriteToOutput                 = iWriteToOutput;
     this._commonConfig                   = commonConfig;
     this._getEntityName                  = getEntityName;
     this._getGlobalOptionSetName         = getGlobalOptionSetName;
     this._getWorkflowName                = getWorkflowName;
     this._getSystemFormName              = getSystemFormName;
     this._getSavedQueryName              = getSavedQueryName;
     this._getSavedQueryVisualizationName = getSavedQueryVisualizationName;
     this._getSiteMapName                 = getSiteMapName;
     this._getReportName                  = getReportName;
     this._getWebResourceName             = getWebResourceName;
     this._getPluginAssemblyName          = getPluginAssemblyName;
     this._getRoleName = getRoleName;
 }
Beispiel #28
0
        public CreateGlobalOptionSetsFileCSharpHandler(
            TextWriter writer
            , IOrganizationServiceExtented service
            , IWriteToOutput iWriteToOutput
            , CreateFileCSharpConfiguration config
            ) : base(writer, config.TabSpacer, config.AllDescriptions)
        {
            this._service        = service ?? throw new ArgumentNullException(nameof(service));
            this._iWriteToOutput = iWriteToOutput ?? throw new ArgumentNullException(nameof(iWriteToOutput));

            this._config = config;

            this._descriptor = new SolutionComponentDescriptor(_service)
            {
                WithManagedInfo = config.WithManagedInfo,
            };

            this._dependencyRepository = new DependencyRepository(this._service);
            this._descriptorHandler    = new DependencyDescriptionHandler(this._descriptor);
            this._repositoryStringMap  = new StringMapRepository(_service);

            if (config.ConstantType == ConstantType.ReadOnlyField)
            {
                _fieldHeader = "static readonly";
            }
            else
            {
                _fieldHeader = "const";
            }
        }
Beispiel #29
0
        public WindowPluginConfigurationComparerPluginAssembly(
            IWriteToOutput iWriteToOutput
            , CommonConfiguration commonConfig
            , string filePath
            )
        {
            InitializeComponent();

            SetInputLanguageEnglish();

            this._iWriteToOutput = iWriteToOutput;

            this._commonConfig = commonConfig;

            LoadFromConfig();

            txtBFilter.SelectionLength = 0;
            txtBFilter.SelectionStart  = txtBFilter.Text.Length;

            txtBFilter.Focus();

            this._itemsSource = new ObservableCollection <EntityViewItem>();

            this.lstVwPluginAssemblies.ItemsSource = _itemsSource;

            if (!string.IsNullOrEmpty(filePath))
            {
                var task = LoadPluginConfiguration(filePath, SetPluginConfig1, txtBFilePath1);
            }
        }
        protected static string GetPluginConfigurationFilePath(IWriteToOutput iWriteToOutput)
        {
            string selectedPath = string.Empty;

            var thread = new Thread(() =>
            {
                try
                {
                    var openFileDialog1 = new Microsoft.Win32.OpenFileDialog
                    {
                        Filter           = "Plugin Configuration (.xml)|*.xml",
                        FilterIndex      = 1,
                        RestoreDirectory = true
                    };

                    if (openFileDialog1.ShowDialog().GetValueOrDefault())
                    {
                        selectedPath = openFileDialog1.FileName;
                    }
                }
                catch (Exception ex)
                {
                    iWriteToOutput.WriteErrorToOutput(null, ex);
                }
            });

            thread.SetApartmentState(ApartmentState.STA);
            thread.Start();

            thread.Join();

            return(selectedPath);
        }