Beispiel #1
0
            private void    PrepareSetNote(object data)
            {
                Action <object, string> SetNote = delegate(object data2, string content)
                {
                    if (data2 is LogNote)
                    {
                        ((LogNote)data2).note = content;
                    }
                    // Add a new note.
                    else if (data2 is Row)
                    {
                        LogNote note = new LogNote()
                        {
                            row  = (Row)data2,
                            note = content
                        };
                        this.notes.Add(note);
                    }

                    this.console.SaveModules();
                };

                for (int i = 0; i < this.notes.Count; i++)
                {
                    if (this.notes[i].row == data)
                    {
                        PromptWindow.Start(this.notes[i].note, SetNote, this.notes[i]);
                        return;
                    }
                }

                PromptWindow.Start(string.Empty, SetNote, data);
            }
Beispiel #2
0
    /// <summary>
    /// 実行
    /// </summary>
    /// <param name="message">メッセージ</param>
    protected override void InvokeAction(InteractionMessage message)
    {
        if (message is not PromptMessage prompt)
        {
            return;
        }

        var viewModel = new PromptViewModel
        {
            Title        = prompt.Title,
            Description  = prompt.Description,
            Text         = prompt.Text,
            IsAllowEmpty = prompt.IsAllowEmpty,
            Validation   = prompt.Validation,
        };

        prompt.Response = null;

        var window = new PromptWindow
        {
            DataContext = viewModel,
            Owner       = Window.GetWindow(this.AssociatedObject),
        };

        if (window.ShowDialog() ?? false)
        {
            prompt.Response = viewModel.Text;
        }
    }
Beispiel #3
0
    static void Create(string tipText)
    {
        PromptWindow window = (PromptWindow)EditorWindow.GetWindow(typeof(PromptWindow));

        window.tipText = tipText;
        window.Show();
    }
Beispiel #4
0
        private static void     SetAsCategory(object data)
        {
            StackTraceSettings stackTrace = HQ.Settings.Get <StackTraceSettings>();
            string             frame      = data as string;

            // Fetch "namespace.class[:.]method(".
            int n = frame.IndexOf("(");

            if (n == -1)
            {
                return;
            }

            string method      = frame.Substring(0, n);
            string placeholder = "Category Name";

            for (int i = 0; i < stackTrace.categories.Count; i++)
            {
                if (stackTrace.categories[i].method == method)
                {
                    placeholder = stackTrace.categories[i].category;
                    break;
                }
            }

            PromptWindow.Start(placeholder, RowUtility.SetCategory, method);
        }
Beispiel #5
0
        private void button_StartRemoteDesktop_Click(object sender, RoutedEventArgs e)
        {
            List <Computer> computersToRemoteDesktop = computers.FindAll(c => c.isAlive);

            PromptWindow promptWindow = new PromptWindow();

            promptWindow.Left = mainWindow.Left + 250;
            promptWindow.Top  = mainWindow.Top + 250;
            promptWindow.ShowDialog();

            if (promptWindow.getChoice() == PromptWindowChoice.CANCEL)
            {
                return;
            }

            if (promptWindow.getChoice() == PromptWindowChoice.CONNECT &&
                promptWindow.getLogin().Length > 0 && promptWindow.getPassword().Length > 0)
            {
                foreach (Computer c in computersToRemoteDesktop)
                {
                    c.startRemoteDesktop(promptWindow.getLogin(), promptWindow.getPassword());
                }
            }
            else
            {
                foreach (Computer c in computersToRemoteDesktop)
                {
                    c.startRemoteDesktop();
                }
            }
        }
        private void MainWindow_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (
                CallStatus.PeerCancelled == CallController.Instance.CurrentCallStatus &&
                (CallStatus.P2pIncoming == CallController.Instance.PreviousCallStatus || CallStatus.ConfIncoming == CallController.Instance.PreviousCallStatus)
                )
            {
                CallController.Instance.CurrentCallStatus = CallStatus.Idle;
                PromptWindow promptWindow = new PromptWindow(this);
                promptWindow.ShowPromptByTime(LanguageUtil.Instance.GetValueByKey("CALL_ENDED_BY_OTHER_USER"), 3000);
            }

            if (
                CallStatus.TimeoutSelfCancelled == CallController.Instance.CurrentCallStatus &&
                (CallStatus.P2pIncoming == CallController.Instance.PreviousCallStatus ||
                 CallStatus.P2pOutgoing == CallController.Instance.PreviousCallStatus ||
                 CallStatus.ConfIncoming == CallController.Instance.PreviousCallStatus)
                )
            {
                CallController.Instance.CurrentCallStatus = CallStatus.Idle;
                PromptWindow promptWindow = new PromptWindow(this);
                promptWindow.ShowPromptByTime(LanguageUtil.Instance.GetValueByKey("CALL_TIMEOUT"), 3000);
            }

            if (CallStatus.PeerDeclined == CallController.Instance.CurrentCallStatus && CallStatus.P2pOutgoing == CallController.Instance.PreviousCallStatus)
            {
                CallController.Instance.CurrentCallStatus = CallStatus.Idle;
                PromptWindow promptWindow = new PromptWindow(this);
                promptWindow.ShowPromptByTime(LanguageUtil.Instance.GetValueByKey("CALL_DECLINED"), 3000);
            }
        }
