예제 #1
0
        public bool LoadMap(string _filepath)
        {
            bool LoadSucess = mapdata.LoadMap(_filepath);

            IsLoad  = LoadSucess;
            IsDirty = false;
            if (LoadSucess == true)
            {
                optionReset();
                //tabitem.Header = mapdata.SafeFileName;
                //tabitem.Content = this;
                InitControl();
                mapDataBinding.PropertyChangeAll();
            }

            return(LoadSucess);

            try
            {
            }
            catch (Exception e)
            {
                Dialog.MsgDialog msgDialog = new MsgDialog(System.IO.Path.GetFileName(_filepath) + "는 열 수 없는 맵입니다.\n" + e.Message, MessageBoxButton.OK, MessageBoxImage.Error);
                msgDialog.ShowDialog();
                return(false);
            }
        }
예제 #2
0
        private void Worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                IsClose = true;
            }
            else
            {
                MsgDialog msgDialog = new MsgDialog("다음과 같은 오류로 그래픽을 불러오지 못했습니다.\n다시 시도하겠습니까?\n" + e.Error.Message, MessageBoxButton.OKCancel, MessageBoxImage.Error);
                msgDialog.ShowDialog();

                if (msgDialog.msgresult == MessageBoxResult.OK)
                {
                    LoadStart();
                    return;
                }
            }

            Close();
        }
예제 #3
0
        public bool SaveMapCommand()
        {
            if (!MapIsLoad())
            {
                return(false);
            }

            bool result = mapeditor.SaveMap();

            if (result)
            {
            }
            else
            {
                Dialog.MsgDialog msgDialog = new MsgDialog("저장에 실패했습니다.", MessageBoxButton.OK, MessageBoxImage.Error);
                msgDialog.ShowDialog();
            }
            SetWindowName();
            return(result);
        }