Example #1
0
        public static IProgressDialog CreateProgressDialog(IDialogHost dialogHost, DialogMode dialogMode, Dispatcher dispatcher)
        {
            IProgressDialog dialog = null;

            dispatcher.Invoke(new Action(() => dialog = new WaitProgressDialog(dialogHost, dialogMode, false, dispatcher)), DispatcherPriority.DataBind);
            return(dialog);
        }
    //*************************************************************************
    //  Constructor: ClusterUserSettingsDialog()
    //
    /// <summary>
    /// Initializes a new instance of the <see cref="ClusterUserSettingsDialog"
    /// /> class.
    /// </summary>
    ///
    /// <param name="mode">
    /// Indicates the mode in which the dialog is being used.
    /// </param>
    ///
    /// <param name="clusterUserSettings">
    /// The object being edited.
    /// </param>
    //*************************************************************************

    public ClusterUserSettingsDialog
    (
        DialogMode mode,
        ClusterUserSettings clusterUserSettings
    )
    {
        Debug.Assert(clusterUserSettings != null);
        clusterUserSettings.AssertValid();

        m_oClusterUserSettings = clusterUserSettings;

        InitializeComponent();

        if (mode == DialogMode.EditOnly)
        {
            this.Text += " Options";
        }

        // Instantiate an object that saves and retrieves the user settings for
        // this dialog.  Note that the object automatically saves the settings
        // when the form closes.

        m_oClusterUserSettingsDialogUserSettings =
            new ClusterUserSettingsDialogUserSettings(this);

        DoDataExchange(false);

        AssertValid();
    }
        public GraphDialog(Action<Graph> callback, DialogMode dialogMode, Graph graph = null)
        {
            this.InitializeComponent();

            _callback = callback;

            switch (dialogMode)
            {
                case DialogMode.CreationMode:

                    _graph = new Graph() { CreationDate = DateTime.Now, LastOpenTime = DateTime.Now, Links = new BindableCollection<Link>(), Nodes = new BindableCollection<Node>() };

                    Title = "New graph";
                    PrimaryButtonText = "Create";

                    break;
                case DialogMode.EditMode:

                    _graph = graph;

                    Title = "Edit graph";
                    PrimaryButtonText = "Save";

                    break;
                default:
                    throw new ArgumentException("Not supported", "dialogMode");
            }
        }
        //*************************************************************************
        //  Constructor: ExportToEmailDialog()
        //
        /// <summary>
        /// Initializes a new instance of the <see cref="ExportToEmailDialog" />
        /// class.
        /// </summary>
        ///
        /// <param name="mode">
        /// Indicates the mode in which the dialog is being used.
        /// </param>
        ///
        /// <param name="workbook">
        /// Workbook containing the graph data.
        /// </param>
        ///
        /// <param name="nodeXLControl">
        /// NodeXLControl containing the graph.  This can be null if <paramref
        /// name="mode" /> is <see cref="DialogMode.EditOnly" />.
        /// </param>
        //*************************************************************************

        public ExportToEmailDialog
        (
            DialogMode mode,
            Microsoft.Office.Interop.Excel.Workbook workbook,
            NodeXLControl nodeXLControl
        )
        {
            Debug.Assert(workbook != null);
            Debug.Assert(nodeXLControl != null || mode == DialogMode.EditOnly);

            m_eMode                      = mode;
            m_oWorkbook                  = workbook;
            m_oNodeXLControl             = nodeXLControl;
            m_oExportToEmailUserSettings = new ExportToEmailUserSettings();
            m_oPasswordUserSettings      = new PasswordUserSettings();

            InitializeComponent();

            if (m_eMode == DialogMode.EditOnly)
            {
                InitializeForEditOnly();
            }

            // Instantiate an object that saves and retrieves the user settings for
            // this dialog.  Note that the object automatically saves the settings
            // when the form closes.

            m_oExportToEmailDialogUserSettings =
                new ExportToEmailDialogUserSettings(this);

            DoDataExchange(false);

            AssertValid();
        }
Example #5
0
 public CustomFileDialog(DialogMode Mode)
 {
     InitializeComponent();
     DataContext = Model;
     Model.SelectMode(Mode);
     Model.OpenFolder();
 }
Example #6
0
        public DataSourceForm(BcSource source, decimal plantId,
                              OracleConnection connection, DialogMode mode)
        {
            InitializeComponent();
            switch (source)
            {
            case BcSource.Workers:
                rbWork.Checked = true;
                break;

            case BcSource.Defects:
                rbDef.Checked = true;
                break;

            case BcSource.Repairs:
                rbRep.Checked = true;
                break;
            }
            this.plantId = plantId;
            plantTableAdapter.Connection = connection;
            if (mode == DialogMode.Master)
            {
                btnBack.Visible = true;
                if (Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName == "ru")
                {
                    btnOk.Text = "Далее";
                }
                else
                {
                    btnOk.Text = "Next";
                }
            }
        }
Example #7
0
        //*************************************************************************
        //  Constructor: GraphMetricsDialog()
        //
        /// <overloads>
        /// Initializes a new instance of the <see cref="GraphMetricsDialog" />
        /// class.
        /// </overloads>
        ///
        /// <summary>
        /// Initializes a new instance of the <see cref="GraphMetricsDialog" />
        /// class with a GraphMetricUserSettings object.
        /// </summary>
        ///
        /// <param name="workbook">
        /// Workbook containing the graph contents.
        /// </param>
        ///
        /// <param name="graphMetricUserSettings">
        /// The object being edited.
        /// </param>
        ///
        /// <param name="mode">
        /// Indicates the mode in which the dialog is being used.
        /// </param>
        //*************************************************************************

        public GraphMetricsDialog
        (
            Microsoft.Office.Interop.Excel.Workbook workbook,
            GraphMetricUserSettings graphMetricUserSettings,
            DialogMode mode
        )
            : this()
        {
            Debug.Assert(workbook != null);
            Debug.Assert(graphMetricUserSettings != null);

            m_oWorkbook = workbook;
            m_oGraphMetricUserSettings = graphMetricUserSettings;
            m_eMode = mode;

            if (m_eMode == DialogMode.EditOnly)
            {
                this.Text += " Options";
                btnOK.Text = "OK";
            }

            // Instantiate an object that saves and retrieves the position of this
            // dialog.  Note that the object automatically saves the settings when
            // the form closes.

            m_oGraphMetricsDialogUserSettings =
                new GraphMetricsDialogUserSettings(this);

            DoDataExchange(false);

            AssertValid();
        }
    //*************************************************************************
    //  Constructor: GraphMetricsDialog()
    //
    /// <summary>
    /// Initializes a new instance of the <see cref="GraphMetricsDialog" />
    /// class.
    /// </summary>
    ///
    /// <param name="mode">
    /// Indicates the mode in which the dialog is being used.
    /// </param>
    ///
    /// <param name="workbook">
    /// Workbook containing the graph contents.
    /// </param>
    //*************************************************************************

    public GraphMetricsDialog
    (
        DialogMode mode,
        Microsoft.Office.Interop.Excel.Workbook workbook
    )
    {
        InitializeComponent();

        m_eMode = mode;
        m_oWorkbook = workbook;
        m_oGraphMetricUserSettings = new GraphMetricUserSettings();

        // Instantiate an object that saves and retrieves the position of this
        // dialog.  Note that the object automatically saves the settings when
        // the form closes.

        m_oGraphMetricsDialogUserSettings =
            new GraphMetricsDialogUserSettings(this);

        if (m_eMode == DialogMode.EditOnly)
        {
            this.Text += " Options";
            btnOK.Text = "OK";
        }

        clbGraphMetrics.Items.AddRange(
            GraphMetricInformation.GetAllGraphMetricInformation() );

        clbGraphMetrics.SetSelected(0, true);

        DoDataExchange(false);

        AssertValid();
    }
