Exemple #1
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="DatabaseHistory" /> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        public DatabaseHistory(IPluginSettings settings)
        {
            InitializeComponent( );

            _viewModel  = new DatabaseHistoryViewModel(settings);
            DataContext = _viewModel;
        }
Exemple #2
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="HistoryViewerViewModel" /> class.
        /// </summary>
        /// <param name="transactionId">The transaction identifier.</param>
        /// <param name="settings">The settings.</param>
        public HistoryViewerViewModel(long transactionId, IPluginSettings settings)
        {
            TransactionId  = transactionId;
            PluginSettings = settings;

            LoadData( );
        }
Exemple #3
0
        // This an entry point
        static PluginEntryPoint()
        {
            PluginSettings.InitLog();                         // init log before doing any logging
            ourLogEventCollector = new UnityEventCollector(); // start collecting Unity messages asap

            ourPluginSettings    = new PluginSettings();
            ourRiderPathProvider = new RiderPathProvider(ourPluginSettings);

            if (IsLoadedFromAssets()) // old mechanism, when EditorPlugin was copied to Assets folder
            {
                var riderPath = ourRiderPathProvider.GetActualRider(EditorPrefsWrapper.ExternalScriptEditor,
                                                                    RiderPathLocator.GetAllFoundPaths(ourPluginSettings.OperatingSystemFamilyRider));
                if (!string.IsNullOrEmpty(riderPath))
                {
                    AddRiderToRecentlyUsedScriptApp(riderPath);
                    if (IsRiderDefaultEditor() && PluginSettings.UseLatestRiderFromToolbox)
                    {
                        EditorPrefsWrapper.ExternalScriptEditor = riderPath;
                    }
                }

                if (!PluginSettings.RiderInitializedOnce)
                {
                    EditorPrefsWrapper.ExternalScriptEditor = riderPath;
                    PluginSettings.RiderInitializedOnce     = true;
                }

                InitForPluginLoadedFromAssets();
                Init();
            }
            else
            {
                Init();
            }
        }
