예제 #1
0
        public void Add(IPluginInfo pluginInfo)
        {
            if (InstalledPlugins.ContainsKey(pluginInfo.PluginIdentifier))
                return;

            InstalledPlugins.Add(pluginInfo.PluginIdentifier, pluginInfo);
        }
예제 #2
0
 internal void AddPlugin( IPluginInfo plugin )
 {
     Debug.Assert( plugin != null );
     Debug.Assert( plugin.Service == this );
     Debug.Assert( !_implementations.Contains( plugin ) );
     _implementations.Add( plugin );
 }
예제 #3
0
        internal ServiceReferenceInfo( IPluginInfo ownerPlugin, IServiceInfo referencedService, DependencyRequirement requirement )
        {
            Debug.Assert( ownerPlugin != null );
            Debug.Assert( referencedService != null );

            _owner = ownerPlugin;
            _reference = referencedService;
            _requirement = requirement;
        }
예제 #4
0
        private void LoadPlugin(IPluginInfo selectedPlugin)
        {
            // Try to load plugin, and set current plugin to newly selected plugin
            _pluginInfo = selectedPlugin;

            selectedPlugin.Plugin.Deserialize(string.Empty);

            // Does the plugin have a graphical interface
            if (selectedPlugin.Plugin.GUI != null)
                // Show plugins graphical interface
                ShowSettings(selectedPlugin);
            else
            // There is no interface for this plugin, hide settings but leave action name input box
                HideSettings();
        }
 public DefaultPlugin(IPluginInfo info, PluginOperate load, PluginOperate unload,
     PluginTestSuccessFlag isSuccessFlag, PluginMessage getMsg)
 {
     if (info == null)
         ArgumentNull.Throw("info");
     if (load == null)
         ArgumentNull.Throw("load");
     if (unload == null)
         ArgumentNull.Throw("unload");
     if (isSuccessFlag == null)
         ArgumentNull.Throw("isSuccessFlag");
     if (getMsg == null)
         ArgumentNull.Throw("getMsg");
     this.Info = info;
     this.load = load;
     this.unload = unload;
     this.isSuccessFlag = isSuccessFlag;
     this.msg = getMsg;
 }
예제 #6
0
        public VMIPlugin( VMIContextViewModel ctx, IPluginInfo plugin, VMIBase parent )
            : base(ctx, parent)
        {
            _pluginInfo = plugin;

            Label = plugin.PublicName;
            Assembly = plugin.AssemblyInfo.AssemblyName;
            DetailsTemplateName = "PluginDetails";

            _systemPluginStatus = VMIContext.Context.ConfigManager.SystemConfiguration.PluginsStatus.GetStatus( Id, ConfigPluginStatus.Manual );
            _userPluginStatus = VMIContext.Context.ConfigManager.UserConfiguration.PluginsStatus.GetStatus( Id, ConfigPluginStatus.Manual );

            _pluginRunner = VMIContext.Context.GetService<PluginRunner>( true );
            _pluginRunner.ApplyDone += new EventHandler<ApplyDoneEventArgs>( OnApplyDone );

            VMIContext.Context.ConfigManager.UserConfiguration.LiveUserConfiguration.Changed += new EventHandler<LiveUserConfigurationChangedEventArgs>( OnLiveUserConfigurationChanged );
            VMIContext.Context.ConfigManager.SystemConfiguration.PluginsStatus.Changed += new EventHandler<PluginStatusCollectionChangedEventArgs>( OnSystemPluginStatusChanged );
            VMIContext.Context.ConfigManager.UserConfiguration.PluginsStatus.Changed += new EventHandler<PluginStatusCollectionChangedEventArgs>( OnUserPluginStatusChanged );

            VMIContext.Context.ConfigManager.UserConfiguration.PropertyChanged += new PropertyChangedEventHandler( OnUserConfigurationChanged );
            VMIContext.Context.ConfigManager.SystemConfiguration.PropertyChanged += new PropertyChangedEventHandler( OnSystemConfigurationChanged );

            CreateCommands();

            IList<IPluginInfo> editableBy = new List<IPluginInfo>();
            foreach( IPluginConfigAccessorInfo p in plugin.EditableBy )
                editableBy.Add( p.Plugin );
            _canEdit = new List<IPluginInfo>();
            foreach( IPluginConfigAccessorInfo p in _pluginInfo.EditorsInfo )
                _canEdit.Add( p.EditedSource );
            IList<IPluginInfo> required = new List<IPluginInfo>();

            _vmRequirementLayers = new List<VMIPluginRequirementLayer>();
            foreach( RequirementLayer layer in RequirementLayers )
            {
                _vmRequirementLayers.Add( new VMIPluginRequirementLayer( this, layer ) );
            }

            ServiceRefs = new VMCollection<VMAlias<VMIService>, IServiceReferenceInfo>( plugin.ServiceReferences, ( info ) => { return new VMAlias<VMIService>( VMIContext.FindOrCreate( info ), this ); } );
            CanEdit = new VMCollection<VMAlias<VMIPlugin>, IPluginInfo>( new CKReadOnlyListOnIList<IPluginInfo>( _canEdit ), ( info ) => { return new VMAlias<VMIPlugin>( VMIContext.FindOrCreate( info ), this ); } );
            EditableBy = new VMCollection<VMAlias<VMIPlugin>, IPluginInfo>( new CKReadOnlyListOnIList<IPluginInfo>( editableBy ), ( info ) => { return new VMAlias<VMIPlugin>( VMIContext.FindOrCreate( info ), this ); } );
        }