Beispiel #7
0
        private static void RequestFirstProfileNameFromUser(IProfileManager profileManager)
        {
            IProfileNameValidator validator = DependencyInjection.Container.Instance.Resolve <IProfileNameValidator>();
            Func <string, Tuple <bool, string> > ValidateProfileName = (name) =>
            {
                if (validator.Validate(name))
                {
                    return(Tuple.Create(true, (string)null));
                }
                else
                {
                    return(Tuple.Create(false, "Invalid profile name"));
                }
            };
            PromptWindow prompt = new PromptWindow("Profile name", "Please provide the name of your first profile", ValidateProfileName);

            // Keep the user here until they fill it out
            while (prompt.DialogResult != true)
            {
                prompt.ShowDialog();
            }

            profileManager.Create(prompt.Input);
            profileManager.OpenProfile(prompt.Input, emitMessage: false);
        }
        // valueConverter: should return a value not passed by validPredicate on failure, or alternatively throw an exception
        public static PromptResult <T> ShowPrompt <T>(Window owner, string title, string initialInput, Func <string, T> valueConverter, Func <T, bool> validPredicate = null)
        {
            T    inputResult;
            bool potentialSuccess = false;

            do
            {
                var prompt = new PromptWindow(title);
                prompt.Owner      = owner;
                prompt.PromptText = initialInput;

                if (prompt.ShowDialog() != true)
                {
                    return(ResultFailed <T>());
                }

                try
                {
                    inputResult      = valueConverter(prompt.PromptText);
                    potentialSuccess = true;
                }
                catch (Exception)
                {
                    inputResult      = default(T);
                    potentialSuccess = false;
                }
            } while (!potentialSuccess || (validPredicate != null && !validPredicate(inputResult)));

            return(ResultFromValue(inputResult));
        }
Beispiel #9
0
        private void SubscriptionsPopupNewCategory(object sender, RoutedEventArgs e)
        {
            var treeComponent = (e.OriginalSource as MenuItem)?.DataContext as TreeComponent;

            if (treeComponent == null)
            {
                return;
            }

            var promptDialog = new PromptWindow("Create new category", "Category name");

            if (promptDialog.ShowDialog() == true)
            {
                var category = new Category()
                {
                    Title            = promptDialog.Result,
                    ParentCategoryId = (treeComponent.Item as Category)?.CategoryId
                };
                var newCategoryData = new NewCategoryData()
                {
                    Category            = category,
                    ParentTreeComponent = treeComponent
                };

                CreateCategory?.Invoke(newCategoryData);
            }
        }
        private void ConfirmPurchaseOrderCollectionExecute(object parameter)
        {
            string       message       = "是否确认订单";
            string       detailMessage = "请检查进货订单中的每一个条目是否正确,确认订单后将无法修改";
            PromptWindow prompt        = new PromptWindow(message, detailMessage);
            bool?        IsConfirmed   = prompt.ShowDialog();

            if (IsConfirmed == true)
            {
                DateTime CurrentTime = DateTime.Now;
                PurchaseOrderCollectionViewModel.PurchaseOrderCollection.PurchaseTime = CurrentTime;
                foreach (var purchaseorderviewmodel in PurchaseOrderCollectionViewModel.PurchaseOrderViewModels)
                {
                    purchaseorderviewmodel.PurchaseOrder.PurchaseTime = CurrentTime;
                    CMContext.PurchaseOrder.Add(purchaseorderviewmodel.PurchaseOrder);
                    BlockViewModel blockViewModel             = purchaseorderviewmodel.BlockViewModel;
                    IEnumerable <CargoCollectionViewModel> cc = blockViewModel.CargoCollectionViewModels.Where <CargoCollectionViewModel>(item => item.CargoCollection.PreciseCargoName == purchaseorderviewmodel.PurchaseOrder.PreciseCargoName);
                    if (cc.Count() == 0)
                    {
                        CargoCollectionViewModel c = new CargoCollectionViewModel(CMContext, purchaseorderviewmodel)
                        {
                            BlockViewModel = blockViewModel, CargoCollectionViewModels = CargoCollectionViewModels
                        };
                        CargoCollectionViewModels.Add(c);
                        blockViewModel.CargoCollectionViewModels.Add(c);
                        CMContext.CargoCollection.Add(c.CargoCollection);
                        PurchasePrizeDic p1 = new PurchasePrizeDic(purchaseorderviewmodel.PurchaseOrder)
                        {
                            UnitPurchasePrize = -1
                        };
                        PurchasePrizeDic p2 = new PurchasePrizeDic(purchaseorderviewmodel.PurchaseOrder);
                        CMContext.PurchasePrizeDic.Add(p1);
                        CMContext.PurchasePrizeDic.Add(p2);
                        c.SelectedPurchasePrizeDic = p1;
                    }
                    else
                    {
                        CargoCollectionViewModel c = cc.First();
                        c.CargoCollection.Amount += purchaseorderviewmodel.PurchaseOrder.Amount;
                        c.CargoCollection.PurchasePrizeDics[0].Amount = c.CargoCollection.Amount;
                        IEnumerable <PurchasePrizeDic> pp = c.CargoCollection.PurchasePrizeDics.Where <PurchasePrizeDic>(item => item.UnitPurchasePrize == purchaseorderviewmodel.PurchaseOrder.UnitPurchasePrize);
                        if (pp.Count() == 0)
                        {
                            PurchasePrizeDic p = new PurchasePrizeDic(purchaseorderviewmodel.PurchaseOrder);
                            CMContext.PurchasePrizeDic.Add(p);
                        }
                        else
                        {
                            pp.First().Amount += purchaseorderviewmodel.PurchaseOrder.Amount;
                        }
                    }
                }
                CMContext.PurchaseOrderCollection.Add(PurchaseOrderCollectionViewModel.PurchaseOrderCollection);
                PurchaseOrderCollectionViewModels.Add(PurchaseOrderCollectionViewModel);
                CMContext.SaveChanges();
                PurchaseOrderCollectionViewModel = null;
                OutPurchaseOrderButtonIsEnabled  = false;
            }
        }