Exemple #4
0
        // This an entry point
        static PluginEntryPoint()
        {
            ourModel = new RProperty <UnityModel>();

            var logSender = new UnityEventLogSender(ourModel);

            logSender.UnityLogRegisterCallBack();

            ourPluginSettings   = new PluginSettings();
            ourRiderPathLocator = new RiderPathLocator(ourPluginSettings);
            var riderPath = ourRiderPathLocator.GetDefaultRiderApp(EditorPrefsWrapper.ExternalScriptEditor,
                                                                   RiderPathLocator.GetAllFoundPaths(ourPluginSettings.OperatingSystemFamilyRider));

            if (string.IsNullOrEmpty(riderPath))
            {
                return;
            }

            AddRiderToRecentlyUsedScriptApp(riderPath);
            if (!PluginSettings.RiderInitializedOnce)
            {
                EditorPrefsWrapper.ExternalScriptEditor = riderPath;
                PluginSettings.RiderInitializedOnce     = true;
            }

            if (Enabled)
            {
                Init();
            }
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="LicensingMetricsViewModel" /> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        public LicensingMetricsViewModel(IPluginSettings settings)
        {
            PluginSettings = settings;

            _dispatcher = Dispatcher.CurrentDispatcher;

            RunCommand = new DelegateCommand(() => _dispatcher.Invoke(Run));

            _jobIdentifier = GetJobId( );

            if (_dispatcherTimer == null)
            {
                _dispatcherTimer          = new DispatcherTimer( );
                _dispatcherTimer.Tick    += DispatcherTimerOnTick;
                _dispatcherTimer.Interval = new TimeSpan(0, 0, 1);                   // 1 secs
                if (_jobIdentifier.HasValue)
                {
                    _dispatcherTimer.Start( );
                }
            }

            Jobs = new ObservableCollection <IndexData>( );

            Load( );
        }
Exemple #6
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="TestEditorViewModel" /> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        /// <param name="query">The query.</param>
        public TestEditorViewModel(IPluginSettings settings, string query)
        {
            PluginSettings = settings;
            Query          = query;

            OkCommand = new DelegateCommand <Window>(OnOkClick);
        }
Exemple #7
0
 public OnOpenAssetHandler(RProperty <UnityModel> model, RiderPathLocator riderPathLocator, IPluginSettings pluginSettings, string slnFile)
 {
     myModel            = model;
     myRiderPathLocator = riderPathLocator;
     myPluginSettings   = pluginSettings;
     mySlnFile          = slnFile;
 }
        public LICSRequest[] GetRequestsWithArticles(IPluginSettings pluginSettings, Ix4RequestProps ix4Property)
        {
            List <LICSRequest> requests = new List <LICSRequest>();
            LICSRequest        request  = new LICSRequest();

            switch (ix4Property)
            {
            case Ix4RequestProps.Articles:
                request.ArticleImport = GetRequestArticles(pluginSettings);
                break;

            case Ix4RequestProps.Deliveries:
                request.DeliveryImport = GetRequestDeliveries(pluginSettings);
                break;

            case Ix4RequestProps.Orders:
                request.OrderImport = GetRequestOrders(pluginSettings);
                break;

            default:
                break;
            }
            requests.Add(request);
            return(requests.ToArray());
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="TenantsViewModel" /> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        public TenantsViewModel(IPluginSettings settings)
        {
            PluginSettings = settings;

            RefreshCommand = new DelegateCommand(Refresh);
            CopyIdCommand  = new DelegateCommand <TenantInfo>(CopyIdClick);
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="RedisPubSubMonitor" /> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        public RedisPubSubMonitor(IPluginSettings settings)
        {
            InitializeComponent( );

            _viewModel = new RedisPubSubMonitorViewModel(settings);

            DataContext = _viewModel;

            var assemblyLocation = Assembly.GetExecutingAssembly( ).Location;

            var directoryName = Path.GetDirectoryName(assemblyLocation);

            if (directoryName != null)
            {
                string xshdPath = Path.Combine(directoryName, "redisSyntax.xshd");

                using (var reader = new XmlTextReader(xshdPath))
                {
                    editor.SyntaxHighlighting = HighlightingLoader.Load(reader, HighlightingManager.Instance);
                }
            }

            editor.MouseHover        += editor_MouseHover;
            editor.MouseHoverStopped += editor_MouseHoverStopped;
            editor.MouseMove         += editor_MouseMove;
            editor.TextArea.PreviewMouseLeftButtonUp += TextArea_PreviewMouseLeftButtonUp;
        }
Exemple #11
0
        // This an entry point
        static PluginEntryPoint()
        {
            PluginSettings.InitLog();                         // init log before doing any logging
            ourLogEventCollector = new UnityEventCollector(); // start collecting Unity messages asap

            ourPluginSettings   = new PluginSettings();
            ourRiderPathLocator = new RiderPathLocator(ourPluginSettings);
            var riderPath = ourRiderPathLocator.GetDefaultRiderApp(EditorPrefsWrapper.ExternalScriptEditor,
                                                                   RiderPathLocator.GetAllFoundPaths(ourPluginSettings.OperatingSystemFamilyRider));

            if (string.IsNullOrEmpty(riderPath))
            {
                return;
            }

            AddRiderToRecentlyUsedScriptApp(riderPath);
            if (!PluginSettings.RiderInitializedOnce)
            {
                EditorPrefsWrapper.ExternalScriptEditor = riderPath;
                PluginSettings.RiderInitializedOnce     = true;
            }

            if (Enabled)
            {
                Init();
            }
        }
Exemple #12
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="OrphanDetectionViewModel" /> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        public OrphanDetectionViewModel(IPluginSettings settings)
        {
            PluginSettings = settings;

            SaveCommand   = new DelegateCommand(SaveClick);
            DeleteCommand = new DelegateCommand(DeleteClick);
        }
Exemple #13
0
        private void WriteWhenLastSaveHappened(object sender, EventArgs e)
        {
            Form             mainWindowForm         = (sender as IPluginContext)?.MainForm as Form;
            XmlNodeEventArgs args                   = e as XmlNodeEventArgs;
            bool             updatingMainWindowText = false;

            if (mainWindowForm == null || args == null)
            {
                return;
            }

            settings = args.XmlNode != null?PluginSettings.CreateSettings(args.XmlNode) : new PluginSettings();

            mainWindowForm.TextChanged += (s, a) =>
            {
                if (!updatingMainWindowText && !string.IsNullOrWhiteSpace(settings.LastSave))
                {
                    try
                    {
                        updatingMainWindowText = true;
                        mainWindowForm.Text   += $" (Settings last saved {settings.LastSave})";
                    }
                    finally
                    {
                        updatingMainWindowText = false;
                    }
                }
            };
            mainWindowForm.Text = string.Empty;
        }
Exemple #14
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="LibraryApplicationsViewModel" /> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        public LibraryApplicationsViewModel(IPluginSettings settings)
        {
            PluginSettings = settings;

            RefreshCommand            = new DelegateCommand(Refresh);
            CopyAppValueCommand       = new DelegateCommand <AppLibraryApp>(CopyAppValueClick);
            CopyValueCommand          = new DelegateCommand <AppLibraryApp>(CopyValueClick);
            CopyCommand               = new DelegateCommand <AppLibraryApp>(CopyClick);
            FilterApplicationCommand  = new DelegateCommand(FilterApplicationClick);
            FilterVersionCommand      = new DelegateCommand(FilterVersionClick);
            FilterPublisherCommand    = new DelegateCommand(FilterPublisherClick);
            FilterPublisherUrlCommand = new DelegateCommand(FilterPublisherUrlClick);

            SelectApplicationsCommand = new DelegateCommand <bool>(selected =>
            {
                SelectClick(ApplicationFilters, selected);
            });
            SelectVersionsCommand = new DelegateCommand <bool>(selected =>
            {
                SelectClick(VersionFilters, selected);
            });
            SelectPublishersCommand = new DelegateCommand <bool>(selected =>
            {
                SelectClick(PublisherFilters, selected);
            });
            SelectPublisherUrlsCommand = new DelegateCommand <bool>(selected =>
            {
                SelectClick(PublisherUrlFilters, selected);
            });
        }
		public ConfigurationMap(Configuration file, IPluginSettings settings, bool autoLoad)
		{
			this.file = file;
			this.settings = settings;
			if (autoLoad)
				Load();
		}
 public LICSRequestOrder[] GetRequestOrders()
 {
     LICSRequestOrder[] requestOrders = new LICSRequestOrder[] { };
     try
     {
         IPluginSettings plugingSettings = _pluginSettings.AllAvailablePluginSettings().FirstOrDefault(pl => pl.CheckOrders);
         if (plugingSettings == null)
         {
             //_logger.Log("There was not adjusted any orders setting");
             return(requestOrders);
         }
         foreach (var plugin in CustomerDataPlugins)
         {
             if (((string)plugin.Metadata[CurrentServiceInformation.NameForPluginMetadata]).Equals(Enum.GetName(typeof(CustomDataSourceTypes), plugingSettings.CheckOrders)))
             {
                 requestOrders = plugin.Value.GetRequestOrders(plugingSettings);
                 break;
             }
         }
     }
     catch (Exception ex)
     {
         //         _logger.Log(ex);
     }
     return(requestOrders);
 }
        private static void LoadSettings()
        {
            if (_folder == null)
            {
                throw new ArgumentNullException("_folder", "Root folder not initialized!");
            }

            string file = CoreVars.GetFilePath(_folder, CoreVars.SettingsFile);

            if (!File.Exists(file))
            {
                var defaultSettings = GetDefaultSettings();
                defaultSettings.Save();
                _settings = defaultSettings;
                return;
            }

            _settings = JsonConvert.DeserializeObject <PluginSettings>(File.ReadAllText(file));
            var def = GetDefaultSettings();

            _settings.GenresTagField = _settings.GenresTagField ?? def.GenresTagField;
            _settings.MoodsTagField  = _settings.MoodsTagField ?? def.MoodsTagField;
            _settings.ThemesTagField = _settings.ThemesTagField ?? def.ThemesTagField;

            _settings.Genres = _settings.Genres ?? def.Genres;
            _settings.Moods  = _settings.Moods ?? def.Moods;
            _settings.Themes = _settings.Themes ?? def.Themes;

            _settings.Save();
        }
        /// <summary>
        /// Creates a new SettingsViewModel.
        /// </summary>
        public SettingsViewModel(IPluginSettings settings)
        {
            Settings           = settings;
            DisplayedMealTypes = SettingsUtils.GetEnumPairs(Settings.DisplayedMealTypes, MealType.Unknown);

            _previousTarget = settings.PriceTarget;
        }
Exemple #19
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="LibraryApplications" /> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        public LibraryApplications(IPluginSettings settings)
        {
            InitializeComponent( );

            var viewModel = new LibraryApplicationsViewModel(settings);

            DataContext = viewModel;
        }
Exemple #20
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="ThreadMonitorViewModel" /> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        public ThreadMonitorViewModel(IPluginSettings settings)
        {
            _dispatcher = Dispatcher.CurrentDispatcher;

            PluginSettings = settings;

            ClearCommand = new DelegateCommand(() => _dispatcher.Invoke(Clear));
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="PerfGraph" /> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        public PerfGraph(IPluginSettings settings)
        {
            var viewModel = new PerfGraphViewModel(settings);

            DataContext = viewModel;

            InitializeComponent( );
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="TableSizes" /> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        public TableSizes(IPluginSettings settings)
        {
            var viewModel = new TableSizesViewModel(settings);

            DataContext = viewModel;

            InitializeComponent( );
        }
Exemple #23
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="OrphanDetection" /> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        public OrphanDetection(IPluginSettings settings)
        {
            InitializeComponent( );

            var viewModel = new OrphanDetectionViewModel(settings);

            DataContext = viewModel;
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="RemoteExecControl" /> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        public RemoteExecControl(IPluginSettings settings)
        {
            InitializeComponent();

            _viewModel = new RemoteExecViewModel(settings);

            DataContext = _viewModel;
        }
Exemple #25
0
        public static Settings SettingsFromInterface(IPluginSettings set)
        {
            Settings s = new Settings(DefaultsFromInterface(set.GetDefaults()));

            s.Data   = set.Data;
            s.Loaded = true;
            return(s);
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="AddFieldDialog" /> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        /// <param name="selectedEntityId">The selected entity identifier.</param>
        public AddFieldDialog(IPluginSettings settings, long selectedEntityId)
        {
            InitializeComponent( );

            _viewModel = new AddFieldDialogViewModel(settings, selectedEntityId);

            DataContext = _viewModel;
        }
        public override void GetDefaultSettings(IPluginSettings Settings)
        {
            base.GetDefaultSettings(Settings);

            Settings.AddSetting("AuthorizationDialog", "AuthorizationDialog", TSettingValueType.svtString, TSettingStorage.ssServerStorage);

            Marshal.FinalReleaseComObject(Settings);
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="TenantsTrend" /> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        public TenantsTrend(IPluginSettings settings)
        {
            var viewModel = new TenantsTrendViewModel(settings);

            DataContext = viewModel;

            InitializeComponent( );
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="UserAccounts" /> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        public UserAccounts(IPluginSettings settings)
        {
            InitializeComponent( );

            var viewModel = new UserAccountsViewModel(settings);

            DataContext = viewModel;
        }
 /// <summary>
 /// Creates a new MainViewModel.
 /// </summary>
 public MainViewModel(ITransportService transportService, IPluginSettings settings,
                      INavigationService navigationService, ILocationService locationService)
 {
     _transportService  = transportService;
     Settings           = settings;
     _navigationService = navigationService;
     _locationService   = locationService;
 }
        /// <summary>
        ///     Initializes a new instance of the <see cref="AddRelationshipDialog" /> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        /// <param name="selectedEntityId">The selected entity identifier.</param>
        /// <param name="forward">if set to <c>true</c> [forward].</param>
        public AddRelationshipDialog(IPluginSettings settings, long selectedEntityId, bool forward)
        {
            InitializeComponent( );

            _viewModel = new AddRelationshipDialogViewModel(settings, selectedEntityId, forward);

            DataContext = _viewModel;
        }
 protected PluginInfoSender()
 {
     _context = ObjectFactory.GetInstance<IPluginContext>();
     _bus = ObjectFactory.GetInstance<ITpBus>();
     PluginMetadata = ObjectFactory.GetInstance<IPluginMetadata>();
     _accountCollection = ObjectFactory.GetInstance<IAccountCollection>();
     _pluginQueueFactory = ObjectFactory.GetInstance<IPluginQueueFactory>();
     _pluginSettings = ObjectFactory.GetInstance<IPluginSettings>();
     _pluginIcon = ObjectFactory.GetInstance<PluginIcon>();
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="settings"></param>
 /// <param name="element"></param>
 internal PluginSetting(IPluginSettings settings, XElement element)
 {
     this.element = element;
     this.settings = settings;
 }
        public override void Initialize()
        {
            if (WasInitialized)
                return;
            battleCount = 0;
            _petLua = PetLua.Instance;
            _pluginSettings = new PluginSettings();
            _pluginProperties = _pluginSettings as IPluginProperties;
            _petJournal = new PetJournal(_pluginProperties, _petLua);
            _petChooser = new PetChooser(_pluginProperties, _petLua, _petJournal);
            _petLoader = new PetLoader(_petLua);
            _petReport = new PetReport();
            _zoneTable = new ZoneList();

            _lastEnemyLevel = 0;
            CurrentProfileLevel = 0;

            MyPets.updateMyPets();      // some healing behavior may need to know the current state

            Moved = false;
            Selected = false;
            AnimationActive = false;
            LoadSuccess = true;        // no failures detected yet

            rand = new Random();
            ReactionTime = rand.NextDouble() * 1000 + 500;
            Logger.Write(string.Format("Reaction time set about {0:F1} msec" , ReactionTime));

            numPetsOwnedOnStart = _petLua.GetNumPetsOwned();
            isSlotAvailableOnStart = ! _petLua.IsSlotLocked(1);
            Logger.WriteDebug("Owned on start: " + numPetsOwnedOnStart + ", slot available: " + isSlotAvailableOnStart);

            if( !string.IsNullOrEmpty(PluginSettings.Instance.LastProfile) )
                LoadProfile(PluginSettings.Instance.LastProfile);

            // will fight everything. Is "nothing" better?

            WasInitialized = true;
        }
Exemple #35
0
 public PluginSettingsPropertyDescriptor(IPluginSettings pluginSettings)
     : base(pluginSettings.GetType().Name, BuildAttributeArray(pluginSettings))
 {
     this.pluginSettings = pluginSettings;
 }
Exemple #36
0
                private static Attribute[] BuildAttributeArray(IPluginSettings pluginSettings)
                {
                    AttributeCollection attributeCollection = TypeDescriptor.GetAttributes(pluginSettings);
                    Attribute[] attributeArray = new Attribute[attributeCollection.Count];

                    for (int i = 0; i < attributeArray.Length; i++)
                        attributeArray[i] = attributeCollection[i];

                    return attributeArray;
                }
 public void TestInit()
 {
     var doc = XDocument.Load("a4t.xml");
     this.settings = new PluginSettings(doc);
 }
Exemple #38
0
 /// <summary>
 /// Initializes the plugin.
 /// </summary>
 public void Initialize( INavigationService navigationService )
 {
     _settings = Container.Bind<IPluginSettings, PluginSettings>();
     Container.Bind<IEventsService, EventsService>();
 }
		public ConfigurationMap(Configuration file, IPluginSettings settings) : this(file, settings, true)
		{
		}