예제 #7
0
        public static CommandInfo FromCommand(ICommand command, IAction action)
        {
            string description;
            string pluginName = string.Empty;

            // Ensure this action has a plugin
            if (string.IsNullOrEmpty(command.PluginClass) || string.IsNullOrEmpty(command.PluginFilename))
            {
                description = LocalizationProvider.Instance.GetTextValue("Action.Messages.DoubleClickToEditCommand");
            }
            else if (PluginManager.Instance.PluginExists(command.PluginClass, command.PluginFilename))
            {
                try
                {
                    // Get plugin for this action
                    IPluginInfo pluginInfo =
                        PluginManager.Instance.FindPluginByClassAndFilename(command.PluginClass,
                                                                            command.PluginFilename);

                    // Feed settings to plugin
                    if (!pluginInfo.Plugin.Deserialize(command.CommandSettings))
                    {
                        command.CommandSettings = pluginInfo.Plugin.Serialize();
                    }

                    pluginName  = pluginInfo.Plugin.Name;
                    description = pluginInfo.Plugin.Description;
                }
                catch
                {
                    pluginName  = string.Empty;
                    description = LocalizationProvider.Instance.GetTextValue("Action.Messages.DoubleClickToEditCommand");
                }
            }
            else
            {
                description = string.Format(LocalizationProvider.Instance.GetTextValue("Action.Messages.NoAssociationAction"), command.PluginClass, command.PluginFilename);
            }

            return(new CommandInfo(action, command, !string.IsNullOrEmpty(command.Name) ? command.Name : pluginName, description, command.IsEnabled));
        }
예제 #8
0
        public AndroidCallDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{EE9D9548-1206-45EA-B2D3-98B1CCF055A2}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_Call);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_BasicInfo);
            pluginInfo.DeviceOSType = EnumOSType.Android;
            pluginInfo.VersionStr   = "0.0";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror | EnumPump.LocalData;
            pluginInfo.GroupIndex   = 0;
            pluginInfo.OrderIndex   = 3;

            pluginInfo.AppName     = "com.android.providers.contacts";
            pluginInfo.Icon        = "\\icons\\call.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_AndroidCall);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/data/data/com.android.providers.contacts/databases/#F");

            PluginInfo = pluginInfo;
        }
예제 #9
0
        public IOSContactsDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{FA1728E7-48EF-40DE-836A-8FB235656D91}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_Contacts);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_BasicInfo);
            pluginInfo.DeviceOSType = EnumOSType.IOS;
            pluginInfo.VersionStr   = "0.0";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror | EnumPump.LocalData;
            pluginInfo.GroupIndex   = 0;
            pluginInfo.OrderIndex   = 2;

            pluginInfo.AppName     = "HomeDomain";
            pluginInfo.Icon        = "\\icons\\contact.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_IosContact);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/HomeDomain/Library/AddressBook");

            PluginInfo = pluginInfo;
        }
예제 #10
0
        public IOSQQDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{618EED69-55ED-45EA-B87A-CF09A6180B46}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_QQ);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_SocialChat);
            pluginInfo.DeviceOSType = EnumOSType.IOS;
            pluginInfo.VersionStr   = "0.0";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror | EnumPump.LocalData;
            pluginInfo.GroupIndex   = 1;
            pluginInfo.OrderIndex   = 1;

            pluginInfo.AppName     = "com.tencent.mqq";
            pluginInfo.Icon        = "\\icons\\Icon-qq.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_IosQQ);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/com.tencent.mqq/Documents/");

            PluginInfo = pluginInfo;
        }
예제 #11
0
        public AndroidBluetoothDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{7AE1B4F1-C3DE-4942-982F-DD80FC5BCA23}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_Bluetooth);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_BasicInfo);
            pluginInfo.DeviceOSType = EnumOSType.Android;
            pluginInfo.VersionStr   = "0.0";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror;
            pluginInfo.GroupIndex   = 0;
            pluginInfo.OrderIndex   = 6;

            pluginInfo.AppName     = "com.android.bluetooth";
            pluginInfo.Icon        = "\\icons\\bluetooth.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_AndroidBluetooth);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/data/misc/bluetoothd/#F");

            PluginInfo = pluginInfo;
        }
예제 #12
0
        private void MetroWindow_Loaded(object sender, RoutedEventArgs e)
        {
            BindExistingApplications();
            BindPlugins();

            if (_currentAction != null)
            {
                //cmbExistingApplication.SelectedItem = ApplicationManager.Instance.CurrentApplication;
                foreach (object comboItem in cmbPlugins.Items)
                {
                    IPluginInfo pluginInfo = (IPluginInfo)comboItem;

                    if (pluginInfo.Class == _currentAction.PluginClass && pluginInfo.Filename == _currentAction.PluginFilename)
                    {
                        cmbPlugins.SelectedIndex = cmbPlugins.Items.IndexOf(comboItem);
                        break;
                    }
                }
                ConditionTextBox.Text = _currentAction.Condition;
            }
        }
예제 #13
0
        public AndroidTwitterDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{8C058225-6D5D-4327-A1A5-612E81BDF934}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_Twitter);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_SocialChat);
            pluginInfo.DeviceOSType = EnumOSType.Android;
            pluginInfo.VersionStr   = "1.0.0";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror | EnumPump.LocalData;
            pluginInfo.GroupIndex   = 1;
            pluginInfo.OrderIndex   = 4;

            pluginInfo.AppName     = "com.twitter.android";
            pluginInfo.Icon        = "\\icons\\twitter.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_AndroidTwitter);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/data/data/com.twitter.android/databases/#F");

            PluginInfo = pluginInfo;
        }