Example #9
0
        private void FindDeadAccountsButton_Click(object sender, EventArgs e)
        {
            _mode = DialogMode.DeadAccountDelete;

            try
            {
                SquadronHelper.Instance.StartAnimation();

                var soList = _enumerator.GetSecurableObjects(UrlText.Text, ScopeEnum.WebApplication, SiteCheck.Checked, ListCheck.Checked, ItemCheck.Checked, ItemCheck.Checked, !UniquePermissionsCheck.Checked);

                var allUsersList = _enumerator.GetPrincipals(UrlText.Text);

                _deadAccounts.Clear();

                foreach (SPUser user in allUsersList)
                {
                    if (!_sharePointUtility.IsInternalUser(user))
                    {
                        if (!_adhelper.IsExists(ADText.Text, user.LoginName))
                        {
                            _deadAccounts.Add(user);
                        }
                    }
                }

                Display(_deadAccounts);
            }
            finally
            {
                SquadronHelper.Instance.StopAnimation();
            }
        }
        public NodeDialog(Action<Node> callback, DialogMode dialogMode, Node node = null)
        {
            this.InitializeComponent();
            _callback = callback;

            switch (dialogMode)
            {
                case DialogMode.CreationMode:

                    Title = "Add new node";
                    PrimaryButtonText = "Create";
                    _node = new Node();

                    break;
                case DialogMode.EditMode:

                    Title = "Edit node";
                    PrimaryButtonText = "Save";
                    _node = node;

                    break;
                default:
                    throw new ArgumentException("Not supported", "dialogMode");
            }
        }
Example #11
0
        public bool send(string title, string message, DialogMode mode = DialogMode.Notification)
        {
            switch (mode)
            {
            case DialogMode.Confirmation:
                //Notification.
                ConfirmationVM _confirmation = new ConfirmationVM(title, message);
                if (ContainerStore.Singleton.windows.showDialog <ConfirmationVM>(_confirmation).Value)
                {
                    return(true);
                }
                break;

            case DialogMode.GetInput:
                //Notification.
                GetInputVM _getInput = new GetInputVM(title, message);
                if (ContainerStore.Singleton.windows.showDialog <GetInputVM>(_getInput).Value)
                {
                    return(true);
                }
                break;

            case DialogMode.Notification:
                //Notification.
                NotificationVM _notification = new NotificationVM(title, message);
                if (ContainerStore.Singleton.windows.showDialog <NotificationVM>(InputViewModel: _notification).Value)
                {
                    return(true);
                }
                break;
            }
            return(false);
        }
Example #12
0
        private MessageBoxResult ShowFinancialTransactionEditDialog(DialogMode mode, bool allowChangeAppointment = true)
        {
            FinancialTransactionEdit viewModel = null;

            switch (mode)
            {
            case DialogMode.Create:
                viewModel = new FinancialTransactionEdit(mode, _customer.ID, (SelectedAppointment != null) ? (int?)SelectedAppointment.ID : null, FinancialTransactionDialogService, MessageService)
                {
                    AllowSelectVisit = false
                };
                break;

            case DialogMode.Update:
            case DialogMode.View:
                viewModel = new FinancialTransactionEdit(mode, SelectedFinancialTransaction.ID, _customer.ID, (SelectedAppointment != null) ? (int?)SelectedAppointment.ID : null, FinancialTransactionDialogService, MessageService)
                {
                    AllowSelectVisit = false
                };
                break;
            }
            ;


            return(viewModel.ShowEditDialog());
        }
Example #13
0
        public async Task<string> ShowInputDialog(string title, string message, string buttonok, string defaulttext, DialogMode mode)
        {
            if (Configuration.ShowFullscreenDialogs)
            {
                var dialog = new AdvancedInputDialog(BaseWindow,
                    new MetroDialogSettings()
                    {
                        AffirmativeButtonText = buttonok,
                        DefaultText = defaulttext,
                        NegativeButtonText = Application.Current.Resources["Cancel"].ToString(),
                        ColorScheme = MetroDialogColorScheme.Theme,
                        AnimateHide = ShowHideAnimation(mode),
                        AnimateShow = ShowShowAnimation(mode)
                    }) { Title = title, Message = message };

                await BaseWindow.ShowMetroDialogAsync(dialog);
                var result = await dialog.WaitForButtonPressAsync();
                await dialog._WaitForCloseAsync();
                var foo = BaseWindow.HideMetroDialogAsync(dialog);
                return result;
            }
            else
            {
                var inputdialog = new InputDialog(title, message, buttonok, defaulttext) { Owner = BaseWindow };
                await Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => inputdialog.ShowDialog()));
                return inputdialog.ResultText;
            }
        }
Example #14
0
 public async Task<bool> ShowMessage(string message, string title, bool cancancel, DialogMode mode, string affirmativeButtonText = null, string negativeButtonText = null)
 {
     if (Configuration.ShowFullscreenDialogs)
     {
         MessageDialogResult result =
             await
                 BaseWindow.ShowMessageAsync(title, message,
                     cancancel ? MessageDialogStyle.AffirmativeAndNegative : MessageDialogStyle.Affirmative,
                     new MetroDialogSettings()
                     {
                         AffirmativeButtonText = affirmativeButtonText ?? Application.Current.Resources["OK"].ToString(),
                         NegativeButtonText = negativeButtonText ?? Application.Current.Resources["Cancel"].ToString(),
                         AnimateHide = ShowHideAnimation(mode),
                         AnimateShow = ShowShowAnimation(mode),
                         ColorScheme = MetroDialogColorScheme.Theme
                     });
         return result == MessageDialogResult.Affirmative;
     }
     else
     {
         var messageWindow = new MessageWindow(message, title, cancancel, affirmativeButtonText, negativeButtonText) { Owner = BaseWindow };
         var result = false;
         await Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => result = messageWindow.ShowDialog() == true));
         return result;
     }
 }