Beispiel #11
0
        private void OnCreateFolderButtonClick(object sender, RoutedEventArgs e)
        {
            var prompt = new PromptWindow();

            prompt.SetTitle("请输入文件夹名称");
            prompt.OnOk += OnInputFolderNameOk;
            prompt.Show();
        }
        public bool?Prompt(string message)
        {
            var promptWindow = new PromptWindow {
                Owner = Window.GetWindow(View), Text = message
            };

            return(promptWindow.ShowDialog());
        }
Beispiel #13
0
        private void Wizzard()
        {
            var result = MessageBox.Show("Hi. You must give me paths to your builder and EGW project. Can I run wizzard to create start link?",
                                         MyApp.AppSettings.ApplicationNameWithVersion,
                                         MessageBoxButton.OKCancel,
                                         MessageBoxImage.Question,
                                         MessageBoxResult.OK
                                         );

            if (result != MessageBoxResult.OK)
            {
                Env.Exit(1);
            }

            string builderFolder = null;

            using (var folderDialog = new System.Windows.Forms.FolderBrowserDialog())
            {
                MyApp.ShowMessage("Step 1: Give me EGW builder folder.");
                folderDialog.ShowNewFolderButton = false;
                var folderResult = folderDialog.ShowDialog();
                if (folderResult != System.Windows.Forms.DialogResult.OK)
                {
                    Env.Exit(2);
                }
                builderFolder = folderDialog.SelectedPath;
            }
            string egwFolder = null;

            using (var folderDialog = new System.Windows.Forms.FolderBrowserDialog())
            {
                MyApp.ShowMessage("Step 2: Give me folder with EGW subApps.");
                folderDialog.ShowNewFolderButton = false;
                var folderResult = folderDialog.ShowDialog();
                if (folderResult != System.Windows.Forms.DialogResult.OK)
                {
                    Env.Exit(2);
                }
                egwFolder = folderDialog.SelectedPath;
            }

            var fileName = PromptWindow.Show("Step 3: Name of lnk file", "EGW builder", "Enter filename without extension");

            var          shell           = new WshShell();
            string       shortcutAddress = Path.Combine(egwFolder, fileName) + ".lnk";
            IWshShortcut shortcut        = (IWshShortcut)shell.CreateShortcut(shortcutAddress);

            shortcut.TargetPath       = System.Reflection.Assembly.GetExecutingAssembly().Location;
            shortcut.WorkingDirectory = MyApp.ExeDir;
            shortcut.IconLocation     = System.Reflection.Assembly.GetExecutingAssembly().Location + ",0";
            shortcut.Arguments        = $"\"{builderFolder}\" \"{egwFolder}\"";
            shortcut.Save();

            MyApp.ShowMessage("Link created. I am going to open target folder and you can use it. Bye.");
            Process.Start(egwFolder);
            Env.Exit(0);
        }
Beispiel #14
0
 private void ButtonBirefDescription_Click(object sender, RoutedEventArgs e)
 {
     if (!Global.IsOpenPrompt)
     {
         Global.IsOpenPrompt = true;
         PromptWindow window = new PromptWindow()
         {
             _HintStr = _item.HintStr
         };
         window.Show();
     }
 }