예제 #14
0
        private void ShowSettings(IPluginInfo PluginInfo)
        {
            // Clear any existing controls
            pnlSettings.Controls.Clear();

            // Show settings interface
            PluginInfo.Plugin.GUI.Show();

            // Add settings to settings panel
            pnlSettings.Controls.Add(PluginInfo.Plugin.GUI);

            pnlSettings.Height  = PluginInfo.Plugin.GUI.RestoreBounds.Height;
            grpSettings.Height  = pnlSettings.Bottom + 3;
            pnlSettings.Visible = true;
            grpActions.Height   = grpSettings.Bottom + 12;
            cmdCancel.Top       = cmdDone.Top = grpActions.Bottom + 8;

            Screen currentScreen = Screen.FromControl(this);

            this.Top = Convert.ToInt32(currentScreen.Bounds.Height / 2 - this.Height / 2);
        }
        public AndroidContactsDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{8DB88FCD-F725-4F9D-864F-78E13EF6BCE1}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_Contacts);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_BasicInfo);
            pluginInfo.DeviceOSType = EnumOSType.Android;
            pluginInfo.VersionStr   = "0.0";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror | EnumPump.LocalData;
            pluginInfo.GroupIndex   = 0;
            pluginInfo.OrderIndex   = 2;

            pluginInfo.AppName     = "com.android.providers.contacts";
            pluginInfo.Icon        = "\\icons\\contact.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_AndroidContact);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/data/data/com.android.providers.contacts/databases/#F");

            PluginInfo = pluginInfo;
        }
예제 #16
0
 public FeatureInfo(
     string id,
     string name,
     int priority,
     string category,
     string description,
     IPluginInfo extension,
     string[] dependencies,
     bool defaultTenantOnly,
     bool allowManage)
 {
     Id                = id;
     Name              = name;
     Priority          = priority;
     Category          = category;
     Description       = description;
     Plugin            = extension;
     Dependencies      = dependencies;
     DefaultTenantOnly = defaultTenantOnly;
     ManageDisallowed  = allowManage;
 }
예제 #17
0
        public IOSEimDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{DBBCC68C-A813-4C2D-93F4-EA37ECB5B72D}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_EimQQ);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_SocialChat);
            pluginInfo.DeviceOSType = EnumOSType.IOS;
            pluginInfo.VersionStr   = "0.0";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror | EnumPump.LocalData;
            pluginInfo.GroupIndex   = 1;
            pluginInfo.OrderIndex   = 3;

            pluginInfo.AppName     = "com.tencent.eim";
            pluginInfo.Icon        = "\\icons\\Icon-qq.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_IosEimQQ);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/com.tencent.eim/Documents/");

            PluginInfo = pluginInfo;
        }
예제 #18
0
        public IOSEntQQDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{0BE1A2C5-1E41-47C7-8363-1AB37D8AA919}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_EntQQ);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_SocialChat);
            pluginInfo.DeviceOSType = EnumOSType.IOS;
            pluginInfo.VersionStr   = "0.0";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror | EnumPump.LocalData;
            pluginInfo.GroupIndex   = 1;
            pluginInfo.OrderIndex   = 2;

            pluginInfo.AppName     = "com.tencent.mQQi";
            pluginInfo.Icon        = "\\icons\\Icon-qq.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_IosEntQQ);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/com.tencent.mQQi/Documents/");

            PluginInfo = pluginInfo;
        }
예제 #19
0
        /// <summary>
        /// 安卓163邮箱数据解析
        /// </summary>
        public Android163EmailDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{0D70BCDB-9388-4A4C-A8D0-AFF1E90408A9}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_Email163);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_WebMail);
            pluginInfo.DeviceOSType = EnumOSType.Android;
            pluginInfo.VersionStr   = "3.0";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror | EnumPump.LocalData;
            pluginInfo.GroupIndex   = 4;
            pluginInfo.OrderIndex   = 1;

            pluginInfo.AppName     = "com.netease.mobimail";
            pluginInfo.Icon        = "\\icons\\Mail163.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_AndroidEmail163);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/data/data/com.netease.mobimail/mmail");

            PluginInfo = pluginInfo;
        }
예제 #20
0
        public IOSSmsDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{245006E7-5C32-44FD-B373-47515B9104C8}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_Sms);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_BasicInfo);
            pluginInfo.DeviceOSType = EnumOSType.IOS;
            pluginInfo.VersionStr   = "0.0";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror | EnumPump.LocalData;
            pluginInfo.GroupIndex   = 0;
            pluginInfo.OrderIndex   = 4;

            pluginInfo.AppName     = "HomeDomain";
            pluginInfo.Icon        = "\\icons\\sms.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_IosSms);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/HomeDomain/Library/SMS");
            pluginInfo.SourcePath.AddItem("/MediaDomain");

            PluginInfo = pluginInfo;
        }
예제 #21
0
        public AndroidQQEimDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{A53B67FC-AD6F-47D5-98C6-0953E01C541C}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_EimQQ);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_SocialChat);
            pluginInfo.DeviceOSType = EnumOSType.Android;
            pluginInfo.VersionStr   = "0.0";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror | EnumPump.LocalData;
            pluginInfo.GroupIndex   = 1;
            pluginInfo.OrderIndex   = 3;

            pluginInfo.AppName     = "com.tencent.eim";
            pluginInfo.Icon        = "\\icons\\eimQQ.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_AndroidEimQQ);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/data/data/com.tencent.eim/databases/#F");
            pluginInfo.SourcePath.AddItem("/data/data/com.tencent.eim/shared_prefs/#F");

            PluginInfo = pluginInfo;
        }
예제 #22
0
        public AndroidSmsDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{DAB60C73-4A35-488F-A0FA-3620F6924B0F}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_Sms);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_BasicInfo);
            pluginInfo.DeviceOSType = EnumOSType.Android;
            pluginInfo.VersionStr   = "0.0";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror | EnumPump.LocalData;
            pluginInfo.GroupIndex   = 0;
            pluginInfo.OrderIndex   = 4;

            pluginInfo.AppName     = "com.android.providers.telephony";
            pluginInfo.Icon        = "\\icons\\sms.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_AndroidSms);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/data/data/com.android.providers.telephony/databases/#F");
            pluginInfo.SourcePath.AddItem("/data/data/com.android.providers.contacts/databases/#F");

            PluginInfo = pluginInfo;
        }