Example #15
0
 public BarcodeStateForm(BarcodeState state, DialogMode mode)
 {
     InitializeComponent();
     InitializeComboBoxes();
     bc.ScaleMode = enumSCALE_MODE.Scale_Millimeter;
     bc.Barcode   = "12345";
     if (Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName == "ru")
     {
         bc.TopText    = "Заголовок";
         bc.BottomText = "Подпись";
     }
     else
     {
         bc.TopText    = "Top text";
         bc.BottomText = "Bottom text";
     }
     bc.BackColor = Color.White;
     if (state == null)
     {
         state = new BarcodeState(bc);
     }
     InitializeControlsValues(state);
     if (mode == DialogMode.Master)
     {
         btnBack.Visible = true;
         if (Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName == "ru")
         {
             btnOk.Text = "Далее";
         }
         else
         {
             btnOk.Text = "Next";
         }
     }
 }
Example #16
0
        //*************************************************************************
        //  Constructor: ClusterUserSettingsDialog()
        //
        /// <summary>
        /// Initializes a new instance of the <see cref="ClusterUserSettingsDialog"
        /// /> class.
        /// </summary>
        ///
        /// <param name="mode">
        /// Indicates the mode in which the dialog is being used.
        /// </param>
        ///
        /// <param name="clusterUserSettings">
        /// The object being edited.
        /// </param>
        //*************************************************************************

        public ClusterUserSettingsDialog
        (
            DialogMode mode,
            ClusterUserSettings clusterUserSettings
        )
        {
            Debug.Assert(clusterUserSettings != null);
            clusterUserSettings.AssertValid();

            m_oClusterUserSettings = clusterUserSettings;

            InitializeComponent();

            if (mode == DialogMode.EditOnly)
            {
                this.Text += " Options";
            }

            // Instantiate an object that saves and retrieves the user settings for
            // this dialog.  Note that the object automatically saves the settings
            // when the form closes.

            m_oClusterUserSettingsDialogUserSettings =
                new ClusterUserSettingsDialogUserSettings(this);

            DoDataExchange(false);

            AssertValid();
        }
Example #17
0
 private void ShowMsgBox(DialogMode dm)
 {
     dialogMode = dm;
     if (dm == DialogMode.ConfirmRestart)
     {
         lblDialogTitle.Text  = "Restart MathsBattle";
         lblDialogText.Text   = "You need to restart MathsBattle for these changes to take place. Continue?";
         btnDialogOK.Text     = "Restart";
         btnDialogCancel.Text = "Cancel";
     }
     else if (dm == DialogMode.ConfirmBattleQuit)
     {
         lblDialogTitle.Text  = "Quit Game";
         lblDialogText.Text   = "Are you sure you want to quit this game? Game progress will be discarded.";
         btnDialogOK.Text     = "Quit";
         btnDialogCancel.Text = "Cancel";
     }
     else if (dm == DialogMode.ConfirmExerciseQuit)
     {
         lblDialogTitle.Text  = "Quit Exercise";
         lblDialogText.Text   = "Are you sure you want to quit this exercise? Progress will be discarded.";
         btnDialogOK.Text     = "Quit";
         btnDialogCancel.Text = "Cancel";
     }
     panelDialogBG.BringToFront();
 }
    //*************************************************************************
    //  Constructor: ExportToEmailDialog()
    //
    /// <summary>
    /// Initializes a new instance of the <see cref="ExportToEmailDialog" />
    /// class.
    /// </summary>
    ///
    /// <param name="mode">
    /// Indicates the mode in which the dialog is being used.
    /// </param>
    ///
    /// <param name="workbook">
    /// Workbook containing the graph data.
    /// </param>
    ///
    /// <param name="nodeXLControl">
    /// NodeXLControl containing the graph.  This can be null if <paramref
    /// name="mode" /> is <see cref="DialogMode.EditOnly" />.
    /// </param>
    //*************************************************************************

    public ExportToEmailDialog
    (
        DialogMode mode,
        Microsoft.Office.Interop.Excel.Workbook workbook,
        NodeXLControl nodeXLControl
    )
    {
        Debug.Assert(workbook != null);
        Debug.Assert(nodeXLControl != null || mode == DialogMode.EditOnly);

        m_eMode = mode;
        m_oWorkbook = workbook;
        m_oNodeXLControl = nodeXLControl;
        m_oExportToEmailUserSettings = new ExportToEmailUserSettings();
        m_oPasswordUserSettings = new PasswordUserSettings();

        InitializeComponent();

        if (m_eMode == DialogMode.EditOnly)
        {
            InitializeForEditOnly();
        }

        // Instantiate an object that saves and retrieves the user settings for
        // this dialog.  Note that the object automatically saves the settings
        // when the form closes.

        m_oExportToEmailDialogUserSettings =
            new ExportToEmailDialogUserSettings(this);

        DoDataExchange(false);

        AssertValid();
    }
Example #19
0
        //*************************************************************************
        //  Constructor: GraphMetricsDialog()
        //
        /// <summary>
        /// Initializes a new instance of the <see cref="GraphMetricsDialog" />
        /// class.
        /// </summary>
        ///
        /// <param name="mode">
        /// Indicates the mode in which the dialog is being used.
        /// </param>
        ///
        /// <param name="workbook">
        /// Workbook containing the graph contents.
        /// </param>
        //*************************************************************************

        public GraphMetricsDialog
        (
            DialogMode mode,
            Microsoft.Office.Interop.Excel.Workbook workbook
        )
        {
            InitializeComponent();

            m_eMode     = mode;
            m_oWorkbook = workbook;
            m_oGraphMetricUserSettings = new GraphMetricUserSettings();

            // Instantiate an object that saves and retrieves the position of this
            // dialog.  Note that the object automatically saves the settings when
            // the form closes.

            m_oGraphMetricsDialogUserSettings =
                new GraphMetricsDialogUserSettings(this);

            if (m_eMode == DialogMode.EditOnly)
            {
                this.Text += " Options";
                btnOK.Text = "OK";
            }

            clbGraphMetrics.Items.AddRange(
                GraphMetricInformation.GetAllGraphMetricInformation());

            clbGraphMetrics.SetSelected(0, true);

            DoDataExchange(false);

            AssertValid();
        }
        public FinancialTransactionEdit(DialogMode mode, int?transactionID, int clientID, int?appointmentID, IDialogService dialogService, IMessageBoxService messageService)
            : base(mode, dialogService, messageService)
        {
            SubTitle = "финансовой операции";
            if (transactionID.HasValue)
            {
                _data = _dc.FinancialTransactions.SingleOrDefault(x => x.ID == transactionID);
                //  _data.ModifiedBy = CurrentUser.ID;
                _data.ModificationTime = DateTime.Now;
            }
            else
            {
                var client = _dc.Customers.Single(x => x.ID == clientID);
                Models.Appointment appointment = null;
                if (appointmentID.HasValue)
                {
                    appointment = _dc.Appointments.SingleOrDefault(x => x.ID == appointmentID);
                }

                _data = new Models.FinancialTransaction()
                {
                    Customer          = client,
                    Appointment       = appointment,
                    TransactionTypeID = (int)TransactionType.Deposit,
                    CreatedBy         = CurrentUser.ID,
                    CreationTime      = DateTime.Now,
                    Amount            = 0m
                };
                _dc.FinancialTransactions.Add(_data);
            };
        }
        public UnterrichtsfachBearbeitenWindow(DialogMode dm)
        {
            InitializeComponent();
            this._dm = dm;

            this.Loaded += UnterrichtsfachAnlegen_Loaded;
        }
