示例#1
0
        /// <summary>
        /// <para>Initialization method, used by constructors, creates folder for tab, inits filenames</para>
        /// <para>Метод инициализации, используемый всеми конструкторами.
        /// Создаёт папку под вкладку, задаёт имена файлов.</para>
        /// </summary>
        /// <param name="type"></param>
        protected void Init(TabTypes type)
        {
            TabType = type;

            if (TabType != TabTypes.CUSTOM)
            {
                TabTypeString = type.ToString();
            }
            else
            {
                TabTypeString = CustomTabType;
            }

            if (IsAllTab())
            {
                _dirname = Log9KCore.Settings.Folder + "/" + Log9KUtil.GetDayMonthYearString() + "/";
            }
            else if (IsInnerLogTab())
            {
                _dirname = Log9KCore.Settings.Folder + "/" + Log9KUtil.GetDayMonthYearString() + "/" + "." + Log9KCore.INNER_LOG_TAB;
            }
            else
            {
                _dirname = Log9KCore.Settings.Folder + "/" + Log9KUtil.GetDayMonthYearString() + "/" + TabTypeString;
            }

            if (IsAllTab())
            {
                Log9KUtil.CreateDirIfNotExists(_dirname);
                _directoryNotCreated = false;
            }

            FilenameLogFile = _dirname + "/" + Log9KUtil.GetDayMonthYearHourMinuteSecondString() + Log9KCore.LOG_EXTENSION;

            try {
                // ReSharper disable once ReturnValueOfPureMethodIsNotUsed
                Path.GetFullPath(FilenameLogFile);
            } catch (Exception e) {
                Log9KCore.InnerLog("Ошибка: что-то не так с именем файла — " + e.Message, true);
            }

            FilenameTempFile = FilenameLogFile + Log9KCore.TEMP_LOG_EXTENSION;

            DuplicationsDictionary = new Dictionary <int, DuplicationNode>();

            InitCollection();

            InitTabHeader();
        }
示例#2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            Uri defaultIconUri = new Uri(DEFAULT_ICON_URI_STRING);

            if (!(value is TabTypes))
            {
                return(defaultIconUri);
            }

            TabTypes tabType       = (TabTypes)value;
            string   tabTypeString = tabType.ToString();

            tabTypeString = tabTypeString.ToLower();
            string iconUriString = ICON_URI_PREFIX + tabTypeString + ICON_EXTENSION;

            return(new Uri(iconUriString));
        }
示例#3
0
    /// <summary>
    ///
    /// Sets the text to display the active tab filter
    ///
    /// </summary>
    private void SwitchTabText()
    {
        var text = "Current: " + tabFilter.ToString();

        tabFilterText.text = text;
    }
示例#4
0
 /// <summary>
 /// <para>Add new tab to Core's tab's collections, </para>
 /// <para>Use this method for adding new tabs instead of directly changing collections</para>
 /// </summary>
 /// <param name="tabType"></param>
 /// <param name="tab"></param>
 private void AddNewTab(TabTypes tabType, Log9KTab tab)
 {
     AddNewTab(tabType.ToString(), tab);
 }
示例#5
0
        /// <summary>
        /// Get tab by given tab type
        /// </summary>
        /// <param name="tabType"></param>
        /// <returns></returns>
        private Log9KTab GetTab(TabTypes tabType)
        {
            string tabTypeString = tabType.ToString();

            return(GetTab(tabTypeString));
        }