Exemple #1
0
        public FileViewModel(DocumentModel _document)
        {
            Document = _document;

            NewCommand    = new CommandClick(NewFile);
            OpenCommand   = new CommandClick(OpenFile);
            SaveCommand   = new CommandClick(SaveFile);
            SaveAsCommand = new CommandClick(SaveFileAs);
            ExitCommand   = new CommandClick(ExitProgram);
        }
Exemple #2
0
        public MainViewModel()
        {
            this.Items = new ObservableCollection <ItemViewModel>();
            client     = new Service1Client();
            user       = new User();

            Rejestracja = new CommandClick(RejestracjaCommand);
            Logowanie   = new CommandClick(LogowanieCommand);

            client.RegisterCompleted     += client_RegisterCompleted;
            client.LoginCompleted        += client_LoginCompleted;
            client.GetUserNotesCompleted += client_GetUserNotesCompleted;
        }
 private void commitInfo_CommandClicked(object sender, CommandEventArgs e)
 {
     CommandClick?.Invoke(sender, e);
 }
Exemple #4
0
 private void DoCommandClick(string command, string data)
 {
     CommandClick?.Invoke(this, new CommandEventArgs(command, data));
 }
Exemple #5
0
        /// <summary></summary>
        protected Command AddNamedCommand(string name, string caption, int iconID, CommandClick onClick)
        {
            Command foundCommand = null;
            string fullName = AddInInstance.ProgID + "." + name;

            CommandEvent commandEvent;
            if (!_commands.TryGetValue(fullName, out commandEvent))
            {
                foundCommand = ApplicationObject.Commands.AddNamedCommand(AddInInstance, name, caption, caption,
                                    true, iconID, null, (int)vsCommandStatus.vsCommandStatusSupported | (int)vsCommandStatus.vsCommandStatusEnabled);

                _commands.Add(fullName, new CommandEvent { Command = foundCommand, OnClick = onClick });
            }

            return foundCommand;
        }
Exemple #6
0
 internal void RaiseCommandClick(CommandSpec spec)
 {
     CommandClick?.Invoke(spec);
 }