コード例 #1
0
        void UpdateView(bool initialUpdate)
        {
            if (currentWindow == null)
            {
                return;
            }
            if (source.IsDisposed)
            {
                currentWindow.Close();
                return;
            }

            SetTextBoxValue(ControlFlag.NameEditbox, source.DisplayName);
            SetTextBoxValue(ControlFlag.FormatTextBox, LogProviderFactoryRegistry.ToString(source.Provider.Factory));

            WriteControl(ControlFlag.VisibleCheckBox | ControlFlag.Checked, source.Visible);
            UpdateColorPanel();
            ShowTechInfoPanel();
            UpdateStatsView(source.Provider.Stats);
            UpdateSuspendResumeTrackingLink();
            UpdateFirstAndLastMessages();
            UpdateSaveAs();
            UpdateAnnotation(initialUpdate);
            UpdateTimeOffset(initialUpdate);
            UpdateCopyPathButton();
            UpdateOpenContainingFolderButton();
        }
コード例 #2
0
 void IPresenter.UpdateView(IUserDefinedFactory factory)
 {
     view.Update(
         messageLabelText: string.Format("You are about to delete '{0}' format definition. Press Finish to delete, Cancel to cancel the operation.",
                                         LogProviderFactoryRegistry.ToString(factory)),
         descriptionTextBoxValue: factory.FormatDescription,
         fileNameTextBoxValue: factory.Location,
         dateTextBoxValue: File.Exists(factory.Location) ? File.GetLastWriteTime(factory.Location).ToString() : ""
         );
 }
コード例 #3
0
        static ViewState MakeViewState(
            string annotation,
            string timeOffset,
            bool sourceVisible,
            bool sourceTrackingEnabled,
            int sourceColorIndex,
            string sourceDisplayName,
            ILogProvider sourceProvider,
            Preprocessing.IManager preprocessings,
            ImmutableArray <Color> themeThreadColors,
            IReadOnlyList <IThread> sourceThreads
            )
        {
            ViewState state = new ViewState();

            state.NameEditbox = new ControlState
            {
                Text = sourceDisplayName
            };
            state.FormatTextBox = new ControlState
            {
                Text = LogProviderFactoryRegistry.ToString(sourceProvider.Factory)
            };
            state.VisibleCheckBox = new ControlState
            {
                Checked = sourceVisible
            };

            state.ColorPanel = new ControlState
            {
                BackColor = themeThreadColors.GetByIndex(sourceColorIndex)
            };

            state.AnnotationTextBox = new ControlState
            {
                Text = annotation
            };

            state.TimeOffsetTextBox = new ControlState
            {
                Text = timeOffset
            };

            UpdateStatsView(state, sourceProvider);
            UpdateSuspendResumeTrackingLink(state, sourceVisible, sourceTrackingEnabled);
            UpdateFirstAndLastMessages(state, sourceThreads, sourceVisible);
            UpdateSaveAs(state, sourceProvider);
            UpdateCopyPathButton(state, sourceProvider, preprocessings);
            UpdateOpenContainingFolderButton(state, sourceProvider, preprocessings);

            return(state);
        }
コード例 #4
0
        IEnumerable <ILogProviderFactory> IRecentlyUsedEntities.SortFactoriesMoreRecentFirst(IEnumerable <ILogProviderFactory> factories)
        {
            var recentFactories = new List <ILogProviderFactory>(GetRecentFactories());
            List <ILogProviderFactory> requestedFactories = new List <ILogProviderFactory>(factories);

            requestedFactories.Sort((f1, f2) => LogProviderFactoryRegistry.ToString(f1).CompareTo(LogProviderFactoryRegistry.ToString(f2)));
            recentFactories.RemoveAll(f1 => !requestedFactories.Exists(f2 => f1 == f2));
            requestedFactories.RemoveAll(f1 => recentFactories.Exists(f2 => f1 == f2));
            foreach (ILogProviderFactory f in recentFactories)
            {
                yield return(f);
            }
            foreach (ILogProviderFactory f in requestedFactories)
            {
                yield return(f);
            }
        }
コード例 #5
0
 public override string GetIdentity()
 {
     return(LogProviderFactoryRegistry.ToString(Factory));
 }
コード例 #6
0
 public override string ToString()
 {
     return(LogProviderFactoryRegistry.ToString(Factory));
 }
コード例 #7
0
ファイル: Extensions.cs プロジェクト: sabrogden/logjoint
 public static void ShowTheDialog(this IPresenter presenter, ILogProviderFactory selectedFactory)
 {
     presenter.ShowTheDialog(LogProviderFactoryRegistry.ToString(selectedFactory));
 }