コード例 #1
0
 public bool Equals(ApplicationSetting other)
 {
     return
         (SkipFirstBlankRows == other.skipFirstBlankRows &&
          SkipFirstBlankColumns == other.SkipFirstBlankColumns &&
          TrimLastBlankRows == other.TrimLastBlankRows &&
          TrimLastBlankColumns == other.TrimLastBlankColumns &&
          ExternalCommands.SequenceEqual(other.ExternalCommands) &&
          FileSettings.SequenceEqual(other.FileSettings) &&
          RecentFileSets.SequenceEqual(other.RecentFileSets) &&
          CellWidth == other.cellWidth &&
          AlternatingColorStrings.SequenceEqual(other.AlternatingColorStrings) &&
          ColumnHeaderColorString.Equals(other.ColumnHeaderColorString) &&
          RowHeaderColorString.Equals(other.RowHeaderColorString) &&
          AddedColorString.Equals(other.AddedColorString) &&
          RemovedColorString.Equals(other.RemovedColorString) &&
          ModifiedColorString.Equals(other.ModifiedColorString) &&
          ModifiedRowColorString.Equals(other.ModifiedRowColorString) &&
          ColorModifiedRow.Equals(other.ColorModifiedRow) &&
          SearchHistory.Equals(other.SearchHistory) &&
          FontName.Equals(other.FontName) &&
          LogFormat.Equals(other.LogFormat) &&
          AddedRowLogFormat.Equals(other.AddedRowLogFormat) &&
          RemovedRowLogFormat.Equals(other.RemovedRowLogFormat));
 }
コード例 #2
0
        public ApplicationSetting Clone()
        {
            var clone = new ApplicationSetting();

            clone.SkipFirstBlankRows      = SkipFirstBlankRows;
            clone.SkipFirstBlankColumns   = SkipFirstBlankColumns;
            clone.TrimLastBlankRows       = TrimLastBlankRows;
            clone.TrimLastBlankColumns    = TrimLastBlankColumns;
            clone.ExternalCommands        = ExternalCommands.Select(c => c.Clone()).ToList();
            clone.FileSettings            = FileSettings.Select(f => f.Clone()).ToList();
            clone.RecentFileSets          = RecentFileSets.ToList();
            clone.CellWidth               = CellWidth;
            clone.AlternatingColorStrings = new ObservableCollection <string>(AlternatingColorStrings);
            clone.ColumnHeaderColorString = ColumnHeaderColorString;
            clone.RowHeaderColorString    = RowHeaderColorString;
            clone.AddedColorString        = AddedColorString;
            clone.RemovedColorString      = RemovedColorString;
            clone.modifiedColorString     = ModifiedColorString;
            clone.ModifiedRowColorString  = ModifiedRowColorString;
            clone.ColorModifiedRow        = ColorModifiedRow;
            clone.SearchHistory           = new ObservableCollection <string>(SearchHistory);
            clone.FontName            = FontName;
            clone.LogFormat           = LogFormat;
            clone.AddedRowLogFormat   = AddedRowLogFormat;
            clone.RemovedRowLogFormat = RemovedRowLogFormat;

            return(clone);
        }
コード例 #3
0
        private void OpenEditorWindow(ExternalCommand command)
        {
            if (command == null)
            {
                command = new ExternalCommand();
            }

            var vm     = new CommandEditorWindowViewModel(command, ExternalCommands);
            var window = new CommandEditorWindow()
            {
                DataContext = vm
            };

            window.ShowDialog();

            if (!vm.IsDone || command.Equals(vm.Command))
            {
                return;
            }

            var index = ExternalCommands.IndexOf(command);

            if (index >= 0)
            {
                RemoveExternalComand(command);
                ExternalCommands.Insert(index, vm.Command);
            }
            else
            {
                ExternalCommands.Add(vm.Command);
            }

            IsDirty = true;
            UpdateView();
        }
コード例 #4
0
        private void Apply()
        {
            App.Instance.Setting.ExternalCommands = ExternalCommands.ToList();
            App.Instance.Setting.Save();

            Refresh();
        }
コード例 #5
0
 private void UpdateView()
 {
     ExternalCommands = ExternalCommands.ToList();
 }
コード例 #6
0
 private void RemoveExternalComand(ExternalCommand command)
 {
     IsDirty |= ExternalCommands.Remove(command);
     UpdateView();
 }