public void Reset()
    {
        EditorOnlyToolSettings = new ToolSettings(hideHandles: true);

        Circle localCircle = new Circle(radius: 1f);
        Path = new CirclePath(this.transform, localCircle);
    }
Example #2
0
 public Stroke(ToolSettings toolSettings, double size, bool isFilled)
 {
     ToolSettings = toolSettings;
     IsFilled     = isFilled;
     Size         = size;
     MinSize      = 1;
     MaxSize      = 20;
 }
Example #3
0
 protected Bspzip(ToolSettings toolSettings, GameConfig game, string bspPath, LogText logsOutput)
 {
     this.toolSettings = toolSettings;
     this.game         = game;
     this.bspPath      = bspPath;
     this.logsOutput   = logsOutput;
     isSyncLogsOutput  = toolSettings.IsSyncLogs;
 }
Example #4
0
 static UnitTestActions()
 {
     ExcludeFromUnitTests = new List <string>();
     XUnit2ToolArgs       = new ToolSettings();
     XUnitToolArgs        = new ToolSettings();
     NUnitToolArgs        = new ToolSettings();
     NUnit3ToolArgs       = new ToolSettings();
 }
Example #5
0
    public void Reset()
    {
        EditorOnlyToolSettings = new ToolSettings(hideHandles: true);

        Circle localCircle = new Circle(radius: 1f);

        Path = new CirclePath(this.transform, localCircle);
    }
Example #6
0
 public Mark(ToolSettings toolSettings, double size, bool isFilled)
 {
     ToolSettings = toolSettings;
     IsFilled     = isFilled;
     Size         = size;
     Point        = new Point(-1, -1);
     MinSize      = 10;
     MaxSize      = 70;
 }
Example #7
0
        public ToolSeetingsForm(GH_Component component, ToolSettings settings)
        {
            // sets the client (inner) size of the window for your content
            this.ClientSize = new Eto.Drawing.Size(100, 200);
            this.Title      = "Tool Settings";

            m_component    = component;
            m_toolsettings = settings;
        }
Example #8
0
        public int ExecuteCommand(string commandSelectedByUser, List <string> parametersSelectedByUser)
        {
            ParseRunToolSettings(commandSelectedByUser);
            string runQuietValue;
            bool   runQuiet = false;

            if (ToolSettings.TryGetValue(RunQuietReservedKeyword, out runQuietValue))
            {
                runQuiet = runQuietValue.Equals("true", StringComparison.OrdinalIgnoreCase);
            }
            string whatIfValue;
            bool   whatIf = false;

            if (ToolSettings.TryGetValue(WhatIfReservedKeyword, out whatIfValue))
            {
                if (string.IsNullOrEmpty(whatIfValue))
                {
                    ToolSettings.TryGetValue(DryRunReservedKeyword, out whatIfValue);
                }
                whatIf = whatIfValue.Equals("true", StringComparison.OrdinalIgnoreCase);
            }

            CompleteCommand commandToRun = BuildCommand(commandSelectedByUser, parametersSelectedByUser);

            if (commandToRun != null)
            {
                int result = 0;

                if (whatIf)
                {
                    PrintColorMessage(ConsoleColor.Yellow, "Showing command, would execute:");
                    PrintColorMessage(ConsoleColor.Yellow, $"\n\n{commandToRun.ToolCommand} {commandToRun.ParametersCommand}\n");
                }
                else
                {
                    if (!runQuiet)
                    {
                        PrintColorMessage(ConsoleColor.DarkYellow, $"Running: {commandToRun.ToolCommand} {commandToRun.ParametersCommand}");
                    }
                    result = RunProcess.ExecuteProcess(commandToRun.ToolCommand, commandToRun.ParametersCommand);
                    if (!runQuiet)
                    {
                        if (result == 0)
                        {
                            PrintColorMessage(ConsoleColor.Green, "Command execution succeeded.");
                        }
                        else
                        {
                            PrintColorMessage(ConsoleColor.Red, "Command execution failed with exit code {0}.", result);
                        }
                    }
                }
                return(result);
            }
            return(1);
        }
Example #9
0
 public Text(ToolSettings toolSettings, double size, bool isFilled)
 {
     Value        = string.Empty;
     ToolSettings = toolSettings;
     IsFilled     = isFilled;
     Size         = size;
     Point        = new Point(-1, -1);
     MinSize      = 20;
     MaxSize      = 200;
 }
