Inheritance: MonoBehaviour
        /// <summary>
        /// Loads the height data.
        /// </summary>
        private void LoadHeightData()
        {
            this.tm = new TerrainModel();

            DateTime dtStart = DateTime.Now;

            //tm.LoadXYZFile(@"D:\BigData\SRTM Tiles Germany\srtm_38_03.xyz");
            this.tm.LoadXYZFile(@"C:\Lanser\BigData\SRTM Tiles Germany\srtm_38_03.xyz");
            DateTime dtStop = DateTime.Now;

            GMapPolygon polygon = new GMapPolygon(new List <PointLatLng>
            {
                new PointLatLng(this.tm.YMin, this.tm.XMin),
                new PointLatLng(this.tm.YMax, this.tm.XMin),
                new PointLatLng(this.tm.YMax, this.tm.XMax),
                new PointLatLng(this.tm.YMin, this.tm.XMax)
            });

            this.mcMapControl.Markers.Add(polygon);

            MB.Information($"Time: {( dtStop - dtStart ).ToHHMMSSString()} / Points: {this.tm.PointCount}");

            GC.WaitForPendingFinalizers();
            GC.Collect();
        }
Ejemplo n.º 2
0
        protected override bool ChampsValides()
        {
            string no_dossier = "";

            if (m_typeDeSaisie == TypeDeSaisie.Ajout)
            {
                no_dossier = Document.PREFIXE_POSTE + " " + DateTime.Now.ToString("yyyyMMdd") + "-" + Document.Instance.NumProchainDossier().ToString().PadLeft(3, '0');
            }
            CodeStatut  codeStatut  = (CodeStatut)comboBoxStatut.SelectedItem;
            Statut      statut      = new Statut(no_dossier, DateNow(), codeStatut, LoggedUser.compte.Matricule);
            Destination destination = new Destination(DateNow(), CodeDestination.RED, "", (m_typeDeSaisie == TypeDeSaisie.Modification) ? m_dossier.Numero : no_dossier, LoggedUser.compte.Matricule);

            if (m_dossier.RapportEvenement == null && m_dossier.RapportAccident == null)
            {
                MB.AvertirCritique("Au moins un rapport (Évenement ou Accident) doit être lié au dossier.");
                return(false);
            }

            m_dossier = new Dossier((m_typeDeSaisie == TypeDeSaisie.Modification) ? m_dossier.Numero : no_dossier, (m_dossier.Statut == null) ? statut : m_dossier.Statut,
                                    m_dossier.RapportAccident, m_dossier.RapportEvenement, m_dossier.RapportEnquete,
                                    (m_dossier.Destination == null) ? destination : m_dossier.Destination, m_dossier.Vehicules, m_dossier.Personnes);

            EnregistrerEtiquete(m_dossier.Numero, LoggedUser.compte.Matricule);
            return(true);
        }
Ejemplo n.º 3
0
        protected override bool ChampsValides() // Appelé d'un template method, mais est aussi un TM !
        {
            string motif;

            if (string.IsNullOrEmpty(textBoxMotif.Text) && comboBoxMotifs.SelectedIndex == -1)
            {
                MB.Avertir("Choisir une option de motif ou en saisir un nouveau");
                return(false);
            }

            if (!string.IsNullOrEmpty(textBoxMotif.Text))
            {
                string motifFormaté = Char.ToUpper(textBoxMotif.Text[0]) + textBoxMotif.Text.Substring(1).ToLower();
                motif = motifFormaté;
                Document.Instance.AjouterMotif(motifFormaté);
            }

            else
            {
                motif = comboBoxMotifs.SelectedItem.ToString();
            }

            string tailleEtForme = StringAvecLongueurMinimum(textBoxTailleEtForme, 1, "Taille et forme");

            DateTime?parution = dateTimeParution.Checked ? dateTimeParution.Value : (DateTime?)null;

            double?prixPayé = DoubleAvecMinimumOuNull(textBoxPrixPayé, 0.0, "Prix payé");

            // S'il y en avait beaucoup, il faudrait probablement créer un BaseDeArticlePhilatélique

            return(FinirValidation(motif, tailleEtForme, parution, prixPayé)); // TM...
        }
        /// <summary>
        /// Constructeur pour le dialogue Saisie Compte
        /// </summary>
        /// <param name="p_typeSaisie">type d'operation</param>
        /// <param name="p_grade">grade de l'utilisateur</param>
        public DlgSaisieCompte(TypeDeSaisie p_typeSaisie, Grade p_grade, Compte p_compte = null)
            : base(p_typeSaisie, p_grade, p_compte)
        {
            InitializeComponent();

            m_typeSaisie = p_typeSaisie;
            m_compte     = p_compte;
            if (p_compte == null && (p_typeSaisie == TypeDeSaisie.Modification ||
                                     p_typeSaisie == TypeDeSaisie.Affichage))
            {
                this.Close();
            }

            if (p_grade != Grade.Capitaine && (p_typeSaisie == TypeDeSaisie.Modification ||
                                               p_typeSaisie == TypeDeSaisie.Ajout))
            {
                MB.Avertir("Vous n\'etes pas autorisés à acceder à cette section");
                this.Close();
            }

            switch (p_typeSaisie)
            {
            case TypeDeSaisie.Ajout: Text = "Ajout d\'un nouveau compte utilisateur"; break;

            case TypeDeSaisie.Modification: Text = "Modification d\'un compte utilisateur"; break;

            case TypeDeSaisie.Affichage: Text = "Information sur le compte #" + p_compte.Matricule; break;
            }
        }
