Ejemplo n.º 1
0
        private void DataReplace(String newDataFilename)
        {
            if (CurrentData == null)
            {
                throw new InvalidOperationException("There is no current ResourceData.");
            }

            var form = new ReplaceResourceForm();

            form.InitialResource = CurrentData;
            form.PopulatePath(newDataFilename);

            if (form.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            var newData = form.ReplacementResource;

            if (newData != null)
            {
                var lang = CurrentData.Lang;
                lang.SwapData(newData);
            }
        }
Ejemplo n.º 2
0
        /// <summary>Replaces the current ResourceData in the ResourceSource with the provided ResourceData.</summary>
        private void DataReplace()
        {
            if (CurrentData == null)
            {
                throw new InvalidOperationException("There is no current ResourceData.");
            }

            ReplaceResourceForm form = new ReplaceResourceForm();

            form.InitialResource = CurrentData;

            if (form.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            ResourceData newData = form.ReplacementResource;

            if (newData != null)
            {
                ResourceLang lang = CurrentData.Lang;
                lang.SwapData(newData);
            }
        }