Beispiel #15
0
        /// <summary>
        /// Creates an empty roster for the user.
        /// </summary>
        private void CreateNewRoster()
        {
            PromptWindow.Close();
            FighterList newList = new FighterList
            {
                ListID   = CreateFighterID(CurrentRoster.SelectedFighters),
                ListName = NewRosterName
            };

            AvailableRosters.Add(newList);
            CreateRosterSelectList();
            CurrentRoster = newList;
        }
        private void DeletePurchaseOrderCollectionExecute(object parameter)
        {
            string       message       = "是否删除订单";
            string       detailMessage = "删除进货订单将删除订单中的每一个条目,请确定后删除";
            PromptWindow prompt        = new PromptWindow(message, detailMessage);
            bool?        IsConfirmed   = prompt.ShowDialog();

            if (IsConfirmed == true)
            {
                PurchaseOrderCollectionViewModel = null;
                OutPurchaseOrderButtonIsEnabled  = false;
            }
        }
        private void DeleteExecute(object parameter)
        {
            string       message       = "是否删除卖货订单";
            string       detailMessage = "删除的卖货订单记录将无法恢复,请确认是否是删除该订单\n删除之前备份订单的信息以便错误删除后进行恢复";
            PromptWindow prompt        = new PromptWindow(message, detailMessage);
            bool?        IsConfirmed   = prompt.ShowDialog();

            if (IsConfirmed == true)
            {
                SellOrderCollectionViewModels.Remove(this);
                CMContext.SellOrderCollection.Remove(SellOrderCollection);
                CMContext.SaveChanges();
            }
        }
    public void OnCreateRoom()
    {
        SoundManager.Instance.PlayUIButtonClick();
        PromptWindow window = UIFactory.Instance.Create(UI_ELEMENT.PROMPT_WINDOW).GetComponent <PromptWindow>();

        window.Initialize();
        window.AttachUIElement(new Vector2(0, 50), LobbySceneGUI.Instance.lobbyGUI);
        window.SetTitle("생성 할 방의 이름을 입력하시오.");

        window.AddConfirmEventFunc(() => {
            CLIENTtoSERVER_CreateRoomPacketData data = new CLIENTtoSERVER_CreateRoomPacketData();
            data.playerKey = GameFramework.Instance.MyPlayer.PlayerKey;
            data.roomName  = window.GetInputText();
            NetworkManager.Instance.SendCommand((int)PROTOCOL.CREATE_ROOM, (int)EXTRA.REQUEST, data);
        });
    }
Beispiel #19
0
        private void OnRenameContextMenuClick(object sender, RoutedEventArgs e)
        {
            var fse = mouseElement.DataContext as FileSystemEntity;

            if (fse == null)
            {
                return;
            }
            var dlg = new PromptWindow();

            dlg.SetTitle("请输入新的文件夹名称");
            dlg.OnOk += (oo, ee) =>
            {
                string strName = dlg.InputText;
                if (string.IsNullOrEmpty(strName) || strName.Equals(fse.Name, StringComparison.CurrentCultureIgnoreCase))
                {
                    return;
                }
                var source = FileBrowseListBox.ItemsSource as List <FileSystemEntity>;
                if (source != null && source.Any(o => o.Type == FileSystemEntityType.Folder &&
                                                 o.Name.Equals(strName, StringComparison.CurrentCultureIgnoreCase) &&
                                                 o.FolderId != fse.FolderId))
                {
                    CustomMessageBox.Alert("新的文件夹名称与其他文件夹名重复!");
                    return;
                }
                BusyIndicator1.IsBusy      = true;
                BusyIndicator1.BusyContent = "正在执行...";
                docContext.RenameFolder(fse.FolderId, strName, obj =>
                {
                    BusyIndicator1.IsBusy = false;
                    if (Utility.Utility.CheckInvokeOperation(obj))
                    {
                        if (obj.Value > 0)
                        {
                            fse.Name = strName;
                        }
                        else
                        {
                            CustomMessageBox.Show("重命名失败!错误码:" + obj.Value);
                        }
                    }
                }, null);
            };
            dlg.Show();
        }
        public Task <PromptButton> Show(Window ownerWindow = null)
        {
            _completionSource?.TrySetResult(null);

            Close();

            _completionSource = new TaskCompletionSource <PromptButton>();
            _promptWindow     = new PromptWindow
            {
                DataContext = this,
                Owner       = ownerWindow
            };

            _promptWindow.Show();

            return(_completionSource.Task);
        }
        public void DeletePlaneExecute(object parameter)
        {
            string       message       = "是否确定删除";
            string       detailMessage = string.Format("本操作将会删除楼层:{0},以及该楼层内全部区域和区域内的货物", Plane.PlaneName);
            PromptWindow prompt        = new PromptWindow(message, detailMessage);
            bool?        IsConfirmed   = prompt.ShowDialog();

            if (IsConfirmed == true)
            {
                WarehouseManagementUserControl          wmuc   = parameter as WarehouseManagementUserControl;
                WarehouseManagementUserControlViewModel wmucvm = wmuc.DataContext as WarehouseManagementUserControlViewModel;
                wmucvm.CargoCollectionViewModels = null;
                DeleteCargoCollections();
                CMContext.Plane.Remove(Plane);
                WarehouseViewModel.PlaneViewModels.Remove(this);
                CMContext.SaveChanges();
            }
        }