Ejemplo n.º 5
0
 protected void OnMBHelp_Click(object sender, MB mn)
 {
     if (MBHelp_Click != null)
     {
         MBHelp_Click(sender, new MBClickEventArgs(mn));
     }
 }
Ejemplo n.º 6
0
        private static MB GetMessageBoxStyle(IWin32Window owner, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, bool showHelp)
        {
            SourceGenerated.EnumValidator.Validate(buttons, nameof(buttons));
            SourceGenerated.EnumValidator.Validate(icon, nameof(icon));
            SourceGenerated.EnumValidator.Validate(defaultButton, nameof(defaultButton));

            // options intentionally not verified because we don't expose all the options Win32 supports.

            if (!SystemInformation.UserInteractive && (options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) == 0)
            {
                throw new InvalidOperationException(SR.CantShowModalOnNonInteractive);
            }

            if (owner is not null && (options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) != 0)
            {
                throw new ArgumentException(SR.CantShowMBServiceWithOwner, nameof(options));
            }

            if (showHelp && (options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) != 0)
            {
                throw new ArgumentException(SR.CantShowMBServiceWithHelp, nameof(options));
            }

            MB style = (showHelp) ? MB.HELP : 0;

            style |= (MB)buttons | (MB)icon | (MB)defaultButton | (MB)options;
            return(style);
        }
 public void Back()
 {
     Menu.SetActive(true);
     TB.SetActive(false);
     DB.SetActive(false);
     MB.SetActive(false);
 }
Ejemplo n.º 8
0
 private void Edit(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrWhiteSpace(TbName.Text))
     {
         MB.MessageBoxInfo("Введите наименование отдела");
         TbName.Focus();
     }
     else if (string.IsNullOrWhiteSpace(TbDaysWorking.Text))
     {
         MB.MessageBoxInfo("Введите рабочие дни");
         TbDaysWorking.Focus();
     }
     else if (string.IsNullOrWhiteSpace(TbTimeWorking.Text))
     {
         MB.MessageBoxInfo("Введите время работы");
         TbTimeWorking.Focus();
     }
     else if (string.IsNullOrWhiteSpace(TbTotalAmount.Text))
     {
         MB.MessageBoxInfo("Введите общее количество мест");
         TbTotalAmount.Focus();
     }
     else
     {
         try
         {
             DataService.GetContext().SaveChanges();
             MB.MessageBoxInfo("Вы успешно изменили отдел");
         }
         catch (Exception ex)
         {
             MB.MessageBoxError(ex.Message);
         }
     }
 }
Ejemplo n.º 9
0
        //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------


        /// <summary>
        /// Handles the UnhandledException event of the CurrentDomain control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="UnhandledExceptionEventArgs"/> instance containing the event data.</param>
        private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            if (e.ExceptionObject is Exception)
            {
                MB.Error(e.ExceptionObject as Exception);
            }
        }