Example #22
0
 public LayoutForm(BcLayout layout, DialogMode mode)
 {
     InitializeComponent();
     if (layout != null)
     {
         InitializeControlsValues(layout);
     }
     else
     {
         tbHorDist.Text = "10";
         tbVerDist.Text = "15";
     }
     if (mode == DialogMode.Master)
     {
         btnBack.Visible = true;
         if (Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName == "ru")
         {
             btnOk.Text = "Завершить";
         }
         else
         {
             btnOk.Text = "Finish";
         }
     }
 }
Example #23
0
    public UIDialog(DialogMode mode)
    {
        m_Mode          = mode;
        m_BackgroundImg = new UIImage();
        m_Text          = new UIText();

        m_Block      = new UIBlock();
        m_Block.Rect = new Rect(0, 0, Screen.width, Screen.height);
        Add(m_Block);
        Add(m_BackgroundImg);
        Add(m_Text);
        if (m_Mode == DialogMode.YES_OR_NO)
        {
            m_YesButton   = new UITextButton();
            m_NoButton    = new UITextButton();
            m_CloseButton = new UIClickButton();
            Add(m_YesButton);
            Add(m_NoButton);
            Add(m_CloseButton);
        }
        else if (m_Mode == DialogMode.TAP_TO_DISMISS)
        {
            m_TipText = new UIText();
            Add(m_TipText);
        }

        SetUIHandler(this);
    }
Example #24
0
        /// <summary>
        /// 显示窗口
        /// </summary>
        /// <typeparam name="TResult">窗口返回的结果的类型</typeparam>
        /// <param name="windowmodel">窗口模式,为<see cref="DialogMode"/></param>类型
        /// <param name="parent">窗口父容器</param>
        /// <param name="result">此参数未使用</param>
        /// <param name="close">此参数未使用</param>
        /// <param name="isResizable">窗口是否可拖拽大小</param>
        /// <param name="GUID">
        /// 窗口标识.
        /// 可根据此ID限制此窗口只能弹出一个
        /// </param>
        public void Show <TResult>(DialogMode windowmodel, FrameworkElement parent, TResult result, Action <TResult> close, bool isResizable, string GUID)
        {
            try
            {
                try
                {
                    double height = SMT.SAAS.Main.CurrentContext.AppContext.AppHost.SilverlightHostRoot.ActualHeight;
                    double width  = SMT.SAAS.Main.CurrentContext.AppContext.AppHost.SilverlightHostRoot.ActualWidth;
                    //MessageBox.Show("1高:" + (height - 50) + " 宽:" + (width - 50));
                    this.MinHeight = height - 50;
                    this.MinWidth  = width - 50;
                }
                catch (Exception ex)
                {
                }
                this._window = ProgramManager.ShowProgram(TitleContent.ToString(), string.Empty, GUID, this, isResizable, true, null);

                //MessageBox.Show("1高:" + this._window.MinHeight + " 宽:" + this._window.MinWidth);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                //MessageBox.Show("Down");
            }
        }
Example #25
0
 public WorkFilterForm(OracleConnection connection,
                       RewDataSet.BarcodeDataTable table, decimal plantId,
                       DialogMode mode)
 {
     InitializeComponent();
     this.plantId = plantId;
     if (table != null)
     {
         foreach (RewDataSet.BarcodeRow row in table)
         {
             rewDataSet.Barcode.AddBarcodeRow(row.Id,
                                              row.Name, row.NameEng, row.Code);
         }
     }
     workerTableAdapter.Connection = connection;
     if (mode == DialogMode.Master)
     {
         btnBack.Visible = true;
         if (Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName == "ru")
         {
             btnOk.Text = "Далее";
         }
         else
         {
             btnOk.Text = "Next";
         }
     }
 }
Example #26
0
        /// <summary>
        /// Create the File Dialog and set it's basic properties
        /// </summary>
        private IAgtFileSelectionDialog CreateFileDialogAndSetParameters(bool allowMultiSelect,
                                                                         string dialogTitle,
                                                                         DialogMode dialogMode,
                                                                         string initialDirectory,
                                                                         bool showSampleInfo,
                                                                         IFileFilter iFileFilter)
        {
            AgtDialog agtDialog = new AgtDialog();
            IAgtFileSelectionDialog fileDialog = agtDialog as IAgtFileSelectionDialog;

            fileDialog.AllowMultiSelect      = allowMultiSelect;
            fileDialog.HelpId                = "0";
            fileDialog.DialogTitle           = dialogTitle;
            fileDialog.OpenOrSave            = dialogMode;
            fileDialog.InitialDirectory      = initialDirectory;
            fileDialog.ShowSampleInformation = showSampleInfo;
            fileDialog.AppPlugIn             = iFileFilter;
            fileDialog.Initialize(dialogMode);

            // set some basic Form properties
            agtDialog.Owner         = this;
            agtDialog.ShowIcon      = false;
            agtDialog.ShowInTaskbar = true;
            agtDialog.BringToFront();
            return(fileDialog);
        }