Beispiel #22
0
        private static IWorkbookSet showPromptWindow(AKProduct product, Project project, string productCutx, SpecificationGroup specificationGroup)
        {
            string globalGvfx    = Path.Combine(project.JobPath, specificationGroup.GlobalFileName);
            string cutPartsCtpx  = Path.Combine(project.JobPath, specificationGroup.CutPartsFileName);
            string edgeEdgx      = Path.Combine(project.JobPath, specificationGroup.EdgeBandFileName);
            string hardwareHwrx  = Path.Combine(project.JobPath, specificationGroup.HardwareFileName);
            string doorstyleDsvx = Path.Combine(project.JobPath, specificationGroup.DoorWizardFileName);

            PromptsViewModel viewmodel = new PromptsViewModel(productCutx, globalGvfx, cutPartsCtpx, edgeEdgx, hardwareHwrx, doorstyleDsvx,
                                                              product.Tab.Name, product.Tab.Photo, product.Tab.VarX, product.Tab.VarZ, product.Tab.VarY);

            PromptWindow prompt = new PromptWindow();

            prompt.ViewModel = viewmodel;
            prompt.ShowDialog();

            return(viewmodel.BookSet);
        }
        public void DeleteBlockExecute(object parameter)
        {
            string       message       = "是否确定删除";
            string       detailMessage = string.Format("本操作将会删除区域:{0},以及该区域内的全部货物", Block.BlockName);
            PromptWindow prompt        = new PromptWindow(message, detailMessage);
            bool?        IsConfirmed   = prompt.ShowDialog();

            if (IsConfirmed == true)
            {
                WarehouseManagementUserControl          wmuc   = parameter as WarehouseManagementUserControl;
                WarehouseManagementUserControlViewModel wmucvm = wmuc.DataContext as WarehouseManagementUserControlViewModel;
                wmucvm.CargoCollectionViewModels = null;
                AllCargoCollectionViewModels     = wmucvm.AllCargoCollectionViewModels;
                DeleteCargoCollections();
                CMContext.Block.Remove(Block);
                PlaneViewModel.BlockViewModels.Remove(this);
                CMContext.SaveChanges();
            }
        }
Beispiel #24
0
        // ## Auto Generating Electives

        /// <summary>
        /// The electivesToolStripMenuItem method is used to handle autogening course
        /// elective placeholders. It can generate a list of eaither general or major
        /// electives and add them to the courseList.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void electivesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // open a new form
            AutoGenElectives genElectWindow = new AutoGenElectives(courseList);

            genElectWindow.ShowDialog();

            // override bool
            bool containsDuplicates = false;

            // check if generated electives already exist
            if (genElectWindow.GeneratedElectives is null)
            {
                return;
            }
            foreach (Course elective in genElectWindow.GeneratedElectives)
            {
                if (courseList.Contains(elective))
                {
                    containsDuplicates = true;
                }
            }

            // if gened electives already exist, prompt to override
            if (containsDuplicates)
            {
                // open prompt form
                PromptWindow prompt = new PromptWindow("Generated Electives of this type already exist.\n" +
                                                       "Override existing?");
                prompt.ShowDialog();
                if (!prompt.Result)
                {
                    return;
                }
            }

            // add all generated electives to Course list and reload
            foreach (Course elective in genElectWindow.GeneratedElectives)
            {
                courseList.Add(elective);
            }
            updateCourseViewer();
        }
        public void DeleteExecute(object parameter)
        {
            string       message       = "是否删除该品类";
            string       detailMessage = "删除该品类将会删除所有库存中该品类的商品";
            PromptWindow prompt        = new PromptWindow(message, detailMessage);
            bool?        IsConfirmed   = prompt.ShowDialog();

            if (IsConfirmed == true)
            {
                var p = CargoCollectionViewModels.Where <CargoCollectionViewModel>
                            (item => item.CargoCollection.PreciseCargoName == Cargo.PreciseCargoName).ToList();
                foreach (var i in p)
                {
                    i.DeleteCargoCollection();
                }
                CMContext.Cargo.Remove(Cargo);
                CargoViewModels.Remove(this);
                CMContext.SaveChanges();
            }
        }
Beispiel #26
0
        public GmailDataHelper Create()
        {
            int            n    = 0;
            PromptSettings ps   = _recorder.LoadData("Prompt" + n);
            String         pass = "";

            if (!String.IsNullOrEmpty(ps.Password))
            {
                ps.SecurePassword = ProtectData.DecryptString(ps.Password);
                pass        = "******".Repeat(ps.SecurePassword.Length);
                ps.Password = pass;
            }
            PromptWindow pw = new PromptWindow();

            pw.DataContext = ps;

            if (pw.ShowDialog() == true)
            {
                if (!String.Equals(pass, ps.Password))
                {
                    ps.SecurePassword = new SecureString();
                    foreach (char c in ps.Password)
                    {
                        ps.SecurePassword.AppendChar(c);
                    }
                }
                var credit = new NetworkCredential(ps.Login, ps.SecurePassword);

                ps.Password       = ProtectData.EncryptString(ps.SecurePassword);
                ps.SecurePassword = null;
                _recorder.StoreData("Prompt" + n, ps);

                GmailDataHelper gdhn = new GmailDataHelper(ps.Login, credit);
                new MailTray(gdhn);
                gdhn.AutoRefresh();
                return(gdhn);
            }
            return(null);
        }
        private void ButtonBirefDescription_Click(object sender, RoutedEventArgs e)
        {
            string path = string.Format(@"{0}\KnowledgeBbase\检测项目操作说明\{1}.rtf", Environment.CurrentDirectory, _item.Name.Replace("*", ""));

            if (string.IsNullOrEmpty(path) || !File.Exists(path))
            {
                Global.IsOpenPrompt = true;
                PromptWindow window = new PromptWindow()
                {
                    _HintStr = _item.HintStr
                };
                window.Show();
            }
            else
            {
                TechnologeDocument window = new TechnologeDocument();
                window.path          = path;
                window.ShowInTaskbar = false;
                window.Topmost       = true;
                window.Owner         = this;
                window.Show();
            }
        }