예제 #23
0
        private void MetroWindow_Loaded(object sender, RoutedEventArgs e)
        {
            BindExistingApplications();
            BindPlugins();

            if (_currentAction != null)
            {
                //cmbExistingApplication.SelectedItem = ApplicationManager.Instance.CurrentApplication;
                foreach (object comboItem in cmbPlugins.Items)
                {
                    IPluginInfo pluginInfo = (IPluginInfo)comboItem;

                    if (pluginInfo.Class == _currentAction.PluginClass && pluginInfo.Filename == _currentAction.PluginFilename)
                    {
                        cmbPlugins.SelectedIndex = cmbPlugins.Items.IndexOf(comboItem);
                        return;
                    }
                }
            }

            NamedPipe.SendMessageAsync("DisableTouchCapture", "GestureSignDaemon");
        }
예제 #24
0
        protected void TouchCapture_GestureRecognized(object sender, RecognitionEventArgs e)
        {
            var touchCapture = (ITouchCapture)sender;

            // Exit if we're teaching
            if (touchCapture.Mode == CaptureMode.Training)
            {
                return;
            }

            // Get action to be executed
            IEnumerable <IAction> executableActions = ApplicationManager.Instance.GetRecognizedDefinedAction(e.GestureName);

            foreach (IAction executableAction in executableActions)
            {
                // Exit if there is no action configured
                if (executableAction == null || !executableAction.IsEnabled ||
                    (touchCapture.Mode == CaptureMode.UserDisabled &&
                     !"GestureSign.CorePlugins.ToggleDisableGestures".Equals(executableAction.PluginClass)) ||
                    !Compute(executableAction.Condition, e.Points, e.ContactIdentifiers))
                {
                    continue;
                }

                // Locate the plugin associated with this action
                IPluginInfo pluginInfo = FindPluginByClassAndFilename(executableAction.PluginClass, executableAction.PluginFilename);

                // Exit if there is no plugin available for action
                if (pluginInfo == null)
                {
                    continue;
                }

                // Load action settings into plugin
                pluginInfo.Plugin.Deserialize(executableAction.ActionSettings);
                // Execute plugin process
                pluginInfo.Plugin.Gestured(new PointInfo(e.FirstCapturedPoints, e.Points));
            }
        }
예제 #25
0
        /// <summary>
        /// 安卓QQ邮箱数据解析
        /// </summary>
        public AndroidQqEmailDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{611D613F-E749-442B-86D5-EB40209F27E3}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_QQEmail);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_WebMail);
            pluginInfo.DeviceOSType = EnumOSType.Android;
            pluginInfo.VersionStr   = "2.0.4";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror | EnumPump.LocalData;
            pluginInfo.GroupIndex   = 4;
            pluginInfo.OrderIndex   = 0;

            pluginInfo.AppName     = "com.tencent.androidqqmail";
            pluginInfo.Icon        = "\\icons\\QQMail.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_AndroidQQEmail);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/data/data/com.tencent.androidqqmail/databases/#F");
            pluginInfo.SourcePath.AddItem("/data/data/com.tencent.androidqqmail/shared_prefs/user_info.xml");

            PluginInfo = pluginInfo;
        }
예제 #26
0
        public IOSMmsDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{013C1560-7974-4DDC-AC76-83A98BBC567E}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_Mms);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_BasicInfo);
            pluginInfo.DeviceOSType = EnumOSType.IOS;
            pluginInfo.VersionStr   = "0.0";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror | EnumPump.LocalData;
            pluginInfo.GroupIndex   = 0;
            pluginInfo.OrderIndex   = 5;

            pluginInfo.AppName     = "HomeDomain";
            pluginInfo.Icon        = "\\icons\\sms.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_IosMms);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/HomeDomain/Library/SMS");
            pluginInfo.SourcePath.AddItem("/MediaDomain");

            PluginInfo = pluginInfo;
        }
예제 #27
0
        public AndroidQQDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{7BFC4BE3-EBAC-41C3-8D0D-2C7AD659C9AB}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_QQ);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_SocialChat);
            pluginInfo.DeviceOSType = EnumOSType.Android;
            pluginInfo.VersionStr   = "0.0";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror | EnumPump.LocalData;
            pluginInfo.GroupIndex   = 1;
            pluginInfo.OrderIndex   = 1;

            pluginInfo.AppName     = "com.tencent.mobileqq";
            pluginInfo.Icon        = "\\icons\\Icon-qq.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_AndroidQQ);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/data/data/com.tencent.mobileqq/databases/#F");
            pluginInfo.SourcePath.AddItem("/data/data/com.tencent.mobileqq/shared_prefs/#F");

            PluginInfo = pluginInfo;
        }
예제 #28
0
        public AndroidQQLiteDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{D20DF00D-8E5E-432E-9F1A-563CD0C2EDCE}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_QQLite);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_SocialChat);
            pluginInfo.DeviceOSType = EnumOSType.Android;
            pluginInfo.VersionStr   = "0.0";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror | EnumPump.LocalData;
            pluginInfo.GroupIndex   = 1;
            pluginInfo.OrderIndex   = 2;

            pluginInfo.AppName     = "com.tencent.qqlite";
            pluginInfo.Icon        = "\\icons\\Icon-qq.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_AndroidQQLite);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/data/data/com.tencent.qqlite/databases/#F");
            pluginInfo.SourcePath.AddItem("/data/data/com.tencent.qqlite/shared_prefs/#F");

            PluginInfo = pluginInfo;
        }
