示例#1
0
        protected override PluginCheckSuspendResult CheckPluginPolicy()
        {
            // Method which is called to check the plugin's policy.
            //
            // Check you policy and create a PluginCheckSuspendResult:
            //      The fist parameter of the contsctucor indicates if standby should be supressed.
            //      The second one gives the reason for supression of standby - should be String.Empty if the first argument is 'false'.
            //
            // You can access your plugin's settings by using property 'CurrentSettings' from the base class (you will need a cast).
            var settings = (WsapmPluginAdvancedSettings)this.CurrentSettings;
            var myString = settings.MyString;

            var checkResult = new PluginCheckSuspendResult(false, String.Empty);

            return(checkResult);
        }
示例#2
0
        /// <summary>
        /// Gets a CheckSuspendResult from a FromPluginCheckSuspendResult.
        /// </summary>
        /// <param name="pluginCheckSuspendResult">The PluginCheckSuspendResult from which to get a CheckSuspendResult.</param>
        /// <param name="pluginSource">The plugin which is the source of the PluginCheckSuspendResult.</param>
        /// <returns>A CheckSuspendResult representing a FromPluginCheckSuspendResult.</returns>
        public static CheckSuspendResult FromPluginCheckSuspendResult(PluginCheckSuspendResult pluginCheckSuspendResult, WsapmPluginBase pluginSource)
        {
            var result = new CheckSuspendResult(false, string.Empty);

            if (pluginCheckSuspendResult == null)
            {
                return(result);
            }

            result.SuspendStandby = pluginCheckSuspendResult.SuspendStandby;

            if (pluginSource != null)
            {
                result.Reason = pluginCheckSuspendResult.Reason + " [" + pluginSource.PluginAttribute.Name + "]";
            }

            return(result);
        }