Example #10
0
        public tasTP_ToolSettings_Form(
            GH_Component _component,
            ToolSettings _settings)
        {
            settings  = _settings;
            component = _component;

            InitializeComponent();
            this.CancelButton = button_cancel;
        }
Example #11
0
 public Circle(ToolSettings toolSettings, double size, bool isFilled)
 {
     Start        = new Point(-1, -1);
     End          = new Point(-1, -1);
     ToolSettings = toolSettings;
     IsFilled     = isFilled;
     Size         = size;
     MinSize      = 1;
     MaxSize      = 20;
 }
    private void OnEnable()
    {
        targetScript = (DynamicBezierPathComponent)target;
        settings     = targetScript.EditorOnlyToolSettings;

        if (!Safety())
        {
            SceneView.currentDrawingSceneView.ShowNotification(new GUIContent(PathEditorUtility.EditorUnavailable));
            return;
        }
    }
Example #13
0
    // PRIVATE

    void UpdateLook()
    {
        Ray        r = new Ray(_avatar.head.position, _avatar.head.forward);
        RaycastHit hit;

        if (Physics.Raycast(r, out hit, _avatar.interactDistance, Layer.TOOL_MASK))
        {
            _lookAtTool = hit.collider.gameObject.GetComponentInParent <ToolSettings>();
            Debug.Log(String.Format("Look ray hit, collider is: {0} tool is: {1}", hit.collider.name, ((_lookAtTool != null) ? _lookAtTool.name : "null")));
        }
    }
Example #14
0
    public void OnTeleport()
    {
        // reset lookat
        _currentPitch = 0f;
        _avatar.head.localRotation = Quaternion.identity;
        _lookAtTool = null;

        // reset physics
        _avatar.avatarRigidBody.velocity        = Vector3.zero;
        _avatar.avatarRigidBody.angularVelocity = Vector3.zero;
    }
Example #15
0
        public static IBalanceReader Create(ToolSettings toolSettings, IAssetsService assetsService)
        {
            if (toolSettings.Ethereum?.EthereumCoreUrl == null)
            {
                throw new ArgumentNullException(nameof(toolSettings.Ethereum.EthereumCoreUrl));
            }

            var client = new EthereumCoreAPI(new Uri(toolSettings.Ethereum.EthereumCoreUrl));

            return(new EthereumBalanceReader(client, assetsService));
        }
    public void Reset()
    {
        EditorOnlyToolSettings = new ToolSettings();

        var localBezier = new QuadraticBezier(
            new Vector3(0.5f, 0f, 0f),
            new Vector3(0f, 0.5f, 0.5f),
            new Vector3(0.5f, 1.0f, 0.5f)
            );
        Path = new QuadraticBezierPath(transform, localBezier);
    }
Example #17
0
        private static IReadOnlyCollection <Output> StartProcess([NotNull] ToolSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }
            var process = ProcessTasks.StartProcess(settings);

            process.AssertZeroExitCode();
            return(process.Output);
        }
    public void Reset()
    {
        EditorOnlyToolSettings = new ToolSettings();

        CubicBezier localBezier = new CubicBezier(
            new Vector3(0.5f, 0f, 0f),
            new Vector3(1.0f, 0.5f, 0f),
            new Vector3(0.5f, 1.0f, 0.5f),
            new Vector3(0f, 0.5f, 0.5f)
            );
        Path = new CubicBezierPath(this.transform, localBezier);
    }
Example #19
0
    public void Reset()
    {
        EditorOnlyToolSettings = new ToolSettings();

        var localBezier = new QuadraticBezier(
            new Vector3(0.5f, 0f, 0f),
            new Vector3(0f, 0.5f, 0.5f),
            new Vector3(0.5f, 1.0f, 0.5f)
            );

        Path = new QuadraticBezierPath(transform, localBezier);
    }
Example #20
0
    public void Reset()
    {
        EditorOnlyToolSettings = new ToolSettings();

        CubicBezier localBezier = new CubicBezier(
            new Vector3(0.5f, 0f, 0f),
            new Vector3(1.0f, 0.5f, 0f),
            new Vector3(0.5f, 1.0f, 0.5f),
            new Vector3(0f, 0.5f, 0.5f)
            );

        Path = new CubicBezierPath(this.transform, localBezier);
    }
    public void Reset()
    {
        EditorOnlyToolSettings = new ToolSettings();

        var dynamicBezier = new DynamicBezier(
            new Vector3(0.5f, 0f, 0f),
            new Vector3(0f, 0.5f, 0.5f),
            new Vector3(0.5f, 1.0f, 0.5f),
            new Vector3(1.5f, 1f, 1f),
            new Vector3(1f, 1.5f, 1.5f)
            );
        Path = new DynamicBezierPath(transform, dynamicBezier);
    }
