示例#1
0
 public ModActionEditorReturnEventArgs(int index, string actionType, string actionBody, StringLocalised actionComment)
 {
     this.Index         = index;
     this.ActionType    = actionType;
     this.ActionBody    = actionBody;
     this.ActionComment = actionComment;
 }
示例#2
0
        public static string GetString(int id, params object[] args)
        {
            StringLocalised loc = m_instance.m_provider.Get("unmapped", id);

            if (loc == null)
            {
                loc = m_instance.m_defaultProvider.Get("unmapped", id);
                if (loc == null)
                {
                    return(String.Format("?{0}", id));
                }
            }

            if (args == null || args.Count() == 0)
            {
                return(loc.text);
            }

            try
            {
                return(String.Format(loc.text, args));
            }
            catch (FormatException)
            {
                return(loc.text);
            }
        }
示例#3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="hWndOwner"></param>
        /// <returns></returns>
        protected override bool RunDialog(IntPtr hWndOwner)
        {
            NoteEditorDialogBox dialogInstance = null;
            bool okTriggered = false;

            try
            {
                dialogInstance       = new NoteEditorDialogBox();
                dialogInstance.Owner = (Form.FromHandle(hWndOwner) as Form);
                dialogInstance.Note  = this.note;
                dialogInstance.textBoxNote.LanguageSelectorVisible = localised;
                if (dialogInstance.ShowDialog() == DialogResult.OK)
                {
                    okTriggered = true;
                    this.note   = dialogInstance.Note;
                    this.Save(this, new NoteEditorDialogBoxSaveEventArgs(note, type));
                }
            }

            finally
            {
                if (dialogInstance != null)
                {
                    dialogInstance.Dispose();
                }
            }
            return(okTriggered);
        }
示例#4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="type">Type</param>
 /// <param name="body">Body</param>
 /// <param name="beforeComment">Before Comment</param>
 /// <param name="afterComment">After Comment</param>
 /// <param name="startLine">Start line</param>
 /// <param name="modifier">Modifier</param>
 public ModAction(string type, string body, string beforeComment, string afterComment, int startLine, string modifier)
 {
     this.Type          = type;
     this.Body          = body;
     this.BeforeComment = beforeComment;
     this.AfterComment  = new StringLocalised(afterComment);
     this.StartLine     = startLine;
     this.Modifier      = modifier;
 }
示例#5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="type">Type</param>
 /// <param name="body">Body</param>
 /// <param name="afterComment">After Comment</param>
 public ModAction(string type, string body, StringLocalised afterComment)
 {
     this.Type          = type;
     this.Body          = body;
     this.BeforeComment = null;
     this.AfterComment  = afterComment;
     this.StartLine     = 0;
     this.Modifier      = null;
 }
        public StringLocalised Get(string section, int id)
        {
            Dictionary <int, StringLocalised> localList = null;

            if (_languageStrings.TryGetValue(section.ToLowerInvariant(), out localList))
            {
                StringLocalised stringLocalised = null;
                if (localList.TryGetValue(id, out stringLocalised))
                {
                    return(stringLocalised);
                }
            }

            return(null);
        }
示例#7
0
        public void SetModAction(int index, string actionType, string actionBody, StringLocalised actionComment, bool isXml)
        {
            actionIndex                      = index;
            comboBoxActionType.Text          = string.Copy(actionType);
            textEditorControlActionBody.Text = string.Copy(actionBody);
            StringLocalised tempLang = new StringLocalised();

            foreach (string Language in actionComment)
            {
                tempLang.Add(actionComment[Language], Language);
            }
            textEditorControlComment.TextLang = tempLang;

            if (isXml)
            {
                switch (actionType)
                {
                case "FIND":
                    textEditorControlComment.Enabled = true;
                    break;

                default:
                    textEditorControlComment.Enabled = false;
                    break;
                }
                textEditorControlComment.LanguageSelectorVisible = true;
            }
            else
            {
                textEditorControlComment.LanguageSelectorVisible = false;
                switch (actionType)
                {
                case "SAVE/CLOSE ALL FILES":
                    textEditorControlComment.Enabled = false;
                    break;

                default:
                    textEditorControlComment.Enabled = true;
                    break;
                }
            }
        }
        public string GetString(string section, int id)
        {
            Dictionary <int, StringLocalised> localList = null;

            if (_languageStrings.TryGetValue(section.ToLowerInvariant(), out localList))
            {
                StringLocalised stringLocalised = null;
                if (localList.TryGetValue(id, out stringLocalised))
                {
                    string prefix = string.Empty;
                    if (_prefix)
                    {
                        prefix = stringLocalised.prefix;
                    }
                    return(prefix + stringLocalised.text);
                }
            }

            return(null);
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="note"></param>
 /// <param name="type"></param>
 public NoteEditorDialogBoxSaveEventArgs(StringLocalised note, string type)
 {
     this.Note = note;
     this.Type = type;
 }
示例#10
0
 /// <summary>
 ///
 /// </summary>
 public NoteEditorDialogBoxSaveEventArgs()
 {
     Note = new StringLocalised();
     Type = "";
 }
示例#11
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="note"></param>
 /// <param name="type"></param>
 public void SetNote(StringLocalised note, string type)
 {
     this.textBoxNote.TextLang = note;
     notetype = type;
 }
示例#12
0
 /// <summary>
 ///
 /// </summary>
 public override void Reset()
 {
     this.note = null;
 }