コード例 #1
0
 public void setupByForm(IWin32Window aOwner)
 {
     using (var lSetupForm = new SetupForm(this))
     {
         lSetupForm.ShowDialog(aOwner);
     }
 }
コード例 #2
0
        public static void Main(string[] args)
        {
            AzusaContext context = AzusaContext.GetInstance();

            if (args.Length != 0)
            {
                switch (args[0])
                {
                case "--launcher":
                    context.TabletMode = true;
                    break;

                case "--setup":
                    break;

                case "--makelicense":
                    CreateLicenseFile();
                    return;

                default:
                    return;
                }
            }

            Program program = new Program();

            try
            {
                program.Run(args);
            }
            catch (StartupFailedException e)
            {
                context.Splash.InvokeClose();
                DialogResult dialogResult = MessageBox.Show(
                    "Die Azusa-Applikation konnte nicht gestartet werden. Soll das Setup-Werkzeug ausgeführt werden?",
                    "", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                if (dialogResult == DialogResult.Yes)
                {
                    SetupForm setupForm = new SetupForm(e);
                    dialogResult = setupForm.ShowDialog();
                }
            }

            context.DestroyContext();
        }
コード例 #3
0
        public override bool SetupCodeModule(Control parentWindow, IValueAccessor stepConfiguration)
        {
            //Setup the code module
            using (SetupForm s = new SetupForm())
            {
                //First read the existing values
                s.tempPath    = stepConfiguration.ReadString("TempPath");
                s.Compression = stepConfiguration.ReadDouble("Compression");
                if (s.ShowDialog() == DialogResult.OK)
                {
                    stepConfiguration.WriteString("TempPath", s.tempPath);
                    stepConfiguration.WriteDouble("Compression", s.Compression);
                    return(true);
                }
            }

            // No changes were made.
            return(false);
        }
コード例 #4
0
        /// <summary>
        /// Shows the plugin configuration.
        /// </summary>
        public void ShowPlugin()
        {
            try
            {
                _inConfiguration = true;

                Log.Debug("MPBlastZonePlugin: ShowPlugin()");

                SetupForm setupForm = new SetupForm();
                if (setupForm.ShowDialog() == DialogResult.OK)
                {
                    SaveSettings();
                }

                StopClient();

                Log.Debug("MPBlastZonePlugin: ShowPlugin() - End");
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
        }
コード例 #5
0
ファイル: E131OutputPlugin.cs プロジェクト: naztrain/vixen
        // -------------------------------------------------------------
        //
        // 	Setup() - called when the user has requested to setup
        // 			  the plugin instance
        //
        // -------------------------------------------------------------
        public override bool Setup()
        {
            isSetupOpen = true;

            using (var setupForm = new SetupForm())
            {
                // Tell the setupForm our output count
                setupForm.PluginChannelCount = this.OutputCount;

                List<int> initialUniverseList = new List<int>();

                setupForm.WarningsOption = _data.Warnings;
                setupForm.StatisticsOption = _data.Statistics;
                setupForm.EventRepeatCount = _data.EventRepeatCount;
                setupForm.EventSuppressCount = _data.EventSuppressCount;
                setupForm.AutoPopulateStart = _data.AutoPopulate;
                setupForm.Blind = _data.Blind;
                setupForm.Priority = _data.Priority;
                setupForm.SetDestination(_data.Multicast, _data.Unicast);

                // for each universe add it to setup form
                foreach (var uE in _data.Universes)
                {
                    setupForm.UniverseAdd(
                        uE.Active, uE.Universe, uE.Start + 1, uE.Size);
                    initialUniverseList.Add(uE.Universe);
                }

                setupForm.Text = (new E131ModuleDescriptor()).TypeName + " Configuration - " + VixenSystem.OutputControllers.Single(controller => controller.ModuleInstanceId == _data.ModuleInstanceId).Name;

                if (setupForm.ShowDialog() == DialogResult.OK)
                {

                    _data.Warnings = setupForm.WarningsOption;
                    _data.Statistics = setupForm.StatisticsOption;
                    _data.EventRepeatCount = setupForm.EventRepeatCount;
                    _data.EventSuppressCount = setupForm.EventSuppressCount;
                    _data.AutoPopulate = setupForm.AutoPopulateStart;
                    _data.Blind = setupForm.Blind;
                    _data.Priority = setupForm.Priority;
                    _data.Universes.Clear();

                    var destination = new Tuple<string, string>(null, null);

                    destination = setupForm.GetDestination();

                    _data.Unicast = destination.Item1;
                    _data.Multicast = destination.Item2;

                    OutputController thisController = VixenSystem.OutputControllers.Single(controller => controller.ModuleInstanceId == _data.ModuleInstanceId);

                    for (int x = 0; x < thisController.Outputs.Length; x++)
                        thisController.Outputs[x].Name = "Output #" + (x + 1).ToString();

                    // add each of the universes as a child
                    for (int i = 0; i < setupForm.UniverseCount; i++)
                    {
                        bool active = true;
                        int universe = 0;
                        int start = 0;
                        int size = 0;

                        if (setupForm.UniverseGet(
                            i, ref active, ref universe, ref start, ref size))
                        {
                            _data.Universes.Add(new UniverseEntry(i, active, universe, start - 1, size,destination.Item1, destination.Item2));

                            for (int x = start - 1; x < start + size - 1; x++)
                               if(x < thisController.Outputs.Length)
                                   if (_data.Unicast == string.Empty || _data.Unicast == null)
                                        thisController.Outputs[x].Name = "#" + (x + 1).ToString() + " " + universe.ToString() + "-" + (x  - start+2).ToString() + ": Multicast";
                                    else
                                        thisController.Outputs[x].Name = "#" + (x + 1).ToString() + " " + universe.ToString() + "-" + (x -start+2).ToString() + ": " + _data.Unicast.ToString();

                        }
                    }

                    running = false; //prevent updates

                    // update in memory table to match xml
                    this.Stop();
                    this.Start();
                }
            }

            isSetupOpen = false;

            return true;
        }
コード例 #6
0
        /// <summary>
        ///   This initializes the game mode.
        /// </summary>
        /// <remarks>
        ///   This gets the user to specify the directories where the programme will store info
        ///   such as install logs, if the directories have not already been setup.
        ///   This method also checks for DLCs, and cleans up any missing FOMods.
        /// </remarks>
        /// <returns>
        ///   <lang langref="true" /> if the game mode was able to initialize;
        ///   <lang langref="false" /> otherwise.
        /// </returns>
        public override bool Init()
        {
            if (!Properties.Settings.Default.falloutNewVegasDoneSetup)
              {
            var sfmSetup = new SetupForm();
            if (sfmSetup.ShowDialog() == DialogResult.Cancel)
            {
              return false;
            }
            Properties.Settings.Default.falloutNewVegasDoneSetup = true;
            Properties.Settings.Default.Save();
              }

              ((SettingsFilesSet) SettingsFiles).FODefaultIniPath = Path.Combine(PluginsPath, @"..\fallout_default.ini");
              if (File.Exists("FNVEdit.exe"))
              {
            Tools.Add(new Command<MainForm>("FNVEdit", "Launches FNVEdit, if it is installed.", LaunchFNVEdit));
              }
              Tools.Add(new CheckedCommand<MainForm>("Archive Invalidation", "Toggles Archive Invalidation.",
                                             ArchiveInvalidation.IsActive(), ToggleArchiveInvalidation));

              if (!File.Exists(((SettingsFilesSet) SettingsFiles).FOIniPath))
              {
            MessageBox.Show(
              "You have no Fallout INI file. Please run Fallout: New Vegas to initialize the file before installing any mods or turning on Archive Invalidation.",
              "Missing INI", MessageBoxButtons.OK, MessageBoxIcon.Information);
              }

              ScanForReadonlyPlugins();
              ScanForReadonlyFiles();

              return true;
        }
コード例 #7
0
        // -------------------------------------------------------------
        //
        // 	Setup() - called when the user has requested to setup
        // 			  the plugin instance
        //
        // -------------------------------------------------------------
        public override bool Setup()
        {
            // define/create objects
            XmlElement newChild;
            using (var setupForm = new SetupForm())
            {
                this.LoadSetupNodeInfo();

                // if our channels from/to are setup then tell the setupForm
                if (this._pluginChannelsFrom != 0 && this._pluginChannelsTo != 0)
                {
                    setupForm.PluginChannelCount = this._pluginChannelsTo - this._pluginChannelsFrom + 1;
                }

                // for each universe add it to setup form
                foreach (var uE in this._universeTable)
                {
                    setupForm.UniverseAdd(
                        uE.Active, uE.Universe, uE.Start + 1, uE.Size, uE.Unicast, uE.Multicast, uE.Ttl);
                }

                setupForm.WarningsOption = this._warningsOption;
                setupForm.StatisticsOption = this._statisticsOption;
                setupForm.EventRepeatCount = this._eventRepeatCount;

                if (setupForm.ShowDialog() == DialogResult.OK)
                {
                    // first get rid of our old children
            //                    while (_setupNode.ChildNodes.Count > 0)
            //                    {
            //                        _setupNode.RemoveChild(_setupNode.ChildNodes[0]);
            //                    }
            //
                    // add the Guid child
            //                    newChild = _setupNode.OwnerDocument.CreateElement("Guid");
            //                    newChild.SetAttribute("id", this._guid.ToString());
            //                    _setupNode.AppendChild(newChild);
            //
                    // add the Options child
            //                    newChild = _setupNode.OwnerDocument.CreateElement("Options");
            //                    newChild.SetAttribute("warnings", setupForm.WarningsOption.ToString());
            //                    newChild.SetAttribute("statistics", setupForm.StatisticsOption.ToString());
            //                    newChild.SetAttribute("eventRepeatCount", setupForm.EventRepeatCount.ToString());
            //                    _setupNode.AppendChild(newChild);
            //
                    // add each of the universes as a child
            //                    for (int i = 0; i < setupForm.UniverseCount; i++)
            //                    {
            //                        bool active = true;
            //                        int universe = 0;
            //                        int start = 0;
            //                        int size = 0;
            //                        string unicast = string.Empty;
            //                        string multicast = string.Empty;
            //                        int ttl = 0;
            //
            //                        if (setupForm.UniverseGet(
            //                            i, ref active, ref universe, ref start, ref size, ref unicast, ref multicast, ref ttl))
            //                        {
            //                            newChild = _setupNode.OwnerDocument.CreateElement("Universe");
            //
            //                            newChild.SetAttribute("active", active.ToString());
            //                            newChild.SetAttribute("number", universe.ToString());
            //                            newChild.SetAttribute("start", start.ToString());
            //                            newChild.SetAttribute("size", size.ToString());
            //                            if (unicast != null)
            //                            {
            //                                newChild.SetAttribute("unicast", unicast);
            //                            }
            //                            else if (multicast != null)
            //                            {
            //                                newChild.SetAttribute("multicast", multicast);
            //                            }
            //
            //                            newChild.SetAttribute("ttl", ttl.ToString());
            //
            //                            _setupNode.AppendChild(newChild);
            //                        }
            //                    }

                    // update in memory table to match xml
                    this.LoadSetupNodeInfo();
                }
            }

            return true;
        }
コード例 #8
0
ファイル: E131OutputPlugin.cs プロジェクト: Jchuchla/vixen
        // -------------------------------------------------------------
        //
        // 	Setup() - called when the user has requested to setup
        // 			  the plugin instance
        //
        // -------------------------------------------------------------
        public override bool Setup()
        {
            //initialize setupNode

            //Initialize();
            isSetupOpen = true;

            // define/create objects

            using (var setupForm = new SetupForm())
            {
                // Tell the setupForm our output count
                setupForm.PluginChannelCount = this.OutputCount;

                List<int> initialUniverseList = new List<int>();
                // for each universe add it to setup form
                foreach (var uE in _data.Universes)
                {
                    setupForm.UniverseAdd(
                        uE.Active, uE.Universe, uE.Start + 1, uE.Size, uE.Unicast, uE.Multicast, uE.Ttl);

                    if (!E131OutputPlugin.EmployedUniverses.Contains(uE.Universe))
                        E131OutputPlugin.EmployedUniverses.Add(uE.Universe);

                    initialUniverseList.Add(uE.Universe);
                }

                setupForm.WarningsOption = _data.Warnings;
                setupForm.StatisticsOption = _data.Statistics;
                setupForm.EventRepeatCount = _data.EventRepeatCount;

                if (setupForm.ShowDialog() == DialogResult.OK)
                {

                    _data.Warnings = setupForm.WarningsOption;
                    _data.Statistics = setupForm.StatisticsOption;
                    _data.EventRepeatCount = setupForm.EventRepeatCount;
                    _data.Universes.Clear();

                    initialUniverseList.ForEach(u => E131OutputPlugin.EmployedUniverses.RemoveAll(t => u == t));

                    // add each of the universes as a child
                    for (int i = 0; i < setupForm.UniverseCount; i++)
                    {
                        bool active = true;
                        int universe = 0;
                        int start = 0;
                        int size = 0;
                        string unicast = string.Empty;
                        string multicast = string.Empty;
                        int ttl = 0;

                        if (setupForm.UniverseGet(
                            i, ref active, ref universe, ref start, ref size, ref unicast, ref multicast, ref ttl))
                        {
                            _data.Universes.Add(new UniverseEntry(i, active, universe, start - 1, size, unicast, multicast, ttl));
                            //Only add the universe if it doesnt already exist
                            if (!E131OutputPlugin.EmployedUniverses.Contains(universe))
                                E131OutputPlugin.EmployedUniverses.Add(universe);
                        }
                    }

                    hasStarted = false; //prevent updates

                    // update in memory table to match xml
                    this.Shutdown();
                    this.Start();
                }
            }

            isSetupOpen = false;

            return true;
        }
コード例 #9
0
        // -------------------------------------------------------------
        //
        // 	Setup() - called when the user has requested to setup
        // 			  the plugin instance
        //
        // -------------------------------------------------------------
        public override bool Setup()
        {
            //initialize setupNode

            //Initialize();
            isSetupOpen = true;

            // define/create objects
            XmlElement newChild;
            using (var setupForm = new SetupForm())
            {
                this.LoadSetupNodeInfo();

                // Tell the setupForm our output count
                setupForm.PluginChannelCount = this.OutputCount;

                // for each universe add it to setup form
                foreach (var uE in this._universeTable)
                {
                    setupForm.UniverseAdd(
                        uE.Active, uE.Universe, uE.Start + 1, uE.Size, uE.Unicast, uE.Multicast, uE.Ttl);
                }

                setupForm.WarningsOption = this._warningsOption;
                setupForm.StatisticsOption = this._statisticsOption;
                setupForm.EventRepeatCount = this._eventRepeatCount;

                if (setupForm.ShowDialog() == DialogResult.OK)
                {
                    // first get rid of our old children
                    while (_setupNode.ChildNodes.Count > 0)
                    {
                        _setupNode.RemoveChild(_setupNode.ChildNodes[0]);
                    }

                    // add the Guid child
                    newChild = _setupNode.OwnerDocument.CreateElement("Guid");
                    newChild.SetAttribute("id", this._guid.ToString());
                    _setupNode.AppendChild(newChild);

                    // add the Options child
                    newChild = _setupNode.OwnerDocument.CreateElement("Options");
                    newChild.SetAttribute("warnings", setupForm.WarningsOption.ToString());
                    newChild.SetAttribute("statistics", setupForm.StatisticsOption.ToString());
                    newChild.SetAttribute("eventRepeatCount", setupForm.EventRepeatCount.ToString());
                    _setupNode.AppendChild(newChild);

                    // add each of the universes as a child
                    for (int i = 0; i < setupForm.UniverseCount; i++)
                    {
                        bool active = true;
                        int universe = 0;
                        int start = 0;
                        int size = 0;
                        string unicast = string.Empty;
                        string multicast = string.Empty;
                        int ttl = 0;

                        if (setupForm.UniverseGet(
                            i, ref active, ref universe, ref start, ref size, ref unicast, ref multicast, ref ttl))
                        {
                            newChild = _setupNode.OwnerDocument.CreateElement("Universe");

                            newChild.SetAttribute("active", active.ToString());
                            newChild.SetAttribute("number", universe.ToString());
                            newChild.SetAttribute("start", start.ToString());
                            newChild.SetAttribute("size", size.ToString());
                            if (unicast != null)
                            {
                                newChild.SetAttribute("unicast", unicast);
                            }
                            else if (multicast != null)
                            {
                                newChild.SetAttribute("multicast", multicast);
                            }

                            newChild.SetAttribute("ttl", ttl.ToString());

                            _setupNode.AppendChild(newChild);
                        }

                    }

                    doc.Save("Modules\\Controller\\E131settings.xml");

                    hasStarted = false; //prevent updates

                    // update in memory table to match xml
                    this.Shutdown();
                    this.Start();

                }
            }

            isSetupOpen = false;

            return true;
        }
コード例 #10
0
        public DialogResult setupByForm(IWin32Window aOwner)
        {
            DialogResult lResult;

                using (var lSetupForm = new SetupForm(this, mItemBrowser))
                {
                    lResult = lSetupForm.ShowDialog(aOwner);
                    raisePropertiesChanged();
                }

                return lResult;
        }