예제 #1
0
        /// <summary>
        /// Edit the information about the specified cluster.  If null create a new cluster.
        /// </summary>
        /// <param name="clusterName">Cluster that is being edited.</param>
        /// <returns>The name of the edited cluster, or null if the operation is cancelled.</returns>
        private ClusterConfiguration EditCluster(string clusterName)
        {
            ClusterConfigEditor editor = new ClusterConfigEditor();

            if (clusterName != null)
            {
                var config = ClusterConfiguration.KnownClusterByName(clusterName);
                editor.SetConfigToEdit(config);
            }
            DialogResult res = editor.ShowDialog();
            if (res == System.Windows.Forms.DialogResult.OK)
            {
                var config = editor.GetConfiguration();
                return config;
            }

            return null;
        }
예제 #2
0
        /// <summary>
        /// Edit the information about the specified cluster.  If null create a new cluster.
        /// </summary>
        /// <param name="clusterName">Cluster that is being edited.</param>
        /// <returns>The name of the edited cluster, or null if the operation is cancelled.</returns>
        private ClusterConfiguration EditCluster(string clusterName)
        {
            ClusterConfigEditor editor = new ClusterConfigEditor();

            try
            {
                if (clusterName != null)
                {
                    var config = ClusterConfiguration.KnownClusterByName(clusterName);
                    editor.SetConfigToEdit(config);
                }
                else
                {
                    editor.SetConfigToEdit(null);
                }
            }
            catch (Exception)
            {
                // This can happen when the cluster serialization has changed
                // and we can no longer read the saved properties
                editor.SetConfigToEdit(null);
            }
            DialogResult res = editor.ShowDialog();
            if (res == System.Windows.Forms.DialogResult.OK)
            {
                var config = editor.GetConfiguration();
                return config;
            }

            return null;
        }