Ejemplo n.º 10
0
        private void MouseDrag(MB button)
        {
            use = true;

            if (!ASUI.MouseOver(area))
            {
                return;
            }
            var deltaV = ASUI.mousePositionRef - oldPos;

            //deltaV = deltaV.Divide(areaSize);
            //deltaV = Vector2.Scale(deltaV, new Vector2(rulerLength, 0));
            switch (button)
            {
            case MB.Left:

                //lx = ASUI.mousePositionRef.x - area.anchoredPosition.x;
                //lx = lx / area.rect.width;
                //lx = Mathf.Clamp01(lx);
                //frameIdx = (int)startPos.x + Mathf.RoundToInt(lx * rulerLength);
                break;

            case MB.Right:

                break;

            case MB.Middle:

                startPos -= deltaV;
                break;

            default: throw null;
            }
            oldPos = ASUI.mousePositionRef;
        }
 private void Add(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrWhiteSpace(TbLogin.Text))
     {
         MB.MessageBoxInfo("Введите логин");
         TbLogin.Focus();
     }
     else if (string.IsNullOrWhiteSpace(TbPassword.Text))
     {
         MB.MessageBoxInfo("Введите пароль");
         TbPassword.Focus();
     }
     else if (string.IsNullOrWhiteSpace(CbRole.Text))
     {
         MB.MessageBoxInfo("Выберите роль");
         CbRole.Focus();
     }
     else
     {
         try
         {
             DataService.GetContext().User.Add(user);
             DataService.GetContext().SaveChanges();
             MB.MessageBoxInfo("Пользователь успешно добавлен");
         }
         catch
         {
             MB.MessageBoxError("Ошибка подключения к базе данных");
         }
     }
 }
Ejemplo n.º 12
0
        /// <summary>
        /// Deletes the RFDevices.
        /// </summary>
        private void DeleteRFDevices()
        {
            if (this.dgRFDevices.SelectedItems.Count == 0)
            {
                MB.Information("No RFDevice Is Selected In The DataGrid!");
                return;
            }

            List <RFDeviceViewModel> list = new List <RFDeviceViewModel>(this.dgRFDevices.SelectedItems.Count);

            foreach (var item in this.dgRFDevices.SelectedItems)
            {
                list.Add(item as RFDeviceViewModel);
            }

            list.ForEach(DeleteRFDevice);

            //var lDelete =new List<RFDeviceViewModel>( dgRFDevices.SelectedItems);
            //            foreach( RFDeviceViewModel device in .ToList() )
            //            {
            //                DeleteRFDevice( device );
            //            }

            //foreach (RFDeviceViewModel device in (from devicemodel in this.RFDevicesCollection where devicemodel.IsMarked == true select devicemodel).ToList())
            //{
            //    DeleteRFDevice(device);
            //}
        }
Ejemplo n.º 13
0
 private void Exit(object sender, RoutedEventArgs e)
 {
     if (MB.MessageBoxQuestion("Вы действительно хотите выйти?"))
     {
         App.Current.Shutdown();
     }
 }
Ejemplo n.º 14
0
 protected void OnCMFilter_Click(object sender, MB mn)
 {
     if (CMFilter_Click != null)
     {
         CMFilter_Click(sender, new MBClickEventArgs(mn));
     }
 }