Beispiel #28
0
        public override void SetPromptWindow(PromptWindow.Mod mod)
        {
            PromptWindow win = PromptWindow.Inst();
            GameResources res = GameResources.Inst();
            win.Show(mod, Strings.PROMPT_TITLE_WANT_TO_BUILD_MARKET, true);
            if(owner.GetMarketLicence(SourceKind.Corn) == LicenceKind.NoLicence)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.FirstUpgrade, 0, this, Strings.PROMPT_TITLE_WANT_TO_BUY_MARKET_UPGRADE_CORN_1, Strings.PROMPT_DESCRIPTION_WANT_TO_BUY_MARKET_UPGRADE_CORN_1, Settings.costMarketCorn1, true, res.GetHudTexture(HUDTexture.IconCorn1)));
            else if (owner.GetMarketLicence(SourceKind.Corn) == LicenceKind.FirstLicence && !Settings.banSecondLicence)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.SecondUpgrade, 0, this, Strings.PROMPT_TITLE_WANT_TO_BUY_MARKET_UPGRADE_CORN_2, Strings.PROMPT_DESCRIPTION_WANT_TO_BUY_MARKET_UPGRADE_CORN_2, Settings.costMarketCorn2, true, res.GetHudTexture(HUDTexture.IconCorn2)));

            if (owner.GetMarketLicence(SourceKind.Meat) == LicenceKind.NoLicence)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.FirstUpgrade, 1, this, Strings.PROMPT_TITLE_WANT_TO_BUY_MARKET_UPGRADE_MEAT_1, Strings.PROMPT_DESCRIPTION_WANT_TO_BUY_MARKET_UPGRADE_MEAT_1, Settings.costMarketMeat1, true, res.GetHudTexture(HUDTexture.IconMeat1)));
            else if (owner.GetMarketLicence(SourceKind.Meat) == LicenceKind.FirstLicence && !Settings.banSecondUpgrade)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.SecondUpgrade, 1, this, Strings.PROMPT_TITLE_WANT_TO_BUY_MARKET_UPGRADE_MEAT_2, Strings.PROMPT_DESCRIPTION_WANT_TO_BUY_MARKET_UPGRADE_MEAT_2, Settings.costMarketMeat2, true, res.GetHudTexture(HUDTexture.IconMeat2)));

            if (owner.GetMarketLicence(SourceKind.Stone) == LicenceKind.NoLicence)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.FirstUpgrade, 2, this, Strings.PROMPT_TITLE_WANT_TO_BUY_MARKET_UPGRADE_STONE_1, Strings.PROMPT_DESCRIPTION_WANT_TO_BUY_MARKET_UPGRADE_STONE_1, Settings.costMarketStone1, true, res.GetHudTexture(HUDTexture.IconStone1)));
            else if (owner.GetMarketLicence(SourceKind.Stone) == LicenceKind.FirstLicence && !Settings.banSecondUpgrade)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.SecondUpgrade, 2, this, Strings.PROMPT_TITLE_WANT_TO_BUY_MARKET_UPGRADE_STONE_2, Strings.PROMPT_DESCRIPTION_WANT_TO_BUY_MARKET_UPGRADE_STONE_2, Settings.costMarketStone2, true, res.GetHudTexture(HUDTexture.IconStone2)));

            if (owner.GetMarketLicence(SourceKind.Wood) == LicenceKind.NoLicence)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.FirstUpgrade, 3, this, Strings.PROMPT_TITLE_WANT_TO_BUY_MARKET_UPGRADE_WOOD_1, Strings.PROMPT_DESCRIPTION_WANT_TO_BUY_MARKET_UPGRADE_WOOD_1, Settings.costMarketWood1, true, res.GetHudTexture(HUDTexture.IconWood1)));
            else if (owner.GetMarketLicence(SourceKind.Wood) == LicenceKind.FirstLicence && !Settings.banSecondUpgrade)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.SecondUpgrade, 3, this, Strings.PROMPT_TITLE_WANT_TO_BUY_MARKET_UPGRADE_WOOD_2, Strings.PROMPT_DESCRIPTION_WANT_TO_BUY_MARKET_UPGRADE_WOOD_2, Settings.costMarketWood2, true, res.GetHudTexture(HUDTexture.IconWood2)));

            if (owner.GetMarketLicence(SourceKind.Ore) == LicenceKind.NoLicence)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.FirstUpgrade, 4, this, Strings.PROMPT_TITLE_WANT_TO_BUY_MARKET_UPGRADE_ORE_1, Strings.PROMPT_DESCRIPTION_WANT_TO_BUY_MARKET_UPGRADE_ORE_1, Settings.costMarketOre1, true, res.GetHudTexture(HUDTexture.IconOre1)));
            else if (owner.GetMarketLicence(SourceKind.Ore) == LicenceKind.FirstLicence && !Settings.banSecondUpgrade)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.SecondUpgrade, 4, this, Strings.PROMPT_TITLE_WANT_TO_BUY_MARKET_UPGRADE_ORE_2, Strings.PROMPT_DESCRIPTION_WANT_TO_BUY_MARKET_UPGRADE_ORE_2, Settings.costMarketOre2, true, res.GetHudTexture(HUDTexture.IconOre2)));

            if (win.GetItemCount() == 0)
            {
                win.AddPromptItem(new PromptItem(Strings.PROMPT_TITLE_WANT_TO_BUILD_MARKET, Strings.PROMPT_DESCRIPTION_ALL_LICENCES_BOUGHT, new SourceAll(0), false, false, GameResources.Inst().GetHudTexture(HUDTexture.IconMarket)));
            }
        }
