예제 #1
0
        protected override void ConfigureApplicationContainer(TinyIoCContainer container)
        {
            base.ConfigureApplicationContainer(container);

            container.Register(typeof(ISpamShieldService), typeof(SpamShieldService));
            container.Register(typeof(ICache), typeof(RuntimeCache));

            RegisterIViewProjections(container);
            TagExtension.SetupViewProjectionFactory(container.Resolve <IViewProjectionFactory>());
            RegisterICommandInvoker(container);
            container.Register <DB.AutoBox>(this.Database);
            //container.Register(typeof(MongoDatabase), (cContainer, overloads) => Database);
        }
예제 #2
0
        protected override void ConfigureApplicationContainer(TinyIoCContainer container)
        {
            base.ConfigureApplicationContainer(container);

            container.Register(typeof(ISpamShieldService), typeof(SpamShieldService));
            container.Register(typeof(ICache), typeof(RuntimeCache));

            RegisterIViewProjections(container);
            TagExtension.SetupViewProjectionFactory(container.Resolve <IViewProjectionFactory>());
            RegisterICommandInvoker(container);

            var db = Database("ibox");

            container.Register(db);
        }
예제 #3
0
        internal static void InsertTag(Form1 form, String tag, TagType type, TagExtension extension, String customTypeBegin = null, String customTypeEnd = null)
        {
            XtraTabControl    pagesTabControl = form.pagesTabControl;
            CustomRichTextBox pageTextBox     = ProgramUtil.GetPageTextBox(pagesTabControl.SelectedTabPage);

            switch (type)
            {
            case TagType.XHTML:
                customTypeBegin = "<";
                customTypeEnd   = ">";
                break;

            case TagType.Forum:
                customTypeBegin = "[";
                customTypeEnd   = "]";
                break;
            }

            if (String.IsNullOrEmpty(customTypeBegin) || String.IsNullOrEmpty(customTypeEnd))
            {
                throw new ParameterException(LanguageUtil.GetCurrentLanguageString("TagTypeEmpty", className));
            }

            String newSelection;
            int    selectionStart = pageTextBox.SelectionStart;
            int    insertionLength;

            switch (extension)
            {
            case TagExtension.Complete:
                newSelection    = customTypeBegin + tag + customTypeEnd + pageTextBox.SelectedText + customTypeBegin + "/" + tag + customTypeEnd;
                insertionLength = newSelection.Length;

                pageTextBox.SelectedText = newSelection;
                pageTextBox.Select(selectionStart, insertionLength);
                break;

            case TagExtension.Short:
                newSelection    = pageTextBox.SelectedText + customTypeBegin + tag + " /" + customTypeEnd;
                insertionLength = newSelection.Length;

                pageTextBox.SelectedText = newSelection;
                pageTextBox.Select(selectionStart, insertionLength);
                break;
            }

            TextManager.RefreshUndoRedoExternal(form);
        }
예제 #4
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Sets the path. </summary>
        ///
        /// <param name="tagPath">  Full pathname of the tag file. </param>
        public void SetPath(string tagPath)
        {
            AbsoluteTagPath = Path.GetFullPath(tagPath);

            TagName              = Path.GetFileNameWithoutExtension(AbsoluteTagPath);
            TagExtension         = Path.GetExtension(AbsoluteTagPath);
            TagExtension         = TagExtension.TrimStart('.');
            TagNameWithExtension = Path.GetFileName(AbsoluteTagPath);

            var tagsRelative = Path.GetDirectoryName(AbsoluteTagPath);

            tagsRelative = tagsRelative.Replace(AbsoluteFolder, "");

            var tagsRelativeSplit = tagsRelative.Split(new char[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries).ToList();

            tagsRelativeSplit.Add(TagName);

            TagPath = System.String.Join(Path.DirectorySeparatorChar.ToString(), tagsRelativeSplit);
        }