public MulticastMessageEditWindow(Tag tag, string comment, AmoebaManager amoebaManager)
        {
            _tag = tag;
            _amoebaManager = amoebaManager;

            _digitalSignatureCollection.AddRange(Settings.Instance.Global_DigitalSignatures.ToArray());

            InitializeComponent();

            this.Title = LanguagesManager.Instance.MulticastMessageEditWindow_Title + " - " + MessageConverter.ToTagString(tag);

            {
                var icon = new BitmapImage();

                icon.BeginInit();
                icon.StreamSource = new FileStream(Path.Combine(_serviceManager.Paths["Icons"], "Amoeba.ico"), FileMode.Open, FileAccess.Read, FileShare.Read);
                icon.EndInit();
                if (icon.CanFreeze) icon.Freeze();

                this.Icon = icon;
            }

            _signatureComboBox.ItemsSource = _digitalSignatureCollection;
            _signatureComboBox.SelectedIndex = 0;

            _commentTextBox.Text = comment;

            _watchTimer = new WatchTimer(this.WatchThread, 0, 1000);
            this.Closed += (sender, e) => _watchTimer.Dispose();

            _textEditor_Helper.Setup(_textEditor);
        }
예제 #2
0
        public static int getProxID()
        {
            try
            {

                DataSet ds = ExecuteQuery("Select t.* from Tage where t.Cod_tag like (select MAX(Cod_tag) from Tag)", getConnection(true));
                DataRow row = ds.Tables[0].Rows[0];
                Tag t= new Tag(row);
                return t.CODTAG + 1;
            }
            catch (Exception e)
            {
                throw new ApplicationException("ErroBD", e);
            }
        }
예제 #3
0
        public static string ToInfoMessage(Tag tag)
        {
            try
            {
                var builder = new StringBuilder();

                if (!string.IsNullOrWhiteSpace(tag.Name)) builder.AppendLine(string.Format("{0}: {1}", LanguagesManager.Instance.Tag_Name, tag.Name));
                if (tag.Id != null) builder.AppendLine(string.Format("{0}: {1}", LanguagesManager.Instance.Tag_Id, NetworkConverter.ToBase64UrlString(tag.Id)));

                if (builder.Length != 0) return builder.ToString().Remove(builder.Length - 2);
                else return null;
            }
            catch (Exception e)
            {
                throw new ArgumentException("ArgumentException", e);
            }
        }
예제 #4
0
        public static IList LoadAll()
        {
            try
            {

                DataSet ds = ExecuteQuery("Select * From Tag", getConnection(true));
                IList list = new ArrayList();

                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    Tag t = new Tag(row);
                    list.Add(t);
                }
                return list;

            }
            catch (Exception e)
            {
                throw new ApplicationException("ErroBD", e);
            }
        }
예제 #5
0
        public static string ToTagString(Tag tag)
        {
            if (tag.Name == null || tag.Id == null) return null;

            try
            {
                return tag.Name + " - " + NetworkConverter.ToBase64UrlString(tag.Id);
            }
            catch (Exception e)
            {
                throw new ArgumentException("ArgumentException", e);
            }
        }
예제 #6
0
 /// <summary>
 /// constructor de VisitorScreen.
 /// </summary>
 /// <param name="tag">Tag recibido.</param>
 public VisitorScreen(Tag tag)
 {
     this.Tag = tag;
 }
예제 #7
0
 /// <summary>
 /// constructor de VisitorButtonNextPage.
 /// </summary>
 /// <param name="tag">Tag recibido.</param>
 public VisitorButtonNextPage(Tag tag)
 {
     this.Tag = tag;
 }