Example #22
0
    void DrawOrPreviewOnNode(Int2 _nodeGridPos, bool _isDeleting, bool _isPermanent)
    {
        ToolSettings _tool = GetCurrentToolSettings();
        Node         _node = GameGrid.GetInstance().TryGetNode(_nodeGridPos);

        if (!_tool.CanUseOnNode(_node))
        {
            return;
        }

        affectedNodeGridPositions.Add(_nodeGridPos);
        GetCurrentToolSettings().UseOnNode(_node, _isDeleting, _isPermanent);
    }
Example #23
0
        internal static void MakeRouters(IApplicationBuilder app, KraftGlobalConfigurationSettings kraftGlobalConfigurationSettings)
        {
            RouteHandler routesHandler;
            ToolSettings tool = GetTool(kraftGlobalConfigurationSettings, "recorder"); //////////////////////////////Recorder/////////////////////////////

            if (tool != null && tool.Enabled)                                          //Recorder enabled from configuration
            {
                kraftGlobalConfigurationSettings.GeneralSettings.ToolsSettings.RequestRecorder.IsEnabled = tool.Enabled;
                routesHandler = new RouteHandler(RecorderDelegate.ExecutionDelegate(app, kraftGlobalConfigurationSettings));

                RouteBuilder routesBuilder = new RouteBuilder(app, routesHandler);

                //we expect the routing to be like this:
                //domain.com/recorder/0|1|2?lang=de
                routesBuilder.MapRoute(
                    name: "recorder",
                    template: tool.Url,
                    defaults: null,
                    constraints: null,
                    dataTokens: new { key = "recorder" }
                    );
                app.UseRouter(routesBuilder.Build());
            }
            tool = GetTool(kraftGlobalConfigurationSettings, "signals"); //////////////////////////////Signals/////////////////////////////
            if (tool != null && tool.Enabled)                            //Signals enabled from configuration
            {
                routesHandler = new RouteHandler(SignalDelegate.ExecutionDelegate(app, kraftGlobalConfigurationSettings));

                RouteBuilder routesBuilder = new RouteBuilder(app, routesHandler);

                //we expect the routing to be like this:
                //domain.com/signals/0|1|2?lang=de
                routesBuilder.MapRoute(
                    name: "signals",
                    template: tool.Url,
                    defaults: null,
                    constraints: null,
                    dataTokens: new { key = "signals" }
                    );
                app.UseRouter(routesBuilder.Build());
            }
            //tool = GetTool(kraftGlobalConfigurationSettings, "errors");//////////////////////////////Errors/////////////////////////////
            //if (tool != null && tool.Enabled)//Errors enabled from configuration
            //{
            //}
            tool = GetTool(kraftGlobalConfigurationSettings, "profiler"); //////////////////////////////Profiler/////////////////////////////
            if (tool != null && tool.Enabled)                             //Profiler enabled from configuration
            {
                app.UseBindKraftProfiler();
            }
        }
Example #24
0
        protected override IEnumerable <FilePath> GetAlternativeToolPaths(ToolSettings settings)
        {
            if (IsOSX)
            {
                string home = _context.Environment.GetEnvironmentVariable("HOME");
                return(new[] {
                    new FilePath("fastlane"),
                    new FilePath($"{home}/.fastlane/bin/fastlane"),
                    new FilePath("/usr/local/bin/fastlane")
                });
            }

            throw new CakeException($"Environment {_context.Environment.Platform} not supported, only OSX is supported");
        }
        public static IEnumerable <IBalanceReader> GetBalanceReaders(
            IAssetsService assetsService,
            ToolSettings toolSettings)
        {
            if (toolSettings.Bitcoin != null)
            {
                yield return(BitcoinBalanceReader.Create(toolSettings));
            }

            if (toolSettings.Ethereum != null)
            {
                yield return(EthereumBalanceReader.Create(toolSettings, assetsService));
            }
        }
    public void Reset()
    {
        EditorOnlyToolSettings = new ToolSettings();

        var dynamicBezier = new DynamicBezier(
            new Vector3(0.5f, 0f, 0f),
            new Vector3(0f, 0.5f, 0.5f),
            new Vector3(0.5f, 1.0f, 0.5f),
            new Vector3(1.5f, 1f, 1f),
            new Vector3(1f, 1.5f, 1.5f)
            );

        Path = new DynamicBezierPath(transform, dynamicBezier);
    }