Ejemplo n.º 15
0
        /// <summary>
        /// Loads the templates.
        /// </summary>
        /// <param name="strFilename">The string filename.</param>
        private void LoadTemplates(string strFilename)
        {
            this.Cursor = Cursors.Wait;

            ClearTemplates();

            try
            {
                XDocument xdoc = XDocument.Load(strFilename);

                foreach (XElement eTemplate in xdoc.Root.Elements("RFDevice"))
                {
                    RFDevice device = RFDevice.FromXml(eTemplate);

                    if (device != null)
                    {
                        this.RFDeviceTemplateCollection.Add(new RFDeviceTemplate(device));
                    }
                }
            }
            catch (Exception ex)
            {
                MB.Error(ex);
            }

            this.Cursor = Cursors.Arrow;
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Saves the templates.
        /// </summary>
        /// <param name="strFilename">The string filename.</param>
        private void SaveTemplates(string strFilename)
        {
            this.Cursor = Cursors.Wait;

            try
            {
                XElement eSIGENCEScenarioTemplates = new XElement("SIGENCEScenarioTemplates", new XAttribute("Version", Tool.Version));

                //-------------------------------------------------------------

                foreach (RFDevice d in from template in this.RFDeviceTemplateCollection select template)
                {
                    if (d.PrimaryKey != Guid.Empty)
                    {
                        eSIGENCEScenarioTemplates.Add(d.ToXml());
                    }
                }

                //-------------------------------------------------------------

                eSIGENCEScenarioTemplates.SaveDefault(strFilename);

                MB.Information("{0}\nsuccessfully saved.", strFilename);
            }
            catch (Exception ex)
            {
                MB.Error(ex);
            }

            this.Cursor = Cursors.Arrow;
        }
Ejemplo n.º 17
0
        //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------


        /// <summary>
        /// Sends the RFDeviceList via UDP to any connect client.
        /// This function is not asynchron, so the main thread is blocked when sending data.
        /// Maybe in oen of the next versions me make this function asynchron.
        /// </summary>
        /// <param name="devicelist">The devicelist.</param>
        private void SendDataUDP(RFDeviceList devicelist)
        {
            try
            {
                using (Socket sender = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp))
                {
                    IPEndPoint endpoint = new IPEndPoint(IPAddress.Parse(this.settings.UDPHost), this.settings.UDPPortSending);

                    foreach (RFDevice device in devicelist)
                    {
                        XElement eDevice = device.ToXml();

                        byte[] baMessage = Encoding.Default.GetBytes(eDevice.ToDefaultString());

                        sender.SendTo(baMessage, endpoint);

                        // Give the poor client some time to process the data when he need or bleed ...
                        if (this.settings.UDPDelay > 0)
                        {
                            Thread.Sleep(this.settings.UDPDelay);
                        }
                    }

                    sender.Close();
                }
            }
            catch (Exception ex)
            {
                MB.Error(ex);
            }
        }
