Example #1
0
        public static void OnMetadataReceived(string key, string value)
        {
            switch (key)
            {
            case "JsonDowloadInfo":
                DowloadInfoUpdater.OnNewDowloadInfoInServer(value);
                break;

            case "ServerList":
                ServerInfoCollection.SetServerCollection(JsonConvert.DeserializeObject <ObservableCollection <ServerCollectionModel> >(value));

                UCLogsViewModel.TextLogs.Value += $"\nServerList - {value}";
                break;

            case "ServerOutputError":
                GameServerReceivedOutoutHandler.OnError(value);
                UCLogsViewModel.TextLogs.Value += $"\nServerOutputError - {value}";
                break;

            case "ServerOutputOutput":
                GameServerReceivedOutoutHandler.OnNewOutput(value);
                UCLogsViewModel.TextLogs.Value += $"\nServerOutputOutput - {value}";
                break;

            case "ServerOutputException":
                GameServerReceivedOutoutHandler.OnException(value);
                UCLogsViewModel.TextLogs.Value += $"\nServerOutputException - {value}";
                break;

            default:
                UCLogsViewModel.TextLogs.Value += $"\nMetadate is not registred";
                break;
            }
        }
Example #2
0
        private void LoadComboBox(ServerInfoCollection servers)
        {
            _suppressSelectionChanged = true;

            _items.Clear();
            _items.AddRange(servers.Select(n => new ServerComboBoxItem(n)).OrderBy(n => n.HostName));

            servers_MultiColumnComboBox.EditorControl.DataSource = null;
            servers_MultiColumnComboBox.EditorControl.DataSource = _items;

            _suppressSelectionChanged = false;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PluginExecutionData" /> class.
 /// </summary>
 /// <param name="metadata">An <see cref="XElement" /> containing plugin-specific XML metadata.</param>
 /// <param name="metadataVersion">The plugin-defined schema version of the XML metadata.</param>
 /// <param name="assets">The assets available for this plugin execution.</param>
 /// <param name="documents">The documents available for this plugin execution.</param>
 /// <param name="servers">The servers available for this plugin execution.</param>
 /// <param name="printQueues">The print queues available for this plugin execution.</param>
 /// <param name="environment">Information about the plugin execution environment.</param>
 /// <param name="context">Contextual/environmental information about this plugin execution.</param>
 /// <param name="retrySettings">Retry configuration for this plugin execution.</param>
 /// <param name="externalCredentials">External credentials used by this plugin execution.</param>
 /// <exception cref="ArgumentNullException"><paramref name="metadata" /> is null.</exception>
 public PluginExecutionData(XElement metadata, string metadataVersion, AssetInfoCollection assets, DocumentCollection documents, ServerInfoCollection servers, PrintQueueInfoCollection printQueues,
                            PluginEnvironment environment, PluginExecutionContext context, PluginRetrySettingDictionary retrySettings, ExternalCredentialInfoCollection externalCredentials)
     : base(metadata, metadataVersion)
 {
     _assets              = assets;
     _documents           = documents;
     _servers             = servers;
     _printQueues         = printQueues;
     _environment         = environment;
     _context             = context;
     _credential          = new Lazy <NetworkCredential>(CreateCredential);
     _retrySettings       = retrySettings;
     _externalCredentials = externalCredentials;
 }
        private void LogUsageData(IAssetInfo asset, ServerInfoCollection servers)
        {
            //Log device usage
            ActivityExecutionAssetUsageLog deviceLog = new ActivityExecutionAssetUsageLog(_executionData, asset);

            ExecutionServices.DataLogger.Submit(deviceLog);

            //Log Server usage
            foreach (ServerInfo server in servers)
            {
                ActivityExecutionServerUsageLog serverLog = new ActivityExecutionServerUsageLog(_executionData, server);
                ExecutionServices.DataLogger.Submit(serverLog);
            }
        }
        /// <summary>
        /// Retrieves <see cref="RemotePrintQueueInfo" /> for all remote print queues in the inventory.
        /// </summary>
        /// <returns><see cref="RemotePrintQueueInfo" /> for all remote print queues in the inventory.</returns>
        public IEnumerable <RemotePrintQueueInfo> GetRemotePrintQueues()
        {
            List <RemotePrintQueueInfo> printQueues = new List <RemotePrintQueueInfo>();
            ServerInfoCollection        servers     = GetServers();

            DatabaseQuery(Resources.SelectPrintQueues, record =>
            {
                RemotePrintQueueInfo printQueueInfo = new RemotePrintQueueInfo
                                                      (
                    (Guid)record["RemotePrintQueueId"],
                    record["Name"] as string,
                    servers.First(n => n.ServerId == (Guid)record["PrintServerId"]),
                    record["AssociatedAssetId"] as string
                                                      );
                printQueues.Add(printQueueInfo);
            });

            return(printQueues);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PluginExecutionData" /> class.
 /// </summary>
 /// <param name="metadata">An <see cref="XElement" /> containing plugin-specific XML metadata.</param>
 /// <param name="metadataVersion">The plugin-defined schema version of the XML metadata.</param>
 /// <param name="assets">The assets available for this plugin execution.</param>
 /// <param name="documents">The documents available for this plugin execution.</param>
 /// <param name="servers">The servers available for this plugin execution.</param>
 /// <param name="printQueues">The print queues available for this plugin execution.</param>
 /// <param name="environment">Information about the plugin execution environment.</param>
 /// <param name="context">Contextual/environmental information about this plugin execution.</param>
 /// <param name="retrySettings">Retry configuration for this plugin execution.</param>
 /// <exception cref="ArgumentNullException"><paramref name="metadata" /> is null.</exception>
 public PluginExecutionData(XElement metadata, string metadataVersion, AssetInfoCollection assets, DocumentCollection documents, ServerInfoCollection servers, PrintQueueInfoCollection printQueues,
                            PluginEnvironment environment, PluginExecutionContext context, PluginRetrySettingDictionary retrySettings)
     : this(metadata, metadataVersion, assets, documents, servers, printQueues, environment, context, retrySettings, new ExternalCredentialInfoCollection(new List <ExternalCredentialInfo>()))
 {
 }