Example #27
0
        //*************************************************************************
        //  Constructor: GraphMetricsDialog()
        //
        /// <overloads>
        /// Initializes a new instance of the <see cref="GraphMetricsDialog" />
        /// class.
        /// </overloads>
        ///
        /// <summary>
        /// Initializes a new instance of the <see cref="GraphMetricsDialog" />
        /// class with a GraphMetricUserSettings object.
        /// </summary>
        ///
        /// <param name="workbook">
        /// Workbook containing the graph contents.
        /// </param>
        ///
        /// <param name="graphMetricUserSettings">
        /// The object being edited.
        /// </param>
        ///
        /// <param name="mode">
        /// Indicates the mode in which the dialog is being used.
        /// </param>
        //*************************************************************************
        public GraphMetricsDialog(
            Microsoft.Office.Interop.Excel.Workbook workbook,
            GraphMetricUserSettings graphMetricUserSettings,
            DialogMode mode
            )
            : this()
        {
            Debug.Assert(workbook != null);
            Debug.Assert(graphMetricUserSettings != null);

            m_oWorkbook = workbook;
            m_oGraphMetricUserSettings = graphMetricUserSettings;
            m_eMode = mode;

            if (m_eMode == DialogMode.EditOnly)
            {
            this.Text += " Options";
            btnOK.Text = "OK";
            }

            // Instantiate an object that saves and retrieves the position of this
            // dialog.  Note that the object automatically saves the settings when
            // the form closes.

            m_oGraphMetricsDialogUserSettings =
            new GraphMetricsDialogUserSettings(this);

            DoDataExchange(false);

            AssertValid();
        }
Example #28
0
 public PosBaseDialogGenericTreeView(Window pSourceWindow, DialogFlags pDialogFlags, DialogMode pDialogMode, T pDataSourceRow)
     : base(pSourceWindow, pDialogFlags)
 {
     //Parameters
     _sourceWindow  = pSourceWindow;
     _dialogMode    = pDialogMode;
     _dataSourceRow = pDataSourceRow;
 }
Example #29
0
        public IMessageDialog CreateMessageDialog(string message, DialogMode dialogMode)
        {
            IMessageDialog dialog = null;

            dialog = new MessageDialog(_dialogHost, dialogMode, message, _dispatcher);

            return(dialog);
        }
Example #30
0
File: Window.cs Project: jjg0519/OA
        /// <summary>
        /// 显示窗口
        /// </summary>
        /// <typeparam name="TResult">窗口返回的结果的类型</typeparam>
        /// <param name="windowmodel">窗口模式,为<see cref="DialogMode"/></param>类型
        /// <param name="parent">窗口父容器</param>
        /// <param name="result">此参数未使用</param>
        /// <param name="close">此参数未使用</param>
        /// <param name="isResizable">窗口是否可拖拽大小</param>
        /// <param name="GUID">
        /// 窗口标识.
        /// 可根据此ID限制此窗口只能弹出一个
        /// </param>
        public void Show <TResult>(DialogMode windowmodel, FrameworkElement parent, TResult result, Action <TResult> close, bool isResizable, string GUID)
        {
            try
            {
                double height = 0;
                double width  = 0;
                try
                {
                    height = SMT.SAAS.Main.CurrentContext.AppContext.AppHost.SilverlightHostRoot.ActualHeight;
                    width  = SMT.SAAS.Main.CurrentContext.AppContext.AppHost.SilverlightHostRoot.ActualWidth;
                    //MessageBox.Show("1高:" + (height - 50) + " 宽:" + (width - 50));
                }
                catch (Exception ex)
                {
                }
                //string msg = "弹出窗内部Form指定高度:" + this.Height + "类型" + this.Height.GetType().Name + " 宽度:" + this.Width + "类型:" + this.Height.GetType().Name
                //    + "弹出窗内部Form指定最小高度:" + this.MinHeight + "类型" + this.MinHeight.GetType().Name + " 最小宽度:" + this.MinWidth + "类型" + this.MinWidth.GetType().Name
                //    + " 当前silverlight显示区高度:" + height + " 宽度:" + width;
                //SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage(msg);
                //SMT.SAAS.Main.CurrentContext.AppContext.ShowSystemMessageText();
                if (height > 0)
                {
                    if (this.MinHeight > height)
                    {
                        this.MinHeight = height - 50;
                    }
                    if (this.Height > height)
                    {
                        this.MinHeight = height - 50;
                    }
                }
                if (width > 0)
                {
                    if (this.MinWidth > width)
                    {
                        this.MinWidth = width - 50;
                    }
                    if (this.Width > width)
                    {
                        this.MinWidth = width - 50;
                    }
                }

                this._window = ProgramManager.ShowProgram(TitleContent.ToString(), string.Empty, GUID, this, isResizable, true, null);

                //MessageBox.Show("1高:" + this._window.MinHeight + " 宽:" + this._window.MinWidth);
            }
            catch (Exception ex)
            {
                SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage(ex.ToString());
                SMT.SAAS.Main.CurrentContext.AppContext.ShowSystemMessageText();
            }
            finally
            {
                //MessageBox.Show("Down");
            }
        }
Example #31
0
 public CustomContentDialog(
     IDialogHost dialogHost,
     DialogMode dialogMode,
     object content,
     Dispatcher dispatcher)
     : base(dialogHost, dialogMode, dispatcher)
 {
     SetContent(content);
 }
Example #32
0
        public AddProjectControl(ListViewItem[] UserList)
        {
            this.UserList = UserList;
            InitializeComponent();

            updateLeaderComboBoxView();

            mode = DialogMode.AddMode;
        }
		public CustomContentDialog(
			IDialogHost dialogHost, 
			DialogMode dialogMode,
			object content,
			Dispatcher dispatcher)
			: base(dialogHost, dialogMode, dispatcher)
		{
			SetContent(content);
		}
 public ICustomContentDialog CreateCustomContentDialog(object content, DialogMode dialogMode)
 {
     ICustomContentDialog dialog = null;
     InvokeInUIThread(() =>
     {
         dialog = new CustomContentDialog(_dialogHost, dialogMode, content, _dispatcher);
     });
     return dialog;
 }
 public BaseEditDialogViewModel(DialogMode mode, IDialogService dialogService, IMessageBoxService messageService)
 {
     _dc            = new Models.CRMContext();
     AllowSave      = false;
     Mode           = mode;
     DialogService  = dialogService;
     MessageService = messageService;
     SesionService.ClearCache();
 }
Example #36
0
		public IMessageDialog CreateMessageDialog(string message, DialogMode dialogMode)
		{
			IMessageDialog dialog = null;
			InvokeInUIThread(() =>
			{
				dialog = new MessageDialog(_dialogHost, dialogMode, message, _dispatcher);
			});
			return dialog;
		}
Example #37
0
        public IMessageDialog CreateMessageDialog(string message, DialogMode dialogMode)
        {
            IMessageDialog dialog = null;

            InvokeInUIThread(() =>
            {
                dialog = new MessageDialog(_dialogHost, dialogMode, message, _dispatcher);
            });
            return(dialog);
        }