예제 #29
0
        public AndroidMirrorInstalledAppDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{2F8C34F8-54C8-461E-A308-DC001DF4678E}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_InstalledApp);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_BasicInfo);
            pluginInfo.DeviceOSType = EnumOSType.Android;
            pluginInfo.VersionStr   = "0.0";
            pluginInfo.Pump         = EnumPump.Mirror;
            pluginInfo.GroupIndex   = 0;
            pluginInfo.OrderIndex   = 1;

            pluginInfo.AppName     = "com.app";
            pluginInfo.Icon        = "\\icons\\app.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_AndroidMirrorInstalledApp);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/data/system/packages.xml");
            //pluginInfo.SourcePath.AddItem("$Apk,apk");

            PluginInfo = pluginInfo;
        }
예제 #30
0
            void IPluginInstallationRequestsBuilder.RequestInstallationState(IPluginInfo plugin, bool desiredState)
            {
                void SetInstallationState(IPluginInfo p, bool state)
                {
                    if (installationRequests.TryGetValue(p.Id, out var currentRequest))
                    {
                        if (currentRequest != state)
                        {
                            installationRequests = installationRequests.Remove(p.Id);
                            owner.changeNotification.Post();
                        }
                    }
                    else if ((p.InstalledPluginManifest != null) != state)
                    {
                        installationRequests = installationRequests.SetItem(p.Id, state);
                        owner.changeNotification.Post();
                    }
                }

                void TraverseDependencies(IPluginInfo p, bool traverseForward, HashSet <IPluginInfo> result)
                {
                    if (result.Add(p))
                    {
                        foreach (var dep in (traverseForward ? p.Dependencies : p.Dependants))
                        {
                            TraverseDependencies(dep, traverseForward, result);
                        }
                    }
                }

                var affectedPlugins = new HashSet <IPluginInfo>();

                TraverseDependencies(plugin, desiredState, affectedPlugins);

                foreach (var affectedPlugin in affectedPlugins)
                {
                    SetInstallationState(affectedPlugin, desiredState);
                }
            }
예제 #31
0
        public AndroidWeChatDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{986488FD-952F-49AC-A5F6-CEA9528709F3}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_Wechat);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_SocialChat);
            pluginInfo.DeviceOSType = EnumOSType.Android;
            pluginInfo.VersionStr   = "0.0";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror | EnumPump.LocalData;
            pluginInfo.GroupIndex   = 1;
            pluginInfo.OrderIndex   = 0;

            pluginInfo.AppName     = "com.tencent.mm";
            pluginInfo.Icon        = "\\icons\\weixin.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_AndroidWechat);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/data/data/com.tencent.mm/MicroMsg/#F");
            pluginInfo.SourcePath.AddItem("/data/data/com.tencent.mm/shared_prefs/#F");//注意,C#插件本身不会使用该文件夹内的数据,但是底层数据库解密需要,所以不能删除!

            PluginInfo = pluginInfo;
        }
예제 #32
0
        public void SaveLoadViewModelTest()
        {
            MainWindowViewModel _vm1 = CreateViewModelWithGraph001();

            string tempFilePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());

            DetailedOperationResult r = _vm1.SaveState(tempFilePath);

            Assert.That(r.IsSuccessful);

            MainWindowViewModel _vm2 = new MainWindowViewModel();

            DetailedOperationResult r2 = _vm2.LoadState(tempFilePath);

            File.Delete(tempFilePath);

            Assert.That(r2.IsSuccessful);

            Assert.That(_vm1.PluginInfos.Count == _vm2.PluginInfos.Count);
            foreach (var infoB in _vm2.PluginInfos)
            {
                Assert.That(_vm1.PluginInfos.Where(x => x.PluginFullName == infoB.PluginFullName).Count() == 1);
                IPluginInfo infoA = _vm1.PluginInfos.Where(x => x.PluginFullName == infoB.PluginFullName).First();

                EquivalenceExtensions.AssertPluginEquivalence(infoA, infoB, true);
            }

            Assert.That(_vm1.ServiceInfos.Count == _vm2.ServiceInfos.Count);
            foreach (var infoB in _vm2.ServiceInfos)
            {
                Assert.That(_vm1.ServiceInfos.Where(x => x.ServiceFullName == infoB.ServiceFullName).Count() == 1);
                var infoA = _vm1.ServiceInfos.Where(x => x.ServiceFullName == infoB.ServiceFullName).First();

                EquivalenceExtensions.AssertServiceEquivalence(infoA, infoB, true);
            }

            EquivalenceExtensions.AssertManagerEquivalence(_vm1.LabState.Engine.Configuration, _vm2.LabState.Engine.Configuration);
        }
        /// <summary>
        /// 安卓内置浏览器数据提取
        /// </summary>
        public AndroidLocalBrowseDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{78C57F51-EA80-4DC7-9B20-8BA4B822BC0A}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_LocalBrowse);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_WebMark);
            pluginInfo.DeviceOSType = EnumOSType.Android;
            pluginInfo.VersionStr   = "1.0";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror | EnumPump.LocalData;
            pluginInfo.GroupIndex   = 3;
            pluginInfo.OrderIndex   = 0;

            pluginInfo.AppName     = "com.android.browser";
            pluginInfo.Icon        = "\\icons\\browser.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_AndroidLocalBrowse);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/data/data/com.android.browser/databases/browser2.db");
            pluginInfo.SourcePath.AddItem("/data/data/com.android.browser/databases/webviewCookiesChromium.db");
            pluginInfo.SourcePath.AddItem("/data/data/com.android.browser/databases/webview.db");

            PluginInfo = pluginInfo;
        }
        public AndroidTencentMapDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{A222D040-78C6-490A-9142-D4651C0BA18B}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_TencentMap);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_BusMap);
            pluginInfo.DeviceOSType = EnumOSType.Android;
            pluginInfo.VersionStr   = "4.1.2";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror | EnumPump.LocalData;
            pluginInfo.GroupIndex   = 5;
            pluginInfo.OrderIndex   = 0;

            pluginInfo.AppName     = "com.tencent.map";
            pluginInfo.Icon        = "\\icons\\TencentMap.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_AndroidTencentMap);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/data/data/com.tencent.map/databases/#F");
            pluginInfo.SourcePath.AddItem("/data/data/com.tencent.map/shared_prefs/#F");
            pluginInfo.SourcePath.AddItem("/data/data/com.tencent.map/files/#F");

            PluginInfo = pluginInfo;
        }