Ejemplo n.º 18
0
        private void RecoveryPassword(object sender, RoutedEventArgs e)
        {
            var employee = DataService.GetContext().Employee.FirstOrDefault(emp => emp.Email == TbEmail.Text);

            if (string.IsNullOrWhiteSpace(TbEmail.Text))
            {
                MB.MessageBoxInfo("Введите почту");
                TbEmail.Focus();
            }
            else if (employee.User == null)
            {
                MB.MessageBoxInfo("Пользователя с данной почтой не существует");
            }
            else
            {
                try
                {
                    string login    = employee.User.Login;
                    string password = employee.User.Password;
                    string email    = "*****@*****.**";
                    var    client   = new SmtpClient("smtp.mail.ru", 25);
                    client.Credentials = new NetworkCredential(email, "WASD1337");
                    client.EnableSsl   = true;
                    client.Send(email, TbEmail.Text, "Ваши данные учетной записи \"PersonnelDepartment\": ", $"Логин: {login}\nПароль: {password}");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Handles the Click event of the Button_LoadScenario control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void Button_LoadScenario_Click(object sender, RoutedEventArgs e)
        {
            //var dlg = new Windows.MainWindow.MainWindow();

            //dlg.LoadFile(@"C:\Lanser\Entwicklung\GitRepositories\SIGENCE-Scenario-Tool\Examples\TestScenario.stf");
            //dlg.ShowDialog();
            MB.NotYetImplemented();
        }
        /// <summary>
        /// Executes the specified string content.
        /// </summary>
        /// <param name="strContent">Content of the string.</param>
        private void Execute(string strContent)
        {
            this.Cursor = Cursors.Wait;

            this.LastOutput = "";
            //ExecutionTime = "-";

            try
            {
                //TODO: Hier muss natrülich ein eigener TextWriter her der das dann direkt in die
                //      TextBox schreibt, das hier ist nur für das schnelle MockUp sinnvoll ...
                using (StringWriter sw = new StringWriter())
                {
                    DateTime dtStarted = DateTime.Now;
                    sw.WriteLine("[{0}] Execution Started ...", dtStarted.Fmt_DD_MM_YYYY_HH_MM_SS());
                    //Console.SetOut(TextWriter.Synchronized(sw));
                    Console.SetOut(sw);

                    ScriptEngine engine = Python.CreateEngine();
                    ScriptScope  scope  = engine.CreateScope();

                    // Hier nur die Devices übergeben, aber nicht das komplette MainWindow ...
                    scope.SetVariable("devices", this.mw.RFDeviceViewModelCollection);

                    engine.Runtime.IO.RedirectToConsole();

                    engine.Execute(strContent, scope);

                    //MB.Information(sw.ToString());
                    DateTime dtStopped = DateTime.Now;
                    this.ExecutionTime = (dtStopped - dtStarted).ToShortString();

                    sw.WriteLine("[{0}] Execution Ended ...", dtStopped.Fmt_DD_MM_YYYY_HH_MM_SS());
                    sw.WriteLine("[{0}] Execution Time: {1}", DateTime.Now.Fmt_DD_MM_YYYY_HH_MM_SS(), this.ExecutionTime);

                    this.LastOutput = sw.ToString();

                    // Hier kann man nun die erzeugten Variablen abfragen ...
                    //StringBuilder sb = new StringBuilder();
                    //foreach (String strVariable in scope.GetVariableNames())
                    //{
                    //    sb.AppendLine(strVariable);
                    //    //var r = scope.GetVariable(strVariable);
                    //    //sb.AppendLine("{0}",strVariable,r. );
                    //}

                    //MB.Information(sb.ToString());
                }
            }
            catch (Exception ex)
            {
                MB.Error(ex);
            }

            this.tecTextEditorControl.Focus();

            this.Cursor = Cursors.Arrow;
        }
Ejemplo n.º 21
0
        // Complete
        private string CalendarCondition()
        {
            StringBuilder sb = new StringBuilder(sSTX, 2000);

            int[] cpi = GetTextLengths(out int itemCount, out int totalChars);
            for (int i = 0; i < itemCount; i++)
            {
                if (cpi[i] > 0)
                {
                    int calCount = MB.GetDecAttribute(ccPF.Number_of_Calendar_Blocks, i);
                    if (calCount > 0)
                    {
                        int n = MB.GetDecAttribute(ccPF.First_Calendar_Block, i);
                        for (int j = 0; j < calCount; j++)
                        {
                            int             index = n + j - 1;
                            Section <ccCal> cs    = new Section <ccCal>(MB, ccCal.Offset_Year, index, 32, true);
                            string[]        cc    = new string[4];
                            sb.Append(sDLE + (char)('1' + i));

                            sb.Append(sESC2);
                            sb.Append(cs.Get(ccCal.Offset_Year, index, 2));
                            sb.Append(cs.Get(ccCal.Offset_Month, index, 2));
                            sb.Append(cs.Get(ccCal.Offset_Day, index, 4));
                            sb.Append(cs.Get(ccCal.Offset_Hour, index, 3));
                            sb.Append(cs.Get(ccCal.Offset_Minute, index, 3));

                            sb.Append(sESC2);
                            sb.Append(cs.Get(ccCal.Substitute_Year, index, 1));
                            sb.Append(cs.Get(ccCal.Substitute_Month, index, 1));
                            sb.Append(cs.Get(ccCal.Substitute_Day, index, 1));
                            sb.Append(cs.Get(ccCal.Substitute_Hour, index, 1));
                            sb.Append(cs.Get(ccCal.Substitute_Minute, index, 1));
                            sb.Append(cs.Get(ccCal.Substitute_Weeks, index, 1));
                            sb.Append(cs.Get(ccCal.Substitute_DayOfWeek, index, 1));

                            sb.Append(sESC2);
                            sb.Append(cs.Get(ccCal.Zero_Suppress_Year, index, 1));
                            sb.Append(cs.Get(ccCal.Zero_Suppress_Month, index, 1));
                            sb.Append(cs.Get(ccCal.Zero_Suppress_Day, index, 1));
                            sb.Append(cs.Get(ccCal.Zero_Suppress_Hour, index, 1));
                            sb.Append(cs.Get(ccCal.Zero_Suppress_Minute, index, 1));
                            sb.Append(cs.Get(ccCal.Zero_Suppress_Weeks, index, 1));
                            sb.Append(cs.Get(ccCal.Zero_Suppress_DayOfWeek, index, 1));

                            sb.Append(sESC2);
                            sb.Append("0");         // We do not have SOP-05

                            sb.Append(sESC2);
                            sb.Append(cs.Get(ccCal.Substitute_Rule, index, 2));
                        }
                    }
                }
            }

            return(sb.Append(sETX).ToString());
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Menu element : Modifier le mot de passe
        /// </summary>
        private void modifierMotDePasseToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DlgResetPass rp = new DlgResetPass();

            if (rp.ShowDialog() == DialogResult.OK)
            {
                MB.Avertir("Votre mot de passe a été modifié");
            }
        }
Ejemplo n.º 23
0
        private static DialogResult ShowCore(IWin32Window owner, string text, string caption,
                                             MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton,
                                             MessageBoxOptions options, bool showHelp)
        {
            MB style = GetMessageBoxStyle(owner, buttons, icon, defaultButton, options, showHelp);

            IntPtr handle = IntPtr.Zero;

            if (showHelp || ((options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) == 0))
            {
                if (owner is null)
                {
                    handle = GetActiveWindow();
                }
                else
                {
                    handle = Control.GetSafeHandle(owner);
                }
            }

            IntPtr userCookie = IntPtr.Zero;

            if (Application.UseVisualStyles)
            {
                // CLR4.0 or later, shell32.dll needs to be loaded explicitly.
                if (Kernel32.GetModuleHandleW(Libraries.Shell32) == IntPtr.Zero)
                {
                    if (Kernel32.LoadLibraryFromSystemPathIfAvailable(Libraries.Shell32) == IntPtr.Zero)
                    {
                        int lastWin32Error = Marshal.GetLastWin32Error();
                        throw new Win32Exception(lastWin32Error, string.Format(SR.LoadDLLError, Libraries.Shell32));
                    }
                }

                // Activate theming scope to get theming for controls at design time and when hosted in browser.
                // NOTE: If a theming context is already active, this call is very fast, so shouldn't be a perf issue.
                userCookie = ThemingScope.Activate(Application.UseVisualStyles);
            }

            Application.BeginModalMessageLoop();
            try
            {
                return((DialogResult)MessageBoxW(new HandleRef(owner, handle), text, caption, style));
            }
            finally
            {
                Application.EndModalMessageLoop();
                ThemingScope.Deactivate(userCookie);

                // Right after the dialog box is closed, Windows sends WM_SETFOCUS back to the previously active control
                // but since we have disabled this thread main window the message is lost. So we have to send it again after
                // we enable the main window.
                User32.SendMessageW(new HandleRef(owner, handle), User32.WM.SETFOCUS);
            }
        }
Ejemplo n.º 24
0
        public static bool TryQueryEntitiesAndIndex <T>
            (this EntitiesDB entitiesDb, EGID entityGID, out uint index, out MB <T> array)
            where T : struct, IEntityViewComponent
        {
            if (entitiesDb.QueryEntitiesAndIndexInternal <T>(entityGID, out index, out array) == true)
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 25
0
 internal static extern bool WTSSendMessage(
     IntPtr hServer,
     [MarshalAs(UnmanagedType.I4)] int sessionId,
     string pTitle,
     [MarshalAs(UnmanagedType.U4)] int titleLength,
     string pMessage,
     [MarshalAs(UnmanagedType.U4)] int messageLength,
     [MarshalAs(UnmanagedType.U4)] MB style,
     [MarshalAs(UnmanagedType.U4)] int timeout,
     [MarshalAs(UnmanagedType.U4)] out int pResponse,
     bool bWait);
        /// <summary>
        /// Opens the file.
        /// </summary>
        /// <param name="strInputFilename">The string input filename.</param>
        internal void LoadFile(string strInputFilename)
        {
            this.Cursor = Cursors.Wait;

            this.CurrentFile = strInputFilename;

            try
            {
                XDocument xdoc = XDocument.Load(strInputFilename);

                //---------------------------------------------------------

                XElement eGeneralSettings = xdoc.Root.Element("GeneralSettings");
                this.Zoom = eGeneralSettings.GetDoubleFromNode("Zoom") ?? this.Zoom;
                //ShowCenter = eGeneralSettings.GetBoolFromNode("ShowCenter") ?? ShowCenter;
                //this.ScenarioDescription = eGeneralSettings.GetStringFromCData( "ScenarioDescription" );

                string strMapProvider = eGeneralSettings.GetStringFromNode("MapProvider") ?? this.MapProvider.Name;
                this.MapProvider = GetProviderFromString(strMapProvider);

                XElement eCenterPosition = eGeneralSettings.Element("CenterPosition");
                this.Latitude  = eCenterPosition.GetDoubleFromNodePoint("Latitude") ?? this.Latitude;
                this.Longitude = eCenterPosition.GetDoubleFromNodePoint("Longitude") ?? this.Longitude;

                //---------------------------------------------------------

                // Create not an new instance, only load the data into the existing one ...
                this.MetaInformation.LoadFromXml(xdoc.Root);

                // Ist ja noch nix passiert ...
                this.DescriptionMarkdownChanged   = false;
                this.DescriptionStylesheetChanged = false;

                //this.tecDescription.Text = this.MetaInformation.Description;
                //this.tecStyleSheet.Text = this.MetaInformation.Stylesheet;

                //---------------------------------------------------------

                XElement eRFDeviceCollection = xdoc.Root.Element("RFDeviceCollection");

                foreach (XElement e in eRFDeviceCollection.Elements())
                {
                    AddRFDevice(RFDevice.FromXml(e));
                }

                AddFileHistory(strInputFilename);
            }
            catch (Exception ex)
            {
                MB.Error(ex);
            }

            this.Cursor = Cursors.Arrow;
        }
Ejemplo n.º 27
0
        // Complete
        private string LineSetting()
        {
            int[] cpi = GetTextLengths(out int itemCount, out int charCount);   //

            int        layout  = MB.GetDecAttribute(ccPF.Format_Setup);         // Message Layout
            int        n       = 0;
            List <int> rows    = new List <int>();                              // Holds the number of rows in each column
            List <int> spacing = new List <int>();                              // Holds the line spacing
            List <int> dups    = new List <int>();                              // Adjacent duplicate columns
            int        lc;                                                      // Line count
            int        ls;                                                      // Line spacing

            while (n < itemCount)                                               // Read all columns
            {
                Section <ccPF> pf = new Section <ccPF>(MB, ccPF.Line_Count, ccPF.Prefix_Code, n, true);
                lc = pf.GetDecAttribute(ccPF.Line_Count, n);                    // Number of lines for this column
                ls = pf.GetDecAttribute(ccPF.Line_Spacing, n);                  // Spacing between lines
                if (cpi[n] == 0)
                {
                    rows.Add(lc);                                               // Create a single entry for all remaining
                    spacing.Add(ls);
                    dups.Add((itemCount - n) / lc);
                    n = itemCount;
                }
                else
                {
                    if (rows.Count > 0 &&                                       // Is this a dup of previous column
                        rows[rows.Count - 1] == lc &&
                        spacing[spacing.Count - 1] == ls)
                    {
                        dups[dups.Count - 1]++;                                 // Just up the count
                    }
                    else
                    {
                        rows.Add(lc);                                           // Create a new entry
                        spacing.Add(ls);
                        dups.Add(1);
                    }
                    n += lc;                                                    // Move on to the next column
                }
            }

            StringBuilder sb = new StringBuilder(sSTX, 2000);

            sb.Append(sESC2);                                                   // Send Header
            sb.AppendFormat("{0:D1}", layout);
            for (int i = 0; i < rows.Count; i++)
            {
                sb.Append(sESC2);                                               // Send column info
                sb.Append(((char)(dups[i] + '0')).ToString());                  // 0x31 to 0x94
                sb.Append(((char)(rows[i] + '0')).ToString());
            }
            return(sb.Append(sETX).ToString());
        }
Ejemplo n.º 28
0
 public void Enable(MB mn, bool state)
 {
     tsMB[(int)mn].Enabled = state;
     if (isCMSTP(mn))
     {
         cmsTP[(int)mn - (int)CMS_TP.MBE_copy].Enabled = state;
     }
     if (isCMSBW(mn))
     {
         cmsBW[(int)mn - (int)CMS_BW.MBR_add].Enabled = state;
     }
 }
Ejemplo n.º 29
0
        /// <summary>
        /// Sends the data UDP.
        /// </summary>
        private void SendDataUDP()
        {
            RFDeviceList devicelist = GetDeviceList();

            if (devicelist.Count == 0)
            {
                MB.Warning("No Selected RFDevice Avaible For Sending!");
                return;
            }

            SendDataUDP(devicelist);
        }
Ejemplo n.º 30
0
 public void Indeterminate(MB mn)
 {
     tsMB[(int)mn].CheckState = CheckState.Indeterminate;
     if (isCMSTP(mn))
     {
         cmsTP[(int)mn - (int)CMS_TP.MBE_copy].CheckState = CheckState.Indeterminate;
     }
     if (isCMSBW(mn))
     {
         cmsBW[(int)mn - (int)CMS_BW.MBR_add].CheckState = CheckState.Indeterminate;
     }
 }
Ejemplo n.º 31
0
 public static extern bool MessageBeep(
     MB BeepType
     );
Ejemplo n.º 32
0
 public void Enable(MB mn, bool state) { tsMB[(int)mn].Enabled = state; }
Ejemplo n.º 33
0
 public void Checked(MB mn, bool state) { tsMB[(int)mn].Checked = state; tsMB[(int)mn].CheckState = state ? CheckState.Checked : CheckState.Unchecked; }
Ejemplo n.º 34
0
 public void Indeterminate(MB mn) { tsMB[(int)mn].CheckState = CheckState.Indeterminate; }
Ejemplo n.º 35
0
 public void Checked(MB mn, bool state)
 {
     tsMB[(int)mn].Checked = state;
     tsMB[(int)mn].CheckState = state ? CheckState.Checked : CheckState.Unchecked;
     if (isCMSTP(mn))
     {
         cmsTP[(int)mn - (int)CMS_TP.MBE_copy].Checked = state;
         cmsTP[(int)mn - (int)CMS_TP.MBE_copy].CheckState = state ? CheckState.Checked : CheckState.Unchecked;
     }
     if (isCMSBW(mn))
     {
         cmsBW[(int)mn - (int)CMS_BW.MBR_add].Checked = state;
         cmsBW[(int)mn - (int)CMS_BW.MBR_add].CheckState = state ? CheckState.Checked : CheckState.Unchecked;
     }
 }
Ejemplo n.º 36
0
 protected void OnMBHelp_Click(object sender, MB mn) { if (MBHelp_Click != null) MBHelp_Click(sender, new MBClickEventArgs(mn)); }
Ejemplo n.º 37
0
 bool isCMSTP(MB mn) { return (mn >= MB.MBE_copy && mn < MB.MBR_add); }
Ejemplo n.º 38
0
 bool isCMSBW(MB mn) { return (mn >= MB.MBR_add && mn < MB.MBT_fnvHash); }
Ejemplo n.º 39
0
 public void Enable(MB mn, bool state)
 {
     tsMB[(int)mn].Enabled = state;
     if (isCMSTP(mn)) cmsTP[(int)mn - (int)CMS_TP.MBE_copy].Enabled = state;
     if (isCMSBW(mn)) cmsBW[(int)mn - (int)CMS_BW.MBR_add].Enabled = state;
 }
Ejemplo n.º 40
0
 public static extern bool WTSSendMessage(
         IntPtr hServer,
         uint   SessionId,
         string pTitle,
         uint   TitleLength,
         string pMessage,
         uint   MessageLength,
         MB     Style,
         uint   Timeout,
     out ID     pResponse,
         bool   bWait
 );
Ejemplo n.º 41
0
 public void Indeterminate(MB mn)
 {
     tsMB[(int)mn].CheckState = CheckState.Indeterminate;
     if (isCMSTP(mn)) cmsTP[(int)mn - (int)CMS_TP.MBE_copy].CheckState = CheckState.Indeterminate;
     if (isCMSBW(mn)) cmsBW[(int)mn - (int)CMS_BW.MBR_add].CheckState = CheckState.Indeterminate;
 }
Ejemplo n.º 42
0
 protected void OnCMFilter_Click(object sender, MB mn) { if (CMFilter_Click != null) CMFilter_Click(sender, new MBClickEventArgs(mn)); }
Ejemplo n.º 43
0
 public bool IsChecked(MB mn) { return tsMB[(int)mn].Checked; }
Ejemplo n.º 44
0
 public class MBClickEventArgs : EventArgs { public readonly MB mn; public MBClickEventArgs(MB mn) { this.mn = mn; } }