コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CommandItem" /> class.
 /// </summary>
 /// <param name="id">The unique command id.</param>
 /// <param name="sortIndex">The sort index, defining the sequence of the items to appear.</param>
 /// <param name="text">The text.</param>
 /// <param name="description">The description.</param>
 /// <param name="doProc">The do proc.</param>
 public CommandItem(string id, int sortIndex, ITranslatableString text, ITranslatableString description, CommandProc doProc)
 {
     this.Id          = id;
     this.sortIndex   = sortIndex;
     this.text        = text;
     this.description = description;
     this.doProc      = doProc;
 }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TranslatableString" /> class.
        /// </summary>
        /// <param name="source">The source.</param>
        public TranslatableString(ITranslatableString source)
        {
            if (source == null)
            {
                throw new ArgumentNullException(@"source");
            }

            this.formatResourceName = source.FormatResourceName;
            this.baseName           = source.BaseName;
            this.assemblyName       = source.AssemblyName;
            this.args = source.Args;
        }
コード例 #3
0
        /// <summary>
        /// Sets the text.
        /// </summary>
        /// <param name="text">The text.</param>
        public void SetText(ITranslatableString text)
        {
            if (!this.IsProgressActive)
            {
                // progress is not active anymore, don't change it
                return;
            }

            if (Logger.IsDebugEnabled)
            {
                var message = string.Format(CultureInfo.CurrentUICulture, Resources.SettingTextPropertyOfProgressItemWithTitle_To_, this.Title, text);
                Logger.Debug(message);
            }

            lock (this.textLock)
            {
                this.translatableText = new TranslatableString(text);
                this.OnChanged();
            }
        }
コード例 #4
0
        public ICommandItem AddCommand(string id, int commandSortIndex, ITranslatableString commandText, ITranslatableString commandDescription, CommandProc commandDoProc)
        {
            var newItem = new CommandItem(id, commandSortIndex, commandText, commandDescription, commandDoProc);

            return(this.AddCommand(newItem));
        }
コード例 #5
0
 /// <summary>
 /// Adds the command.
 /// </summary>
 /// <param name="id">The unique command id.</param>
 /// <param name="commandSortIndex">The sort index, defining the sequence of the items to appear.</param>
 /// <param name="commandText">The commandText.</param>
 /// <param name="commandDescription">The commandDescription.</param>
 /// <param name="commandDoProc">The command procedure to be called to execute the command.</param>
 /// <returns>The new command item.</returns>
 public ICommandItem AddCommand(string id, int commandSortIndex, ITranslatableString commandText, ITranslatableString commandDescription, CommandProc commandDoProc)
 {
     return(this.commandProvider.AddCommand(id, commandSortIndex, commandText, commandDescription, commandDoProc));
 }
コード例 #6
0
 /// <summary>
 /// Moves the progress bar another step and updates the current text
 /// </summary>
 /// <param name="textUpdate">Text to be displayed.</param>
 public void StepUpdate(ITranslatableString textUpdate)
 {
     this.SetText(textUpdate);
     this.StepUpdate();
 }
コード例 #7
0
 /// <summary>
 /// Sets the text.
 /// </summary>
 /// <param name="newText">The text to set.</param>
 public void SetText(ITranslatableString newText)
 {
     this.commandItemBase.SetText(newText);
 }
コード例 #8
0
 /// <summary>
 /// Sets the description.
 /// </summary>
 /// <param name="newDescription">The description to set.</param>
 public void SetDescription(ITranslatableString newDescription)
 {
     this.commandItemBase.SetDescription(newDescription);
 }
コード例 #9
0
 /// <summary>
 /// Sets the text.
 /// </summary>
 /// <param name="newText">The text.</param>
 public void SetText(ITranslatableString newText)
 {
     this.text = newText;
 }
コード例 #10
0
 /// <summary>
 /// Sets the description.
 /// </summary>
 /// <param name="newDescription">The description to set.</param>
 public void SetDescription(ITranslatableString newDescription)
 {
     this.description = newDescription;
 }