Example #27
0
    public static void ApplyToolSettings(ToolSettings target, ToolSettings source)
    {
        if (source == null)
        {
            return;
        }
        if (source.EnvironmentVariables != null)
        {
            target.EnvironmentVariables = new Dictionary <string, string>(source.EnvironmentVariables);
        }

        target.ToolPath         = source.ToolPath;
        target.WorkingDirectory = source.WorkingDirectory;
        target.ToolTimeout      = source.ToolTimeout;
    }
Example #28
0
    public static HttpRequestMessage Message(ToolSettings settings)
    {
        var message = new HttpRequestMessage(HttpMethod(settings.Method), settings.URL)
        {
            Content = new StringContent(settings.Body)
        };

        foreach (var header in settings.Headers)
        {
            var split = header.Split(':');
            var name  = split[0].Trim();
            var value = split[1].Trim();
            message.Headers.Add(name, value);
        }
        return(message);
    }
        /// <summary>
        /// Do some setup on load
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void PortalSiteSettingsControl_Load(object sender, EventArgs e)
        {
            // Loads or creates the settings for the plugin
            if (!SettingsManager.Instance.TryLoad(GetType(), out _toolSettings))
            {
                _toolSettings = new ToolSettings();
            }
            if (!_toolSettings.LatestMessageDisplayed)
            {
                ShowInfoNotification("Site settings are being updated regularly, especially around the various Authentication settings. Check out the Learn More link for more detail on the latest updates.  If you see missing settings or inconsistencies, please submit an issue via Github!", new Uri("https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/configure-site-settings"));
                _toolSettings.LatestMessageDisplayed = true;
            }

            ClearUI();
            ToggleEnabledState();
        }
Example #30
0
        private async Task <Tool> ExtractAsync(ToolSettings toolSettings)
        {
            var tool = ToolUtility.GetLatestToolOrNull(_settings, toolSettings);

            if (tool == null)
            {
                throw new TorSharpException(
                          $"No version of {toolSettings.Name} was found under {_settings.ZippedToolsDirectory}.");
            }

            await ExtractToolAsync(tool, _settings.ReloadTools).ConfigureAwait(false);

            PermissionsUtility.MakeExecutable(_settings, tool.ExecutablePath);

            return(tool);
        }
Example #31
0
        /// <summary>
        /// Read the <see cref="TorSharpSettings.ZippedToolsDirectory"/> and find the latest tool matching the criteria
        /// in the provided <paramref name="toolSettings"/>. If none is found return null.
        /// </summary>
        /// /// <param name="settings">The settings for TorSharp.</param>
        /// <param name="toolSettings">The settings for the tool.</param>
        /// <returns>The tool, or null if none was found.</returns>
        public static Tool GetLatestToolOrNull(
            TorSharpSettings settings,
            ToolSettings toolSettings)
        {
            if (!Directory.Exists(settings.ZippedToolsDirectory))
            {
                return(null);
            }

            var fileExtension = ArchiveUtility.GetFileExtension(toolSettings.ZippedToolFormat);
            var pattern       = $"{toolSettings.Prefix}*{fileExtension}";

            string[] zipPaths = Directory
                                .EnumerateFiles(settings.ZippedToolsDirectory, pattern, SearchOption.TopDirectoryOnly)
                                .ToArray();

            var versions = new List <Tool>();

            foreach (string zipPath in zipPaths)
            {
                string fileName         = Path.GetFileName(zipPath);
                string withoutExtension = fileName.Substring(0, fileName.Length - fileExtension.Length);
                string directoryPath    = Path.Combine(settings.ExtractedToolsDirectory, withoutExtension);
                string version          = withoutExtension.Substring(toolSettings.Prefix.Length);
                if (!Version.TryParse(version, out var parsedVersion))
                {
                    continue;
                }

                versions.Add(new Tool
                {
                    Settings          = toolSettings,
                    ZipPath           = zipPath,
                    DirectoryPath     = directoryPath,
                    Version           = parsedVersion,
                    ExecutablePath    = Path.Combine(directoryPath, toolSettings.ExecutablePath),
                    WorkingDirectory  = Path.Combine(directoryPath, toolSettings.WorkingDirectory),
                    ConfigurationPath = Path.Combine(directoryPath, toolSettings.ConfigurationPath),
                });
            }

            return(versions
                   .OrderByDescending(t => t.Version)
                   .FirstOrDefault());
        }