Beispiel #29
0
        public override void SetPromptWindow(PromptWindow.Mod mod)
        {
            PromptWindow win = PromptWindow.Inst();
            GameResources res = GameResources.Inst();
            win.Show(mod, Strings.PROMPT_TITLE_WANT_TO_BUILD_MONASTERY, true);

            if(owner.GetMonasteryUpgrade(SourceBuildingKind.Mill) == UpgradeKind.NoUpgrade)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.FirstUpgrade, 0, this, Strings.PROMPT_TITLE_WANT_TO_UPGRADE_1_MILL, Strings.PROMPT_DESCRIPTION_WANT_TO_UPGRADE_1_MILL, Settings.costMonasteryCorn1, true, res.GetHudTexture(HUDTexture.IconMill1)));
            else if (owner.GetMonasteryUpgrade(SourceBuildingKind.Mill) == UpgradeKind.FirstUpgrade && !Settings.banSecondUpgrade)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.SecondUpgrade, 0, this, Strings.PROMPT_TITLE_WANT_TO_UPGRADE_2_MILL, Strings.PROMPT_DESCRIPTION_WANT_TO_UPGRADE_2_MILL, Settings.costMonasteryCorn2, true, res.GetHudTexture(HUDTexture.IconMill2)));

            if (owner.GetMonasteryUpgrade(SourceBuildingKind.Stepherd) == UpgradeKind.NoUpgrade)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.FirstUpgrade, 1, this, Strings.PROMPT_TITLE_WANT_TO_UPGRADE_1_STEPHERD, Strings.PROMPT_DESCRIPTION_WANT_TO_UPGRADE_1_STEPHERD, Settings.costMonasteryMeat1, true, res.GetHudTexture(HUDTexture.IconStepherd1)));
            else if (owner.GetMonasteryUpgrade(SourceBuildingKind.Stepherd) == UpgradeKind.FirstUpgrade && !Settings.banSecondUpgrade)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.SecondUpgrade, 1, this, Strings.PROMPT_TITLE_WANT_TO_UPGRADE_2_STEPHERD, Strings.PROMPT_DESCRIPTION_WANT_TO_UPGRADE_2_STEPHERD, Settings.costMonasteryMeat2, true, res.GetHudTexture(HUDTexture.IconStepherd2)));

            if (owner.GetMonasteryUpgrade(SourceBuildingKind.Quarry) == UpgradeKind.NoUpgrade)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.FirstUpgrade, 2, this, Strings.PROMPT_TITLE_WANT_TO_UPGRADE_1_QUARRY, Strings.PROMPT_DESCRIPTION_WANT_TO_UPGRADE_1_QUARRY, Settings.costMonasteryStone1, true, res.GetHudTexture(HUDTexture.IconQuarry1)));
            else if (owner.GetMonasteryUpgrade(SourceBuildingKind.Quarry) == UpgradeKind.FirstUpgrade && !Settings.banSecondUpgrade)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.SecondUpgrade, 2, this, Strings.PROMPT_TITLE_WANT_TO_UPGRADE_2_QUARRY, Strings.PROMPT_DESCRIPTION_WANT_TO_UPGRADE_2_QUARRY, Settings.costMonasteryStone2, true, res.GetHudTexture(HUDTexture.IconQuarry2)));

            if (owner.GetMonasteryUpgrade(SourceBuildingKind.Saw) == UpgradeKind.NoUpgrade)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.FirstUpgrade, 3, this, Strings.PROMPT_TITLE_WANT_TO_UPGRADE_1_SAW, Strings.PROMPT_DESCRIPTION_WANT_TO_UPGRADE_1_SAW, Settings.costMonasteryWood1, true, res.GetHudTexture(HUDTexture.IconSaw1)));
            else if (owner.GetMonasteryUpgrade(SourceBuildingKind.Saw) == UpgradeKind.FirstUpgrade && !Settings.banSecondUpgrade)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.SecondUpgrade, 3, this, Strings.PROMPT_TITLE_WANT_TO_UPGRADE_2_SAW, Strings.PROMPT_DESCRIPTION_WANT_TO_UPGRADE_2_SAW, Settings.costMonasteryWood2, true, res.GetHudTexture(HUDTexture.IconSaw2)));

            if (owner.GetMonasteryUpgrade(SourceBuildingKind.Mine) == UpgradeKind.NoUpgrade)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.FirstUpgrade, 4, this, Strings.PROMPT_TITLE_WANT_TO_UPGRADE_1_MINE, Strings.PROMPT_DESCRIPTION_WANT_TO_UPGRADE_1_MINE, Settings.costMonasteryOre1, true, res.GetHudTexture(HUDTexture.IconMine1)));
            else if (owner.GetMonasteryUpgrade(SourceBuildingKind.Mine) == UpgradeKind.FirstUpgrade && !Settings.banSecondUpgrade)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.SecondUpgrade, 4, this, Strings.PROMPT_TITLE_WANT_TO_UPGRADE_2_MINE, Strings.PROMPT_DESCRIPTION_WANT_TO_UPGRADE_2_MINE, Settings.costMonasteryOre2, true, res.GetHudTexture(HUDTexture.IconMine2)));

            if (win.GetItemCount() == 0)
            {
                win.AddPromptItem(new PromptItem(Strings.PROMPT_TITLE_WANT_TO_BUILD_MONASTERY, Strings.PROMPT_DESCRIPTION_ALL_UPGRADES_INVENTED, new SourceAll(0), false, false, GameResources.Inst().GetHudTexture(HUDTexture.IconMonastery)));
            }
        }
