diff --git a/CS/console-ai-extension/Program.cs b/CS/console-ai-extension/Program.cs index 5407780..335b54e 100644 --- a/CS/console-ai-extension/Program.cs +++ b/CS/console-ai-extension/Program.cs @@ -3,6 +3,8 @@ using DevExpress.AIIntegration.Extensions; using DevExpress.AIIntegration.Localization; using DevExpress.Data; +using Microsoft.Extensions.AI; +using System; using System.Globalization; @@ -14,9 +16,6 @@ static void Main(string[] args) { Console.OutputEncoding = System.Text.Encoding.UTF8; - //Enable sending large texts to Ollama - //AsyncDownloadPolicy.ConfigureHttpClient += AsyncDownloadPolicy_ConfigureHttpClient; - //Enable localization //AIIntegrationLocalizer.Active = new CustomAILocalizer(); @@ -33,15 +32,6 @@ static void Main(string[] args) Console.ReadKey(); } - private static void AsyncDownloadPolicy_ConfigureHttpClient(object sender, AsyncDownloadPolicy.ConfigureHttpClientEventArgs e) - { - string? fullTypeName = e?.ValueType.FullName; - if (fullTypeName.Contains("Ollama")) - { - e.Client.Timeout = TimeSpan.FromMinutes(15); - } - } - public class SampleAITextModifier { //Modify the following lines to obtain and pass your personal Azure OpenAI credentails to the Register* method. @@ -50,15 +40,18 @@ public class SampleAITextModifier string DeploymentName { get { return Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENTNAME"); } } AIExtensionsContainerDefault defaultAIContainer; + public SampleAITextModifier() { - defaultAIContainer = new AIExtensionsContainerDefault(); - //defaultAIContainer.RegisterChatClientOllamaAIService("http://localhost:11434/api/chat", "llama3.1"); - defaultAIContainer.RegisterChatClientOpenAIService( - new AzureOpenAIClient(new Uri(AzureOpenAIEndpoint), - new System.ClientModel.ApiKeyCredential(AzureOpenAIKey)), - DeploymentName - ); + + ///To register Ollama + //OllamaChatClient ollamaChatClient = new OllamaChatClient("http://localhost:11434/api/chat", "llama3.1"); + //defaultAIContainer = AIExtensionsContainerConsole.CreateDefaultAIExtensionContainer(ollamaChatClient); + + ///To register Azure OpenAI + AzureOpenAIClient azureOpenAIClient = new AzureOpenAIClient(new Uri(AzureOpenAIEndpoint), + new System.ClientModel.ApiKeyCredential(AzureOpenAIKey)); + defaultAIContainer = AIExtensionsContainerConsole.CreateDefaultAIExtensionContainer(azureOpenAIClient.AsChatClient(DeploymentName)); } public void ChangeDefaults() @@ -81,7 +74,7 @@ public async Task GetTranslation(string textToTranslate, string language } return translatedText; } - // Something unexpected happens + // When something unexpected has happened switch (result.Status) { case ResponseStatus.MaxTokenLimitExceeded: @@ -98,13 +91,14 @@ public async Task GetTranslation(string textToTranslate, string language // How to replace the default extension public async Task GetShakespeareText(string textToModify) { - defaultAIContainer.Register(); - string res = await defaultAIContainer.RewriteStyleAsync(new RewriteStyleRequest(textToModify, WritingStyle.Formal)); - return res; + defaultAIContainer.Register(); + string res = await defaultAIContainer.ChangeStyleAsync(new ChangeStyleRequest(textToModify, WritingStyle.Formal)); + return res; } //How to register and call your own extension - public async Task GetMarkTwainText(string textToModify) { + public async Task GetMarkTwainText(string textToModify) + { var localContainer = new AIExtensionsContainerLocal(defaultAIContainer); localContainer.Register(); @@ -119,10 +113,10 @@ public async Task GetMarkTwainText(string textToModify) { } } #region How to modify the default extension - public class WilliamShakespeareStyleExtension : RewriteStyleExtension + public class WilliamShakespeareStyleExtension : ChangeStyleExtension { public WilliamShakespeareStyleExtension(IServiceProvider serviceProvider) : base(serviceProvider) { } - protected override string GetSystemPrompt(RewriteStyleRequest request) + protected override string GetSystemPrompt(ChangeStyleRequest request) { return "Rewrite this text in the William Shakespeare style."; } diff --git a/CS/console-ai-extension/Runtime-AI-Extensions.csproj b/CS/console-ai-extension/Runtime-AI-Extensions.csproj index 7922925..5b7096d 100644 --- a/CS/console-ai-extension/Runtime-AI-Extensions.csproj +++ b/CS/console-ai-extension/Runtime-AI-Extensions.csproj @@ -9,10 +9,10 @@ - - - - + + + + diff --git a/CS/winforms-ai-extensions/MemoEditForm.Designer.cs b/CS/winforms-ai-extensions/MemoEditForm.Designer.cs index 5e6a327..14a7716 100644 --- a/CS/winforms-ai-extensions/MemoEditForm.Designer.cs +++ b/CS/winforms-ai-extensions/MemoEditForm.Designer.cs @@ -41,25 +41,25 @@ private void InitializeComponent() // // memoEdit1 // - languageInfo1.Culture = new System.Globalization.CultureInfo("es"); - languageInfo2.Culture = new System.Globalization.CultureInfo("de"); - languageInfo3.Culture = new System.Globalization.CultureInfo("pt"); - behaviorManager1.SetBehaviors(memoEdit1, new DevExpress.Utils.Behaviors.Behavior[] { (DevExpress.AIIntegration.WinForms.ExpandBehavior)DevExpress.Utils.Behaviors.Behavior.Create(typeof(DevExpress.AIIntegration.WinForms.ExpandBehavior), typeof(DevExpress.AIIntegration.WinForms.MemoEditExpandBehaviorSource), new object[] { null }), (DevExpress.AIIntegration.WinForms.ShortenBehavior)DevExpress.Utils.Behaviors.Behavior.Create(typeof(DevExpress.AIIntegration.WinForms.ShortenBehavior), typeof(DevExpress.AIIntegration.WinForms.MemoEditShortenBehaviorSource), new object[] { null }), (DevExpress.AIIntegration.WinForms.ToneStyleBehavior)DevExpress.Utils.Behaviors.Behavior.Create(typeof(DevExpress.AIIntegration.WinForms.ToneStyleBehavior), typeof(DevExpress.AIIntegration.WinForms.MemoEditToneStyleBehaviorSource), new object[] { null }), (DevExpress.AIIntegration.WinForms.ExplainBehavior)DevExpress.Utils.Behaviors.Behavior.Create(typeof(DevExpress.AIIntegration.WinForms.ExplainBehavior), typeof(DevExpress.AIIntegration.WinForms.MemoEditExplainBehaviorSource), new object[] { null }), (DevExpress.AIIntegration.WinForms.ProofreadBehavior)DevExpress.Utils.Behaviors.Behavior.Create(typeof(DevExpress.AIIntegration.WinForms.ProofreadBehavior), typeof(DevExpress.AIIntegration.WinForms.MemoEditProofreadBehaviorSource), new object[] { null }), (DevExpress.AIIntegration.WinForms.RewriteStyleBehavior)DevExpress.Utils.Behaviors.Behavior.Create(typeof(DevExpress.AIIntegration.WinForms.RewriteStyleBehavior), typeof(DevExpress.AIIntegration.WinForms.MemoEditRewriteStyleBehaviorSource), new object[] { null }), (DevExpress.AIIntegration.WinForms.SummarizeBehavior)DevExpress.Utils.Behaviors.Behavior.Create(typeof(DevExpress.AIIntegration.WinForms.SummarizeBehavior), typeof(DevExpress.AIIntegration.WinForms.MemoEditSummarizeBehaviorSource), new object[] { DevExpress.AIIntegration.SummarizeBehaviorMode.Abstractive, null }), (DevExpress.AIIntegration.WinForms.CustomRequestBehavior)DevExpress.Utils.Behaviors.Behavior.Create(typeof(DevExpress.AIIntegration.WinForms.CustomRequestBehavior), typeof(DevExpress.AIIntegration.WinForms.MemoEditCustomRequestBehaviorSource), new object[] { null }), (DevExpress.AIIntegration.WinForms.TranslateBehavior)DevExpress.Utils.Behaviors.Behavior.Create(typeof(DevExpress.AIIntegration.WinForms.TranslateBehavior), typeof(DevExpress.AIIntegration.WinForms.MemoEditTranslateBehaviorSource), new object[] { new DevExpress.AIIntegration.Desktop.LanguageInfo[] { languageInfo1, languageInfo2, languageInfo3 }, null }) }); + languageInfo1.Culture = new System.Globalization.CultureInfo("pt"); + languageInfo2.Culture = new System.Globalization.CultureInfo("es"); + languageInfo3.Culture = new System.Globalization.CultureInfo("de"); + behaviorManager1.SetBehaviors(memoEdit1, new DevExpress.Utils.Behaviors.Behavior[] { DevExpress.AIIntegration.WinForms.ExpandBehavior.Create(typeof(DevExpress.AIIntegration.WinForms.MemoEditExpandBehaviorSource)), DevExpress.AIIntegration.WinForms.ShortenBehavior.Create(typeof(DevExpress.AIIntegration.WinForms.MemoEditShortenBehaviorSource)), DevExpress.AIIntegration.WinForms.SummarizeBehavior.Create(typeof(DevExpress.AIIntegration.WinForms.MemoEditSummarizeBehaviorSource), DevExpress.AIIntegration.SummarizationMode.Abstractive), DevExpress.AIIntegration.WinForms.ExplainBehavior.Create(typeof(DevExpress.AIIntegration.WinForms.MemoEditExplainBehaviorSource)), DevExpress.AIIntegration.WinForms.ChangeToneBehavior.Create(typeof(DevExpress.AIIntegration.WinForms.MemoEditChangeToneBehaviorSource)), DevExpress.AIIntegration.WinForms.ProofreadBehavior.Create(typeof(DevExpress.AIIntegration.WinForms.MemoEditProofreadBehaviorSource)), DevExpress.AIIntegration.WinForms.ChangeStyleBehavior.Create(typeof(DevExpress.AIIntegration.WinForms.MemoEditChangeStyleBehaviorSource)), DevExpress.AIIntegration.WinForms.TranslateBehavior.Create(typeof(DevExpress.AIIntegration.WinForms.MemoEditTranslateBehaviorSource), new DevExpress.AIIntegration.Desktop.LanguageInfo[] { languageInfo1, languageInfo2, languageInfo3 }), DevExpress.AIIntegration.WinForms.CustomRequestBehavior.Create(typeof(DevExpress.AIIntegration.WinForms.MemoEditCustomRequestBehaviorSource)) }); memoEdit1.Dock = DockStyle.Fill; memoEdit1.EditValue = resources.GetString("memoEdit1.EditValue"); memoEdit1.Location = new Point(0, 0); - memoEdit1.Margin = new Padding(3, 2, 3, 2); + memoEdit1.Margin = new Padding(2, 2, 2, 2); memoEdit1.Name = "memoEdit1"; - memoEdit1.Size = new Size(1268, 653); + memoEdit1.Size = new Size(951, 496); memoEdit1.TabIndex = 0; // // MemoEditForm // - AutoScaleDimensions = new SizeF(12F, 25F); + AutoScaleDimensions = new SizeF(9F, 19F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(1268, 653); + ClientSize = new Size(951, 496); Controls.Add(memoEdit1); - Margin = new Padding(3, 2, 3, 2); + Margin = new Padding(2, 2, 2, 2); Name = "MemoEditForm"; Text = "Form1"; ((System.ComponentModel.ISupportInitialize)memoEdit1.Properties).EndInit(); diff --git a/CS/winforms-ai-extensions/Program.cs b/CS/winforms-ai-extensions/Program.cs index dddca7c..c9205a0 100644 --- a/CS/winforms-ai-extensions/Program.cs +++ b/CS/winforms-ai-extensions/Program.cs @@ -1,9 +1,11 @@ using Azure.AI.OpenAI; using DevExpress.AIIntegration; +using Microsoft.Extensions.AI; namespace WinForms_AI_Extensions { - internal static class Program { + internal static class Program + { //Modify the following lines to obtain and pass your personal Azure OpenAI credentails to the Register* method. static string AzureOpenAIEndpoint { get { return Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT"); } } static string AzureOpenAIKey { get { return Environment.GetEnvironmentVariable("AZURE_OPENAI_APIKEY"); } } @@ -27,11 +29,12 @@ static void Main() private static void RegisterDevExpressAI() { - AIExtensionsContainerDesktop.Default.RegisterChatClientOpenAIService( - new AzureOpenAIClient( - new Uri(AzureOpenAIEndpoint), - new System.ClientModel.ApiKeyCredential(AzureOpenAIKey)), - DeploymentName); + ///To register Ollama + //OllamaChatClient ollamaChatClient = new OllamaChatClient("http://localhost:11434/api/chat", "llama3.1"); + + AzureOpenAIClient azureOpenAIClient = new AzureOpenAIClient(new Uri(AzureOpenAIEndpoint), + new System.ClientModel.ApiKeyCredential(AzureOpenAIKey)); + AIExtensionsContainerDesktop.Default.RegisterChatClient(azureOpenAIClient.AsChatClient(DeploymentName)); } } } \ No newline at end of file diff --git a/CS/winforms-ai-extensions/RichEditForm.Designer.cs b/CS/winforms-ai-extensions/RichEditForm.Designer.cs index 74964af..6ef750c 100644 --- a/CS/winforms-ai-extensions/RichEditForm.Designer.cs +++ b/CS/winforms-ai-extensions/RichEditForm.Designer.cs @@ -32,14 +32,10 @@ private void InitializeComponent() DevExpress.AIIntegration.Desktop.LanguageInfo languageInfo1 = new DevExpress.AIIntegration.Desktop.LanguageInfo(); DevExpress.AIIntegration.Desktop.LanguageInfo languageInfo2 = new DevExpress.AIIntegration.Desktop.LanguageInfo(); DevExpress.AIIntegration.Desktop.LanguageInfo languageInfo3 = new DevExpress.AIIntegration.Desktop.LanguageInfo(); - DevExpress.XtraBars.Ribbon.ReduceOperation reduceOperation1 = new DevExpress.XtraBars.Ribbon.ReduceOperation(); DevExpress.XtraBars.Ribbon.GalleryItemGroup galleryItemGroup1 = new DevExpress.XtraBars.Ribbon.GalleryItemGroup(); + DevExpress.XtraBars.Ribbon.ReduceOperation reduceOperation1 = new DevExpress.XtraBars.Ribbon.ReduceOperation(); richEditControl1 = new DevExpress.XtraRichEdit.RichEditControl(); - richEditBarController1 = new DevExpress.XtraRichEdit.UI.RichEditBarController(components); - behaviorManager1 = new DevExpress.Utils.Behaviors.BehaviorManager(components); ribbonControl1 = new DevExpress.XtraBars.Ribbon.RibbonControl(); - commonRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.CommonRibbonPageGroup(); - fileRibbonPage1 = new DevExpress.XtraRichEdit.UI.FileRibbonPage(); undoItem1 = new DevExpress.XtraRichEdit.UI.UndoItem(); redoItem1 = new DevExpress.XtraRichEdit.UI.RedoItem(); fileNewItem1 = new DevExpress.XtraRichEdit.UI.FileNewItem(); @@ -49,20 +45,20 @@ private void InitializeComponent() quickPrintItem1 = new DevExpress.XtraRichEdit.UI.QuickPrintItem(); printItem1 = new DevExpress.XtraRichEdit.UI.PrintItem(); printPreviewItem1 = new DevExpress.XtraRichEdit.UI.PrintPreviewItem(); - infoRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.InfoRibbonPageGroup(); encryptDocumentItem1 = new DevExpress.XtraRichEdit.UI.EncryptDocumentItem(); showDocumentPropertiesFormItem1 = new DevExpress.XtraRichEdit.UI.ShowDocumentPropertiesFormItem(); - clipboardRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.ClipboardRibbonPageGroup(); - homeRibbonPage1 = new DevExpress.XtraRichEdit.UI.HomeRibbonPage(); pasteItem1 = new DevExpress.XtraRichEdit.UI.PasteItem(); cutItem1 = new DevExpress.XtraRichEdit.UI.CutItem(); copyItem1 = new DevExpress.XtraRichEdit.UI.CopyItem(); pasteSpecialItem1 = new DevExpress.XtraRichEdit.UI.PasteSpecialItem(); - fontRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.FontRibbonPageGroup(); + barButtonGroup1 = new DevExpress.XtraBars.BarButtonGroup(); changeFontNameItem1 = new DevExpress.XtraRichEdit.UI.ChangeFontNameItem(); + repositoryItemFontEditRichEdit1 = new DevExpress.XtraRichEdit.UI.RepositoryItemFontEditRichEdit(); changeFontSizeItem1 = new DevExpress.XtraRichEdit.UI.ChangeFontSizeItem(); + repositoryItemRichEditFontSizeEdit1 = new DevExpress.XtraRichEdit.Design.RepositoryItemRichEditFontSizeEdit(); fontSizeIncreaseItem1 = new DevExpress.XtraRichEdit.UI.FontSizeIncreaseItem(); fontSizeDecreaseItem1 = new DevExpress.XtraRichEdit.UI.FontSizeDecreaseItem(); + barButtonGroup2 = new DevExpress.XtraBars.BarButtonGroup(); toggleFontBoldItem1 = new DevExpress.XtraRichEdit.UI.ToggleFontBoldItem(); toggleFontItalicItem1 = new DevExpress.XtraRichEdit.UI.ToggleFontItalicItem(); toggleFontUnderlineItem1 = new DevExpress.XtraRichEdit.UI.ToggleFontUnderlineItem(); @@ -71,23 +67,20 @@ private void InitializeComponent() toggleFontDoubleStrikeoutItem1 = new DevExpress.XtraRichEdit.UI.ToggleFontDoubleStrikeoutItem(); toggleFontSuperscriptItem1 = new DevExpress.XtraRichEdit.UI.ToggleFontSuperscriptItem(); toggleFontSubscriptItem1 = new DevExpress.XtraRichEdit.UI.ToggleFontSubscriptItem(); + barButtonGroup3 = new DevExpress.XtraBars.BarButtonGroup(); changeFontColorItem1 = new DevExpress.XtraRichEdit.UI.ChangeFontColorItem(); changeFontHighlightColorItem1 = new DevExpress.XtraRichEdit.UI.ChangeFontHighlightColorItem(); + changeTextCaseItem1 = new DevExpress.XtraRichEdit.UI.ChangeTextCaseItem(); makeTextUpperCaseItem1 = new DevExpress.XtraRichEdit.UI.MakeTextUpperCaseItem(); makeTextLowerCaseItem1 = new DevExpress.XtraRichEdit.UI.MakeTextLowerCaseItem(); capitalizeEachWordCaseItem1 = new DevExpress.XtraRichEdit.UI.CapitalizeEachWordCaseItem(); toggleTextCaseItem1 = new DevExpress.XtraRichEdit.UI.ToggleTextCaseItem(); - changeTextCaseItem1 = new DevExpress.XtraRichEdit.UI.ChangeTextCaseItem(); clearFormattingItem1 = new DevExpress.XtraRichEdit.UI.ClearFormattingItem(); - barButtonGroup1 = new DevExpress.XtraBars.BarButtonGroup(); - repositoryItemFontEditRichEdit1 = new DevExpress.XtraRichEdit.UI.RepositoryItemFontEditRichEdit(); - repositoryItemRichEditFontSizeEdit1 = new DevExpress.XtraRichEdit.Design.RepositoryItemRichEditFontSizeEdit(); - barButtonGroup2 = new DevExpress.XtraBars.BarButtonGroup(); - barButtonGroup3 = new DevExpress.XtraBars.BarButtonGroup(); - paragraphRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.ParagraphRibbonPageGroup(); + barButtonGroup4 = new DevExpress.XtraBars.BarButtonGroup(); toggleBulletedListItem1 = new DevExpress.XtraRichEdit.UI.ToggleBulletedListItem(); toggleNumberingListItem1 = new DevExpress.XtraRichEdit.UI.ToggleNumberingListItem(); toggleMultiLevelListItem1 = new DevExpress.XtraRichEdit.UI.ToggleMultiLevelListItem(); + barButtonGroup5 = new DevExpress.XtraBars.BarButtonGroup(); decreaseIndentItem1 = new DevExpress.XtraRichEdit.UI.DecreaseIndentItem(); increaseIndentItem1 = new DevExpress.XtraRichEdit.UI.IncreaseIndentItem(); rtlToggleBulletedListItem1 = new DevExpress.XtraRichEdit.UI.RtlToggleBulletedListItem(); @@ -97,18 +90,21 @@ private void InitializeComponent() rtlIncreaseIndentItem1 = new DevExpress.XtraRichEdit.UI.RtlIncreaseIndentItem(); toggleParagraphLeftToRightItem1 = new DevExpress.XtraRichEdit.UI.ToggleParagraphLeftToRightItem(); toggleParagraphRightToLeftItem1 = new DevExpress.XtraRichEdit.UI.ToggleParagraphRightToLeftItem(); + barButtonGroup6 = new DevExpress.XtraBars.BarButtonGroup(); toggleParagraphAlignmentLeftItem1 = new DevExpress.XtraRichEdit.UI.ToggleParagraphAlignmentLeftItem(); toggleParagraphAlignmentCenterItem1 = new DevExpress.XtraRichEdit.UI.ToggleParagraphAlignmentCenterItem(); toggleParagraphAlignmentRightItem1 = new DevExpress.XtraRichEdit.UI.ToggleParagraphAlignmentRightItem(); toggleParagraphAlignmentJustifyItem1 = new DevExpress.XtraRichEdit.UI.ToggleParagraphAlignmentJustifyItem(); + toggleParagraphAlignmentArabicJustifyGroupItem1 = new DevExpress.XtraRichEdit.UI.ToggleParagraphAlignmentArabicJustifyGroupItem(); toggleParagraphAlignmentArabicJustifyItem1 = new DevExpress.XtraRichEdit.UI.ToggleParagraphAlignmentArabicJustifyItem(); toggleParagraphAlignmentJustifyLowItem1 = new DevExpress.XtraRichEdit.UI.ToggleParagraphAlignmentJustifyLowItem(); toggleParagraphAlignmentJustifyMediumItem1 = new DevExpress.XtraRichEdit.UI.ToggleParagraphAlignmentJustifyMediumItem(); toggleParagraphAlignmentJustifyHighItem1 = new DevExpress.XtraRichEdit.UI.ToggleParagraphAlignmentJustifyHighItem(); - toggleParagraphAlignmentArabicJustifyGroupItem1 = new DevExpress.XtraRichEdit.UI.ToggleParagraphAlignmentArabicJustifyGroupItem(); toggleParagraphAlignmentDistributeItem1 = new DevExpress.XtraRichEdit.UI.ToggleParagraphAlignmentDistributeItem(); toggleParagraphAlignmentThaiDistributeItem1 = new DevExpress.XtraRichEdit.UI.ToggleParagraphAlignmentThaiDistributeItem(); toggleShowWhitespaceItem1 = new DevExpress.XtraRichEdit.UI.ToggleShowWhitespaceItem(); + barButtonGroup7 = new DevExpress.XtraBars.BarButtonGroup(); + changeParagraphLineSpacingItem1 = new DevExpress.XtraRichEdit.UI.ChangeParagraphLineSpacingItem(); setSingleParagraphSpacingItem1 = new DevExpress.XtraRichEdit.UI.SetSingleParagraphSpacingItem(); setSesquialteralParagraphSpacingItem1 = new DevExpress.XtraRichEdit.UI.SetSesquialteralParagraphSpacingItem(); setDoubleParagraphSpacingItem1 = new DevExpress.XtraRichEdit.UI.SetDoubleParagraphSpacingItem(); @@ -117,167 +113,77 @@ private void InitializeComponent() removeSpacingBeforeParagraphItem1 = new DevExpress.XtraRichEdit.UI.RemoveSpacingBeforeParagraphItem(); addSpacingAfterParagraphItem1 = new DevExpress.XtraRichEdit.UI.AddSpacingAfterParagraphItem(); removeSpacingAfterParagraphItem1 = new DevExpress.XtraRichEdit.UI.RemoveSpacingAfterParagraphItem(); - changeParagraphLineSpacingItem1 = new DevExpress.XtraRichEdit.UI.ChangeParagraphLineSpacingItem(); changeParagraphBackColorItem1 = new DevExpress.XtraRichEdit.UI.ChangeParagraphBackColorItem(); - barButtonGroup4 = new DevExpress.XtraBars.BarButtonGroup(); - barButtonGroup5 = new DevExpress.XtraBars.BarButtonGroup(); - barButtonGroup6 = new DevExpress.XtraBars.BarButtonGroup(); - barButtonGroup7 = new DevExpress.XtraBars.BarButtonGroup(); - stylesRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.StylesRibbonPageGroup(); galleryChangeStyleItem1 = new DevExpress.XtraRichEdit.UI.GalleryChangeStyleItem(); - editingRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.EditingRibbonPageGroup(); findItem1 = new DevExpress.XtraRichEdit.UI.FindItem(); replaceItem1 = new DevExpress.XtraRichEdit.UI.ReplaceItem(); - pagesRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.PagesRibbonPageGroup(); - insertRibbonPage1 = new DevExpress.XtraRichEdit.UI.InsertRibbonPage(); insertPageBreakItem21 = new DevExpress.XtraRichEdit.UI.InsertPageBreakItem2(); - tablesRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.TablesRibbonPageGroup(); insertTableItem1 = new DevExpress.XtraRichEdit.UI.InsertTableItem(); - illustrationsRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.IllustrationsRibbonPageGroup(); insertFloatingPictureItem1 = new DevExpress.XtraRichEdit.UI.InsertFloatingPictureItem(); - linksRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.LinksRibbonPageGroup(); insertBookmarkItem1 = new DevExpress.XtraRichEdit.UI.InsertBookmarkItem(); insertHyperlinkItem1 = new DevExpress.XtraRichEdit.UI.InsertHyperlinkItem(); - headerFooterRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.HeaderFooterRibbonPageGroup(); editPageHeaderItem1 = new DevExpress.XtraRichEdit.UI.EditPageHeaderItem(); editPageFooterItem1 = new DevExpress.XtraRichEdit.UI.EditPageFooterItem(); insertPageNumberItem1 = new DevExpress.XtraRichEdit.UI.InsertPageNumberItem(); insertPageCountItem1 = new DevExpress.XtraRichEdit.UI.InsertPageCountItem(); - textRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.TextRibbonPageGroup(); insertTextBoxItem1 = new DevExpress.XtraRichEdit.UI.InsertTextBoxItem(); insertObjectItem1 = new DevExpress.XtraRichEdit.UI.InsertObjectItem(); - symbolsRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.SymbolsRibbonPageGroup(); insertSymbolItem1 = new DevExpress.XtraRichEdit.UI.InsertSymbolItem(); - ((System.ComponentModel.ISupportInitialize)richEditBarController1).BeginInit(); - ((System.ComponentModel.ISupportInitialize)behaviorManager1).BeginInit(); + fileRibbonPage1 = new DevExpress.XtraRichEdit.UI.FileRibbonPage(); + commonRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.CommonRibbonPageGroup(); + infoRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.InfoRibbonPageGroup(); + homeRibbonPage1 = new DevExpress.XtraRichEdit.UI.HomeRibbonPage(); + clipboardRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.ClipboardRibbonPageGroup(); + fontRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.FontRibbonPageGroup(); + paragraphRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.ParagraphRibbonPageGroup(); + stylesRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.StylesRibbonPageGroup(); + editingRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.EditingRibbonPageGroup(); + insertRibbonPage1 = new DevExpress.XtraRichEdit.UI.InsertRibbonPage(); + pagesRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.PagesRibbonPageGroup(); + tablesRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.TablesRibbonPageGroup(); + illustrationsRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.IllustrationsRibbonPageGroup(); + linksRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.LinksRibbonPageGroup(); + headerFooterRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.HeaderFooterRibbonPageGroup(); + textRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.TextRibbonPageGroup(); + symbolsRibbonPageGroup1 = new DevExpress.XtraRichEdit.UI.SymbolsRibbonPageGroup(); + richEditBarController1 = new DevExpress.XtraRichEdit.UI.RichEditBarController(components); + behaviorManager1 = new DevExpress.Utils.Behaviors.BehaviorManager(components); ((System.ComponentModel.ISupportInitialize)ribbonControl1).BeginInit(); ((System.ComponentModel.ISupportInitialize)repositoryItemFontEditRichEdit1).BeginInit(); ((System.ComponentModel.ISupportInitialize)repositoryItemRichEditFontSizeEdit1).BeginInit(); + ((System.ComponentModel.ISupportInitialize)richEditBarController1).BeginInit(); + ((System.ComponentModel.ISupportInitialize)behaviorManager1).BeginInit(); SuspendLayout(); // // richEditControl1 // - languageInfo1.Culture = new System.Globalization.CultureInfo("de"); - languageInfo2.Culture = new System.Globalization.CultureInfo("pt"); - languageInfo3.Culture = new System.Globalization.CultureInfo("es"); - behaviorManager1.SetBehaviors(richEditControl1, new DevExpress.Utils.Behaviors.Behavior[] { (DevExpress.AIIntegration.WinForms.SummarizeBehavior)DevExpress.Utils.Behaviors.Behavior.Create(typeof(DevExpress.AIIntegration.WinForms.SummarizeBehavior), typeof(DevExpress.AIIntegration.WinForms.RichEditSummarizeBehaviorSource), new object[] { DevExpress.AIIntegration.SummarizeBehaviorMode.Abstractive, null }), (DevExpress.AIIntegration.WinForms.TranslateBehavior)DevExpress.Utils.Behaviors.Behavior.Create(typeof(DevExpress.AIIntegration.WinForms.TranslateBehavior), typeof(DevExpress.AIIntegration.WinForms.RichEditTranslateBehaviorSource), new object[] { new DevExpress.AIIntegration.Desktop.LanguageInfo[] { languageInfo1, languageInfo2, languageInfo3 }, null }), (DevExpress.AIIntegration.WinForms.ToneStyleBehavior)DevExpress.Utils.Behaviors.Behavior.Create(typeof(DevExpress.AIIntegration.WinForms.ToneStyleBehavior), typeof(DevExpress.AIIntegration.WinForms.RichEditToneStyleBehaviorSource), new object[] { null }), (DevExpress.AIIntegration.WinForms.ProofreadBehavior)DevExpress.Utils.Behaviors.Behavior.Create(typeof(DevExpress.AIIntegration.WinForms.ProofreadBehavior), typeof(DevExpress.AIIntegration.WinForms.RichEditProofreadBehaviorSource), new object[] { null }), (DevExpress.AIIntegration.WinForms.RewriteStyleBehavior)DevExpress.Utils.Behaviors.Behavior.Create(typeof(DevExpress.AIIntegration.WinForms.RewriteStyleBehavior), typeof(DevExpress.AIIntegration.WinForms.RichEditRewriteStyleBehaviorSource), new object[] { null }), (DevExpress.AIIntegration.WinForms.ExpandBehavior)DevExpress.Utils.Behaviors.Behavior.Create(typeof(DevExpress.AIIntegration.WinForms.ExpandBehavior), typeof(DevExpress.AIIntegration.WinForms.RichEditExpandBehaviorSource), new object[] { null }), (DevExpress.AIIntegration.WinForms.ShortenBehavior)DevExpress.Utils.Behaviors.Behavior.Create(typeof(DevExpress.AIIntegration.WinForms.ShortenBehavior), typeof(DevExpress.AIIntegration.WinForms.RichEditShortenBehaviorSource), new object[] { null }), (DevExpress.AIIntegration.WinForms.ExplainBehavior)DevExpress.Utils.Behaviors.Behavior.Create(typeof(DevExpress.AIIntegration.WinForms.ExplainBehavior), typeof(DevExpress.AIIntegration.WinForms.RichEditExplainBehaviorSource), new object[] { null }), (DevExpress.AIIntegration.WinForms.CustomRequestBehavior)DevExpress.Utils.Behaviors.Behavior.Create(typeof(DevExpress.AIIntegration.WinForms.CustomRequestBehavior), typeof(DevExpress.AIIntegration.WinForms.RichEditCustomRequestBehaviorSource), new object[] { null }), (DevExpress.AIIntegration.WinForms.GenerateDescriptionBehavior)DevExpress.Utils.Behaviors.Behavior.Create(typeof(DevExpress.AIIntegration.WinForms.GenerateDescriptionBehavior), typeof(DevExpress.AIIntegration.WinForms.RichEditGenerateDescriptionBehaviorSource), new object[] { null }), (DevExpress.AIIntegration.WinForms.GenerateAltTextBehavior)DevExpress.Utils.Behaviors.Behavior.Create(typeof(DevExpress.AIIntegration.WinForms.GenerateAltTextBehavior), typeof(DevExpress.AIIntegration.WinForms.RichEditGenerateAltTextBehaviorSource), new object[] { null }) }); + languageInfo1.Culture = new System.Globalization.CultureInfo("pt"); + languageInfo2.Culture = new System.Globalization.CultureInfo("es"); + languageInfo3.Culture = new System.Globalization.CultureInfo("de"); + behaviorManager1.SetBehaviors(richEditControl1, new DevExpress.Utils.Behaviors.Behavior[] { DevExpress.AIIntegration.WinForms.ExpandBehavior.Create(typeof(DevExpress.AIIntegration.WinForms.RichEditExpandBehaviorSource)), DevExpress.AIIntegration.WinForms.ShortenBehavior.Create(typeof(DevExpress.AIIntegration.WinForms.RichEditShortenBehaviorSource)), DevExpress.AIIntegration.WinForms.SummarizeBehavior.Create(typeof(DevExpress.AIIntegration.WinForms.RichEditSummarizeBehaviorSource), DevExpress.AIIntegration.SummarizationMode.Abstractive), DevExpress.AIIntegration.WinForms.ExplainBehavior.Create(typeof(DevExpress.AIIntegration.WinForms.RichEditExplainBehaviorSource)), DevExpress.AIIntegration.WinForms.ChangeToneBehavior.Create(typeof(DevExpress.AIIntegration.WinForms.RichEditChangeToneBehaviorSource)), DevExpress.AIIntegration.WinForms.ProofreadBehavior.Create(typeof(DevExpress.AIIntegration.WinForms.RichEditProofreadBehaviorSource)), DevExpress.AIIntegration.WinForms.ChangeStyleBehavior.Create(typeof(DevExpress.AIIntegration.WinForms.RichEditChangeStyleBehaviorSource)), DevExpress.AIIntegration.WinForms.TranslateBehavior.Create(typeof(DevExpress.AIIntegration.WinForms.RichEditTranslateBehaviorSource), new DevExpress.AIIntegration.Desktop.LanguageInfo[] { languageInfo1, languageInfo2, languageInfo3 }), DevExpress.AIIntegration.WinForms.CustomRequestBehavior.Create(typeof(DevExpress.AIIntegration.WinForms.RichEditCustomRequestBehaviorSource)), DevExpress.AIIntegration.WinForms.GenerateImageDescriptionBehavior.Create(typeof(DevExpress.AIIntegration.WinForms.RichEditGenerateDescriptionBehaviorSource)) }); richEditControl1.Dock = DockStyle.Fill; - richEditControl1.Location = new Point(0, 292); + richEditControl1.Location = new Point(0, 231); + richEditControl1.Margin = new Padding(2, 2, 2, 2); richEditControl1.MenuManager = ribbonControl1; richEditControl1.Name = "richEditControl1"; richEditControl1.Options.DocumentSaveOptions.CurrentFormat = DevExpress.XtraRichEdit.DocumentFormat.PlainText; - richEditControl1.Size = new Size(1895, 1431); + richEditControl1.Size = new Size(1421, 1004); richEditControl1.TabIndex = 0; richEditControl1.Text = "Text"; // - // richEditBarController1 - // - richEditBarController1.BarItems.Add(undoItem1); - richEditBarController1.BarItems.Add(redoItem1); - richEditBarController1.BarItems.Add(fileNewItem1); - richEditBarController1.BarItems.Add(fileOpenItem1); - richEditBarController1.BarItems.Add(fileSaveItem1); - richEditBarController1.BarItems.Add(fileSaveAsItem1); - richEditBarController1.BarItems.Add(quickPrintItem1); - richEditBarController1.BarItems.Add(printItem1); - richEditBarController1.BarItems.Add(printPreviewItem1); - richEditBarController1.BarItems.Add(encryptDocumentItem1); - richEditBarController1.BarItems.Add(showDocumentPropertiesFormItem1); - richEditBarController1.BarItems.Add(pasteItem1); - richEditBarController1.BarItems.Add(cutItem1); - richEditBarController1.BarItems.Add(copyItem1); - richEditBarController1.BarItems.Add(pasteSpecialItem1); - richEditBarController1.BarItems.Add(changeFontNameItem1); - richEditBarController1.BarItems.Add(changeFontSizeItem1); - richEditBarController1.BarItems.Add(fontSizeIncreaseItem1); - richEditBarController1.BarItems.Add(fontSizeDecreaseItem1); - richEditBarController1.BarItems.Add(toggleFontBoldItem1); - richEditBarController1.BarItems.Add(toggleFontItalicItem1); - richEditBarController1.BarItems.Add(toggleFontUnderlineItem1); - richEditBarController1.BarItems.Add(toggleFontDoubleUnderlineItem1); - richEditBarController1.BarItems.Add(toggleFontStrikeoutItem1); - richEditBarController1.BarItems.Add(toggleFontDoubleStrikeoutItem1); - richEditBarController1.BarItems.Add(toggleFontSuperscriptItem1); - richEditBarController1.BarItems.Add(toggleFontSubscriptItem1); - richEditBarController1.BarItems.Add(changeFontColorItem1); - richEditBarController1.BarItems.Add(changeFontHighlightColorItem1); - richEditBarController1.BarItems.Add(makeTextUpperCaseItem1); - richEditBarController1.BarItems.Add(makeTextLowerCaseItem1); - richEditBarController1.BarItems.Add(capitalizeEachWordCaseItem1); - richEditBarController1.BarItems.Add(toggleTextCaseItem1); - richEditBarController1.BarItems.Add(changeTextCaseItem1); - richEditBarController1.BarItems.Add(clearFormattingItem1); - richEditBarController1.BarItems.Add(toggleBulletedListItem1); - richEditBarController1.BarItems.Add(toggleNumberingListItem1); - richEditBarController1.BarItems.Add(toggleMultiLevelListItem1); - richEditBarController1.BarItems.Add(decreaseIndentItem1); - richEditBarController1.BarItems.Add(increaseIndentItem1); - richEditBarController1.BarItems.Add(rtlToggleBulletedListItem1); - richEditBarController1.BarItems.Add(rtlToggleNumberingListItem1); - richEditBarController1.BarItems.Add(rtlToggleMultiLevelListItem1); - richEditBarController1.BarItems.Add(rtlDecreaseIndentItem1); - richEditBarController1.BarItems.Add(rtlIncreaseIndentItem1); - richEditBarController1.BarItems.Add(toggleParagraphLeftToRightItem1); - richEditBarController1.BarItems.Add(toggleParagraphRightToLeftItem1); - richEditBarController1.BarItems.Add(toggleParagraphAlignmentLeftItem1); - richEditBarController1.BarItems.Add(toggleParagraphAlignmentCenterItem1); - richEditBarController1.BarItems.Add(toggleParagraphAlignmentRightItem1); - richEditBarController1.BarItems.Add(toggleParagraphAlignmentJustifyItem1); - richEditBarController1.BarItems.Add(toggleParagraphAlignmentArabicJustifyItem1); - richEditBarController1.BarItems.Add(toggleParagraphAlignmentJustifyLowItem1); - richEditBarController1.BarItems.Add(toggleParagraphAlignmentJustifyMediumItem1); - richEditBarController1.BarItems.Add(toggleParagraphAlignmentJustifyHighItem1); - richEditBarController1.BarItems.Add(toggleParagraphAlignmentArabicJustifyGroupItem1); - richEditBarController1.BarItems.Add(toggleParagraphAlignmentDistributeItem1); - richEditBarController1.BarItems.Add(toggleParagraphAlignmentThaiDistributeItem1); - richEditBarController1.BarItems.Add(toggleShowWhitespaceItem1); - richEditBarController1.BarItems.Add(setSingleParagraphSpacingItem1); - richEditBarController1.BarItems.Add(setSesquialteralParagraphSpacingItem1); - richEditBarController1.BarItems.Add(setDoubleParagraphSpacingItem1); - richEditBarController1.BarItems.Add(showLineSpacingFormItem1); - richEditBarController1.BarItems.Add(addSpacingBeforeParagraphItem1); - richEditBarController1.BarItems.Add(removeSpacingBeforeParagraphItem1); - richEditBarController1.BarItems.Add(addSpacingAfterParagraphItem1); - richEditBarController1.BarItems.Add(removeSpacingAfterParagraphItem1); - richEditBarController1.BarItems.Add(changeParagraphLineSpacingItem1); - richEditBarController1.BarItems.Add(changeParagraphBackColorItem1); - richEditBarController1.BarItems.Add(galleryChangeStyleItem1); - richEditBarController1.BarItems.Add(findItem1); - richEditBarController1.BarItems.Add(replaceItem1); - richEditBarController1.BarItems.Add(insertPageBreakItem21); - richEditBarController1.BarItems.Add(insertTableItem1); - richEditBarController1.BarItems.Add(insertFloatingPictureItem1); - richEditBarController1.BarItems.Add(insertBookmarkItem1); - richEditBarController1.BarItems.Add(insertHyperlinkItem1); - richEditBarController1.BarItems.Add(editPageHeaderItem1); - richEditBarController1.BarItems.Add(editPageFooterItem1); - richEditBarController1.BarItems.Add(insertPageNumberItem1); - richEditBarController1.BarItems.Add(insertPageCountItem1); - richEditBarController1.BarItems.Add(insertTextBoxItem1); - richEditBarController1.BarItems.Add(insertObjectItem1); - richEditBarController1.BarItems.Add(insertSymbolItem1); - richEditBarController1.Control = richEditControl1; - // // ribbonControl1 // + ribbonControl1.EmptyAreaImageOptions.ImagePadding = new Padding(22, 23, 22, 23); ribbonControl1.ExpandCollapseItem.Id = 0; ribbonControl1.Items.AddRange(new DevExpress.XtraBars.BarItem[] { ribbonControl1.ExpandCollapseItem, undoItem1, redoItem1, fileNewItem1, fileOpenItem1, fileSaveItem1, fileSaveAsItem1, quickPrintItem1, printItem1, printPreviewItem1, encryptDocumentItem1, showDocumentPropertiesFormItem1, pasteItem1, cutItem1, copyItem1, pasteSpecialItem1, barButtonGroup1, changeFontNameItem1, changeFontSizeItem1, fontSizeIncreaseItem1, fontSizeDecreaseItem1, barButtonGroup2, toggleFontBoldItem1, toggleFontItalicItem1, toggleFontUnderlineItem1, toggleFontDoubleUnderlineItem1, toggleFontStrikeoutItem1, toggleFontDoubleStrikeoutItem1, toggleFontSuperscriptItem1, toggleFontSubscriptItem1, barButtonGroup3, changeFontColorItem1, changeFontHighlightColorItem1, changeTextCaseItem1, makeTextUpperCaseItem1, makeTextLowerCaseItem1, capitalizeEachWordCaseItem1, toggleTextCaseItem1, clearFormattingItem1, barButtonGroup4, toggleBulletedListItem1, toggleNumberingListItem1, toggleMultiLevelListItem1, barButtonGroup5, decreaseIndentItem1, increaseIndentItem1, rtlToggleBulletedListItem1, rtlToggleNumberingListItem1, rtlToggleMultiLevelListItem1, rtlDecreaseIndentItem1, rtlIncreaseIndentItem1, toggleParagraphLeftToRightItem1, toggleParagraphRightToLeftItem1, barButtonGroup6, toggleParagraphAlignmentLeftItem1, toggleParagraphAlignmentCenterItem1, toggleParagraphAlignmentRightItem1, toggleParagraphAlignmentJustifyItem1, toggleParagraphAlignmentArabicJustifyGroupItem1, toggleParagraphAlignmentArabicJustifyItem1, toggleParagraphAlignmentJustifyLowItem1, toggleParagraphAlignmentJustifyMediumItem1, toggleParagraphAlignmentJustifyHighItem1, toggleParagraphAlignmentDistributeItem1, toggleParagraphAlignmentThaiDistributeItem1, toggleShowWhitespaceItem1, barButtonGroup7, changeParagraphLineSpacingItem1, setSingleParagraphSpacingItem1, setSesquialteralParagraphSpacingItem1, setDoubleParagraphSpacingItem1, showLineSpacingFormItem1, addSpacingBeforeParagraphItem1, removeSpacingBeforeParagraphItem1, addSpacingAfterParagraphItem1, removeSpacingAfterParagraphItem1, changeParagraphBackColorItem1, galleryChangeStyleItem1, findItem1, replaceItem1, insertPageBreakItem21, insertTableItem1, insertFloatingPictureItem1, insertBookmarkItem1, insertHyperlinkItem1, editPageHeaderItem1, editPageFooterItem1, insertPageNumberItem1, insertPageCountItem1, insertTextBoxItem1, insertObjectItem1, insertSymbolItem1 }); ribbonControl1.Location = new Point(0, 0); + ribbonControl1.Margin = new Padding(2, 2, 2, 2); ribbonControl1.MaxItemId = 92; ribbonControl1.Name = "ribbonControl1"; + ribbonControl1.OptionsMenuMinWidth = 247; ribbonControl1.Pages.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPage[] { fileRibbonPage1, homeRibbonPage1, insertRibbonPage1 }); ribbonControl1.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] { repositoryItemFontEditRichEdit1, repositoryItemRichEditFontSizeEdit1 }); - ribbonControl1.Size = new Size(1895, 292); - // - // commonRibbonPageGroup1 - // - commonRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; - commonRibbonPageGroup1.Name = "commonRibbonPageGroup1"; - // - // fileRibbonPage1 - // - fileRibbonPage1.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] { commonRibbonPageGroup1, infoRibbonPageGroup1 }); - fileRibbonPage1.Name = "fileRibbonPage1"; + ribbonControl1.Size = new Size(1421, 231); // // undoItem1 // @@ -324,11 +230,6 @@ private void InitializeComponent() printPreviewItem1.Id = 9; printPreviewItem1.Name = "printPreviewItem1"; // - // infoRibbonPageGroup1 - // - infoRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; - infoRibbonPageGroup1.Name = "infoRibbonPageGroup1"; - // // encryptDocumentItem1 // encryptDocumentItem1.Id = 10; @@ -339,22 +240,6 @@ private void InitializeComponent() showDocumentPropertiesFormItem1.Id = 11; showDocumentPropertiesFormItem1.Name = "showDocumentPropertiesFormItem1"; // - // clipboardRibbonPageGroup1 - // - clipboardRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; - clipboardRibbonPageGroup1.Name = "clipboardRibbonPageGroup1"; - // - // homeRibbonPage1 - // - homeRibbonPage1.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] { clipboardRibbonPageGroup1, fontRibbonPageGroup1, paragraphRibbonPageGroup1, stylesRibbonPageGroup1, editingRibbonPageGroup1 }); - homeRibbonPage1.Name = "homeRibbonPage1"; - reduceOperation1.Behavior = DevExpress.XtraBars.Ribbon.ReduceOperationBehavior.UntilAvailable; - reduceOperation1.GroupName = null; - reduceOperation1.ItemLinkIndex = 0; - reduceOperation1.ItemLinksCount = 0; - reduceOperation1.Operation = DevExpress.XtraBars.Ribbon.ReduceOperationType.Gallery; - homeRibbonPage1.ReduceOperations.Add(reduceOperation1); - // // pasteItem1 // pasteItem1.Id = 19; @@ -375,10 +260,11 @@ private void InitializeComponent() pasteSpecialItem1.Id = 22; pasteSpecialItem1.Name = "pasteSpecialItem1"; // - // fontRibbonPageGroup1 + // barButtonGroup1 // - fontRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.True; - fontRibbonPageGroup1.Name = "fontRibbonPageGroup1"; + barButtonGroup1.Id = 12; + barButtonGroup1.Name = "barButtonGroup1"; + barButtonGroup1.Tag = "{97BBE334-159B-44d9-A168-0411957565E8}"; // // changeFontNameItem1 // @@ -386,12 +272,25 @@ private void InitializeComponent() changeFontNameItem1.Id = 23; changeFontNameItem1.Name = "changeFontNameItem1"; // + // repositoryItemFontEditRichEdit1 + // + repositoryItemFontEditRichEdit1.AutoHeight = false; + repositoryItemFontEditRichEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) }); + repositoryItemFontEditRichEdit1.Name = "repositoryItemFontEditRichEdit1"; + // // changeFontSizeItem1 // changeFontSizeItem1.Edit = repositoryItemRichEditFontSizeEdit1; changeFontSizeItem1.Id = 24; changeFontSizeItem1.Name = "changeFontSizeItem1"; // + // repositoryItemRichEditFontSizeEdit1 + // + repositoryItemRichEditFontSizeEdit1.AutoHeight = false; + repositoryItemRichEditFontSizeEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) }); + repositoryItemRichEditFontSizeEdit1.Control = richEditControl1; + repositoryItemRichEditFontSizeEdit1.Name = "repositoryItemRichEditFontSizeEdit1"; + // // fontSizeIncreaseItem1 // fontSizeIncreaseItem1.Id = 25; @@ -402,6 +301,12 @@ private void InitializeComponent() fontSizeDecreaseItem1.Id = 26; fontSizeDecreaseItem1.Name = "fontSizeDecreaseItem1"; // + // barButtonGroup2 + // + barButtonGroup2.Id = 13; + barButtonGroup2.Name = "barButtonGroup2"; + barButtonGroup2.Tag = "{433DA7F0-03E2-4650-9DB5-66DD92D16E39}"; + // // toggleFontBoldItem1 // toggleFontBoldItem1.Id = 27; @@ -442,6 +347,12 @@ private void InitializeComponent() toggleFontSubscriptItem1.Id = 34; toggleFontSubscriptItem1.Name = "toggleFontSubscriptItem1"; // + // barButtonGroup3 + // + barButtonGroup3.Id = 14; + barButtonGroup3.Name = "barButtonGroup3"; + barButtonGroup3.Tag = "{DF8C5334-EDE3-47c9-A42C-FE9A9247E180}"; + // // changeFontColorItem1 // changeFontColorItem1.Id = 35; @@ -452,6 +363,12 @@ private void InitializeComponent() changeFontHighlightColorItem1.Id = 36; changeFontHighlightColorItem1.Name = "changeFontHighlightColorItem1"; // + // changeTextCaseItem1 + // + changeTextCaseItem1.Id = 37; + changeTextCaseItem1.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] { new DevExpress.XtraBars.LinkPersistInfo(makeTextUpperCaseItem1), new DevExpress.XtraBars.LinkPersistInfo(makeTextLowerCaseItem1), new DevExpress.XtraBars.LinkPersistInfo(capitalizeEachWordCaseItem1), new DevExpress.XtraBars.LinkPersistInfo(toggleTextCaseItem1) }); + changeTextCaseItem1.Name = "changeTextCaseItem1"; + // // makeTextUpperCaseItem1 // makeTextUpperCaseItem1.Id = 38; @@ -472,68 +389,38 @@ private void InitializeComponent() toggleTextCaseItem1.Id = 41; toggleTextCaseItem1.Name = "toggleTextCaseItem1"; // - // changeTextCaseItem1 - // - changeTextCaseItem1.Id = 37; - changeTextCaseItem1.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] { new DevExpress.XtraBars.LinkPersistInfo(makeTextUpperCaseItem1), new DevExpress.XtraBars.LinkPersistInfo(makeTextLowerCaseItem1), new DevExpress.XtraBars.LinkPersistInfo(capitalizeEachWordCaseItem1), new DevExpress.XtraBars.LinkPersistInfo(toggleTextCaseItem1) }); - changeTextCaseItem1.Name = "changeTextCaseItem1"; - // // clearFormattingItem1 // clearFormattingItem1.Id = 42; clearFormattingItem1.Name = "clearFormattingItem1"; // - // barButtonGroup1 + // barButtonGroup4 // - barButtonGroup1.Id = 12; - barButtonGroup1.Name = "barButtonGroup1"; - barButtonGroup1.Tag = "{97BBE334-159B-44d9-A168-0411957565E8}"; + barButtonGroup4.Id = 15; + barButtonGroup4.Name = "barButtonGroup4"; + barButtonGroup4.Tag = "{0B3A7A43-3079-4ce0-83A8-3789F5F6DC9F}"; // - // repositoryItemFontEditRichEdit1 + // toggleBulletedListItem1 // - repositoryItemFontEditRichEdit1.AutoHeight = false; - repositoryItemFontEditRichEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) }); - repositoryItemFontEditRichEdit1.Name = "repositoryItemFontEditRichEdit1"; + toggleBulletedListItem1.Id = 43; + toggleBulletedListItem1.Name = "toggleBulletedListItem1"; // - // repositoryItemRichEditFontSizeEdit1 + // toggleNumberingListItem1 // - repositoryItemRichEditFontSizeEdit1.AutoHeight = false; - repositoryItemRichEditFontSizeEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) }); - repositoryItemRichEditFontSizeEdit1.Control = richEditControl1; - repositoryItemRichEditFontSizeEdit1.Name = "repositoryItemRichEditFontSizeEdit1"; + toggleNumberingListItem1.Id = 44; + toggleNumberingListItem1.Name = "toggleNumberingListItem1"; // - // barButtonGroup2 - // - barButtonGroup2.Id = 13; - barButtonGroup2.Name = "barButtonGroup2"; - barButtonGroup2.Tag = "{433DA7F0-03E2-4650-9DB5-66DD92D16E39}"; - // - // barButtonGroup3 - // - barButtonGroup3.Id = 14; - barButtonGroup3.Name = "barButtonGroup3"; - barButtonGroup3.Tag = "{DF8C5334-EDE3-47c9-A42C-FE9A9247E180}"; - // - // paragraphRibbonPageGroup1 - // - paragraphRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.True; - paragraphRibbonPageGroup1.Name = "paragraphRibbonPageGroup1"; - // - // toggleBulletedListItem1 - // - toggleBulletedListItem1.Id = 43; - toggleBulletedListItem1.Name = "toggleBulletedListItem1"; - // - // toggleNumberingListItem1 - // - toggleNumberingListItem1.Id = 44; - toggleNumberingListItem1.Name = "toggleNumberingListItem1"; - // - // toggleMultiLevelListItem1 + // toggleMultiLevelListItem1 // toggleMultiLevelListItem1.Id = 45; toggleMultiLevelListItem1.Name = "toggleMultiLevelListItem1"; // + // barButtonGroup5 + // + barButtonGroup5.Id = 16; + barButtonGroup5.Name = "barButtonGroup5"; + barButtonGroup5.Tag = "{4747D5AB-2BEB-4ea6-9A1D-8E4FB36F1B40}"; + // // decreaseIndentItem1 // decreaseIndentItem1.Id = 46; @@ -579,6 +466,12 @@ private void InitializeComponent() toggleParagraphRightToLeftItem1.Id = 54; toggleParagraphRightToLeftItem1.Name = "toggleParagraphRightToLeftItem1"; // + // barButtonGroup6 + // + barButtonGroup6.Id = 17; + barButtonGroup6.Name = "barButtonGroup6"; + barButtonGroup6.Tag = "{8E89E775-996E-49a0-AADA-DE338E34732E}"; + // // toggleParagraphAlignmentLeftItem1 // toggleParagraphAlignmentLeftItem1.Id = 55; @@ -599,6 +492,12 @@ private void InitializeComponent() toggleParagraphAlignmentJustifyItem1.Id = 58; toggleParagraphAlignmentJustifyItem1.Name = "toggleParagraphAlignmentJustifyItem1"; // + // toggleParagraphAlignmentArabicJustifyGroupItem1 + // + toggleParagraphAlignmentArabicJustifyGroupItem1.Id = 59; + toggleParagraphAlignmentArabicJustifyGroupItem1.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] { new DevExpress.XtraBars.LinkPersistInfo(DevExpress.XtraBars.BarLinkUserDefines.KeyTip, toggleParagraphAlignmentArabicJustifyItem1, "", false, true, true, 0, null, DevExpress.XtraBars.BarItemPaintStyle.Standard, "AJ", ""), new DevExpress.XtraBars.LinkPersistInfo(toggleParagraphAlignmentJustifyLowItem1), new DevExpress.XtraBars.LinkPersistInfo(toggleParagraphAlignmentJustifyMediumItem1), new DevExpress.XtraBars.LinkPersistInfo(toggleParagraphAlignmentJustifyHighItem1) }); + toggleParagraphAlignmentArabicJustifyGroupItem1.Name = "toggleParagraphAlignmentArabicJustifyGroupItem1"; + // // toggleParagraphAlignmentArabicJustifyItem1 // toggleParagraphAlignmentArabicJustifyItem1.Id = 60; @@ -619,12 +518,6 @@ private void InitializeComponent() toggleParagraphAlignmentJustifyHighItem1.Id = 63; toggleParagraphAlignmentJustifyHighItem1.Name = "toggleParagraphAlignmentJustifyHighItem1"; // - // toggleParagraphAlignmentArabicJustifyGroupItem1 - // - toggleParagraphAlignmentArabicJustifyGroupItem1.Id = 59; - toggleParagraphAlignmentArabicJustifyGroupItem1.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] { new DevExpress.XtraBars.LinkPersistInfo(DevExpress.XtraBars.BarLinkUserDefines.KeyTip, toggleParagraphAlignmentArabicJustifyItem1, "", false, true, true, 0, null, DevExpress.XtraBars.BarItemPaintStyle.Standard, "AJ", ""), new DevExpress.XtraBars.LinkPersistInfo(toggleParagraphAlignmentJustifyLowItem1), new DevExpress.XtraBars.LinkPersistInfo(toggleParagraphAlignmentJustifyMediumItem1), new DevExpress.XtraBars.LinkPersistInfo(toggleParagraphAlignmentJustifyHighItem1) }); - toggleParagraphAlignmentArabicJustifyGroupItem1.Name = "toggleParagraphAlignmentArabicJustifyGroupItem1"; - // // toggleParagraphAlignmentDistributeItem1 // toggleParagraphAlignmentDistributeItem1.Id = 64; @@ -640,6 +533,18 @@ private void InitializeComponent() toggleShowWhitespaceItem1.Id = 66; toggleShowWhitespaceItem1.Name = "toggleShowWhitespaceItem1"; // + // barButtonGroup7 + // + barButtonGroup7.Id = 18; + barButtonGroup7.Name = "barButtonGroup7"; + barButtonGroup7.Tag = "{9A8DEAD8-3890-4857-A395-EC625FD02217}"; + // + // changeParagraphLineSpacingItem1 + // + changeParagraphLineSpacingItem1.Id = 67; + changeParagraphLineSpacingItem1.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] { new DevExpress.XtraBars.LinkPersistInfo(setSingleParagraphSpacingItem1), new DevExpress.XtraBars.LinkPersistInfo(setSesquialteralParagraphSpacingItem1), new DevExpress.XtraBars.LinkPersistInfo(setDoubleParagraphSpacingItem1), new DevExpress.XtraBars.LinkPersistInfo(showLineSpacingFormItem1), new DevExpress.XtraBars.LinkPersistInfo(DevExpress.XtraBars.BarLinkUserDefines.KeyTip, addSpacingBeforeParagraphItem1, "", false, true, true, 0, null, DevExpress.XtraBars.BarItemPaintStyle.Standard, "B", ""), new DevExpress.XtraBars.LinkPersistInfo(removeSpacingBeforeParagraphItem1), new DevExpress.XtraBars.LinkPersistInfo(addSpacingAfterParagraphItem1), new DevExpress.XtraBars.LinkPersistInfo(removeSpacingAfterParagraphItem1) }); + changeParagraphLineSpacingItem1.Name = "changeParagraphLineSpacingItem1"; + // // setSingleParagraphSpacingItem1 // setSingleParagraphSpacingItem1.Id = 68; @@ -680,46 +585,11 @@ private void InitializeComponent() removeSpacingAfterParagraphItem1.Id = 75; removeSpacingAfterParagraphItem1.Name = "removeSpacingAfterParagraphItem1"; // - // changeParagraphLineSpacingItem1 - // - changeParagraphLineSpacingItem1.Id = 67; - changeParagraphLineSpacingItem1.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] { new DevExpress.XtraBars.LinkPersistInfo(setSingleParagraphSpacingItem1), new DevExpress.XtraBars.LinkPersistInfo(setSesquialteralParagraphSpacingItem1), new DevExpress.XtraBars.LinkPersistInfo(setDoubleParagraphSpacingItem1), new DevExpress.XtraBars.LinkPersistInfo(showLineSpacingFormItem1), new DevExpress.XtraBars.LinkPersistInfo(DevExpress.XtraBars.BarLinkUserDefines.KeyTip, addSpacingBeforeParagraphItem1, "", false, true, true, 0, null, DevExpress.XtraBars.BarItemPaintStyle.Standard, "B", ""), new DevExpress.XtraBars.LinkPersistInfo(removeSpacingBeforeParagraphItem1), new DevExpress.XtraBars.LinkPersistInfo(addSpacingAfterParagraphItem1), new DevExpress.XtraBars.LinkPersistInfo(removeSpacingAfterParagraphItem1) }); - changeParagraphLineSpacingItem1.Name = "changeParagraphLineSpacingItem1"; - // // changeParagraphBackColorItem1 // changeParagraphBackColorItem1.Id = 76; changeParagraphBackColorItem1.Name = "changeParagraphBackColorItem1"; // - // barButtonGroup4 - // - barButtonGroup4.Id = 15; - barButtonGroup4.Name = "barButtonGroup4"; - barButtonGroup4.Tag = "{0B3A7A43-3079-4ce0-83A8-3789F5F6DC9F}"; - // - // barButtonGroup5 - // - barButtonGroup5.Id = 16; - barButtonGroup5.Name = "barButtonGroup5"; - barButtonGroup5.Tag = "{4747D5AB-2BEB-4ea6-9A1D-8E4FB36F1B40}"; - // - // barButtonGroup6 - // - barButtonGroup6.Id = 17; - barButtonGroup6.Name = "barButtonGroup6"; - barButtonGroup6.Tag = "{8E89E775-996E-49a0-AADA-DE338E34732E}"; - // - // barButtonGroup7 - // - barButtonGroup7.Id = 18; - barButtonGroup7.Name = "barButtonGroup7"; - barButtonGroup7.Tag = "{9A8DEAD8-3890-4857-A395-EC625FD02217}"; - // - // stylesRibbonPageGroup1 - // - stylesRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.True; - stylesRibbonPageGroup1.Name = "stylesRibbonPageGroup1"; - // // galleryChangeStyleItem1 // // @@ -727,15 +597,10 @@ private void InitializeComponent() // galleryChangeStyleItem1.Gallery.ColumnCount = 10; galleryChangeStyleItem1.Gallery.Groups.AddRange(new DevExpress.XtraBars.Ribbon.GalleryItemGroup[] { galleryItemGroup1 }); - galleryChangeStyleItem1.Gallery.ImageSize = new Size(130, 92); + galleryChangeStyleItem1.Gallery.ImageSize = new Size(97, 70); galleryChangeStyleItem1.Id = 77; galleryChangeStyleItem1.Name = "galleryChangeStyleItem1"; // - // editingRibbonPageGroup1 - // - editingRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; - editingRibbonPageGroup1.Name = "editingRibbonPageGroup1"; - // // findItem1 // findItem1.Id = 78; @@ -746,48 +611,21 @@ private void InitializeComponent() replaceItem1.Id = 79; replaceItem1.Name = "replaceItem1"; // - // pagesRibbonPageGroup1 - // - pagesRibbonPageGroup1.AllowTextClipping = false; - pagesRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; - pagesRibbonPageGroup1.Name = "pagesRibbonPageGroup1"; - // - // insertRibbonPage1 - // - insertRibbonPage1.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] { pagesRibbonPageGroup1, tablesRibbonPageGroup1, illustrationsRibbonPageGroup1, linksRibbonPageGroup1, headerFooterRibbonPageGroup1, textRibbonPageGroup1, symbolsRibbonPageGroup1 }); - insertRibbonPage1.Name = "insertRibbonPage1"; - // // insertPageBreakItem21 // insertPageBreakItem21.Id = 80; insertPageBreakItem21.Name = "insertPageBreakItem21"; // - // tablesRibbonPageGroup1 - // - tablesRibbonPageGroup1.AllowTextClipping = false; - tablesRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; - tablesRibbonPageGroup1.Name = "tablesRibbonPageGroup1"; - // // insertTableItem1 // insertTableItem1.Id = 81; insertTableItem1.Name = "insertTableItem1"; // - // illustrationsRibbonPageGroup1 - // - illustrationsRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; - illustrationsRibbonPageGroup1.Name = "illustrationsRibbonPageGroup1"; - // // insertFloatingPictureItem1 // insertFloatingPictureItem1.Id = 82; insertFloatingPictureItem1.Name = "insertFloatingPictureItem1"; // - // linksRibbonPageGroup1 - // - linksRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; - linksRibbonPageGroup1.Name = "linksRibbonPageGroup1"; - // // insertBookmarkItem1 // insertBookmarkItem1.Id = 83; @@ -798,11 +636,6 @@ private void InitializeComponent() insertHyperlinkItem1.Id = 84; insertHyperlinkItem1.Name = "insertHyperlinkItem1"; // - // headerFooterRibbonPageGroup1 - // - headerFooterRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; - headerFooterRibbonPageGroup1.Name = "headerFooterRibbonPageGroup1"; - // // editPageHeaderItem1 // editPageHeaderItem1.Id = 85; @@ -823,11 +656,6 @@ private void InitializeComponent() insertPageCountItem1.Id = 88; insertPageCountItem1.Name = "insertPageCountItem1"; // - // textRibbonPageGroup1 - // - textRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; - textRibbonPageGroup1.Name = "textRibbonPageGroup1"; - // // insertTextBoxItem1 // insertTextBoxItem1.Id = 89; @@ -838,31 +666,223 @@ private void InitializeComponent() insertObjectItem1.Id = 90; insertObjectItem1.Name = "insertObjectItem1"; // + // insertSymbolItem1 + // + insertSymbolItem1.Id = 91; + insertSymbolItem1.Name = "insertSymbolItem1"; + // + // fileRibbonPage1 + // + fileRibbonPage1.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] { commonRibbonPageGroup1, infoRibbonPageGroup1 }); + fileRibbonPage1.Name = "fileRibbonPage1"; + // + // commonRibbonPageGroup1 + // + commonRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; + commonRibbonPageGroup1.Name = "commonRibbonPageGroup1"; + commonRibbonPageGroup1.Text = ""; + // + // infoRibbonPageGroup1 + // + infoRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; + infoRibbonPageGroup1.Name = "infoRibbonPageGroup1"; + infoRibbonPageGroup1.Text = ""; + // + // homeRibbonPage1 + // + homeRibbonPage1.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] { clipboardRibbonPageGroup1, fontRibbonPageGroup1, paragraphRibbonPageGroup1, stylesRibbonPageGroup1, editingRibbonPageGroup1 }); + homeRibbonPage1.Name = "homeRibbonPage1"; + reduceOperation1.Behavior = DevExpress.XtraBars.Ribbon.ReduceOperationBehavior.UntilAvailable; + reduceOperation1.GroupName = null; + reduceOperation1.ItemLinkIndex = 0; + reduceOperation1.ItemLinksCount = 0; + reduceOperation1.Operation = DevExpress.XtraBars.Ribbon.ReduceOperationType.Gallery; + homeRibbonPage1.ReduceOperations.Add(reduceOperation1); + // + // clipboardRibbonPageGroup1 + // + clipboardRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; + clipboardRibbonPageGroup1.Name = "clipboardRibbonPageGroup1"; + clipboardRibbonPageGroup1.Text = ""; + // + // fontRibbonPageGroup1 + // + fontRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.True; + fontRibbonPageGroup1.Name = "fontRibbonPageGroup1"; + fontRibbonPageGroup1.Text = ""; + // + // paragraphRibbonPageGroup1 + // + paragraphRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.True; + paragraphRibbonPageGroup1.Name = "paragraphRibbonPageGroup1"; + paragraphRibbonPageGroup1.Text = ""; + // + // stylesRibbonPageGroup1 + // + stylesRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.True; + stylesRibbonPageGroup1.Name = "stylesRibbonPageGroup1"; + stylesRibbonPageGroup1.Text = ""; + // + // editingRibbonPageGroup1 + // + editingRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; + editingRibbonPageGroup1.Name = "editingRibbonPageGroup1"; + editingRibbonPageGroup1.Text = ""; + // + // insertRibbonPage1 + // + insertRibbonPage1.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] { pagesRibbonPageGroup1, tablesRibbonPageGroup1, illustrationsRibbonPageGroup1, linksRibbonPageGroup1, headerFooterRibbonPageGroup1, textRibbonPageGroup1, symbolsRibbonPageGroup1 }); + insertRibbonPage1.Name = "insertRibbonPage1"; + // + // pagesRibbonPageGroup1 + // + pagesRibbonPageGroup1.AllowTextClipping = false; + pagesRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; + pagesRibbonPageGroup1.Name = "pagesRibbonPageGroup1"; + pagesRibbonPageGroup1.Text = ""; + // + // tablesRibbonPageGroup1 + // + tablesRibbonPageGroup1.AllowTextClipping = false; + tablesRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; + tablesRibbonPageGroup1.Name = "tablesRibbonPageGroup1"; + tablesRibbonPageGroup1.Text = ""; + // + // illustrationsRibbonPageGroup1 + // + illustrationsRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; + illustrationsRibbonPageGroup1.Name = "illustrationsRibbonPageGroup1"; + illustrationsRibbonPageGroup1.Text = ""; + // + // linksRibbonPageGroup1 + // + linksRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; + linksRibbonPageGroup1.Name = "linksRibbonPageGroup1"; + linksRibbonPageGroup1.Text = ""; + // + // headerFooterRibbonPageGroup1 + // + headerFooterRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; + headerFooterRibbonPageGroup1.Name = "headerFooterRibbonPageGroup1"; + headerFooterRibbonPageGroup1.Text = ""; + // + // textRibbonPageGroup1 + // + textRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; + textRibbonPageGroup1.Name = "textRibbonPageGroup1"; + textRibbonPageGroup1.Text = ""; + // // symbolsRibbonPageGroup1 // symbolsRibbonPageGroup1.AllowTextClipping = false; symbolsRibbonPageGroup1.CaptionButtonVisible = DevExpress.Utils.DefaultBoolean.False; symbolsRibbonPageGroup1.Name = "symbolsRibbonPageGroup1"; + symbolsRibbonPageGroup1.Text = ""; // - // insertSymbolItem1 + // richEditBarController1 // - insertSymbolItem1.Id = 91; - insertSymbolItem1.Name = "insertSymbolItem1"; + richEditBarController1.BarItems.Add(undoItem1); + richEditBarController1.BarItems.Add(redoItem1); + richEditBarController1.BarItems.Add(fileNewItem1); + richEditBarController1.BarItems.Add(fileOpenItem1); + richEditBarController1.BarItems.Add(fileSaveItem1); + richEditBarController1.BarItems.Add(fileSaveAsItem1); + richEditBarController1.BarItems.Add(quickPrintItem1); + richEditBarController1.BarItems.Add(printItem1); + richEditBarController1.BarItems.Add(printPreviewItem1); + richEditBarController1.BarItems.Add(encryptDocumentItem1); + richEditBarController1.BarItems.Add(showDocumentPropertiesFormItem1); + richEditBarController1.BarItems.Add(pasteItem1); + richEditBarController1.BarItems.Add(cutItem1); + richEditBarController1.BarItems.Add(copyItem1); + richEditBarController1.BarItems.Add(pasteSpecialItem1); + richEditBarController1.BarItems.Add(changeFontNameItem1); + richEditBarController1.BarItems.Add(changeFontSizeItem1); + richEditBarController1.BarItems.Add(fontSizeIncreaseItem1); + richEditBarController1.BarItems.Add(fontSizeDecreaseItem1); + richEditBarController1.BarItems.Add(toggleFontBoldItem1); + richEditBarController1.BarItems.Add(toggleFontItalicItem1); + richEditBarController1.BarItems.Add(toggleFontUnderlineItem1); + richEditBarController1.BarItems.Add(toggleFontDoubleUnderlineItem1); + richEditBarController1.BarItems.Add(toggleFontStrikeoutItem1); + richEditBarController1.BarItems.Add(toggleFontDoubleStrikeoutItem1); + richEditBarController1.BarItems.Add(toggleFontSuperscriptItem1); + richEditBarController1.BarItems.Add(toggleFontSubscriptItem1); + richEditBarController1.BarItems.Add(changeFontColorItem1); + richEditBarController1.BarItems.Add(changeFontHighlightColorItem1); + richEditBarController1.BarItems.Add(makeTextUpperCaseItem1); + richEditBarController1.BarItems.Add(makeTextLowerCaseItem1); + richEditBarController1.BarItems.Add(capitalizeEachWordCaseItem1); + richEditBarController1.BarItems.Add(toggleTextCaseItem1); + richEditBarController1.BarItems.Add(changeTextCaseItem1); + richEditBarController1.BarItems.Add(clearFormattingItem1); + richEditBarController1.BarItems.Add(toggleBulletedListItem1); + richEditBarController1.BarItems.Add(toggleNumberingListItem1); + richEditBarController1.BarItems.Add(toggleMultiLevelListItem1); + richEditBarController1.BarItems.Add(decreaseIndentItem1); + richEditBarController1.BarItems.Add(increaseIndentItem1); + richEditBarController1.BarItems.Add(rtlToggleBulletedListItem1); + richEditBarController1.BarItems.Add(rtlToggleNumberingListItem1); + richEditBarController1.BarItems.Add(rtlToggleMultiLevelListItem1); + richEditBarController1.BarItems.Add(rtlDecreaseIndentItem1); + richEditBarController1.BarItems.Add(rtlIncreaseIndentItem1); + richEditBarController1.BarItems.Add(toggleParagraphLeftToRightItem1); + richEditBarController1.BarItems.Add(toggleParagraphRightToLeftItem1); + richEditBarController1.BarItems.Add(toggleParagraphAlignmentLeftItem1); + richEditBarController1.BarItems.Add(toggleParagraphAlignmentCenterItem1); + richEditBarController1.BarItems.Add(toggleParagraphAlignmentRightItem1); + richEditBarController1.BarItems.Add(toggleParagraphAlignmentJustifyItem1); + richEditBarController1.BarItems.Add(toggleParagraphAlignmentArabicJustifyItem1); + richEditBarController1.BarItems.Add(toggleParagraphAlignmentJustifyLowItem1); + richEditBarController1.BarItems.Add(toggleParagraphAlignmentJustifyMediumItem1); + richEditBarController1.BarItems.Add(toggleParagraphAlignmentJustifyHighItem1); + richEditBarController1.BarItems.Add(toggleParagraphAlignmentArabicJustifyGroupItem1); + richEditBarController1.BarItems.Add(toggleParagraphAlignmentDistributeItem1); + richEditBarController1.BarItems.Add(toggleParagraphAlignmentThaiDistributeItem1); + richEditBarController1.BarItems.Add(toggleShowWhitespaceItem1); + richEditBarController1.BarItems.Add(setSingleParagraphSpacingItem1); + richEditBarController1.BarItems.Add(setSesquialteralParagraphSpacingItem1); + richEditBarController1.BarItems.Add(setDoubleParagraphSpacingItem1); + richEditBarController1.BarItems.Add(showLineSpacingFormItem1); + richEditBarController1.BarItems.Add(addSpacingBeforeParagraphItem1); + richEditBarController1.BarItems.Add(removeSpacingBeforeParagraphItem1); + richEditBarController1.BarItems.Add(addSpacingAfterParagraphItem1); + richEditBarController1.BarItems.Add(removeSpacingAfterParagraphItem1); + richEditBarController1.BarItems.Add(changeParagraphLineSpacingItem1); + richEditBarController1.BarItems.Add(changeParagraphBackColorItem1); + richEditBarController1.BarItems.Add(galleryChangeStyleItem1); + richEditBarController1.BarItems.Add(findItem1); + richEditBarController1.BarItems.Add(replaceItem1); + richEditBarController1.BarItems.Add(insertPageBreakItem21); + richEditBarController1.BarItems.Add(insertTableItem1); + richEditBarController1.BarItems.Add(insertFloatingPictureItem1); + richEditBarController1.BarItems.Add(insertBookmarkItem1); + richEditBarController1.BarItems.Add(insertHyperlinkItem1); + richEditBarController1.BarItems.Add(editPageHeaderItem1); + richEditBarController1.BarItems.Add(editPageFooterItem1); + richEditBarController1.BarItems.Add(insertPageNumberItem1); + richEditBarController1.BarItems.Add(insertPageCountItem1); + richEditBarController1.BarItems.Add(insertTextBoxItem1); + richEditBarController1.BarItems.Add(insertObjectItem1); + richEditBarController1.BarItems.Add(insertSymbolItem1); + richEditBarController1.Control = richEditControl1; // // RichEditForm // - AutoScaleDimensions = new SizeF(12F, 25F); + AutoScaleDimensions = new SizeF(9F, 19F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(1895, 1723); + ClientSize = new Size(1421, 1235); Controls.Add(richEditControl1); Controls.Add(ribbonControl1); + Margin = new Padding(2, 2, 2, 2); Name = "RichEditForm"; + Ribbon = ribbonControl1; Text = "RichEditForm"; - ((System.ComponentModel.ISupportInitialize)richEditBarController1).EndInit(); - ((System.ComponentModel.ISupportInitialize)behaviorManager1).EndInit(); ((System.ComponentModel.ISupportInitialize)ribbonControl1).EndInit(); ((System.ComponentModel.ISupportInitialize)repositoryItemFontEditRichEdit1).EndInit(); ((System.ComponentModel.ISupportInitialize)repositoryItemRichEditFontSizeEdit1).EndInit(); + ((System.ComponentModel.ISupportInitialize)richEditBarController1).EndInit(); + ((System.ComponentModel.ISupportInitialize)behaviorManager1).EndInit(); ResumeLayout(false); PerformLayout(); } diff --git a/CS/winforms-ai-extensions/WinForms-AI-Extensions.csproj b/CS/winforms-ai-extensions/WinForms-AI-Extensions.csproj index 9ab1864..444e859 100644 --- a/CS/winforms-ai-extensions/WinForms-AI-Extensions.csproj +++ b/CS/winforms-ai-extensions/WinForms-AI-Extensions.csproj @@ -1,27 +1,24 @@  - - WinExe - net8.0-windows - WinForms_AI_Extensions - enable - true - enable - + + WinExe + net8.0-windows + WinForms_AI_Extensions + enable + true + enable + - - - - - - - - + + + + + - - - Always - - + + + Always + + \ No newline at end of file diff --git a/CS/wpf-ai-extensions/App.xaml.cs b/CS/wpf-ai-extensions/App.xaml.cs index f5f31c7..540e5c6 100644 --- a/CS/wpf-ai-extensions/App.xaml.cs +++ b/CS/wpf-ai-extensions/App.xaml.cs @@ -25,11 +25,13 @@ protected override void OnStartup(StartupEventArgs e) ApplicationThemeHelper.ApplicationThemeName = "Office2019Colorful"; - AIExtensionsContainerDesktop.Default.RegisterChatClientOpenAIService( - new AzureOpenAIClient( - new Uri(AzureOpenAIEndpoint), - new System.ClientModel.ApiKeyCredential(AzureOpenAIKey)), - DeploymentName); + + ///To register Ollama + //OllamaChatClient ollamaChatClient = new OllamaChatClient("http://localhost:11434/api/chat", "llama3.1"); + + AzureOpenAIClient azureOpenAIClient = new AzureOpenAIClient(new Uri(AzureOpenAIEndpoint), + new System.ClientModel.ApiKeyCredential(AzureOpenAIKey)); + AIExtensionsContainerDesktop.Default.RegisterChatClient(azureOpenAIClient.AsChatClient(DeploymentName)); } } } diff --git a/CS/wpf-ai-extensions/MainWindow.xaml b/CS/wpf-ai-extensions/MainWindow.xaml index b2f287a..2341692 100644 --- a/CS/wpf-ai-extensions/MainWindow.xaml +++ b/CS/wpf-ai-extensions/MainWindow.xaml @@ -6,8 +6,7 @@ xmlns:local="clr-namespace:WPF_AI_Extensions" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm" - xmlns:wpf="clr-namespace:DevExpress.AIIntegration.Wpf;assembly=DevExpress.AIIntegration.Wpf.v24.2" - xmlns:desktop="clr-namespace:DevExpress.AIIntegration.Desktop;assembly=DevExpress.AIIntegration.Desktop.v24.2" + xmlns:dxai="http://schemas.devexpress.com/winfx/2008/xaml/ai" xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800"> @@ -16,23 +15,25 @@ - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/CS/wpf-ai-extensions/RichEditWindow.xaml b/CS/wpf-ai-extensions/RichEditWindow.xaml index cab79ea..50251bf 100644 --- a/CS/wpf-ai-extensions/RichEditWindow.xaml +++ b/CS/wpf-ai-extensions/RichEditWindow.xaml @@ -5,27 +5,28 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:WPF_AI_Extensions" xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm" - xmlns:dxre="http://schemas.devexpress.com/winfx/2008/xaml/richedit" - xmlns:wpfo="clr-namespace:DevExpress.AIIntegration.Wpf.Office;assembly=DevExpress.AIIntegration.Wpf.v24.2" - xmlns:desktop="clr-namespace:DevExpress.AIIntegration.Desktop;assembly=DevExpress.AIIntegration.Desktop.v24.2" + xmlns:dxre="http://schemas.devexpress.com/winfx/2008/xaml/richedit" + xmlns:dxai="http://schemas.devexpress.com/winfx/2008/xaml/ai" mc:Ignorable="d" Title="RichEditWindow" Height="450" Width="800"> - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/CS/wpf-ai-extensions/WPF-AI-Extensions.csproj b/CS/wpf-ai-extensions/WPF-AI-Extensions.csproj index 2662cc6..d0db604 100644 --- a/CS/wpf-ai-extensions/WPF-AI-Extensions.csproj +++ b/CS/wpf-ai-extensions/WPF-AI-Extensions.csproj @@ -10,9 +10,10 @@ - - - + + + + diff --git a/README.md b/README.md index 9cd8d02..68578c9 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,15 @@ This example registers an Azure OpenAI service and uses AI APIs within a .NET 8 ## Implementation Details -Install DevExpress AI-related NuGet packages +Install the following NuGet packages: -1. DevExpress.AIIntegration.WinForms / DevExpress.AIIntegration.WPF +1. Azure.AI.OpenAI -2. DevExpress.AIIntegration.Azure.OpenAI +2. DevExpress.AIIntegration + +3. Microsoft.Extensions.AI.Ollama + +4. Microsoft.Extensions.AI.OpenAI ### Register AI Services @@ -35,13 +39,19 @@ static string AzureOpenAIEndpoint { get { return Environment.GetEnvironmentVaria static string AzureOpenAIKey { get { return Environment.GetEnvironmentVariable("AZURE_OPENAI_APIKEY"); } } static string DeploymentName { get { return Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENTNAME"); } } -... -AIExtensionsContainerDesktop.Default.RegisterChatClientOpenAIService( - new AzureOpenAIClient( - new Uri(AzureOpenAIEndpoint), - new System.ClientModel.ApiKeyCredential(AzureOpenAIKey)), - DeploymentName); -// To use offline models powered by Ollama, use the RegisterChatClientOllamaAIService("http://localhost:11434/api/chat", "llama3.1"); method +AIExtensionsContainerDefault defaultAIContainer; +public SampleAITextModifier() +{ + + ///To register Ollama + //OllamaChatClient ollamaChatClient = new OllamaChatClient("http://localhost:11434/api/chat", "yourModelName"); + //defaultAIContainer = AIExtensionsContainerConsole.CreateDefaultAIExtensionContainer(ollamaChatClient); + + ///To register Azure OpenAI + AzureOpenAIClient azureOpenAIClient = new AzureOpenAIClient(new Uri(AzureOpenAIEndpoint), + new System.ClientModel.ApiKeyCredential(AzureOpenAIKey)); + defaultAIContainer = AIExtensionsContainerConsole.CreateDefaultAIExtensionContainer(azureOpenAIClient.AsChatClient(DeploymentName)); +} ``` ### WinForms