Message() публичный статический Метод

public static Message ( object &data, string htmlContent, MessageImg imageType, string title, string subTitle, List buttonsList = null, bool waitResponse = true, Action clickHandler = null, int minWidth = 450 ) : int
data object
htmlContent string
imageType MessageImg
title string
subTitle string
buttonsList List
waitResponse bool
clickHandler Action
minWidth int
Результат int
Пример #1
0
 private static void DoFetch(ConfLine conf)
 {
     if (!string.IsNullOrEmpty(conf.DistantPath))
     {
         var answ = (_dontWarnFetch || _silentUpdate) ? 0 : UserCommunication.Message("This will <b>replace your local</b> configuration with the distant one.<br><br>Do you wish to continue?", MessageImg.MsgInfo, "Fetch", "Confirmation", new List <string> {
             "Yes I do", "Yes don't ask again", "No, Cancel"
         }, true);
         if (answ == 0 || answ == 1)
         {
             if (answ == 1)
             {
                 _dontWarnFetch = true;
             }
             if (conf.IsDir)
             {
                 Utils.CopyDirectory(conf.DistantPath, conf.LocalPath);
             }
             else
             {
                 Utils.CopyFile(conf.DistantPath, conf.LocalPath);
                 if (conf.OnImport != null)
                 {
                     conf.OnImport(conf);
                 }
             }
         }
     }
 }
Пример #2
0
        private static void DoDelete(ConfLine conf)
        {
            var answ = UserCommunication.Message("Do you really want to delete this file?", MessageImg.MsgQuestion, "Delete", "Confirmation", new List <string> {
                "Yes I do", "No, Cancel"
            }, true);

            if (answ == 0)
            {
                Utils.DeleteFile(conf.LocalPath);
                if (conf.OnImport != null)
                {
                    conf.OnImport(conf);
                }
            }
        }
Пример #3
0
        /// <summary>
        /// Method to call when the user starts notepad++,
        /// check if an update has been done since the last time notepad was closed
        /// </summary>
        public static void CheckForUpdateDone()
        {
            // an update has been done
            if (File.Exists(Config.FileVersionLog))
            {
                // The dll is still in the update dir, something went wrong
                if (File.Exists(Config.FileDownloadedPlugin))
                {
                    UserCommunication.Notify(@"<h2>I require your attention!</h2><br>
                        <div>
                        The update didn't go as expected, i couldn't replace the old plugin file by the new one!<br>
                        It is very likely because i didn't get the rights to write a file in your /plugins/ folder, don't panic!<br>
                        You will have to manually copy the new file and delete the old file :<br><br>
                        <b>MOVE (delete the source and replace the target)</b> this file : <div>" + Path.GetDirectoryName(Config.FileDownloadedPlugin).ToHtmlLink(Config.FileDownloadedPlugin) + @"</div><br>
                        <b>In this folder</b> (replacing the old file) : <div>" + Path.GetDirectoryName(AssemblyInfo.Location).ToHtmlLink() + @"</div><br><br>
                        Please do it as soon as possible, as i will stop checking for more updates until this problem is fixed.<br>
                        <i>(n.b. : this message will be shown at startup as long as the above-mentionned file exists!)</i><br>
                        Thank you for your patience!</div>", MessageImg.MsgUpdate, "Update", "Problem during the update!");
                    return;
                }

                UserCommunication.Message(("# What's new in this version? #\n\n" + Utils.ReadAllText(Config.FileVersionLog, Encoding.Default)).MdToHtml(),
                                          MessageImg.MsgUpdate,
                                          "A new version has been installed!",
                                          "Updated to version " + AssemblyInfo.Version,
                                          new List <string> {
                    "ok"
                },
                                          false);

                // delete update related files/folders
                Utils.DeleteFile(Config.FileVersionLog);
                Utils.DeleteDirectory(Config.FolderUpdate, true);

                // reset the log files
                Utils.DeleteDirectory(Config.FolderLog, true);

                // update UDL
                if (!Config.Instance.GlobalDontUpdateUdlOnUpdate)
                {
                    Style.InstallUdl();
                }
            }
        }
Пример #4
0
 private static void DoPush(ConfLine conf)
 {
     if (!string.IsNullOrEmpty(conf.LocalPath))
     {
         var answ = _dontWarnPush ? 0 : UserCommunication.Message("This will <b>replace the distant configuration <i>(for everyone!)</i></b> with your local configuration.<br><br>Do you wish to continue?", MessageImg.MsgWarning, "Push", "Confirmation", new List <string> {
             "Yes I do", "Yes don't ask again", "No, Cancel"
         }, true);
         if (answ == 0 || answ == 1)
         {
             if (answ == 1)
             {
                 _dontWarnPush = true;
             }
             if (conf.IsDir)
             {
                 Utils.CopyDirectory(conf.LocalPath, conf.DistantPath);
             }
             else
             {
                 Utils.CopyFile(conf.LocalPath, conf.DistantPath);
             }
         }
     }
 }