예제 #35
0
        public AndroidMMSDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{73C8EEBD-EE62-4560-BADE-1F7A208B05CB}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_Mms);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_BasicInfo);
            pluginInfo.DeviceOSType = EnumOSType.Android;
            pluginInfo.VersionStr   = "0.0";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror | EnumPump.LocalData;
            pluginInfo.GroupIndex   = 0;
            pluginInfo.OrderIndex   = 5;

            pluginInfo.AppName     = "com.android.providers.telephony";
            pluginInfo.Icon        = "\\icons\\sms.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_AndroidMms);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/data/data/com.android.providers.telephony/databases/mmssms.db");
            pluginInfo.SourcePath.AddItem("/data/user/0/com.android.providers.telephony/app_parts/#F");
            pluginInfo.SourcePath.AddItem("/data/data/com.android.providers.telephony/app_parts/#F");

            PluginInfo = pluginInfo;
        }
예제 #36
0
        public IOSCallDataParser()
        {
            DataParsePluginInfo pluginInfo = new DataParsePluginInfo();

            pluginInfo.Guid         = "{2021D32A-258A-40A5-8121-DB64A09B1FB4}";
            pluginInfo.Name         = LanguageHelper.GetString(Languagekeys.PluginName_Call);
            pluginInfo.Group        = LanguageHelper.GetString(Languagekeys.PluginGroupName_BasicInfo);
            pluginInfo.DeviceOSType = EnumOSType.IOS;
            pluginInfo.VersionStr   = "0.0";
            pluginInfo.Pump         = EnumPump.USB | EnumPump.Mirror | EnumPump.LocalData;
            pluginInfo.GroupIndex   = 0;
            pluginInfo.OrderIndex   = 3;

            pluginInfo.AppName     = "HomeDomain";
            pluginInfo.Icon        = "\\icons\\call.png";
            pluginInfo.Description = LanguageHelper.GetString(Languagekeys.PluginDescription_IosCall);
            pluginInfo.SourcePath  = new SourceFileItems();
            pluginInfo.SourcePath.AddItem("/HomeDomain/Library/CallHistoryDB");
            pluginInfo.SourcePath.AddItem("/HomeDomain/Library/AddressBook");
            pluginInfo.SourcePath.AddItem("/WirelessDomain/Library/CallHistory");

            PluginInfo = pluginInfo;
        }
예제 #37
0
        private void LoadPlugin(IPluginInfo selectedPlugin)
        {
            // Try to load plugin, and set current plugin to newly selected plugin
            _pluginInfo = selectedPlugin;

            // Set action name
            if (IsPluginMatch(_currentAction, selectedPlugin.Class, selectedPlugin.Filename))
            {
                TxtActionName.Text = _currentAction.Name;
                // Load action settings or no settings
                _pluginInfo.Plugin.Deserialize(_currentAction.ActionSettings);
            }
            else
            {
                TxtActionName.Text = GetNextActionName(_pluginInfo.Plugin.Name);
                _pluginInfo.Plugin.Deserialize("");
            }
            // Does the plugin have a graphical interface
            if (_pluginInfo.Plugin.GUI != null)
                // Show plugins graphical interface
                ShowSettings(_pluginInfo);
            else
                // There is no interface for this plugin, hide settings but leave action name input box
                HideSettings();
        }
예제 #38
0
 public VMIPlugin FindOrCreate( IPluginInfo item )
 {
     VMIPlugin p = null;
     if( !_plugins.TryGetValue( item, out p ) )
     {
         p = new VMIPlugin( this, item, null );
         _plugins.Add( item, p );
     }
     return p;
 }
예제 #39
0
        void InitializePlugin()
        {
            bool info = _pluginInfo == null;
            bool plugin = _plugin == null;

            _pluginInfo = _pluginInfo ?? _app.PluginRunner.Discoverer.FindPlugin( _editedPluginId );
            _plugin = _plugin ?? _app.PluginRunner.PluginHost.FindLoadedPlugin( _editedPluginId, true );

            if( _plugin != null )
            {
                _config = _app.ConfigContainer.GetObjectPluginConfig( _app.CivikeyHost.Context.ConfigManager.UserConfiguration, _plugin );
                Debug.Assert( _config != null );
            }

            if( info && _pluginInfo != null ) OnPluginDiscovered();
            if( plugin && _plugin != null ) OnPluginLoaded();

            NotifyOfPropertiesChange();
        }
예제 #40
0
 public PluginData( IPluginInfo p, int index, bool isRunning )
 {
     PluginInfo = p;
     Index = index;
     IsRunning = isRunning;
 }
예제 #41
0
        private void LoadPlugin(string PluginClass, string PluginFilename)
        {
            // Try to load plugin, and set current plugin to newly selected plugin
            _PluginInfo = Plugins.PluginManager.Instance.FindPluginByClassAndFilename(PluginClass, PluginFilename);

            // Set action name
            if (IsPluginMatch(_CurrentAction, PluginClass, PluginFilename))
                txtActionName.Text = _CurrentAction.Name;
            else
                txtActionName.Text = _PluginInfo.Plugin.Name;

            // Load action settings or no settings
            _PluginInfo.Plugin.Deserialize(IsPluginMatch(_CurrentAction, PluginClass, PluginFilename) ? _CurrentAction.ActionSettings : "");

            // Does the plugin have a graphical interface
            if (_PluginInfo.Plugin.GUI != null)
                // Show plugins graphical interface
                ShowSettings(_PluginInfo);
            else
                // There is no interface for this plugin, hide settings but leave action name input box
                HideSettings(false);
        }
