private void Form1_Load(object sender, EventArgs e) { CheckForIllegalCrossThreadCalls = false; Licensing.LicensingForm(this, menuStrip1, HelpString, OtherText); Solver.Init(); statuslabel.Text = ""; }
public void Execute() { LogManager.LogFactory = new ConsoleLogFactory(); Licensing.RegisterLicense("<removed>"); var redisManagerPool = new RedisManagerPool("redis://redisHost?db=7"); for (int i = 0; i < 5; i++) { try { using (IRedisClient client = redisManagerPool.GetClient()) { string value = client.GetValue("status"); Console.WriteLine($"Successfully retrieved value => '{value}'"); } } catch (Exception ex) { Console.WriteLine($"Exception handled \n{ex}"); } Console.WriteLine("Sleeping for 25 seconds to allow client to be garbage collected"); Thread.Sleep(TimeSpan.FromSeconds(25)); } }
public RavenConfiguration Initialize() { Http.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); Testing.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); Server.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); Core.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); Replication.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); Cluster.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); Etl.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); Queries.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); Patching.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); Logs.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); Memory.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); Storage.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); Security.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); Indexing.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); Monitoring.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); Studio.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); Databases.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); PerformanceHints.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); Licensing.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); Tombstones.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); Subscriptions.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName); PostInit(); Initialized = true; return(this); }
public RavenConfiguration Initialize() { Core.Initialize(Settings); Replication.Initialize(Settings); SqlReplication.Initialize(Settings); Queries.Initialize(Settings); Patching.Initialize(Settings); DebugLog.Initialize(Settings); BulkInsert.Initialize(Settings); Server.Initialize(Settings); Memory.Initialize(Settings); Storage.Initialize(Settings); Encryption.Initialize(Settings); Indexing.Initialize(Settings); Monitoring.Initialize(Settings); Expiration.Initialize(Settings); Studio.Initialize(Settings); Databases.Initialize(Settings); Licensing.Initialize(Settings); Quotas.Initialize(Settings); Tombstones.Initialize(Settings); PostInit(); Initialized = true; return(this); }
private static void Main(string[] args) { var license = ConfigurationManager.AppSettings["servicestack:license"]; if (!string.IsNullOrEmpty(license)) { Licensing.RegisterLicense(license); } LogManager.LogFactory = new EventLogFactory("React.Sample.SSS.SelfHost", "Application"); ILog log = LogManager.GetLogger(typeof(Program)); try { var appHost = new AppHost().Init().Start("http://*:8088/"); appHost.StartUpErrors.Each(error => log.Error(error)); ; } catch (Exception ex) { log.Error(ex); } "ServiceStack Self Host with Razor listening at http://localhost:8088 ".Print(); Process.Start("http://localhost:8088/"); Console.ReadLine(); }
private void BtnValDocAndTransToKey_Click(object sender, RoutedEventArgs e) { if (!Licensing.SignedDocumentIsValid(this.TxtLicenseDocument.Text)) { Display.DialogMessage("Attention!", "License Document (XML) is not Valid.", EMessageType.Error); return; } // IMPORTANT: Document (XML) and Key Code must be equivalent always to avoid mistakes. var Info = Licensing.ExtractValidLicense(this.TxtLicenseDocument.Text, "1"); this.TxtUser.Text = Info.Item1; this.CbxType.SelectedItem = AppExec.LicenseTypes.FirstOrDefault(item => item.TechName == Info.Item2); this.CbxEdition.SelectedItem = AppExec.LicenseEditions.FirstOrDefault(item => item.TechName == Info.Item3); this.CbxMode.SelectedItem = AppExec.LicenseModes.FirstOrDefault(item => item.TechName == Info.Item4); this.TxtExpiration.Text = Info.Item5.ToString("yyyyMMdd"); this.TxtLicenseKeyCode.Text = Licensing.LicenseDocumentToKeyCode(this.TxtLicenseDocument.Text); /* * var ValBytes = this.TxtLicenseDocument.Text.StringToBytes(); * var ValCompZip = BytesHandling.Compress(ValBytes, true); * var ValCompDef = BytesHandling.Compress(ValBytes, false); * var ValBase64Zip = Convert.ToBase64String(ValCompZip); * var ValBase64Def = Convert.ToBase64String(ValCompDef); * * Display.DialogMessage("Sizes...", "Original =" + this.TxtLicenseDocument.Text.Length + * "\nBytes UTF8=" + ValBytes.Length + * "\nComp Zip=" + ValCompZip.Length + * "\nComp Def=" + ValCompDef.Length + * "\nCompB64Zip=" + ValBase64Zip.Length + * "\nCompB64Def=" + ValBase64Def.Length); */ }
public void ProcessRegistration() { try { var Document = Licensing.LicenseKeyCodeToDocument(this.TxtKeyCode.Text); var License = Licensing.ExtractValidLicense(Document, AppExec.ApplicationVersionMajorNumber); AppExec.CurrentLicenseUserName = License.Item1; AppExec.CurrentLicenseType = AppExec.LicenseTypes.GetByTechName(License.Item2); AppExec.CurrentLicenseEdition = AppExec.LicenseEditions.GetByTechName(License.Item3); AppExec.CurrentLicenseMode = AppExec.LicenseModes.GetByTechName(License.Item4); AppExec.CurrentLicenseExpiration = License.Item5; General.StringToFile(AppExec.LicenseFilePath, this.TxtKeyCode.Text); this.TxtLicensedUser.Text = AppExec.CurrentLicenseUserName; this.TxtLicType.Text = AppExec.CurrentLicenseType.Name; this.TxtLicEdition.Text = AppExec.CurrentLicenseEdition.Name; this.TxtLicMode.Text = AppExec.CurrentLicenseMode.Name; this.TxtLicExpiration.Text = (AppExec.CurrentLicenseExpiration == General.EMPTY_DATE ? "NEVER" : AppExec.CurrentLicenseExpiration.ToShortDateString()); this.BrdLicense.Background = Brushes.Honeydew; Display.DialogMessage("Attention!", "Product License has been successfully registered!", EMessageType.Information); } catch (Exception Problem) { Display.DialogMessage("Attention!", "Cannot validate and register License.\nProblem: " + Problem.Message, EMessageType.Error); } //? Display.GetCurrentWindow().Close(); }
private void BtnGenerate_Click(object sender, RoutedEventArgs e) { try { if (this.PrivateKey.IsAbsent()) { var Location = Display.DialogGetOpenFile("Select Key file...", ".key", "Keys (*.key)|*.key"); if (Location == null) { return; } PrivateKey = General.FileToString(Location.LocalPath); } // IMPORTANT: Document (XML) and Key Code must be equivalent always to avoid mistakes. var LicenseDoc = Licensing.CreateLicenseInfoSignedDocument(this.TxtUser.Text, ((SimpleElement)this.CbxType.SelectedItem).TechName, ((SimpleElement)this.CbxEdition.SelectedItem).TechName, ((SimpleElement)this.CbxMode.SelectedItem).TechName, DateTime.ParseExact(this.TxtExpiration.Text.Trim(), "yyyyMMdd", CultureInfo.InvariantCulture), AppExec.ApplicationName, AppExec.ApplicationVersionMajorNumber, PrivateKey); this.TxtLicenseDocument.Text = LicenseDoc; } catch (Exception Problem) { Display.DialogMessage("Error!", "Cannot load key file or generate license document.\nProblem: " + Problem.Message, EMessageType.Error); } }
private void BtnSave_Click(object sender, RoutedEventArgs e) { try { // IMPORTANT: Document (XML) and Key Code must be equivalent always to avoid mistakes. this.TxtLicenseDocument.Text = Licensing.LicenseKeyCodeToDocument(this.TxtLicenseKeyCode.Text); } catch (Exception Problem) { Display.DialogMessage("Error!", "Cannot convert License Key Code to Document. Problem: " + Problem.Message, EMessageType.Error); } if (!Licensing.SignedDocumentIsValid(this.TxtLicenseDocument.Text)) { Display.DialogMessage("Attention!", "License document is not valid", EMessageType.Error); return; } var Location = Display.DialogGetSaveFile("Save License Key file...", "." + AppExec.LICENSE_EXTENSION, "Licenses (*." + AppExec.LICENSE_EXTENSION + ")|*." + AppExec.LICENSE_EXTENSION); if (Location == null) { return; } try { General.StringToFile(Location.LocalPath, this.TxtLicenseKeyCode.Text); } catch (Exception Problem) { Display.DialogMessage("Error!", "Cannot save License Key file. Problem: " + Problem.Message, EMessageType.Error); } }
/// <summary> /// The main program executes the tests. Output may be routed to /// various locations, depending on the arguments passed. /// </summary> /// <remarks>Run with --help for a full list of arguments supported</remarks> /// <param name="args"></param> public static int Main(string[] args) { var licenseKey = Environment.GetEnvironmentVariable("SERVICESTACK_LICENSE"); if (string.IsNullOrEmpty(licenseKey)) { throw new ArgumentNullException("SERVICESTACK_LICENSE", "Add Environment variable for SERVICESTACK_LICENSE"); } Licensing.RegisterLicense(licenseKey); //"ActivatedLicenseFeatures: ".Print(LicenseUtils.ActivatedLicenseFeatures()); LogManager.LogFactory = new ConsoleLogFactory(debugEnabled: true); CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); JsConfig.InitStatics(); //JsonServiceClient client = new JsonServiceClient(); var writer = new ExtendedTextWrapper(Console.Out); var result = new AutoRun(((IReflectableType)typeof(NetCoreTestsRunner)).GetTypeInfo().Assembly).Execute(args, writer, Console.In); #if DEBUG "Press Any Key to Quit.".Print(); Console.Read(); #endif return(result); }
public async void TestAGPL() { using (var contentRoot = new TempContentRoot() .AddResource("images/fire.jpg", "TestFiles.fire-umbrella-small.jpg")) { var clock = new RealClock(); var mgr = new LicenseManagerSingleton(ImazenPublicKeys.Test, clock, new StringCacheMem()); var licensing = new Licensing(mgr); using var host = await StartAsyncWithOptions(new ImageflowMiddlewareOptions () { Licensing = licensing, MyOpenSourceProjectUrl = "https://github.com/username/project", EnforcementMethod = EnforceLicenseWith.RedDotWatermark }.MapPath("/", Path.Combine(contentRoot.PhysicalPath, "images"))); // Create an HttpClient to send requests to the TestServer using var client = host.GetTestClient(); using var licensedResponse = await client.GetAsync("/fire.jpg?w=1"); licensedResponse.EnsureSuccessStatusCode(); var page = licensing.Result.ProvidePublicLicensesPage(); Assert.Contains("License Validation OFF", page); Assert.Contains("No license keys found.", page); Assert.DoesNotContain("You must purchase a license key or comply with the AGPLv3.", page); Assert.DoesNotContain("To get a license key", page); Assert.Contains("You are using EnforceLicenseWith.RedDotWatermark", page); await host.StopAsync(CancellationToken.None); } }
public TestsBase() { if (File.Exists(LicenseTextPath)) { Licensing.RegisterLicenseFromFile(LicenseTextPath); } }
static void Main() { try { if (!Licensing.CanBuildEnhancedVersionHash()) { // nie udalo sie stworzyc hasha. Ktos probuje odpalic wersje rozszerzona MessageBox.Show("Unable to build Enhanced version hash.\r\nWe are sorry but " + EngineConfig.C_GAME_NAME + " Enhanced version cannot be run under Windows Guest Account. Please run the game under Administrator account.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (EngineConfig.IsEnhancedVersion) { MessageBox.Show("You already have Wings of Fury 2: Return of the legend enhanced version!", "Wings of Fury 2 - Enhanced Version"); return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); } catch (Exception exception) { MessageBox.Show(exception.Message + ", " + exception.InnerException.Message + ". " + exception.StackTrace); } }
protected void Application_Start(object sender, EventArgs e) { JarsCore.Container = MEFBusinessLoader.Init(); //add license string licPath = "~/ServiceStackLicense.txt".MapHostAbsolutePath(); Logger.Info($"Register ServiceStack license if available."); Licensing.RegisterLicense("7387-e1JlZjo3Mzg3LE5hbWU6Q2Fwcmljb3JuIENvZGluZyBMdGQsVHlwZTpJbmRpZSxNZXRhOjAsSGFzaDpUYk9zUnp0SlR3dUVkdEdDWVl6M2thVUVQQ3IrSFpQQWlUUVBESHdRNnVXLzZwNUtzMUxjYjRBVmpuTTJYalZqRTEwWU9FOXVNWDM2bHh6NWVyOFlVNlovSUUwa1Q0bWpxMDQ4V0lzajN6cCtRVGcwZTVwa1ZFL3Q0NjcyWmFSak56ZXo3QnZqbTU3Zmt4LzhLTDdoV0VCNmtNR0UvdXA2bUJob1Z6YWxYdVk9LEV4cGlyeToyMDIwLTA3LTA2fQ==");//.RegisterLicenseFromFileIfExists(licPath); AppHost appHost = new AppHost(); //appHost.OnConnect = (evtSub, dictVal) => { Console.WriteLine($"OnConnect - Connection UserId:{evtSub.UserId} UserName: {evtSub.UserName} dictVals:{dictVal.Values}"); }; //appHost.OnSubscribe = (evtSub) => { Console.WriteLine($"OnSubscribe - sub:{evtSub.UserId}"); }; //appHost.OnPublish = (sub, res, msg) => { if (!msg.Contains("cmd.onHeartbeat")) Console.WriteLine($"Publish - DisplayName:{sub.DisplayName} Res.Status:{res.StatusCode} MsgLen:{msg}"); }; //appHost.OnUnsubscribe = (evtSub) => { Console.WriteLine($"OnUnsubscribe - sub:{evtSub.UserId}"); }; appHost.LimitToAuthenticatedUser = true; //start the service appHost.Init(); //resolve the events plugin loaded in the configuration. IServerEvents se = appHost.TryResolve <IServerEvents>(); Logger.Info("Jars IIS App Started"); }
public void Register(IConfiguration Configuration) { //configuration = Locator.Current.GetService<IConfiguration>(); после этого не находит settings, "Object reference not set to an instance of an object." configuration = Configuration; settings = configuration.GetSection("ServiceStackSettings").Get <ServiceStackSettings>(); try { var serviceStackKey = settings.LicenseKey; Licensing.RegisterLicense(serviceStackKey); } catch (LicenseException) { var licenseKeyAddress = settings.LicenseKeyAddress; var newTrialKey = GetNewTrialKeyFromHtmlText(licenseKeyAddress); settings.LicenseKey = newTrialKey; configuration.GetSection("ServiceStackSettings").Set(settings); var newServiceStackKey = settings.LicenseKey; Licensing.RegisterLicense(newServiceStackKey); } }
public void Can_register_valid_license_from_EnvironmentVariable() { var licenseKeyText = Environment.GetEnvironmentVariable("SERVICESTACK_LICENSE"); Licensing.RegisterLicense(licenseKeyText); Assert.That(LicenseUtils.ActivatedLicenseFeatures(), Is.EqualTo(LicenseFeature.All)); }
public void ConfigureAppHost() { IConfiguration configuration = new ConfigurationBuilder().AddJsonFile("appsettings.json", true, true).Build(); Licensing.RegisterLicense(configuration["ServiceStack:Licence"]); AppHost = new BasicAppHost(typeof(OrganizationService).Assembly) { TestMode = true, ConfigureContainer = container => { container.RegisterAutoWiredAs <StubMessageBus, IMessageBus>(); container.RegisterAutoWiredAs <StubTimeProvider, ITimeProvider>(); container.Register <IAuthSession>(c => new AuthUserSession { Email = "*****@*****.**" }); container.RegisterValidators(typeof(AddressValidator).Assembly); } }; AppHost.Plugins.Add(new ValidationFeature()); AppHost.Init(); Service = AppHost.Container.Resolve <T>(); Service.Request = new MockHttpRequest(); }
/// <summary> /// The main program executes the tests. Output may be routed to /// various locations, depending on the arguments passed. /// </summary> /// <remarks>Run with --help for a full list of arguments supported</remarks> /// <param name="args"></param> public static int Main(string[] args) { var licenseKey = Environment.GetEnvironmentVariable("SERVICESTACK_LICENSE"); if (licenseKey.IsNullOrEmpty()) { throw new ArgumentNullException("SERVICESTACK_LICENSE", "Add Environment variable for SERVICESTACK_LICENSE"); } Licensing.RegisterLicense(licenseKey); //"ActivatedLicenseFeatures: ".Print(LicenseUtils.ActivatedLicenseFeatures()); var postgreSqlDb = Environment.GetEnvironmentVariable("POSTGRESQL_DB"); if (!String.IsNullOrEmpty(postgreSqlDb)) { Config.PostgreSqlDb = postgreSqlDb; } CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); JsConfig.InitStatics(); //JsonServiceClient client = new JsonServiceClient(); var writer = new ExtendedTextWrapper(Console.Out); return(new AutoRun(((IReflectableType)typeof(NetCoreTestsRunner)).GetTypeInfo().Assembly).Execute(args, writer, Console.In)); }
private void view_Load(object sender, EventArgs e) { serverview.ListViewItemSorter = lvs; //turn off thread safety CheckForIllegalCrossThreadCalls = false; threadsInstance = new threads(this); Application.DoEvents(); //select the first item in the latency filter drop box latencydrop.SelectedIndex = 0; //make sure the current directory is the working directory resetDirectory(); //get config FormConfigRestore.LoadConfig(this, configlocation); //get previous info serversInstance.deserialise(serverlistfile); //get all the columns serverview.Columns.Clear(); foreach (var kvp in protocolInstance.getColumns()) { serverview.Columns.Add(kvp.Key, kvp.Value).Name = kvp.Key; } //apply the loaded filters to all the servers allServersToServerView(); Controller.ToolStripText(toolStripStatusLabel1, ref statusStrip1, "Ready"); Licensing.LicensingForm(this, menuStrip1, HelpString, OtherText); }
/// <summary> /// Base constructor requires a Name and Assembly where web service implementation is located /// </summary> public AppHost() : base("MyApp", typeof(PingService).Assembly, typeof(MyServices).Assembly) { Licensing.RegisterLicenseFromFileIfExists("~/ss_license.txt".MapHostAbsolutePath()); }
protected void Application_Start(object sender, EventArgs e) { log4net.Config.XmlConfigurator.Configure(); Licensing.RegisterLicenseFromFileIfExists(@"~/appsettings.license.txt".MapHostAbsolutePath()); new AppHost().Init(); }
public override void Configure(Container container) { Licensing.RegisterLicense(new AppSettings().GetString("servicestack:license")); SetConfig(new HostConfig { DebugMode = true, WriteErrorsToResponse = true, }); JsConfig.DateHandler = DateHandler.ISO8601; Plugins.Add(new CorsFeature()); Plugins.Add(new SwaggerFeature()); Plugins.Add(new PostmanFeature { DefaultLabelFmt = new List <string> { "route" } }); var documentStore = new DocumentStore { DefaultDatabase = "PowerDeploy", Url = "http://localhost:8080", }.Initialize(); IndexCreation.CreateIndexes(typeof(Deployment_Latest).Assembly, documentStore); Bootstrapper.ConfigureDependencies(container, documentStore); DataInitializer.InitializerWithDefaultValuesIfEmpty(documentStore); }
public void Start() { Console.WriteLine("Dummy ApiService started"); _appHost = new AppHost(); Licensing.RegisterLicenseFromFileIfExists("Licence/sslicense.txt".MapHostAbsolutePath()); _appHost.Init().Start(ConfigurationManager.AppSettings["Main_REST_ServiceURL"]); }
protected TestBase() { Licensing.RegisterLicense(LicensingTests.TestBusiness2014Text); //Uncomment to run tests under a different Culture //System.Threading.Thread.CurrentThread.CurrentCulture = // System.Globalization.CultureInfo.GetCultureInfo("sv-SE"); }
protected void Application_Start(object sender, EventArgs e) { Licensing.RegisterLicenseFromFileIfExists(@"~/appsettings.license.txt".MapHostAbsolutePath()); var appHost = new AppHost(); appHost.Init(); }
public void Test1() { Licensing.RegisterLicense(@"..."); TestAppHostInitializer test = new TestAppHostInitializer(); test.Init().Start("http://localhost:2000"); }
public void TearDown() { #if NETCORE Licensing.RegisterLicense(Environment.GetEnvironmentVariable("SERVICESTACK_LICENSE")); #else Licensing.RegisterLicense(new AppSettings().GetString("servicestack:license")); #endif }
public void Init() { appHost = new UnitTestHost(); var debugSettings = new FileInfo(@"~/../../../TechStacks/wwwroot_build/deploy/appsettings.license.txt".MapAbsolutePath()); Licensing.RegisterLicenseFromFileIfExists(debugSettings.FullName); appHost.Init(); }
public void Can_register_valid_licenses() { Licensing.RegisterLicense(TestBusiness2013Text); Assert.That(LicenseUtils.ActivatedLicenseFeatures(), Is.EqualTo(LicenseFeature.All)); Licensing.RegisterLicense(TestIndie2013Text); Assert.That(LicenseUtils.ActivatedLicenseFeatures(), Is.EqualTo(LicenseFeature.All)); }
public AppHostConsole() : base("Fordere WebService Console", typeof(UserService).Assembly) { Licensing.RegisterLicense("TODO"); LogManager.LogFactory = new NLogFactory(); LogManager.GetLogger(typeof(AppHostConsole)); }
public MessageViewer(Licensing.License license) { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); _license = license; _message = null; messageXmlViewer.Dock = DockStyle.Fill; binaryViewer.Dock = DockStyle.Fill; webBrowser1.Dock = DockStyle.Fill; messageRichTextBox.Dock = DockStyle.Fill; _defaultHtml = Documents.MessageViewerDefaultPage(); SizePanelForBorder(mainPanel); ConfigureView(); ConfigureButtons(); base.Load += new EventHandler(MessageViewer_Load); }
private void Initialize(Licensing.License license, QueueTaskManager queueTaskManager, QSetQueueItem initialRecipient, System.Messaging.Message[] messages, QSetQueueItem sourceQueueItem) { _license = license; InitializeComponent(); if (messages != null && messages.Length > 0) _mode = Mode.ExistingMessage; else _mode = Mode.NewMessage; _queueTaskManager = queueTaskManager; _sourceQueueItem = sourceQueueItem; base.Closing += new CancelEventHandler(NewMessageForm_Closing); numberOfCopiesComboBoxItem.ToolTipText = "Select the number of copies to send to each recipient queue."; numberOfCopiesComboBoxItem.ComboBox.SelectedIndex = 0; numberOfCopiesComboBoxItem.ComboBox.KeyPress += new KeyPressEventHandler(ComboBox_KeyPress); numberOfCopiesComboBoxItem.ComboBox.MaxLength = 4; _messageViewer = new MessageViewer(license); _messageViewer.Dock = DockStyle.Fill; _messageViewerHostPanel.Controls.Add(_messageViewer); recipientsListView.Items.Clear(); messagesListView.Items.Clear(); if (_mode == Mode.NewMessage) { FormatterComboItem[] formatterItems = new FormatterComboItem[3]; formatterItems[0] = new FormatterComboItem(_FORMATTER_ACTIVEX, MessageFormatterType.ActiveX); formatterItems[1] = new FormatterComboItem(_FORMATTER_BINARY, MessageFormatterType.Binary); formatterItems[2] = new FormatterComboItem(_FORMATTER_XML, MessageFormatterType.Xml); formatterComboBoxItem.ComboBox.DisplayMember = "Name"; formatterComboBoxItem.ComboBox.ValueMember = "FormatterType"; formatterComboBoxItem.ComboBox.DataSource = formatterItems; formatterComboBoxItem.ComboBox.SelectedIndex = 2; formatterComboBoxItem.ComboBox.DropDownStyle = ComboBoxStyle.DropDownList; foreach (MenuItemBase item in optionsPriorityMenuItem.Items) item.Checked = false; priorityNormalMenuItem.Checked = true; ConfigureMessagePriorityMenuItems(); SelectMessagePriorityMenuItem(System.Messaging.MessagePriority.Normal); } else { if (messages.Length == 1) existingMessagesLabel.Text = "Message:"; else existingMessagesLabel.Text = "Messages:"; foreach (System.Messaging.Message message in messages) { ListViewItem item = new ListViewItem(message.Label, (int)Resources.Images.IconType.Message); item.Tag = message; messagesListView.Items.Add(item); } messagesListView.Items[0].Selected = true; } //TODO when multiple messages are supplied leave all the options blank so that the existing message properties take effect // but let the options be selectable so they can be overridde. When a single message is passed into the form all // of the options can be defaulted to that messages options sendAndKeepOpenButtonItem.Visible = _mode == Mode.NewMessage; formatterComboBoxItem.Visible = _mode == Mode.NewMessage; optionsDropDownMenuItem.Visible = _mode == Mode.NewMessage; labelLabel.Visible = _mode == Mode.NewMessage; labelTextBox.Visible = _mode == Mode.NewMessage; newMessagePanel.Visible = _mode == Mode.NewMessage; existingMessagePanel.Visible = _mode == Mode.ExistingMessage; ConfigureControls(); SetupToolTips(); if (initialRecipient != null) AddQueueItemToRecipientsList(initialRecipient); }
public NewMessageForm(Licensing.License license, QueueTaskManager queueTaskManager) { Initialize(license, queueTaskManager, null, null, null); }
public NewMessageForm(Licensing.License license, QueueTaskManager queueTaskManager, System.Messaging.Message[] messages, QSetQueueItem sourceQueueItem) { Initialize(license, queueTaskManager, null, messages, sourceQueueItem); }
public NewMessageForm(Licensing.License license, QueueTaskManager queueTaskManager, QSetQueueItem initialRecipient) { Initialize(license, queueTaskManager, initialRecipient, null, null); }