Ejemplo n.º 1
0
        private bool EditStringMapping(string name, LipSyncMapData newMapping)
        {
            bool             retVal   = false;
            bool             doRemove = true;
            LipSyncMapEditor editor   = new LipSyncMapEditor(newMapping);

            editor.LibraryMappingName = name;

            if (editor.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if ((name.Equals(editor.LibraryMappingName) == false) &&
                    (this.Contains(editor.LibraryMappingName) == true))
                {
                    DialogResult dr =
                        MessageBox.Show("Overwrite existing " +
                                        editor.LibraryMappingName + " mapping?",
                                        "Map exists",
                                        MessageBoxButtons.YesNo);

                    doRemove = (dr == DialogResult.Yes) ? true : false;
                }

                if (doRemove == true)
                {
                    RemoveMapping(name);
                }

                AddMapping(!doRemove, editor.LibraryMappingName, editor.MapData, false);
                retVal = true;
            }

            return(retVal);
        }
Ejemplo n.º 2
0
        private bool EditStringMapping(string name, LipSyncMapData newMapping)
        {
            bool             retVal   = false;
            bool             doRemove = true;
            LipSyncMapEditor editor   = new LipSyncMapEditor(newMapping);

            editor.LibraryMappingName = name;

            if (editor.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if ((name.Equals(editor.LibraryMappingName) == false) &&
                    (this.Contains(editor.LibraryMappingName) == true))
                {
                    //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
                    MessageBoxForm.msgIcon = SystemIcons.Question;                     //this is used if you want to add a system icon to the message form.
                    var messageBox = new MessageBoxForm("Overwrite existing " +
                                                        editor.LibraryMappingName + " mapping?",
                                                        "Map exists", true, false);
                    messageBox.ShowDialog();

                    doRemove = (messageBox.DialogResult == DialogResult.OK) ? true : false;
                }

                if (doRemove == true)
                {
                    RemoveMapping(name);
                }

                AddMapping(!doRemove, editor.LibraryMappingName, editor.MapData, false);
                retVal = true;
            }

            return(retVal);
        }