Example #38
0
        public ICustomContentDialog CreateCustomContentDialog(object content, DialogMode dialogMode)
        {
            ICustomContentDialog dialog = null;

            InvokeInUIThread(() =>
            {
                dialog = new CustomContentDialog(_dialogHost, dialogMode, content, _dispatcher);
            });
            return(dialog);
        }
		private WaitProgressDialog(
			IDialogHost dialogHost,
			DialogMode dialogMode,
			bool showWaitAnimation,
			Dispatcher dispatcher)
			: base(dialogHost, dialogMode, dispatcher)
		{
			_waitProgressDialogControl = new WaitProgressDialogControl(showWaitAnimation);
			SetContent(_waitProgressDialogControl);
		}
Example #40
0
 private WaitProgressDialog(
     IDialogHost dialogHost,
     DialogMode dialogMode,
     bool showWaitAnimation,
     Dispatcher dispatcher)
     : base(dialogHost, dialogMode, dispatcher)
 {
     _waitProgressDialogControl = new WaitProgressDialogControl(showWaitAnimation);
     SetContent(_waitProgressDialogControl);
 }
Example #41
0
 public void ShowDialog(string titleText, string messageText, string rightText, string leftText, DialogType dialogType, DialogMode dialogMode = DialogMode.Normal)
 {
     Title           = titleText;
     Message         = messageText;
     RightButtonText = rightText;
     LeftButtonText  = leftText;
     DialogState     = dialogType;
     IsDialogOpen    = true;
     DialogModes     = dialogMode;
 }
Example #42
0
 public DialogConfigurationPrintersType(Window pSourceWindow, GenericTreeViewXPO pTreeView, DialogFlags pFlags, DialogMode pDialogMode, XPGuidObject pXPGuidObject)
     : base(pSourceWindow, pTreeView, pFlags, pDialogMode, pXPGuidObject)
 {
     _dialogMode = pDialogMode;
     this.Title  = Utils.GetWindowTitle(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "window_title_edit_dialogconfigurationprinterstype"));
     SetSizeRequest(500, 383);
     InitUI();
     InitNotes();
     ShowAll();
 }
Example #43
0
		public IWaitDialog CreateWaitDialog(DialogMode dialogMode)
		{
			IWaitDialog dialog = null;
			InvokeInUIThread(() =>
			{
				dialog = WaitProgressDialog.CreateWaitDialog(_dialogHost, dialogMode, _dispatcher);
				dialog.CloseWhenWorkerFinished = true;
			});
			return dialog;
		}
Example #44
0
		public IProgressDialog CreateProgressDialog(string message, DialogMode dialogMode)
		{
			IProgressDialog dialog = null;
			InvokeInUIThread(() =>
			{
				dialog = WaitProgressDialog.CreateProgressDialog(_dialogHost, dialogMode, _dispatcher);
				dialog.CloseWhenWorkerFinished = true;
				dialog.Message = message;
			});
			return dialog;
		}
		public static IProgressDialog CreateProgressDialog(
			IDialogHost dialogHost,
			DialogMode dialogMode,
			Dispatcher dispatcher)
		{
			IProgressDialog dialog = null;
			dispatcher.Invoke(
				new Action(() => dialog = new WaitProgressDialog(
					dialogHost, dialogMode, false, dispatcher)),
				DispatcherPriority.DataBind);
			return dialog;
		}
    //*************************************************************************
    //  Constructor: AutoFillWorkbookDialog()
    //
    /// <summary>
    /// Initializes a new instance of the <see cref="AutoFillWorkbookDialog" />
    /// class.
    /// </summary>
    ///
    /// <param name="mode">
    /// Indicates the mode in which the dialog is being used.
    /// </param>
    ///
    /// <param name="workbook">
    /// Workbook containing the graph data.
    /// </param>
    //*************************************************************************

    public AutoFillWorkbookDialog
    (
        DialogMode mode,
        Microsoft.Office.Interop.Excel.Workbook workbook
    )
    {
        Debug.Assert(workbook != null);

        InitializeComponent();

        m_eMode = mode;
        m_oWorkbook = workbook;

        m_oAutoFillUserSettings = new AutoFillUserSettings();

        if (m_eMode == DialogMode.EditOnly)
        {
            this.Text += " Options";
            btnAutoFill.Text = "OK";
            btnClose.Text = "Cancel";

            // The column header text "When Autofill is clicked..." makes no
            // sense when the "Autofill" button text has been changed to "OK".

            lblDestinationColumnHeader1.Text =
                lblDestinationColumnHeader2.Text =
                lblDestinationColumnHeader3.Text =
                lblDestinationColumnHeader1.Text.Replace("clicked", "run");
        }

        // Instantiate an object that retrieves and saves the position of this
        // dialog.  Note that the object automatically saves the settings when
        // the form closes.

        m_oAutoFillWorkbookDialogUserSettings =
            new AutoFillWorkbookDialogUserSettings(this);

        // Initialize the ComboBoxes used to specify the data sources for the
        // table columns.

        InitializeVertexComboBoxes(m_oWorkbook);
        InitializeEdgeComboBoxes(m_oWorkbook);
        InitializeGroupComboBoxes(m_oWorkbook);

        DoDataExchange(false);

        AssertValid();
    }
        public override void ShowAlert(View view, DialogScope dialogScope, DialogMode dialogMode)
        {
            var viewHost = GetNewDialogWindow();

            // prepare host view and viewmodel

            viewHost.HostedView = view;

            viewHost.HostedViewModel = view.ViewModel;

            view.ViewModel.InteractionCompleting += viewModel_modalInteractionCompleting;

            PrepareViewForDisplay(viewHost, view);

            viewHost.ShowDialog();
        }
    //*************************************************************************
    //  Constructor: ExportToNodeXLGraphGalleryDialog()
    //
    /// <summary>
    /// Initializes a new instance of the <see
    /// cref="ExportToNodeXLGraphGalleryDialog" /> class.
    /// </summary>
    ///
    /// <param name="mode">
    /// Indicates the mode in which the dialog is being used.
    /// </param>
    ///
    /// <param name="workbook">
    /// Workbook containing the graph data.
    /// </param>
    ///
    /// <param name="nodeXLControl">
    /// NodeXLControl containing the graph.  This can be null if <paramref
    /// name="mode" /> is <see cref="DialogMode.EditOnly" />.
    /// </param>
    //*************************************************************************

    public ExportToNodeXLGraphGalleryDialog
    (
        DialogMode mode,
        Microsoft.Office.Interop.Excel.Workbook workbook,
        NodeXLControl nodeXLControl
    )
    {
        Debug.Assert(workbook != null);
        Debug.Assert(nodeXLControl != null || mode == DialogMode.EditOnly);

        m_eMode = mode;
        m_oWorkbook = workbook;
        m_oNodeXLControl = nodeXLControl;

        m_oExportToNodeXLGraphGalleryUserSettings =
            new ExportToNodeXLGraphGalleryUserSettings();

        m_oPasswordUserSettings = new PasswordUserSettings();

        InitializeComponent();

        if (m_eMode == DialogMode.EditOnly)
        {
            InitializeForEditOnly();
        }

        lnkNodeXLGraphGallery.Tag = ProjectInformation.NodeXLGraphGalleryUrl;

        usrExportedFilesDescription.Workbook = workbook;

        lnkCreateAccount.Tag =
            ProjectInformation.NodeXLGraphGalleryCreateAccountUrl;

        // Instantiate an object that saves and retrieves the position of
        // this dialog.  Note that the object automatically saves the settings
        // when the form closes.

        m_oExportToNodeXLGraphGalleryDialogUserSettings =
            new ExportToNodeXLGraphGalleryDialogUserSettings(this);

        DoDataExchange(false);

        AssertValid();
    }