Beispiel #30
0
        public override void SetPromptWindow(PromptWindow.Mod mod)
        {
            PromptWindow win = PromptWindow.Inst();
            GameResources res = GameResources.Inst();
            win.Show(mod, titleBuilding, true);
            upgrade = GetUpgrade();
            if (upgrade == UpgradeKind.NoUpgrade)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.FirstUpgrade, 0, this, upgrade1Title, upgrade1Description, upgrade1cost, true, upgrade1icon));
            else if (upgrade == UpgradeKind.FirstUpgrade)
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.SecondUpgrade, 0, this, upgrade2Title, upgrade2Description, upgrade2cost, true, upgrade2icon));
            else
            {
                win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.SecondUpgrade, 0, this, titleBuilding, Strings.PROMPT_DESCRIPTION_ALL_UPGRADES_USED, new SourceAll(0), true, upgrade2icon));

                //win.AddPromptItem(new PromptItem(titleBuilding, Strings.PROMPT_DESCRIPTION_ALL_UPGRADES_USED, new SourceAll(0), false, false, upgrade2icon));
            }
        }
Beispiel #31
0
 public abstract void SetPromptWindow(PromptWindow.Mod mod);
Beispiel #32
0
        public override void SetPromptWindow(PromptWindow.Mod mod)
        {
            if (!playerPrompt)
            {
                PromptWindow win = PromptWindow.Inst();
                GameResources res = GameResources.Inst();
                win.Show(mod, Strings.PROMPT_TITLE_WANT_TO_BUILD_FORT, true);

                if(!Settings.banFortCaptureHexa)
                    win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.FirstUpgrade, 0, this, Strings.PROMPT_TITLE_WANT_TO_BUY_FORT_ACTION_CAPTURE, Strings.PROMPT_DESCRIPTION_WANT_TO_BUY_FORT_ACTION_CAPTURE, costCaptureHexa, true, res.GetHudTexture(HUDTexture.IconFortCapture)));
                if(!Settings.banFortCrusade)
                    win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.FirstUpgrade, 1, this, Strings.PROMPT_TITLE_WANT_TO_BUY_FORT_ACTION_CRUSADE, Strings.PROMPT_DESCRIPTION_WANT_TO_BUY_FORT_ACTION_CRUSADE, Settings.costFortCrusade, true, res.GetHudTexture(HUDTexture.IconFortCrusade)));
                if (!Settings.banFortStealSources)
                    win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.FirstUpgrade, 2, this, Strings.PROMPT_TITLE_WANT_TO_BUY_FORT_ACTION_SOURCES, Strings.PROMPT_DESCRIPTION_WANT_TO_BUY_FORT_ACTION_SOURCES, costSources, true, res.GetHudTexture(HUDTexture.IconFortSources)));
                if (!Settings.banFortParade)
                    win.AddPromptItem(new SpecialBuildingPromptItem(townID, hexaID, UpgradeKind.FirstUpgrade, 3, this, Strings.PROMPT_TITLE_WANT_TO_BUY_FORT_ACTION_PARADE, Strings.PROMPT_DESCRIPTION_WANT_TO_BUY_FORT_ACTION_PARADE, costParade, true, res.GetHudTexture(HUDTexture.IconFortParade)));
            }
            playerPrompt = false;
        }
        private void CancelExecute(object parameter)
        {
            PromptWindow promptWindow = parameter as PromptWindow;

            promptWindow.DialogResult = false;
        }
        private void ConfirmExecute(object parameter)
        {
            PromptWindow promptWindow = parameter as PromptWindow;

            promptWindow.DialogResult = true;
        }
Beispiel #35
0
 private void    ChangeStreamName()
 {
     PromptWindow.Start(this.name, this.RenameStream, null);
 }