Example #32
0
    //cycles through the various settings
    protected virtual void Start()
    {
        if (SettingsPages != null && ActiveIndex < SettingsPages.Length)
        {
            ActiveToolset = SettingsPages[ActiveIndex];
        }

        SettingsPages = GetComponentsInChildren <ToolSettings>();
        if (SettingsPages.Length > 0)
        {
            ActiveToolset = SettingsPages[0];
        }

        for (int i = 0; i < SettingsPages.Length; i++)
        {
            SettingsPages[i].gameObject.SetActive(ActiveIndex == i);
        }
    }
    private bool Safety()
    {
        bool safe = true;

        //~ Fixes first run issues
        if (settings == null)
        {
            targetScript.Reset();
        }
        settings = targetScript.EditorOnlyToolSettings;

        //~ Fixes deleted transform issues
        if (targetPath.LocalSpaceTransform == null)
        {
            targetPath.LocalSpaceTransform = null;
            safe = false;
        }

        return(safe);
    }
        public static IBalanceReader Create(ToolSettings toolSettings)
        {
            if (toolSettings.Bitcoin?.Network == null)
            {
                throw new ArgumentNullException(nameof(toolSettings.Bitcoin.Network));
            }

            if (toolSettings.Bitcoin?.NinjaUrl == null)
            {
                throw new ArgumentNullException(nameof(toolSettings.Bitcoin.NinjaUrl));
            }

            var client = new QBitNinjaClient(new Uri(toolSettings.Bitcoin.NinjaUrl),
                                             Network.GetNetwork(toolSettings.Bitcoin.Network))
            {
                Colored = true
            };

            return(new BitcoinBalanceReader(client));
        }
    private bool Safety()
    {
        bool safe = true;

        //~ Fixes first run issues
        if (settings == null)
        {
            targetScript.Reset();
        }
        qdrBezierPath = targetScript.Path;
        settings = targetScript.EditorOnlyToolSettings;

        //~ Fixes deleted transform issues
        if (qdrBezierPath.LocalSpaceTransform == null)
        {
            qdrBezierPath.LocalSpaceTransform = null;
            safe = false;
        }

        return safe;
    }
    private void OnEnable()
    {
        targetScript = (QuadraticBezierPathComponent)target;
        qdrBezierPath = targetScript.Path;
        settings = targetScript.EditorOnlyToolSettings;

        if (!Safety())
        {
            SceneView.currentDrawingSceneView.ShowNotification(new GUIContent(PathEditorUtility.EditorUnavailable));
            return;
        }
    }
 public void Reset()
 {
     EditorOnlyToolSettings = new ToolSettings();
     Path = new LinePath(this.transform, Vector3.one * -1f, Vector3.one);
 }
    public bool Safety()
    {
        bool safe = true;

        //~ Fixes first run issues
        if (settings == null)
        {
            targetScript.Reset();
            safe = false;
        }
        circlePath = targetScript.Path;
        settings = targetScript.EditorOnlyToolSettings;

        //~ Fixes deleted transform issues
        if (circlePath.LocalSpaceTransform == null)
        {
            circlePath.LocalSpaceTransform = null;
            safe = false;
        }

        return safe;
    }
Example #39
0
        public override void Run()
        {
            try
              {
            //string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetAssembly(GetType()).Location);
            //System.Reflection.Assembly.LoadFrom(System.IO.Path.Combine(path, "AvalonDock.Themes.dll"));
            bw = new BackgroundWorker();
            bw.DoWork += delegate
            {
              try
              {
            // TODO: if i replace code below as compiler says (Warning CS0618: 'ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWindow' is obsolete: 'Use SD.Workbench.MainWindow instead')
            while (ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWindow == null)
            {
              Thread.Sleep(100);
            }
            ICSharpCode.SharpDevelop.SD.Workbench.MainWindow.Dispatcher.Invoke
              (DispatcherPriority.Normal, new ThreadStart
               (
                 delegate
                 {
                   var settings = new ToolSettings();
                   var m = settings.LoadSettings();
                   if (m==null) return;
                   var t = m.Theme[0];
                   settings.SetTheme(t.ToTheme());

                 }
                )
              );
              }
              catch (Exception ex)
              {
            MessageBox.Show(ex.ToString(), "ThemeTool Startup Error");
              }
            };
            bw.RunWorkerAsync();
              }
              catch (Exception ex)
              {
            MessageBox.Show(ex.ToString(), "ThemeTool Startup Error");
              }
        }