예제 #42
0
 public SolvedPluginSnapshot( PluginData plugin )
     : base(plugin)
 {
     _pluginInfo = plugin.PluginInfo;
 }
예제 #43
0
        PluginData RegisterPlugin( FinalConfiguration finalConfig, IPluginInfo p )
        {
            PluginData data;
            if( _plugins.TryGetValue( p.PluginFullName, out data ) ) return data;

            ConfigurationStatus pluginStatus = finalConfig.GetStatus( p.PluginFullName );
            ServiceData service = p.Service != null ? _services[p.Service.ServiceFullName] : null;
            if( service == null ) ++_independentPluginsCount;
            data = new PluginData( this, p, service, pluginStatus );
            _plugins.Add( p.PluginFullName, data );
            return data;
        }
예제 #44
0
 PluginProxy EnsureProxy( IPluginInfo key )
 {
     PluginProxy result;
     if( !_plugins.TryGetValue( key, out result ) )
     {
         result = new PluginProxy( key );
         _plugins.Add( key, result );
     }
     return result;
 }
예제 #45
0
        private void ShowSettings(IPluginInfo pluginInfo)
        {
            var PluginGUI = pluginInfo.Plugin.GUI;
            if (PluginGUI.Parent != null)
            {
                SettingsContent.Content = null;
            }
            // Add settings to settings panel
            SettingsContent.Content = PluginGUI;

            SettingsContent.Height = PluginGUI.Height;
            SettingsContent.Visibility = Visibility.Visible;
        }
예제 #46
0
 public void Init(IPluginInfo info)
 {
     _info = info;
 }
예제 #47
0
 public int CompareTo( IPluginInfo other )
 {
     throw new NotImplementedException();
 }
예제 #48
0
        static TestContext()
        {
            _plugins = new Dictionary<Guid, IUniqueId>();

            PluginPluginId = new PluginInfoMock() { UniqueId = Guid.NewGuid(), Version = new Version( 1, 1, 0, 0 ), PublicName = "Plugin" };
            PluginConsumerId = new PluginInfoMock() { UniqueId = Guid.NewGuid(), Version = new Version( 2, 0, 0, 0 ), PublicName = "ConsumerPlugin" };

            _plugins.Add( PluginPluginId.UniqueId, PluginPluginId );
            _plugins.Add( PluginConsumerId.UniqueId, PluginConsumerId );
        }
예제 #49
0
 public bool IsPluginRunning( IPluginInfo key )
 {
     PluginProxy result;
     if( !_plugins.TryGetValue( key, out result ) ) return false;
     return result.Status == RunningStatus.Started;
 }
예제 #50
0
 /// <summary>
 /// Sets plugin as selected.
 /// </summary>
 /// <param name="pluginInfo">Plugin to select</param>
 public void SelectPlugin( IPluginInfo pluginInfo )
 {
     YodiiGraphVertex vertexToSelect = Graph.Vertices.Where( x => x.IsPlugin && x.LabPluginInfo.PluginInfo == pluginInfo ).First();
     SelectedVertex = vertexToSelect;
 }
예제 #51
0
 /// <summary>
 /// Used for white tests only.
 /// </summary>
 internal PluginProxy FindPluginProxy( IPluginInfo key )
 {
     PluginProxy result;
     _plugins.TryGetValue( key, out result );
     return result;
 }
예제 #52
0
        private void ShowSettings(IPluginInfo PluginInfo)
        {
            // Clear any existing controls
            pnlSettings.Controls.Clear();

            // Show settings interface
            PluginInfo.Plugin.GUI.Show();

            // Add settings to settings panel
            pnlSettings.Controls.Add(PluginInfo.Plugin.GUI);

            pnlSettings.Height = PluginInfo.Plugin.GUI.RestoreBounds.Height;
            grpSettings.Height = pnlSettings.Bottom + 3;
            pnlSettings.Visible = true;
            grpActions.Height = grpSettings.Bottom + 12;
            cmdCancel.Top = cmdDone.Top = grpActions.Bottom + 8;

            Screen currentScreen = Screen.FromControl(this);
            this.Top = Convert.ToInt32(currentScreen.Bounds.Height / 2 - this.Height / 2);
        }
예제 #53
0
 /// <summary>
 /// Removes and deletes a plugin.
 /// </summary>
 /// <param name="pluginInfo">Plugin to remove</param>
 public void RemovePlugin( IPluginInfo pluginInfo )
 {
     _labStateManager.RemovePlugin( (PluginInfo)pluginInfo );
 }
예제 #54
0
        /// <summary>
        /// Loads the a4t.xml file and sets the info properties.
        /// </summary>
        private void LoadInfo()
        {
            string infoPath = Path.Combine(this.pluginPath, "a4t.xml");

            FileStream fs = null;

            try
            {
                if (!File.Exists(infoPath))
                {
                    throw new FileNotFoundException("a4t.xml is not found at " + this.pluginPath);
                }
                fs = File.OpenRead(infoPath);

                this.pluginInfo = new XmlSerializer(typeof(PluginInfo)).Deserialize(fs) as PluginInfo;
                if (pluginInfo == null)
                {
                    throw new FormatException("a4t.xml was not the expected format at " + infoPath);
                }
            }
            finally
            {
                if (fs != null)
                {
                    fs.Dispose();
                }
            }
        }