Example #49
0
		protected DialogBase(
			IDialogHost dialogHost,
			DialogMode dialogMode,
			Dispatcher dispatcher)
		{
			_dialogHost = dialogHost;
			_dispatcher = dispatcher;
			Mode = dialogMode;
			CloseBehavior = DialogCloseBehavior.AutoCloseOnButtonClick;

			OkText = "Ok";
			CancelText = "Cancel";
			YesText = "Yes";
			NoText = "No";

			switch (dialogMode)
			{
				case DialogMode.None:
					break;
				case DialogMode.Ok:
					CanOk = true;
					break;
				case DialogMode.Cancel:
					CanCancel = true;
					break;
				case DialogMode.OkCancel:
					CanOk = true;
					CanCancel = true;
					break;
				case DialogMode.YesNo:
					CanYes = true;
					CanNo = true;
					break;
				case DialogMode.YesNoCancel:
					CanYes = true;
					CanNo = true;
					CanCancel = true;
					break;
				default:
					throw new ArgumentOutOfRangeException("dialogMode");
			}

		}
        public MessageDialog(
			IDialogHost dialogHost, 
			DialogMode dialogMode,
			string message,
			Dispatcher dispatcher)
            : base(dialogHost, dialogMode, dispatcher)
        {
            InvokeUICall(() =>
                {
                    _messageTextBlock = new TextBlock
                    {
                        Text = message,
                        HorizontalAlignment = HorizontalAlignment.Center,
                        VerticalAlignment = VerticalAlignment.Center,
                        TextWrapping = TextWrapping.Wrap,
                    };
                    SetContent(_messageTextBlock);
                });
        }
    //*************************************************************************
    //  Constructor: MergeDuplicateEdgesUserSettingsDialog()
    //
    /// <summary>
    /// Initializes a new instance of the <see
    /// cref="MergeDuplicateEdgesUserSettingsDialog" /> class.
    /// </summary>
    ///
    /// <param name="mode">
    /// Indicates the mode in which the dialog is being used.
    /// </param>
    ///
    /// <param name="mergeDuplicateEdgesUserSettings">
    /// The object being edited.
    /// </param>
    ///
    /// <param name="workbook">
    /// Workbook containing the graph contents.
    /// </param>
    //*************************************************************************

    public MergeDuplicateEdgesUserSettingsDialog
    (
        DialogMode mode,
        MergeDuplicateEdgesUserSettings mergeDuplicateEdgesUserSettings,
        Microsoft.Office.Interop.Excel.Workbook workbook
    )
    {
        Debug.Assert(mergeDuplicateEdgesUserSettings != null);
        mergeDuplicateEdgesUserSettings.AssertValid();
        Debug.Assert(workbook != null);

        m_oMergeDuplicateEdgesUserSettings = mergeDuplicateEdgesUserSettings;

        // Instantiate an object that saves and retrieves the position of this
        // dialog.  Note that the object automatically saves the settings when
        // the form closes.

        m_oMergeDuplicateEdgesUserSettingsDialogUserSettings =
            new MergeDuplicateEdgesUserSettingsDialogUserSettings(this);

        InitializeComponent();

        if (mode == DialogMode.EditOnly)
        {
            this.Text += " Options";
        }

        ListObject oEdgeTable;

        if ( ExcelTableUtil.TryGetTable(workbook, WorksheetNames.Edges,
            TableNames.Edges, out oEdgeTable) )
        {
            cbxThirdColumnNameForDuplicateDetection
                .PopulateWithTableColumnNames(oEdgeTable);
        }

        DoDataExchange(false);

        AssertValid();
    }
        public LinkDialog(IEnumerable<Node> vertexes, Action<Link> callback, DialogMode dialogMode, Link link = null)
        {
            this.InitializeComponent();

            _vertexes = vertexes;
            _callback = callback;

            Vertex1CB.ItemsSource = _vertexes;
            Vertex2CB.ItemsSource = _vertexes;

            switch (dialogMode)
            {
                case DialogMode.CreationMode:

                    _link = new Link();

                    Title = "New vertex";
                    PrimaryButtonText = "Add";

                    IsTwoSidedCB.IsChecked = false;

                    break;
                case DialogMode.EditMode:

                    _link = link;

                    Title = "EditVertex";
                    PrimaryButtonText = "Save";

                    Vertex1CB.SelectedItem = _link.Node1;
                    Vertex2CB.SelectedItem = _link.Node2;
                    IsTwoSidedCB.IsChecked = _link.IsTwoSided;

                    break;
                default:
                    throw new ArgumentException("Not supported", "dialogMode");
            }
        }
    //*************************************************************************
    //  Constructor: AutomateTasksDialog()
    //
    /// <summary>
    /// Initializes a new instance of the <see cref="AutomateTasksDialog" />
    /// class.
    /// </summary>
    ///
    /// <param name="mode">
    /// Indicates the mode in which the dialog is being used.
    /// </param>
    ///
    /// <param name="thisWorkbook">
    /// Workbook containing the graph contents.
    /// </param>
    ///
    /// <param name="nodeXLControl">
    /// The NodeXLControl object.  This can be null if <paramref name="mode" />
    /// is <see cref="DialogMode.EditOnly" />.
    /// </param>
    //*************************************************************************

    public AutomateTasksDialog
    (
        DialogMode mode,
        ThisWorkbook thisWorkbook,
        NodeXLControl nodeXLControl
    )
    {
        Debug.Assert(thisWorkbook != null);
        Debug.Assert(nodeXLControl != null || mode == DialogMode.EditOnly);

        m_eMode = mode;
        m_oAutomateTasksUserSettings = new AutomateTasksUserSettings();
        m_oThisWorkbook = thisWorkbook;
        m_oNodeXLControl = nodeXLControl;
        m_bIgnoreItemCheckEvents = false;

        InitializeComponent();

        if (m_eMode == DialogMode.EditOnly)
        {
            this.Text += " Options";
            btnOK.Text = "OK";
        }

        // Instantiate an object that saves and retrieves the user settings for
        // this dialog.  Note that the object automatically saves the settings
        // when the form closes.

        m_oAutomateTasksDialogUserSettings =
            new AutomateTasksDialogUserSettings(this);

        PopulateTasksToRun();

        DoDataExchange(false);

        AssertValid();
    }
    //*************************************************************************
    //  Constructor: CreateSubgraphImagesDialog()
    //
    /// <summary>
    /// Initializes a new instance of the <see
    /// cref="CreateSubgraphImagesDialog" /> class.
    /// </summary>
    ///
    /// <param name="mode">
    /// Indicates the mode in which the dialog is being used.
    /// </param>
    ///
    /// <param name="workbook">
    /// Workbook containing the graph data.  If <paramref name="mode" /> is
    /// <see cref="DialogMode.EditOnly" />, the workbook isn't used and this
    /// parameter must be null.
    /// </param>
    ///
    /// <param name="selectedVertexNames">
    /// Collection of zero or more vertex names corresponding to the selected
    /// rows in the vertex worksheet.  If <paramref name="mode" /> is <see
    /// cref="DialogMode.EditOnly" />, the collection isn't used and this
    /// parameter must be null.
    /// </param>
    //*************************************************************************

    public CreateSubgraphImagesDialog
    (
        DialogMode mode,
        Microsoft.Office.Interop.Excel.Workbook workbook,
        ICollection<String> selectedVertexNames
    )
    {
        InitializeComponent();

        m_eMode = mode;
        m_oWorkbook = workbook;
        m_oSelectedVertexNames = selectedVertexNames;

        // Instantiate an object that saves and retrieves the user settings for
        // this dialog.  Note that the object automatically saves the settings
        // when the form closes.

        m_oCreateSubgraphImagesDialogUserSettings =
            new CreateSubgraphImagesDialogUserSettings(this);

        m_oSubgraphImageCreator = new SubgraphImageCreator();

        m_oSubgraphImageCreator.ImageCreationProgressChanged +=
            new ProgressChangedEventHandler(
                SubgraphImageCreator_ImageCreationProgressChanged);

        m_oSubgraphImageCreator.ImageCreationCompleted +=
            new RunWorkerCompletedEventHandler(
                SubgraphImageCreator_ImageCreationCompleted);

        m_eState = DialogState.Idle;

        DoDataExchange(false);

        AssertValid();
    }