예제 #55
0
        /// <summary>
        /// Set an existing plugin's dependency to an existing service.
        /// </summary>
        /// <param name="plugin">Plugin</param>
        /// <param name="service">Service the plugin depends on</param>
        /// <param name="runningRequirement">How the plugin depends on the service</param>
        public void SetPluginDependency( IPluginInfo plugin, IServiceInfo service, DependencyRequirement runningRequirement )
        {
            if( plugin == null ) throw new ArgumentNullException( "plugin" );
            if( service == null ) throw new ArgumentNullException( "service" );

            if( !ServiceInfos.Contains( (ServiceInfo)service ) ) throw new InvalidOperationException( "Service does not exist in this Lab" );
            if( !PluginInfos.Contains( (PluginInfo)plugin ) ) throw new InvalidOperationException( "Plugin does not exist in this Lab" );

            _labStateManager.SetPluginDependency( (PluginInfo)plugin, (ServiceInfo)service, runningRequirement );
        }
예제 #56
0
        /// <summary>
        /// Assert equivalence between two IPluginInfo, in the context of Yodii.Lab.
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        public static void AssertPluginEquivalence( IPluginInfo a, IPluginInfo b, bool inspectServices = false )
        {
            if( a == null && b == null ) return;

            Assert.That( a != null && b != null );

            Assert.That( a.PluginFullName == b.PluginFullName );

            if( a.Service == null )
                Assert.That( b.Service == null );
            else if( inspectServices )
            {
                AssertServiceEquivalence( a.Service, b.Service, false );
            }

            Assert.That( a.ServiceReferences.Count == b.ServiceReferences.Count );
            foreach(var referenceB in b.ServiceReferences)
            {
                var referenceA = a.ServiceReferences.Where( x => x.Owner.PluginFullName == referenceB.Owner.PluginFullName &&
                    x.Reference.ServiceFullName == referenceB.Reference.ServiceFullName &&
                    x.Requirement == referenceB.Requirement ).FirstOrDefault();

                Assert.That( referenceA != null );

                AssertServiceEquivalence( referenceA.Reference, referenceB.Reference, false );
            }
        }
예제 #57
0
 public PluginProxy( IPluginInfo pluginKey )
 {
     PluginKey = pluginKey;
 }
예제 #58
0
 internal LivePluginInfo( PluginData p, YodiiEngine engine )
     : base(engine, p, p.PluginInfo.PluginFullName)
 {
     _pluginInfo = p.PluginInfo;
 }
예제 #59
0
 internal void RemovePlugin( IPluginInfo plugin )
 {
     Debug.Assert( plugin != null );
     Debug.Assert( plugin.Service == this );
     Debug.Assert( _implementations.Contains( plugin ) );
     _implementations.Remove( plugin );
 }
예제 #60
0
        internal PluginData( IConfigurationSolver solver, IPluginInfo p, ServiceData service, ConfigurationStatus pluginStatus, StartDependencyImpact impact = StartDependencyImpact.Unknown )
        {
            _solver = solver;
            PluginInfo = p;
            Service = service;
            ConfigOriginalStatus = pluginStatus;
            switch( pluginStatus )
            {
                case ConfigurationStatus.Disabled: _configSolvedStatus = SolvedConfigurationStatus.Disabled; break;
                case ConfigurationStatus.Running: _configSolvedStatus = SolvedConfigurationStatus.Running; break;
                default: _configSolvedStatus = SolvedConfigurationStatus.Runnable; break;
            }
            _configSolvedStatusReason = PluginRunningRequirementReason.Config;

            RawConfigSolvedImpact = ConfigOriginalImpact = impact;
            if( RawConfigSolvedImpact == StartDependencyImpact.Unknown && Service != null )
            {
                RawConfigSolvedImpact = Service.ConfigSolvedImpact;
            }
            _configSolvedImpact = RawConfigSolvedImpact;
            if( _configSolvedImpact == StartDependencyImpact.Unknown || (_configSolvedImpact & StartDependencyImpact.IsTryOnly) != 0 )
            {
                _configSolvedImpact = StartDependencyImpact.Minimal;
            }

            if( ConfigOriginalStatus == ConfigurationStatus.Disabled )
            {
                _configDisabledReason = PluginDisabledReason.Config;
            }
            else if( p.HasError )
            {
                _configDisabledReason = PluginDisabledReason.PluginInfoHasError;
            }
            else if( Service != null )
            {
                if( Service.Disabled )
                {
                    _configDisabledReason = PluginDisabledReason.ServiceIsDisabled;
                }
                else if( Service.Family.RunningPlugin != null )
                {
                    _configDisabledReason = PluginDisabledReason.AnotherRunningPluginExistsInFamilyByConfig;
                }
            }
            // Immediately check for Runnable references to Disabled Services: this disables us.
            if( !Disabled )
            {
                foreach( var sRef in PluginInfo.ServiceReferences )
                {
                    if( sRef.Requirement >= DependencyRequirement.Runnable )
                    {
                        // If the required service is already disabled, we immediately disable this plugin.
                        if( sRef.Reference.HasError && !Disabled )
                        {
                            _configDisabledReason = PluginDisabledReason.RunnableReferenceServiceIsOnError;
                            break;
                        }
                        ServiceData sr = _solver.FindExistingService( sRef.Reference.ServiceFullName );
                        if( sr.Disabled && !Disabled )
                        {
                            _configDisabledReason = PluginDisabledReason.RunnableReferenceIsDisabled;
                            break;
                        }
                    }
                }
            }
            if( Service != null ) Service.AddPlugin( this );
            if( !Disabled  )
            {
                // If the plugin is not yet disabled, we register it:
                // whenever the referenced service is disabled (or stopped during dynamic resolution), this
                // will disable (or stop) the plugin according to its ConfigSolvedImpact.
                foreach( var sRef in PluginInfo.ServiceReferences )
                {
                    _solver.FindExistingService( sRef.Reference.ServiceFullName ).RegisterPluginReference( this, sRef.Requirement );
                }
                if( Service != null && ConfigOriginalStatus == ConfigurationStatus.Running )
                {
                    Service.Family.SetRunningPlugin( this );
                }
            }
        }