Example #55
0
 private bool ShowShowAnimation(DialogMode mode)
 {
     switch (mode)
     {
         case DialogMode.Single:
             return true;
         case DialogMode.First:
             return true;
         case DialogMode.Last:
             return false;
         case DialogMode.Following:
             return false;
         default:
             throw new ArgumentOutOfRangeException("mode");
     }
 }
Example #56
0
 public abstract void ShowAlert(View view, DialogScope dialogScope, DialogMode dialogMode);
Example #57
0
	// -- Interface -- //
	public void SetActiveText( DialogMode newMode ){
		m_CurrentDialogMode = newMode;
	}
        internal NewFunctionImportDialog(
            Function baseFunction,
            string functionImportName,
            ICollection<Function> functions,
            IEnumerable<ComplexType> complexTypes,
            IEnumerable<EntityType> entityTypes,
            ConceptualEntityContainer container,
            object selectedElement)
        {
            // The dialog 3 mode:
            // - New function import: to create a new function import
            // - Full edit function import: the dialog is launched from model browser; all fields are editable
            _mode = DialogMode.New;
            _editedFunctionImport = container.FunctionImports().Where(x => x.LocalName.Value == functionImportName).FirstOrDefault();
            if (_editedFunctionImport != null)
            {
                _mode = DialogMode.FullEdit;
            }
            _functions = functions;
            _lastGeneratedStoredProc = null;
            _container = container;
            _updateSelectedComplexType = false;
            InitializeSupportedFeatures();
            InitializeComponent();
            InitializeDialogFont();

            // set tooltip on functionImportComposableCheckBox if not supported
            if (false == _composableFunctionImportFeatureState.IsEnabled())
            {
                var isComposableToolTipMsg = string.Format(
                    CultureInfo.CurrentCulture, DialogsResource.NewFunctionImportDialog_IsComposableTooltipText,
                    EntityFrameworkVersion.Version2);
                var isComposableToolTip = new ToolTip();
                isComposableToolTip.ShowAlways = true; // show even if control inactive
                isComposableToolTip.SetToolTip(functionImportComposableCheckBox, isComposableToolTipMsg);
            }

            // once the components are initialized, check the functionImportComposableCheckBox if appropriate
            if (_composableFunctionImportFeatureState.IsEnabled())
            {
                if (DialogMode.FullEdit == _mode)
                {
                    functionImportComposableCheckBox.Checked = (BoolOrNone.TrueValue == _editedFunctionImport.IsComposable.Value);
                }
                else
                {
                    Debug.Assert(_mode == DialogMode.New, "Unexpected mode");

                    functionImportComposableCheckBox.Checked = baseFunction != null && baseFunction.IsComposable.Value;
                }
            }

            // Hide the Update button/GetColumnInformation frame if this functionality isn't allowed
            if (!_getColumnInformationFeatureState.IsVisible())
            {
                updateComplexTypeButton.Visible = false;
                returnTypeShapeGroup.Visible = false;
                if (ClientSize.Height > returnTypeShapeGroup.Height)
                {
                    var newSize = new Size(Size.Width, Size.Height - returnTypeShapeGroup.Height);
                    MinimumSize = newSize;
                    Size = newSize;
                }
            }

            PopulateComboBoxes(complexTypes, entityTypes, functions);
            UpdateStateComboBoxes(selectedElement, baseFunction, functionImportName);
            SetComplexTypeTooltip();
            CheckOkButtonEnabled();
            UpdateReturnTypeComboBoxesState();
            UpdateReturnTypeInfoAreaState();
            SetCreateNewComplexTypeButtonProperties();

            if (components == null)
            {
                components = new Container();
            }
            // Since Visual Studio has already defined Dispose method in the generated file(designer.cs),
            // we instantiates Diposer class that calls our custom dispose method when Form is disposed.
            components.Add(new Disposer(OnDispose));
        }
Example #59
0
		public NewProjectDlg(DialogMode NewProjectDialogMode)
		{
			DataContext = this;
			InitializeComponent();

			if (List_Languages.Items.Count > 0)
				List_Languages.SelectedIndex = 0;

			if (List_FileTypes.Items.Count > 0)
			{
				_FileType = List_FileTypes.Items[0] as FileTemplate;
				List_FileTypes.SelectedIndex = 0;
			}

			NewProjectDlgMode = NewProjectDialogMode;
		}
 public DialogEventArgs(DialogMode dialogMode)
 {
     DialogMode = dialogMode;
 }