Working on collaboration via the internet on a subtitle (Networking) - Initial version

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@181 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2010-12-14 08:20:33 +00:00
parent e3fd45f1e7
commit ef870f8d30
42 changed files with 4524 additions and 170 deletions

View File

@ -14,12 +14,15 @@ namespace Nikse.SubtitleEdit.Controls
public const int ColumnIndexDuration = 3; public const int ColumnIndexDuration = 3;
public const int ColumnIndexText = 4; public const int ColumnIndexText = 4;
public const int ColumnIndexTextAlternate = 5; public const int ColumnIndexTextAlternate = 5;
public int ColumnIndexExtra = 5;
private int _firstVisibleIndex = -1; private int _firstVisibleIndex = -1;
private string _lineSeparatorString = " || "; private string _lineSeparatorString = " || ";
public string SubtitleFontName = "Tahoma"; public string SubtitleFontName = "Tahoma";
public bool SubtitleFontBold = false; public bool SubtitleFontBold = false;
public int SubtitleFontSize = 8; public int SubtitleFontSize = 8;
public bool IsAlternateTextColumnVisible { get; private set; }
public bool IsExtraColumnVisible { get; private set; }
public int FirstVisibleIndex public int FirstVisibleIndex
{ {
@ -62,36 +65,40 @@ namespace Nikse.SubtitleEdit.Controls
GridLines = true; GridLines = true;
} }
public void AddAlternateTextColumn(string text) public void ShowAlternateTextColumn(string text)
{ {
if (!IsColumTextAlternateActive) if (!IsAlternateTextColumnVisible)
{ {
Columns.Add(new ColumnHeader { Text = text, Width = -2 }); ColumnIndexExtra = ColumnIndexTextAlternate + 1;
if (IsExtraColumnVisible)
{
Columns.Insert(ColumnIndexTextAlternate, new ColumnHeader { Text = text, Width = -2 });
}
else
{
Columns.Add(new ColumnHeader { Text = text, Width = -2 });
}
int length = Columns[ColumnIndexNumber].Width + Columns[ColumnIndexStart].Width + Columns[ColumnIndexEnd].Width + Columns[ColumnIndexDuration].Width; int length = Columns[ColumnIndexNumber].Width + Columns[ColumnIndexStart].Width + Columns[ColumnIndexEnd].Width + Columns[ColumnIndexDuration].Width;
int lengthAvailable = this.Width - length; int lengthAvailable = this.Width - length;
Columns[ColumnIndexText].Width = (lengthAvailable / 2) - 15; Columns[ColumnIndexText].Width = (lengthAvailable / 2) - 15;
Columns[ColumnIndexTextAlternate].Width = -2; Columns[ColumnIndexTextAlternate].Width = -2;
IsAlternateTextColumnVisible = true;
} }
} }
public void RemoveAlternateTextColumn() public void HideAlternateTextColumn()
{ {
if (IsColumTextAlternateActive) if (IsAlternateTextColumnVisible)
{ {
IsAlternateTextColumnVisible = false;
Columns.RemoveAt(ColumnIndexTextAlternate); Columns.RemoveAt(ColumnIndexTextAlternate);
ColumnIndexExtra = ColumnIndexTextAlternate;
SubtitleListView_Resize(null, null); SubtitleListView_Resize(null, null);
} }
} }
public bool IsColumTextAlternateActive
{
get
{
return Columns.Count - 1 >= ColumnIndexTextAlternate;
}
}
void SubtitleListView_Resize(object sender, EventArgs e) void SubtitleListView_Resize(object sender, EventArgs e)
{ {
int width = 0; int width = 0;
@ -303,6 +310,85 @@ namespace Nikse.SubtitleEdit.Controls
Items[index].SubItems[ColumnIndexText].Text = text.Replace(Environment.NewLine, _lineSeparatorString); Items[index].SubItems[ColumnIndexText].Text = text.Replace(Environment.NewLine, _lineSeparatorString);
} }
public void SetTimeAndText(int index, Paragraph paragraph)
{
if (index >= 0 && index < Items.Count)
{
ListViewItem item = Items[index];
item.SubItems[ColumnIndexStart].Text = paragraph.StartTime.ToString();
item.SubItems[ColumnIndexEnd].Text = paragraph.EndTime.ToString();
item.SubItems[ColumnIndexDuration].Text = string.Format("{0},{1:000}", paragraph.Duration.Seconds, paragraph.Duration.Milliseconds);
Items[index].SubItems[ColumnIndexText].Text = paragraph.Text.Replace(Environment.NewLine, _lineSeparatorString);
}
}
public void ShowExtraColumn(string title)
{
if (!IsExtraColumnVisible)
{
if (IsAlternateTextColumnVisible)
ColumnIndexExtra = ColumnIndexTextAlternate + 1;
else
ColumnIndexExtra = ColumnIndexTextAlternate;
Columns.Add(new ColumnHeader { Text = title, Width = 80 });
int length = Columns[ColumnIndexNumber].Width + Columns[ColumnIndexStart].Width + Columns[ColumnIndexEnd].Width + Columns[ColumnIndexDuration].Width;
int lengthAvailable = this.Width - length;
if (IsAlternateTextColumnVisible)
{
int part = lengthAvailable / 5;
Columns[ColumnIndexText].Width = part * 2;
Columns[ColumnIndexTextAlternate].Width = part * 2;
Columns[ColumnIndexTextAlternate].Width = part;
}
else
{
int part = lengthAvailable / 6;
Columns[ColumnIndexText].Width = part * 4;
Columns[ColumnIndexTextAlternate].Width = part * 2;
}
IsExtraColumnVisible = true;
}
}
public void HideExtraColumn()
{
if (IsExtraColumnVisible)
{
IsExtraColumnVisible = false;
Columns.RemoveAt(ColumnIndexExtra);
SubtitleListView_Resize(null, null);
}
}
public void SetExtraText(int index, string text, Color color)
{
if (index >= 0 && index < Items.Count)
{
if (IsAlternateTextColumnVisible)
ColumnIndexExtra = ColumnIndexTextAlternate + 1;
else
ColumnIndexExtra = ColumnIndexTextAlternate;
if (!IsExtraColumnVisible)
{
ShowExtraColumn(string.Empty);
}
if (Items[index].SubItems.Count <= ColumnIndexExtra)
Items[index].SubItems.Add(new ListViewItem.ListViewSubItem());
if (Items[index].SubItems.Count <= ColumnIndexExtra)
Items[index].SubItems.Add(new ListViewItem.ListViewSubItem());
Items[index].SubItems[ColumnIndexExtra].Text = text;
Items[index].UseItemStyleForSubItems = false;
Items[index].SubItems[ColumnIndexExtra].BackColor = Color.AntiqueWhite;
Items[index].SubItems[ColumnIndexExtra].ForeColor = color;
}
}
public void SetAlternateText(int index, string text) public void SetAlternateText(int index, string text)
{ {
if (index >= 0 && index < Items.Count && Columns.Count >= ColumnIndexTextAlternate + 1) if (index >= 0 && index < Items.Count && Columns.Count >= ColumnIndexTextAlternate + 1)
@ -406,7 +492,7 @@ namespace Nikse.SubtitleEdit.Controls
Columns[ColumnIndexNumber].Width = 45; Columns[ColumnIndexNumber].Width = 45;
Columns[ColumnIndexEnd].Width = 80; Columns[ColumnIndexEnd].Width = 80;
Columns[ColumnIndexDuration].Width = 55; Columns[ColumnIndexDuration].Width = 55;
if (IsColumTextAlternateActive) if (IsAlternateTextColumnVisible)
{ {
Columns[ColumnIndexText].Width = 250; Columns[ColumnIndexText].Width = 250;
Columns[ColumnIndexTextAlternate].Width = -2; Columns[ColumnIndexTextAlternate].Width = -2;

View File

@ -21,7 +21,6 @@ namespace Nikse.SubtitleEdit.Forms
buttonPreview.Text = Configuration.Settings.Language.General.Preview; buttonPreview.Text = Configuration.Settings.Language.General.Preview;
buttonOK.Text = Configuration.Settings.Language.General.OK; buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel; buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
} }
public List<Paragraph> TypewriterParagraphs public List<Paragraph> TypewriterParagraphs

View File

@ -33,6 +33,7 @@
this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.labelStatus = new System.Windows.Forms.ToolStripStatusLabel(); this.labelStatus = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripSelected = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripSelected = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusNetworking = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripButtonFileNew = new System.Windows.Forms.ToolStripButton(); this.toolStripButtonFileNew = new System.Windows.Forms.ToolStripButton();
this.toolStripButtonFileOpen = new System.Windows.Forms.ToolStripButton(); this.toolStripButtonFileOpen = new System.Windows.Forms.ToolStripButton();
@ -138,12 +139,19 @@
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.changeLanguageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.changeLanguageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItemNetworking = new System.Windows.Forms.ToolStripMenuItem();
this.startServerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.joinSessionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.chatToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.showSessionKeyLogToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.leaveSessionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.helpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tabControlSubtitle = new System.Windows.Forms.TabControl(); this.tabControlSubtitle = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.labelCharactersPerSecond = new System.Windows.Forms.Label();
this.labelAutoDuration = new System.Windows.Forms.Label(); this.labelAutoDuration = new System.Windows.Forms.Label();
this.panelSingleLine = new System.Windows.Forms.Panel(); this.panelSingleLine = new System.Windows.Forms.Panel();
this.labelTextLineTotal = new System.Windows.Forms.Label(); this.labelTextLineTotal = new System.Windows.Forms.Label();
@ -217,7 +225,7 @@
this.panelVideoPlayer = new System.Windows.Forms.Panel(); this.panelVideoPlayer = new System.Windows.Forms.Panel();
this.labelSubtitle = new System.Windows.Forms.Label(); this.labelSubtitle = new System.Windows.Forms.Label();
this.mediaPlayer = new Nikse.SubtitleEdit.Controls.VideoPlayerContainer(); this.mediaPlayer = new Nikse.SubtitleEdit.Controls.VideoPlayerContainer();
this.checkBoxSyncListViewWithVideWhilePlaying = new System.Windows.Forms.CheckBox(); this.checkBoxSyncListViewWithVideoWhilePlaying = new System.Windows.Forms.CheckBox();
this.labelVideoInfo = new System.Windows.Forms.Label(); this.labelVideoInfo = new System.Windows.Forms.Label();
this.trackBarWaveFormPosition = new System.Windows.Forms.TrackBar(); this.trackBarWaveFormPosition = new System.Windows.Forms.TrackBar();
this.panelWaveFormControls = new System.Windows.Forms.Panel(); this.panelWaveFormControls = new System.Windows.Forms.Panel();
@ -284,7 +292,7 @@
this.buttonAdjustSecForward1 = new System.Windows.Forms.Button(); this.buttonAdjustSecForward1 = new System.Windows.Forms.Button();
this.numericUpDownSecAdjust1 = new System.Windows.Forms.NumericUpDown(); this.numericUpDownSecAdjust1 = new System.Windows.Forms.NumericUpDown();
this.buttonAdjustSecBack1 = new System.Windows.Forms.Button(); this.buttonAdjustSecBack1 = new System.Windows.Forms.Button();
this.label4 = new System.Windows.Forms.Label(); this.labelVideoPosition2 = new System.Windows.Forms.Label();
this.buttonAdjustGoToPosAndPause = new System.Windows.Forms.Button(); this.buttonAdjustGoToPosAndPause = new System.Windows.Forms.Button();
this.buttonAdjustPlayBefore = new System.Windows.Forms.Button(); this.buttonAdjustPlayBefore = new System.Windows.Forms.Button();
this.timeUpDownVideoPositionAdjust = new Nikse.SubtitleEdit.Controls.TimeUpDown(); this.timeUpDownVideoPositionAdjust = new Nikse.SubtitleEdit.Controls.TimeUpDown();
@ -301,7 +309,6 @@
this.mergeWithNextToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mergeWithNextToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItemWaveFormPlaySelection = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItemWaveFormPlaySelection = new System.Windows.Forms.ToolStripMenuItem();
this.labelCharactersPerSecond = new System.Windows.Forms.Label();
this.statusStrip1.SuspendLayout(); this.statusStrip1.SuspendLayout();
this.toolStrip1.SuspendLayout(); this.toolStrip1.SuspendLayout();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
@ -336,7 +343,8 @@
this.statusStrip1.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.statusStrip1.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.labelStatus, this.labelStatus,
this.toolStripSelected}); this.toolStripSelected,
this.toolStripStatusNetworking});
this.statusStrip1.Location = new System.Drawing.Point(0, 658); this.statusStrip1.Location = new System.Drawing.Point(0, 658);
this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(1502, 25); this.statusStrip1.Size = new System.Drawing.Size(1502, 25);
@ -354,11 +362,22 @@
// //
this.toolStripSelected.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.toolStripSelected.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripSelected.Name = "toolStripSelected"; this.toolStripSelected.Name = "toolStripSelected";
this.toolStripSelected.Size = new System.Drawing.Size(787, 20); this.toolStripSelected.Size = new System.Drawing.Size(570, 20);
this.toolStripSelected.Spring = true; this.toolStripSelected.Spring = true;
this.toolStripSelected.Text = "toolStripSelected"; this.toolStripSelected.Text = "toolStripSelected";
this.toolStripSelected.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.toolStripSelected.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
// //
// toolStripStatusNetworking
//
this.toolStripStatusNetworking.Image = global::Nikse.SubtitleEdit.Properties.Resources.connect;
this.toolStripStatusNetworking.Name = "toolStripStatusNetworking";
this.toolStripStatusNetworking.Padding = new System.Windows.Forms.Padding(50, 0, 0, 0);
this.toolStripStatusNetworking.Size = new System.Drawing.Size(217, 20);
this.toolStripStatusNetworking.Text = "toolStripStatusNetworking";
this.toolStripStatusNetworking.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.toolStripStatusNetworking.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.toolStripStatusNetworking.Click += new System.EventHandler(this.toolStripStatusNetworking_Click);
//
// toolStrip1 // toolStrip1
// //
this.toolStrip1.AutoSize = false; this.toolStrip1.AutoSize = false;
@ -652,6 +671,7 @@
this.toolStripMenuItemSyncronization, this.toolStripMenuItemSyncronization,
this.toolStripMenuItemAutoTranslate, this.toolStripMenuItemAutoTranslate,
this.optionsToolStripMenuItem, this.optionsToolStripMenuItem,
this.toolStripMenuItemNetworking,
this.helpToolStripMenuItem}); this.helpToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Name = "menuStrip1";
@ -1277,6 +1297,54 @@
this.changeLanguageToolStripMenuItem.Text = "Change language..."; this.changeLanguageToolStripMenuItem.Text = "Change language...";
this.changeLanguageToolStripMenuItem.Click += new System.EventHandler(this.ChangeLanguageToolStripMenuItemClick); this.changeLanguageToolStripMenuItem.Click += new System.EventHandler(this.ChangeLanguageToolStripMenuItemClick);
// //
// toolStripMenuItemNetworking
//
this.toolStripMenuItemNetworking.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.startServerToolStripMenuItem,
this.joinSessionToolStripMenuItem,
this.chatToolStripMenuItem,
this.showSessionKeyLogToolStripMenuItem,
this.leaveSessionToolStripMenuItem});
this.toolStripMenuItemNetworking.Name = "toolStripMenuItemNetworking";
this.toolStripMenuItemNetworking.Size = new System.Drawing.Size(82, 20);
this.toolStripMenuItemNetworking.Text = "Networking";
this.toolStripMenuItemNetworking.DropDownOpening += new System.EventHandler(this.toolStripMenuItemNetworking_DropDownOpening);
//
// startServerToolStripMenuItem
//
this.startServerToolStripMenuItem.Name = "startServerToolStripMenuItem";
this.startServerToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
this.startServerToolStripMenuItem.Text = "Start new session";
this.startServerToolStripMenuItem.Click += new System.EventHandler(this.startServerToolStripMenuItem_Click);
//
// joinSessionToolStripMenuItem
//
this.joinSessionToolStripMenuItem.Name = "joinSessionToolStripMenuItem";
this.joinSessionToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
this.joinSessionToolStripMenuItem.Text = "Join session";
this.joinSessionToolStripMenuItem.Click += new System.EventHandler(this.joinSessionToolStripMenuItem_Click);
//
// chatToolStripMenuItem
//
this.chatToolStripMenuItem.Name = "chatToolStripMenuItem";
this.chatToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
this.chatToolStripMenuItem.Text = "Chat";
this.chatToolStripMenuItem.Click += new System.EventHandler(this.chatToolStripMenuItem_Click);
//
// showSessionKeyLogToolStripMenuItem
//
this.showSessionKeyLogToolStripMenuItem.Name = "showSessionKeyLogToolStripMenuItem";
this.showSessionKeyLogToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
this.showSessionKeyLogToolStripMenuItem.Text = "Show session info and log";
this.showSessionKeyLogToolStripMenuItem.Click += new System.EventHandler(this.showSessionKeyLogToolStripMenuItem_Click);
//
// leaveSessionToolStripMenuItem
//
this.leaveSessionToolStripMenuItem.Name = "leaveSessionToolStripMenuItem";
this.leaveSessionToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
this.leaveSessionToolStripMenuItem.Text = "Leave session";
this.leaveSessionToolStripMenuItem.Click += new System.EventHandler(this.leaveSessionToolStripMenuItem_Click);
//
// helpToolStripMenuItem // helpToolStripMenuItem
// //
this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -1290,14 +1358,14 @@
// //
this.helpToolStripMenuItem1.Name = "helpToolStripMenuItem1"; this.helpToolStripMenuItem1.Name = "helpToolStripMenuItem1";
this.helpToolStripMenuItem1.ShortcutKeys = System.Windows.Forms.Keys.F1; this.helpToolStripMenuItem1.ShortcutKeys = System.Windows.Forms.Keys.F1;
this.helpToolStripMenuItem1.Size = new System.Drawing.Size(118, 22); this.helpToolStripMenuItem1.Size = new System.Drawing.Size(152, 22);
this.helpToolStripMenuItem1.Text = "Help"; this.helpToolStripMenuItem1.Text = "Help";
this.helpToolStripMenuItem1.Click += new System.EventHandler(this.HelpToolStripMenuItem1Click); this.helpToolStripMenuItem1.Click += new System.EventHandler(this.HelpToolStripMenuItem1Click);
// //
// aboutToolStripMenuItem // aboutToolStripMenuItem
// //
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(118, 22); this.aboutToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.aboutToolStripMenuItem.Text = "About"; this.aboutToolStripMenuItem.Text = "About";
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.AboutToolStripMenuItemClick); this.aboutToolStripMenuItem.Click += new System.EventHandler(this.AboutToolStripMenuItemClick);
// //
@ -1356,6 +1424,16 @@
this.groupBox1.TabIndex = 1; this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
// //
// labelCharactersPerSecond
//
this.labelCharactersPerSecond.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.labelCharactersPerSecond.Location = new System.Drawing.Point(1170, 12);
this.labelCharactersPerSecond.Name = "labelCharactersPerSecond";
this.labelCharactersPerSecond.Size = new System.Drawing.Size(177, 13);
this.labelCharactersPerSecond.TabIndex = 31;
this.labelCharactersPerSecond.Text = "labelCharactersPerSecond";
this.labelCharactersPerSecond.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// labelAutoDuration // labelAutoDuration
// //
this.labelAutoDuration.AutoSize = true; this.labelAutoDuration.AutoSize = true;
@ -1471,9 +1549,9 @@
// //
// buttonAutoBreak // buttonAutoBreak
// //
this.buttonAutoBreak.Location = new System.Drawing.Point(136, 75); this.buttonAutoBreak.Location = new System.Drawing.Point(139, 75);
this.buttonAutoBreak.Name = "buttonAutoBreak"; this.buttonAutoBreak.Name = "buttonAutoBreak";
this.buttonAutoBreak.Size = new System.Drawing.Size(57, 21); this.buttonAutoBreak.Size = new System.Drawing.Size(64, 21);
this.buttonAutoBreak.TabIndex = 4; this.buttonAutoBreak.TabIndex = 4;
this.buttonAutoBreak.Text = "Auto br"; this.buttonAutoBreak.Text = "Auto br";
this.buttonAutoBreak.UseVisualStyleBackColor = true; this.buttonAutoBreak.UseVisualStyleBackColor = true;
@ -1481,9 +1559,9 @@
// //
// buttonPrevious // buttonPrevious
// //
this.buttonPrevious.Location = new System.Drawing.Point(6, 75); this.buttonPrevious.Location = new System.Drawing.Point(7, 75);
this.buttonPrevious.Name = "buttonPrevious"; this.buttonPrevious.Name = "buttonPrevious";
this.buttonPrevious.Size = new System.Drawing.Size(57, 21); this.buttonPrevious.Size = new System.Drawing.Size(64, 21);
this.buttonPrevious.TabIndex = 2; this.buttonPrevious.TabIndex = 2;
this.buttonPrevious.Text = "< Prev "; this.buttonPrevious.Text = "< Prev ";
this.buttonPrevious.UseVisualStyleBackColor = true; this.buttonPrevious.UseVisualStyleBackColor = true;
@ -1491,9 +1569,9 @@
// //
// buttonNext // buttonNext
// //
this.buttonNext.Location = new System.Drawing.Point(69, 75); this.buttonNext.Location = new System.Drawing.Point(73, 75);
this.buttonNext.Name = "buttonNext"; this.buttonNext.Name = "buttonNext";
this.buttonNext.Size = new System.Drawing.Size(57, 21); this.buttonNext.Size = new System.Drawing.Size(64, 21);
this.buttonNext.TabIndex = 3; this.buttonNext.TabIndex = 3;
this.buttonNext.Text = "Next >"; this.buttonNext.Text = "Next >";
this.buttonNext.UseVisualStyleBackColor = true; this.buttonNext.UseVisualStyleBackColor = true;
@ -1955,7 +2033,7 @@
this.groupBoxVideo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) this.groupBoxVideo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.groupBoxVideo.Controls.Add(this.panelVideoPlayer); this.groupBoxVideo.Controls.Add(this.panelVideoPlayer);
this.groupBoxVideo.Controls.Add(this.checkBoxSyncListViewWithVideWhilePlaying); this.groupBoxVideo.Controls.Add(this.checkBoxSyncListViewWithVideoWhilePlaying);
this.groupBoxVideo.Controls.Add(this.labelVideoInfo); this.groupBoxVideo.Controls.Add(this.labelVideoInfo);
this.groupBoxVideo.Controls.Add(this.trackBarWaveFormPosition); this.groupBoxVideo.Controls.Add(this.trackBarWaveFormPosition);
this.groupBoxVideo.Controls.Add(this.panelWaveFormControls); this.groupBoxVideo.Controls.Add(this.panelWaveFormControls);
@ -2008,15 +2086,15 @@
this.mediaPlayer.DragDrop += new System.Windows.Forms.DragEventHandler(this.mediaPlayer_DragDrop); this.mediaPlayer.DragDrop += new System.Windows.Forms.DragEventHandler(this.mediaPlayer_DragDrop);
this.mediaPlayer.DragEnter += new System.Windows.Forms.DragEventHandler(this.mediaPlayer_DragEnter); this.mediaPlayer.DragEnter += new System.Windows.Forms.DragEventHandler(this.mediaPlayer_DragEnter);
// //
// checkBoxSyncListViewWithVideWhilePlaying // checkBoxSyncListViewWithVideoWhilePlaying
// //
this.checkBoxSyncListViewWithVideWhilePlaying.AutoSize = true; this.checkBoxSyncListViewWithVideoWhilePlaying.AutoSize = true;
this.checkBoxSyncListViewWithVideWhilePlaying.Location = new System.Drawing.Point(561, 11); this.checkBoxSyncListViewWithVideoWhilePlaying.Location = new System.Drawing.Point(561, 11);
this.checkBoxSyncListViewWithVideWhilePlaying.Name = "checkBoxSyncListViewWithVideWhilePlaying"; this.checkBoxSyncListViewWithVideoWhilePlaying.Name = "checkBoxSyncListViewWithVideoWhilePlaying";
this.checkBoxSyncListViewWithVideWhilePlaying.Size = new System.Drawing.Size(207, 17); this.checkBoxSyncListViewWithVideoWhilePlaying.Size = new System.Drawing.Size(207, 17);
this.checkBoxSyncListViewWithVideWhilePlaying.TabIndex = 1; this.checkBoxSyncListViewWithVideoWhilePlaying.TabIndex = 1;
this.checkBoxSyncListViewWithVideWhilePlaying.Text = "Sync listview with movie when playing"; this.checkBoxSyncListViewWithVideoWhilePlaying.Text = "Sync listview with movie when playing";
this.checkBoxSyncListViewWithVideWhilePlaying.UseVisualStyleBackColor = true; this.checkBoxSyncListViewWithVideoWhilePlaying.UseVisualStyleBackColor = true;
// //
// labelVideoInfo // labelVideoInfo
// //
@ -2640,7 +2718,7 @@
this.tabPageAdjust.Controls.Add(this.buttonAdjustSecForward1); this.tabPageAdjust.Controls.Add(this.buttonAdjustSecForward1);
this.tabPageAdjust.Controls.Add(this.numericUpDownSecAdjust1); this.tabPageAdjust.Controls.Add(this.numericUpDownSecAdjust1);
this.tabPageAdjust.Controls.Add(this.buttonAdjustSecBack1); this.tabPageAdjust.Controls.Add(this.buttonAdjustSecBack1);
this.tabPageAdjust.Controls.Add(this.label4); this.tabPageAdjust.Controls.Add(this.labelVideoPosition2);
this.tabPageAdjust.Controls.Add(this.buttonAdjustGoToPosAndPause); this.tabPageAdjust.Controls.Add(this.buttonAdjustGoToPosAndPause);
this.tabPageAdjust.Controls.Add(this.buttonAdjustPlayBefore); this.tabPageAdjust.Controls.Add(this.buttonAdjustPlayBefore);
this.tabPageAdjust.Controls.Add(this.timeUpDownVideoPositionAdjust); this.tabPageAdjust.Controls.Add(this.timeUpDownVideoPositionAdjust);
@ -2827,14 +2905,14 @@
this.buttonAdjustSecBack1.UseVisualStyleBackColor = true; this.buttonAdjustSecBack1.UseVisualStyleBackColor = true;
this.buttonAdjustSecBack1.Click += new System.EventHandler(this.buttonAdjustSecBack_Click); this.buttonAdjustSecBack1.Click += new System.EventHandler(this.buttonAdjustSecBack_Click);
// //
// label4 // labelVideoPosition2
// //
this.label4.AutoSize = true; this.labelVideoPosition2.AutoSize = true;
this.label4.Location = new System.Drawing.Point(9, 219); this.labelVideoPosition2.Location = new System.Drawing.Point(9, 219);
this.label4.Name = "label4"; this.labelVideoPosition2.Name = "labelVideoPosition2";
this.label4.Size = new System.Drawing.Size(77, 13); this.labelVideoPosition2.Size = new System.Drawing.Size(77, 13);
this.label4.TabIndex = 12; this.labelVideoPosition2.TabIndex = 12;
this.label4.Text = "Video position:"; this.labelVideoPosition2.Text = "Video position:";
// //
// buttonAdjustGoToPosAndPause // buttonAdjustGoToPosAndPause
// //
@ -2950,16 +3028,6 @@
this.toolStripMenuItemWaveFormPlaySelection.Text = "Play selection"; this.toolStripMenuItemWaveFormPlaySelection.Text = "Play selection";
this.toolStripMenuItemWaveFormPlaySelection.Click += new System.EventHandler(this.toolStripMenuItemWaveFormPlaySelection_Click); this.toolStripMenuItemWaveFormPlaySelection.Click += new System.EventHandler(this.toolStripMenuItemWaveFormPlaySelection_Click);
// //
// labelCharactersPerSecond
//
this.labelCharactersPerSecond.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.labelCharactersPerSecond.Location = new System.Drawing.Point(1170, 12);
this.labelCharactersPerSecond.Name = "labelCharactersPerSecond";
this.labelCharactersPerSecond.Size = new System.Drawing.Size(177, 13);
this.labelCharactersPerSecond.TabIndex = 31;
this.labelCharactersPerSecond.Text = "labelCharactersPerSecond";
this.labelCharactersPerSecond.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// Main // Main
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -3239,7 +3307,7 @@
private System.Windows.Forms.NumericUpDown numericUpDownSec1; private System.Windows.Forms.NumericUpDown numericUpDownSec1;
private System.Windows.Forms.Button buttonForward1; private System.Windows.Forms.Button buttonForward1;
private System.Windows.Forms.Label labelCreateTip; private System.Windows.Forms.Label labelCreateTip;
private System.Windows.Forms.Label label4; private System.Windows.Forms.Label labelVideoPosition2;
private Controls.TimeUpDown timeUpDownVideoPositionAdjust; private Controls.TimeUpDown timeUpDownVideoPositionAdjust;
private System.Windows.Forms.Button buttonAdjustSecForward1; private System.Windows.Forms.Button buttonAdjustSecForward1;
private System.Windows.Forms.NumericUpDown numericUpDownSecAdjust1; private System.Windows.Forms.NumericUpDown numericUpDownSecAdjust1;
@ -3250,7 +3318,7 @@
private System.Windows.Forms.Button buttonAdjustSecForward2; private System.Windows.Forms.Button buttonAdjustSecForward2;
private System.Windows.Forms.NumericUpDown numericUpDownSecAdjust2; private System.Windows.Forms.NumericUpDown numericUpDownSecAdjust2;
private System.Windows.Forms.Button buttonAdjustSecBack2; private System.Windows.Forms.Button buttonAdjustSecBack2;
private System.Windows.Forms.CheckBox checkBoxSyncListViewWithVideWhilePlaying; private System.Windows.Forms.CheckBox checkBoxSyncListViewWithVideoWhilePlaying;
private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label6;
@ -3301,6 +3369,13 @@
private System.Windows.Forms.ToolStripMenuItem colorToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem colorToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem fontNameToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem fontNameToolStripMenuItem;
private System.Windows.Forms.Label labelCharactersPerSecond; private System.Windows.Forms.Label labelCharactersPerSecond;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemNetworking;
private System.Windows.Forms.ToolStripMenuItem startServerToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem joinSessionToolStripMenuItem;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusNetworking;
private System.Windows.Forms.ToolStripMenuItem leaveSessionToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem showSessionKeyLogToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem chatToolStripMenuItem;
} }
} }

View File

@ -7,14 +7,14 @@ using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Web; using System.Web;
using System.Windows.Forms; using System.Windows.Forms;
using System.Xml;
using Nikse.SubtitleEdit.Controls; using Nikse.SubtitleEdit.Controls;
using Nikse.SubtitleEdit.Logic; using Nikse.SubtitleEdit.Logic;
using Nikse.SubtitleEdit.Logic.BluRaySup;
using Nikse.SubtitleEdit.Logic.Enums; using Nikse.SubtitleEdit.Logic.Enums;
using Nikse.SubtitleEdit.Logic.SubtitleFormats; using Nikse.SubtitleEdit.Logic.SubtitleFormats;
using Nikse.SubtitleEdit.Logic.VideoPlayers; using Nikse.SubtitleEdit.Logic.VideoPlayers;
using Nikse.SubtitleEdit.Logic.VobSub; using Nikse.SubtitleEdit.Logic.VobSub;
using Nikse.SubtitleEdit.Logic.BluRaySup; using Nikse.SubtitleEdit.Logic.Networking;
namespace Nikse.SubtitleEdit.Forms namespace Nikse.SubtitleEdit.Forms
{ {
@ -72,6 +72,8 @@ namespace Nikse.SubtitleEdit.Forms
System.Windows.Forms.Timer _timerAutoSave = new Timer(); System.Windows.Forms.Timer _timerAutoSave = new Timer();
string _textAutoSave; string _textAutoSave;
NikseWebServiceSession _networkSession;
NetworkChat _networkChat = null;
private bool AutoRepeatContinueOn private bool AutoRepeatContinueOn
{ {
@ -92,7 +94,7 @@ namespace Nikse.SubtitleEdit.Forms
if (versionInfo.Length >= 3 && versionInfo[2] != "0") if (versionInfo.Length >= 3 && versionInfo[2] != "0")
_title += "." + versionInfo[2]; _title += "." + versionInfo[2];
} }
return _title; return _title + " Beta";
} }
} }
@ -139,6 +141,7 @@ namespace Nikse.SubtitleEdit.Forms
SetLanguage(Configuration.Settings.General.Language); SetLanguage(Configuration.Settings.General.Language);
toolStripStatusNetworking.Visible = false;
labelTextLineLengths.Text = string.Empty; labelTextLineLengths.Text = string.Empty;
labelCharactersPerSecond.Text = string.Empty; labelCharactersPerSecond.Text = string.Empty;
labelTextLineTotal.Text = string.Empty; labelTextLineTotal.Text = string.Empty;
@ -149,6 +152,7 @@ namespace Nikse.SubtitleEdit.Forms
timeUpDownStartTime.TimeCode = new TimeCode(0, 0, 0, 0); timeUpDownStartTime.TimeCode = new TimeCode(0, 0, 0, 0);
checkBoxAutoRepeatOn.Checked = Configuration.Settings.General.AutoRepeatOn; checkBoxAutoRepeatOn.Checked = Configuration.Settings.General.AutoRepeatOn;
checkBoxAutoContinue.Checked = Configuration.Settings.General.AutoContinueOn; checkBoxAutoContinue.Checked = Configuration.Settings.General.AutoContinueOn;
checkBoxSyncListViewWithVideoWhilePlaying.Checked = Configuration.Settings.General.SyncListViewWithVideoWhilePlaying;
SetFormatToSubRip(); SetFormatToSubRip();
@ -617,7 +621,7 @@ namespace Nikse.SubtitleEdit.Forms
tabPageTranslate.Text = _language.VideoControls.Translate; tabPageTranslate.Text = _language.VideoControls.Translate;
tabPageCreate.Text = _language.VideoControls.Create; tabPageCreate.Text = _language.VideoControls.Create;
tabPageAdjust.Text = _language.VideoControls.Adjust; tabPageAdjust.Text = _language.VideoControls.Adjust;
checkBoxSyncListViewWithVideWhilePlaying.Text = _language.VideoControls.SelectCurrentElementWhilePlaying; checkBoxSyncListViewWithVideoWhilePlaying.Text = _language.VideoControls.SelectCurrentElementWhilePlaying;
if (_videoFileName == null) if (_videoFileName == null)
labelVideoInfo.Text = Configuration.Settings.Language.General.NoVideoLoaded; labelVideoInfo.Text = Configuration.Settings.Language.General.NoVideoLoaded;
@ -646,6 +650,7 @@ namespace Nikse.SubtitleEdit.Forms
buttonForward1.Text = _language.VideoControls.SecondsForwardShort; buttonForward1.Text = _language.VideoControls.SecondsForwardShort;
buttonForward2.Text = _language.VideoControls.SecondsForwardShort; buttonForward2.Text = _language.VideoControls.SecondsForwardShort;
labelVideoPosition.Text = _language.VideoControls.VideoPosition; labelVideoPosition.Text = _language.VideoControls.VideoPosition;
labelVideoPosition2.Text = _language.VideoControls.VideoPosition;
labelCreateTip.Text = _language.VideoControls.CreateTip; labelCreateTip.Text = _language.VideoControls.CreateTip;
buttonSetStartAndOffsetRest.Text = _language.VideoControls.SetstartTimeAndOffsetOfRest; buttonSetStartAndOffsetRest.Text = _language.VideoControls.SetstartTimeAndOffsetOfRest;
@ -1910,9 +1915,11 @@ namespace Nikse.SubtitleEdit.Forms
{ {
int line = _findHelper.SelectedIndex; int line = _findHelper.SelectedIndex;
int pos = _findHelper.SelectedPosition; int pos = _findHelper.SelectedPosition;
bool success = _findHelper.Success;
_findHelper = replaceDialog.GetFindDialogHelper(_subtitleListViewIndex); _findHelper = replaceDialog.GetFindDialogHelper(_subtitleListViewIndex);
_findHelper.SelectedIndex = line; _findHelper.SelectedIndex = line;
_findHelper.SelectedPosition = pos; _findHelper.SelectedPosition = pos;
_findHelper.Success = success;
} }
int replaceCount = 0; int replaceCount = 0;
bool searchStringFound = true; bool searchStringFound = true;
@ -2009,7 +2016,12 @@ namespace Nikse.SubtitleEdit.Forms
else if (!replaceDialog.FindOnly) // replace once only else if (!replaceDialog.FindOnly) // replace once only
{ {
string msg = string.Empty; string msg = string.Empty;
if (textBoxListViewText.SelectionLength == _findHelper.FindTextLength) if (_findHelper.FindType == FindType.RegEx && _findHelper.Success)
{
textBoxListViewText.SelectedText = _findHelper.ReplaceText;
msg = _language.OneReplacementMade + " ";
}
else if (textBoxListViewText.SelectionLength == _findHelper.FindTextLength)
{ {
textBoxListViewText.SelectedText = _findHelper.ReplaceText; textBoxListViewText.SelectedText = _findHelper.ReplaceText;
msg = _language.OneReplacementMade + " "; msg = _language.OneReplacementMade + " ";
@ -2543,7 +2555,7 @@ namespace Nikse.SubtitleEdit.Forms
} }
ShowSource(); ShowSource();
SubtitleListview1.AddAlternateTextColumn(Configuration.Settings.Language.General.OriginalText); SubtitleListview1.ShowAlternateTextColumn(Configuration.Settings.Language.General.OriginalText);
SubtitleListview1.Fill(_subtitle, _subtitleAlternate); SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
RestoreSubtitleListviewIndexes(); RestoreSubtitleListviewIndexes();
@ -2629,7 +2641,7 @@ namespace Nikse.SubtitleEdit.Forms
startIndex = result.IndexOf(key, startIndex + key.Length); startIndex = result.IndexOf(key, startIndex + key.Length);
} }
ShowSource(); ShowSource();
SubtitleListview1.AddAlternateTextColumn(Configuration.Settings.Language.General.OriginalText); SubtitleListview1.ShowAlternateTextColumn(Configuration.Settings.Language.General.OriginalText);
SubtitleListview1.Fill(_subtitle, _subtitleAlternate); SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
ShowStatus(_language.TranslationFromSwedishToDanishComplete); ShowStatus(_language.TranslationFromSwedishToDanishComplete);
SubtitleListview1.SelectIndexAndEnsureVisible(firstSelectedIndex); SubtitleListview1.SelectIndexAndEnsureVisible(firstSelectedIndex);
@ -2845,10 +2857,10 @@ namespace Nikse.SubtitleEdit.Forms
mergeAfterToolStripMenuItem.Visible = true; mergeAfterToolStripMenuItem.Visible = true;
mergeBeforeToolStripMenuItem.Visible = true; mergeBeforeToolStripMenuItem.Visible = true;
splitLineToolStripMenuItem.Visible = true; splitLineToolStripMenuItem.Visible = true;
typeEffectToolStripMenuItem.Visible = true;
toolStripSeparator7.Visible = true; toolStripSeparator7.Visible = true;
karokeeEffectToolStripMenuItem.Visible = true; typeEffectToolStripMenuItem.Visible = _networkSession == null;
toolStripSeparatorAdvancedFunctions.Visible = true; karokeeEffectToolStripMenuItem.Visible = _networkSession == null;
toolStripSeparatorAdvancedFunctions.Visible = _networkSession == null;
showSelectedLinesEarlierlaterToolStripMenuItem.Visible = true; showSelectedLinesEarlierlaterToolStripMenuItem.Visible = true;
visualSyncSelectedLinesToolStripMenuItem.Visible = true; visualSyncSelectedLinesToolStripMenuItem.Visible = true;
googleTranslateSelectedLinesToolStripMenuItem.Visible = true; googleTranslateSelectedLinesToolStripMenuItem.Visible = true;
@ -2977,24 +2989,35 @@ namespace Nikse.SubtitleEdit.Forms
indexes.Add(item.Index); indexes.Add(item.Index);
int firstIndex = SubtitleListview1.SelectedItems[0].Index; int firstIndex = SubtitleListview1.SelectedItems[0].Index;
int startNumber = _subtitle.Paragraphs[0].Number; if (_networkSession != null)
indexes.Reverse();
foreach (int i in indexes)
{ {
_subtitle.Paragraphs.RemoveAt(i); _networkSession.TimerStop();
NetworkGetSendUpdates(indexes, 0, null);
} }
_subtitle.Renumber(startNumber); else
SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
if (SubtitleListview1.FirstVisibleIndex == 0)
SubtitleListview1.FirstVisibleIndex = - 1;
if (SubtitleListview1.Items.Count > firstIndex)
{ {
SubtitleListview1.SelectIndexAndEnsureVisible(firstIndex); int startNumber = _subtitle.Paragraphs[0].Number;
} indexes.Reverse();
else if (SubtitleListview1.Items.Count > 0) foreach (int i in indexes)
{ {
SubtitleListview1.SelectIndexAndEnsureVisible(SubtitleListview1.Items.Count-1); _subtitle.Paragraphs.RemoveAt(i);
if (_networkSession != null && _networkSession.LastSubtitle != null && i < _networkSession.LastSubtitle.Paragraphs.Count)
_networkSession.LastSubtitle.Paragraphs.RemoveAt(i);
}
_subtitle.Renumber(startNumber);
SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
if (SubtitleListview1.FirstVisibleIndex == 0)
SubtitleListview1.FirstVisibleIndex = -1;
if (SubtitleListview1.Items.Count > firstIndex)
{
SubtitleListview1.SelectIndexAndEnsureVisible(firstIndex);
}
else if (SubtitleListview1.Items.Count > 0)
{
SubtitleListview1.SelectIndexAndEnsureVisible(SubtitleListview1.Items.Count - 1);
}
} }
ShowStatus(statusText); ShowStatus(statusText);
ShowSource(); ShowSource();
_change = true; _change = true;
@ -3043,11 +3066,18 @@ namespace Nikse.SubtitleEdit.Forms
newParagraph.EndTime.TotalMilliseconds = 3000; newParagraph.EndTime.TotalMilliseconds = 3000;
} }
_subtitle.Paragraphs.Insert(firstSelectedIndex, newParagraph); if (_networkSession != null)
{
_subtitleListViewIndex = -1; _networkSession.TimerStop();
_subtitle.Renumber(startNumber); NetworkGetSendUpdates(new List<int>(), firstSelectedIndex, newParagraph);
SubtitleListview1.Fill(_subtitle, _subtitleAlternate); }
else
{
_subtitle.Paragraphs.Insert(firstSelectedIndex, newParagraph);
_subtitleListViewIndex = -1;
_subtitle.Renumber(startNumber);
SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
}
SubtitleListview1.SelectIndexAndEnsureVisible(firstSelectedIndex); SubtitleListview1.SelectIndexAndEnsureVisible(firstSelectedIndex);
ShowSource(); ShowSource();
ShowStatus(_language.LineInserted); ShowStatus(_language.LineInserted);
@ -3097,10 +3127,17 @@ namespace Nikse.SubtitleEdit.Forms
newParagraph.EndTime.TotalMilliseconds = 3000; newParagraph.EndTime.TotalMilliseconds = 3000;
} }
_subtitle.Paragraphs.Insert(firstSelectedIndex, newParagraph); if (_networkSession != null)
{
_subtitle.Renumber(startNumber); _networkSession.TimerStop();
SubtitleListview1.Fill(_subtitle, _subtitleAlternate); NetworkGetSendUpdates(new List<int>(), firstSelectedIndex, newParagraph);
}
else
{
_subtitle.Paragraphs.Insert(firstSelectedIndex, newParagraph);
_subtitle.Renumber(startNumber);
SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
}
SubtitleListview1.SelectIndexAndEnsureVisible(firstSelectedIndex); SubtitleListview1.SelectIndexAndEnsureVisible(firstSelectedIndex);
ShowSource(); ShowSource();
ShowStatus(_language.LineInserted); ShowStatus(_language.LineInserted);
@ -3353,8 +3390,6 @@ namespace Nikse.SubtitleEdit.Forms
currentParagraph.EndTime.TotalMilliseconds = middle; currentParagraph.EndTime.TotalMilliseconds = middle;
newParagraph.StartTime.TotalMilliseconds = currentParagraph.EndTime.TotalMilliseconds + 1; newParagraph.StartTime.TotalMilliseconds = currentParagraph.EndTime.TotalMilliseconds + 1;
_subtitle.Paragraphs.Insert(firstSelectedIndex + 1, newParagraph);
string[] lines = currentParagraph.Text.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries); string[] lines = currentParagraph.Text.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
if (lines.Length == 2) if (lines.Length == 2)
@ -3373,8 +3408,17 @@ namespace Nikse.SubtitleEdit.Forms
} }
} }
_subtitle.Renumber(startNumber); if (_networkSession != null)
SubtitleListview1.Fill(_subtitle, _subtitleAlternate); {
_networkSession.TimerStop();
NetworkGetSendUpdates(new List<int>(), firstSelectedIndex, newParagraph);
}
else
{
_subtitle.Paragraphs.Insert(firstSelectedIndex + 1, newParagraph);
_subtitle.Renumber(startNumber);
SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
}
SubtitleListview1.SelectIndexAndEnsureVisible(firstSelectedIndex); SubtitleListview1.SelectIndexAndEnsureVisible(firstSelectedIndex);
ShowSource(); ShowSource();
ShowStatus(_language.LineSplitted); ShowStatus(_language.LineSplitted);
@ -3403,16 +3447,24 @@ namespace Nikse.SubtitleEdit.Forms
prevParagraph.Text += Environment.NewLine + currentParagraph.Text.Replace(Environment.NewLine, " "); prevParagraph.Text += Environment.NewLine + currentParagraph.Text.Replace(Environment.NewLine, " ");
prevParagraph.Text = Utilities.AutoBreakLine(prevParagraph.Text); prevParagraph.Text = Utilities.AutoBreakLine(prevParagraph.Text);
// prevParagraph.EndTime.TotalMilliseconds = prevParagraph.EndTime.TotalMilliseconds + currentParagraph.Duration.TotalMilliseconds; // prevParagraph.EndTime.TotalMilliseconds = prevParagraph.EndTime.TotalMilliseconds + currentParagraph.Duration.TotalMilliseconds;
prevParagraph.EndTime.TotalMilliseconds = currentParagraph.EndTime.TotalMilliseconds; prevParagraph.EndTime.TotalMilliseconds = currentParagraph.EndTime.TotalMilliseconds;
_subtitle.Paragraphs.Remove(currentParagraph); if (_networkSession != null)
{
_subtitle.Renumber(startNumber); _networkSession.TimerStop();
SubtitleListview1.Fill(_subtitle, _subtitleAlternate); List<int> deleteIndices = new List<int>();
SubtitleListview1.Items[firstSelectedIndex-1].Selected = true; deleteIndices.Add(_subtitle.GetIndex(currentParagraph));
SubtitleListview1.SelectIndexAndEnsureVisible(firstSelectedIndex-1); NetworkGetSendUpdates(deleteIndices, 0, null);
}
else
{
_subtitle.Paragraphs.Remove(currentParagraph);
_subtitle.Renumber(startNumber);
SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
SubtitleListview1.Items[firstSelectedIndex-1].Selected = true;
}
SubtitleListview1.SelectIndexAndEnsureVisible(firstSelectedIndex - 1);
ShowSource(); ShowSource();
ShowStatus(_language.LinesMerged); ShowStatus(_language.LinesMerged);
SubtitleListview1.SelectedIndexChanged += SubtitleListview1_SelectedIndexChanged; SubtitleListview1.SelectedIndexChanged += SubtitleListview1_SelectedIndexChanged;
@ -3444,13 +3496,23 @@ namespace Nikse.SubtitleEdit.Forms
//currentParagraph.EndTime.TotalMilliseconds = currentParagraph.EndTime.TotalMilliseconds + nextParagraph.Duration.TotalMilliseconds; //nextParagraph.EndTime; //currentParagraph.EndTime.TotalMilliseconds = currentParagraph.EndTime.TotalMilliseconds + nextParagraph.Duration.TotalMilliseconds; //nextParagraph.EndTime;
currentParagraph.EndTime.TotalMilliseconds = nextParagraph.EndTime.TotalMilliseconds; currentParagraph.EndTime.TotalMilliseconds = nextParagraph.EndTime.TotalMilliseconds;
_subtitle.Paragraphs.Remove(nextParagraph); if (_networkSession != null)
{
_subtitle.Renumber(startNumber); _networkSession.TimerStop();
SubtitleListview1.Fill(_subtitle, _subtitleAlternate); _networkSession.UpdateLine(_subtitle.GetIndex(currentParagraph), currentParagraph);
SubtitleListview1.SelectIndexAndEnsureVisible(firstSelectedIndex); List<int> deleteIndices = new List<int>();
deleteIndices.Add(_subtitle.GetIndex(nextParagraph));
NetworkGetSendUpdates(deleteIndices, 0, null);
}
else
{
_subtitle.Paragraphs.Remove(nextParagraph);
_subtitle.Renumber(startNumber);
SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
}
ShowSource(); ShowSource();
ShowStatus(_language.LinesMerged); ShowStatus(_language.LinesMerged);
SubtitleListview1.SelectIndexAndEnsureVisible(firstSelectedIndex);
SubtitleListview1.SelectedIndexChanged += SubtitleListview1_SelectedIndexChanged; SubtitleListview1.SelectedIndexChanged += SubtitleListview1_SelectedIndexChanged;
RefreshSelectedParagraph(); RefreshSelectedParagraph();
_change = true; _change = true;
@ -3582,6 +3644,18 @@ namespace Nikse.SubtitleEdit.Forms
} }
else else
{ {
if (_networkSession != null)
{
try
{
_networkSession.TimerStop();
_networkSession.Leave();
}
catch
{
}
}
if (Configuration.Settings.General.StartRememberPositionAndSize && WindowState != FormWindowState.Minimized) if (Configuration.Settings.General.StartRememberPositionAndSize && WindowState != FormWindowState.Minimized)
{ {
Configuration.Settings.General.StartPosition = Left + ";" + Top; Configuration.Settings.General.StartPosition = Left + ";" + Top;
@ -3594,6 +3668,7 @@ namespace Nikse.SubtitleEdit.Forms
Configuration.Settings.General.AutoRepeatOn = checkBoxAutoRepeatOn.Checked; Configuration.Settings.General.AutoRepeatOn = checkBoxAutoRepeatOn.Checked;
Configuration.Settings.General.AutoContinueOn = checkBoxAutoContinue.Checked; Configuration.Settings.General.AutoContinueOn = checkBoxAutoContinue.Checked;
Configuration.Settings.General.SyncListViewWithVideoWhilePlaying = checkBoxSyncListViewWithVideoWhilePlaying.Checked;
if (!string.IsNullOrEmpty(_fileName)) if (!string.IsNullOrEmpty(_fileName))
Configuration.Settings.RecentFiles.Add(_fileName, FirstVisibleIndex, FirstSelectedIndex); Configuration.Settings.RecentFiles.Add(_fileName, FirstVisibleIndex, FirstSelectedIndex);
@ -4404,6 +4479,7 @@ namespace Nikse.SubtitleEdit.Forms
{ {
if (mediaPlayer.VideoPlayer != null) if (mediaPlayer.VideoPlayer != null)
{ {
_endSeconds = -1;
mediaPlayer.TooglePlayPause(); mediaPlayer.TooglePlayPause();
e.SuppressKeyPress = true; e.SuppressKeyPress = true;
} }
@ -5018,7 +5094,7 @@ namespace Nikse.SubtitleEdit.Forms
toolStripSeparatorInsertUnicodeCharacter.Visible = true; toolStripSeparatorInsertUnicodeCharacter.Visible = true;
} }
if (SubtitleListview1.IsColumTextAlternateActive) if (SubtitleListview1.IsAlternateTextColumnVisible)
{ {
toolStripMenuItemTranslationMode.ShortcutKeys = Keys.None; toolStripMenuItemTranslationMode.ShortcutKeys = Keys.None;
toolStripMenuItemTranslationMode.ShortcutKeyDisplayString = string.Empty; toolStripMenuItemTranslationMode.ShortcutKeyDisplayString = string.Empty;
@ -5195,9 +5271,9 @@ namespace Nikse.SubtitleEdit.Forms
private void toolStripMenuItemTranslationMode_Click(object sender, EventArgs e) private void toolStripMenuItemTranslationMode_Click(object sender, EventArgs e)
{ {
if (SubtitleListview1.IsColumTextAlternateActive) if (SubtitleListview1.IsAlternateTextColumnVisible)
{ {
SubtitleListview1.RemoveAlternateTextColumn(); SubtitleListview1.HideAlternateTextColumn();
_subtitleAlternate = new Subtitle(); _subtitleAlternate = new Subtitle();
} }
else else
@ -5244,7 +5320,7 @@ namespace Nikse.SubtitleEdit.Forms
_subtitleAlternate.CalculateFrameNumbersFromTimeCodes(CurrentFrameRate); _subtitleAlternate.CalculateFrameNumbersFromTimeCodes(CurrentFrameRate);
SubtitleListview1.AddAlternateTextColumn(Configuration.Settings.Language.General.OriginalText); SubtitleListview1.ShowAlternateTextColumn(Configuration.Settings.Language.General.OriginalText);
SubtitleListview1.Fill(_subtitle, _subtitleAlternate); SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
} }
@ -5445,7 +5521,7 @@ namespace Nikse.SubtitleEdit.Forms
panelVideoPlayer.Width = w; // this.Width - (panelVideoPlayer.Left + 34); panelVideoPlayer.Width = w; // this.Width - (panelVideoPlayer.Left + 34);
labelVideoInfo.TextAlign = ContentAlignment.TopLeft; labelVideoInfo.TextAlign = ContentAlignment.TopLeft;
labelVideoInfo.Left = checkBoxSyncListViewWithVideWhilePlaying.Left + checkBoxSyncListViewWithVideWhilePlaying.Width + 10; labelVideoInfo.Left = checkBoxSyncListViewWithVideoWhilePlaying.Left + checkBoxSyncListViewWithVideoWhilePlaying.Width + 10;
} }
} }
else if (AudioWaveForm.Visible) else if (AudioWaveForm.Visible)
@ -5453,7 +5529,7 @@ namespace Nikse.SubtitleEdit.Forms
AudioWaveForm.Left = tabControlButtons.Left + tabControlButtons.Width + 5; AudioWaveForm.Left = tabControlButtons.Left + tabControlButtons.Width + 5;
AudioWaveForm.Width = this.Width - (AudioWaveForm.Left + 34); AudioWaveForm.Width = this.Width - (AudioWaveForm.Left + 34);
} }
checkBoxSyncListViewWithVideWhilePlaying.Left = tabControlButtons.Left + tabControlButtons.Width + 5; checkBoxSyncListViewWithVideoWhilePlaying.Left = tabControlButtons.Left + tabControlButtons.Width + 5;
panelWaveFormControls.Left = AudioWaveForm.Left; panelWaveFormControls.Left = AudioWaveForm.Left;
trackBarWaveFormPosition.Left = panelWaveFormControls.Left + panelWaveFormControls.Width + 5; trackBarWaveFormPosition.Left = panelWaveFormControls.Left + panelWaveFormControls.Width + 5;
trackBarWaveFormPosition.Width = AudioWaveForm.Left + AudioWaveForm.Width - trackBarWaveFormPosition.Left + 5; trackBarWaveFormPosition.Width = AudioWaveForm.Left + AudioWaveForm.Width - trackBarWaveFormPosition.Left + 5;
@ -5866,7 +5942,7 @@ namespace Nikse.SubtitleEdit.Forms
// mediaPlayer.RefreshProgressBar(); // mediaPlayer.RefreshProgressBar();
// Utilities.ShowSubtitle(_subtitle.Paragraphs, labelSubtitle, mediaPlayer.VideoPlayer); // Utilities.ShowSubtitle(_subtitle.Paragraphs, labelSubtitle, mediaPlayer.VideoPlayer);
if (AutoRepeatContinueOn && !checkBoxSyncListViewWithVideWhilePlaying.Checked) if (AutoRepeatContinueOn) // && (_endSeconds == -1 && !checkBoxSyncListViewWithVideoWhilePlaying.Checked))
{ {
if (_endSeconds >= 0 && mediaPlayer.CurrentPosition > _endSeconds && checkBoxAutoRepeatOn.Checked) if (_endSeconds >= 0 && mediaPlayer.CurrentPosition > _endSeconds && checkBoxAutoRepeatOn.Checked)
{ {
@ -5904,7 +5980,7 @@ namespace Nikse.SubtitleEdit.Forms
timeUpDownVideoPositionAdjust.TimeCode = new TimeCode(TimeSpan.FromMilliseconds(mediaPlayer.CurrentPosition * 1000.0)); timeUpDownVideoPositionAdjust.TimeCode = new TimeCode(TimeSpan.FromMilliseconds(mediaPlayer.CurrentPosition * 1000.0));
mediaPlayer.RefreshProgressBar(); mediaPlayer.RefreshProgressBar();
int index = Utilities.ShowSubtitle(_subtitle.Paragraphs, labelSubtitle, mediaPlayer.VideoPlayer); int index = Utilities.ShowSubtitle(_subtitle.Paragraphs, labelSubtitle, mediaPlayer.VideoPlayer);
if (index != -1 && checkBoxSyncListViewWithVideWhilePlaying.Checked) if (index != -1 && checkBoxSyncListViewWithVideoWhilePlaying.Checked)
{ {
if ((DateTime.Now.Ticks - _lastTextKeyDownTicks) > 10000 * 700) // only if last typed char was entered > 700 milliseconds if ((DateTime.Now.Ticks - _lastTextKeyDownTicks) > 10000 * 700) // only if last typed char was entered > 700 milliseconds
{ {
@ -6019,6 +6095,7 @@ namespace Nikse.SubtitleEdit.Forms
private void buttonStop_Click_1(object sender, EventArgs e) private void buttonStop_Click_1(object sender, EventArgs e)
{ {
_endSeconds = -1;
timerAutoContinue.Stop(); timerAutoContinue.Stop();
mediaPlayer.Pause(); mediaPlayer.Pause();
labelStatus.Text = string.Empty; labelStatus.Text = string.Empty;
@ -6083,7 +6160,7 @@ namespace Nikse.SubtitleEdit.Forms
if (toolStripButtonToogleVideo.Checked && !AudioWaveForm.Visible) if (toolStripButtonToogleVideo.Checked && !AudioWaveForm.Visible)
{ {
labelVideoInfo.TextAlign = ContentAlignment.TopLeft; labelVideoInfo.TextAlign = ContentAlignment.TopLeft;
labelVideoInfo.Left = checkBoxSyncListViewWithVideWhilePlaying.Left + checkBoxSyncListViewWithVideWhilePlaying.Width + 10; labelVideoInfo.Left = checkBoxSyncListViewWithVideoWhilePlaying.Left + checkBoxSyncListViewWithVideoWhilePlaying.Width + 10;
} }
Refresh(); Refresh();
@ -6789,5 +6866,375 @@ namespace Nikse.SubtitleEdit.Forms
} }
} }
} public void SetSubtitle(Subtitle subtitle, string message)
{
_subtitle = subtitle;
SubtitleListview1.Fill(subtitle);
_change = true;
ShowStatus(message);
}
private void startServerToolStripMenuItem_Click(object sender, EventArgs e)
{
_networkSession = new NikseWebServiceSession(_subtitle, _subtitleAlternate, TimerWebServiceTick, OnUpdateUserLogEntries);
NetworkStart networkNew = new NetworkStart();
networkNew.Initialize(_networkSession, _fileName);
if (networkNew.ShowDialog(this) == DialogResult.OK)
{
_networkSession.Log(_networkSession.CurrentUser.UserName + ": Started session " + _networkSession.SessionId + " at " + DateTime.Now.ToLongTimeString());
toolStripStatusNetworking.Visible = true;
toolStripStatusNetworking.Text = "Network mode";
EnableDisableControlsNotWorkingInNetworkMode(false);
SubtitleListview1.ShowExtraColumn("User/action");
}
else
{
_networkSession = null;
}
}
private void joinSessionToolStripMenuItem_Click(object sender, EventArgs e)
{
_networkSession = new NikseWebServiceSession(_subtitle, _subtitleAlternate, TimerWebServiceTick, OnUpdateUserLogEntries);
NetworkJoin networkJoin = new NetworkJoin();
networkJoin.Initialize(_networkSession);
if (networkJoin.ShowDialog(this) == DialogResult.OK)
{
_subtitle = _networkSession.Subtitle;
_subtitleAlternate = _networkSession.OriginalSubtitle;
if (_subtitleAlternate != null && _subtitleAlternate.Paragraphs.Count > 0)
SubtitleListview1.ShowAlternateTextColumn(Configuration.Settings.Language.General.OriginalText);
_fileName = networkJoin.FileName;
Text = Title + " - " + _fileName;
this.Text = Title;
toolStripStatusNetworking.Visible = true;
toolStripStatusNetworking.Text = "Network mode";
EnableDisableControlsNotWorkingInNetworkMode(false);
_networkSession.Log(_networkSession.CurrentUser.UserName + ": Joined session " + _networkSession.SessionId + " at " + DateTime.Now.ToLongTimeString());
SubtitleListview1.ShowExtraColumn("User/action");
_subtitleListViewIndex = -1;
_oldSelectedParagraph = null;
SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
SubtitleListview1.SelectIndexAndEnsureVisible(0);
_change = true;
}
else
{
_networkSession = null;
}
}
private void EnableDisableControlsNotWorkingInNetworkMode(bool enabled)
{
//Top menu
newToolStripMenuItem.Enabled = enabled;
openToolStripMenuItem.Enabled = enabled;
reopenToolStripMenuItem.Enabled = enabled;
toolStripMenuItemOpenContainingFolder.Enabled = enabled;
toolStripMenuItemCompare.Enabled = enabled;
toolStripMenuItemImportDvdSubtitles.Enabled = enabled;
toolStripMenuItemSubIdx.Enabled = enabled;
toolStripMenuItemImportBluRaySup.Enabled = enabled;
matroskaImportStripMenuItem.Enabled = enabled;
toolStripMenuItemManualAnsi.Enabled = enabled;
toolStripMenuItemImportText.Enabled = enabled;
toolStripMenuItemImportTimeCodes.Enabled = enabled;
showHistoryforUndoToolStripMenuItem.Enabled = enabled;
multipleReplaceToolStripMenuItem.Enabled = enabled;
toolsToolStripMenuItem.Enabled = enabled;
toolStripMenuItemSyncronization.Enabled = enabled;
toolStripMenuItemAutoTranslate.Enabled = enabled;
//Toolbar
toolStripButtonFileNew.Enabled = enabled;
toolStripButtonFileOpen.Enabled = enabled;
toolStripButtonVisualSync.Enabled = enabled;
// textbox source
textBoxSource.ReadOnly = !enabled;
}
internal void TimerWebServiceTick(object sender, EventArgs e)
{
if (_networkSession == null)
return;
List<int> insertIndices = new List<int>();
List<int> deleteIndices = new List<int>();
NetworkGetSendUpdates(deleteIndices, 0, null);
}
private void NetworkGetSendUpdates(List<int> deleteIndices, int insertIndex, Paragraph insertParagraph)
{
_networkSession.TimerStop();
bool doReFill = false;
bool updateListViewStatus = false;
SubtitleListview1.SelectedIndexChanged -= SubtitleListview1_SelectedIndexChanged;
string message;
var updates = _networkSession.GetUpdates(out message);
if (message == "OK")
{
foreach (var update in updates)
{
if (update.User.Ip != _networkSession.CurrentUser.Ip || update.User.UserName != _networkSession.CurrentUser.UserName)
{
if (update.Action == "USR")
{
_networkSession.Users.Add(update.User);
if (_networkChat != null && !_networkChat.IsDisposed)
{
_networkChat.AddUser(update.User);
}
_networkSession.Log("New user: " + update.User.UserName + " (" + update.User.Ip + ")");
}
else if (update.Action == "MSG")
{
_networkSession.ChatLog.Add(new NikseWebServiceSession.ChatEntry() { User = update.User, Message = update.Text });
if (_networkChat == null || _networkChat.IsDisposed)
{
_networkChat = new NetworkChat();
_networkChat.Initialize(_networkSession);
_networkChat.Show(this);
}
else
{
_networkChat.AddChatMessage(update.User, update.Text);
}
_networkSession.Log("Message: " + update.User.UserName + " (" + update.User.Ip + "): " + update.Text);
}
else if (update.Action == "DEL")
{
doReFill = true;
_subtitle.Paragraphs.RemoveAt(update.Index);
if (_networkSession.LastSubtitle != null)
_networkSession.LastSubtitle.Paragraphs.RemoveAt(update.Index);
_networkSession.Log("Delete: " + update.User.UserName + " (" + update.User.Ip + "): Index=" + update.Index.ToString());
_networkSession.AdjustUpdateLogToDelete(update.Index);
_change = true;
if (deleteIndices.Count > 0)
{
for (int i = deleteIndices.Count - 1; i >= 0; i--)
{
int index = deleteIndices[i];
if (index == update.Index)
deleteIndices.RemoveAt(i);
else if (index > update.Index)
deleteIndices[i] = index - 1;
}
}
if (insertIndex > update.Index)
insertIndex--;
}
else if (update.Action == "INS")
{
doReFill = true;
Paragraph p = new Paragraph(update.Text, update.StartMilliseconds, update.EndMilliseconds);
_subtitle.Paragraphs.Insert(update.Index, p);
if (_networkSession.LastSubtitle != null)
_networkSession.LastSubtitle.Paragraphs.Insert(update.Index, new Paragraph(p));
_networkSession.Log("Insert: " + update.User.UserName + " (" + update.User.Ip + "): Index=" + update.Index.ToString() + ", Text=" + update.Text.Replace(Environment.NewLine, Configuration.Settings.General.ListViewLineSeparatorString));
_networkSession.AddToWsUserLog(update.User, update.Index, update.Action, false);
updateListViewStatus = true;
_networkSession.AdjustUpdateLogToInsert(update.Index);
_change = true;
if (deleteIndices.Count > 0)
{
for (int i = deleteIndices.Count - 1; i >= 0; i--)
{
int index = deleteIndices[i];
if (index > update.Index)
deleteIndices[i] = index +1;
}
}
if (insertIndex > update.Index)
insertIndex++;
}
else if (update.Action == "UPD")
{
updateListViewStatus = true;
Paragraph p = _subtitle.GetParagraphOrDefault(update.Index);
if (p != null)
{
p.StartTime.TotalMilliseconds = update.StartMilliseconds;
p.EndTime.TotalMilliseconds = update.EndMilliseconds;
p.Text = update.Text;
SubtitleListview1.SetTimeAndText(update.Index, p);
_networkSession.AddToWsUserLog(update.User, update.Index, update.Action, true);
updateListViewStatus = true;
}
if (_networkSession.LastSubtitle != null)
{
p = _networkSession.LastSubtitle.GetParagraphOrDefault(update.Index);
if (p != null)
{
p.StartTime.TotalMilliseconds = update.StartMilliseconds;
p.EndTime.TotalMilliseconds = update.EndMilliseconds;
p.Text = update.Text;
}
}
_change = true;
}
else if (update.Action == "BYE")
{
if (_networkChat != null && !_networkChat.IsDisposed)
_networkChat.RemoveUser(update.User);
SeNetworkService.SeUser removeUser = null;
foreach (var user in _networkSession.Users)
{
if (user.UserName == update.User.UserName)
{
removeUser = user;
break;
}
}
if (removeUser != null)
_networkSession.Users.Remove(removeUser);
_networkSession.Log("Bye: " + update.User.UserName + " (" + update.User.Ip + ")");
}
else
{
_networkSession.Log("UNKNOWN ACTION: " + update.Action + " by " + update.User.UserName + " (" + update.User.Ip + ")");
}
}
}
if (deleteIndices.Count > 0)
{
deleteIndices.Sort();
deleteIndices.Reverse();
foreach (int i in deleteIndices)
{
_subtitle.Paragraphs.RemoveAt(i);
if (_networkSession != null && _networkSession.LastSubtitle != null && i < _networkSession.LastSubtitle.Paragraphs.Count)
_networkSession.LastSubtitle.Paragraphs.RemoveAt(i);
}
_networkSession.DeleteLines(deleteIndices);
doReFill = true;
}
if (insertIndex >= 0 && insertParagraph != null)
{
_subtitle.Paragraphs.Insert(insertIndex, insertParagraph);
if (_networkSession != null && _networkSession.LastSubtitle != null && insertIndex < _networkSession.LastSubtitle.Paragraphs.Count)
_networkSession.LastSubtitle.Paragraphs.Insert(insertIndex, insertParagraph);
_networkSession.InsertLine(insertIndex, insertParagraph);
doReFill = true;
}
_networkSession.CheckForAndSubmitUpdates(updates); // updates only (no inserts/deletes)
}
else
{
MessageBox.Show(message);
leaveSessionToolStripMenuItem_Click(null, null);
SubtitleListview1.SelectedIndexChanged += SubtitleListview1_SelectedIndexChanged;
return;
}
if (doReFill)
{
_subtitle.Renumber(1);
SubtitleListview1.Fill(_subtitle);
UpdateListviewwithUserLogEntries();
if (_oldSelectedParagraph != null)
{
Paragraph p = _subtitle.GetFirstAlike(_oldSelectedParagraph);
if (p != null)
{
_subtitleListViewIndex = _subtitle.GetIndex(p);
SubtitleListview1.SelectIndexAndEnsureVisible(_subtitleListViewIndex);
}
}
}
else if (updateListViewStatus)
{
UpdateListviewwithUserLogEntries();
}
_networkSession.LastSubtitle = new Subtitle(_subtitle);
SubtitleListview1.SelectedIndexChanged += SubtitleListview1_SelectedIndexChanged;
_networkSession.TimerStart();
}
private void UpdateListviewwithUserLogEntries()
{
SubtitleListview1.BeginUpdate();
foreach (UpdateLogEntry entry in _networkSession.UpdateLog)
SubtitleListview1.SetExtraText(entry.Index, entry.ToString(), Utilities.GetColorFromUserName(entry.UserName));
SubtitleListview1.EndUpdate();
}
private void leaveSessionToolStripMenuItem_Click(object sender, EventArgs e)
{
if (_networkSession != null)
{
_networkSession.TimerStop();
_networkSession.Leave();
}
if (_networkChat != null && !_networkChat.IsDisposed)
{
_networkChat.Close();
_networkChat = null;
}
_networkSession = null;
EnableDisableControlsNotWorkingInNetworkMode(true);
toolStripStatusNetworking.Visible = false;
SubtitleListview1.HideExtraColumn();
_networkChat = null;
}
private void toolStripMenuItemNetworking_DropDownOpening(object sender, EventArgs e)
{
startServerToolStripMenuItem.Visible = _networkSession == null;
joinSessionToolStripMenuItem.Visible = _networkSession == null;
showSessionKeyLogToolStripMenuItem.Visible = _networkSession != null;
leaveSessionToolStripMenuItem.Visible = _networkSession != null;
chatToolStripMenuItem.Visible = _networkSession != null;
}
internal void OnUpdateUserLogEntries(object sender, EventArgs e)
{
UpdateListviewwithUserLogEntries();
}
private void toolStripStatusNetworking_Click(object sender, EventArgs e)
{
showSessionKeyLogToolStripMenuItem_Click(null, null);
}
private void showSessionKeyLogToolStripMenuItem_Click(object sender, EventArgs e)
{
NetworkLogAndInfo networkLog = new NetworkLogAndInfo();
networkLog.Initialize(_networkSession);
networkLog.ShowDialog(this);
}
private void chatToolStripMenuItem_Click(object sender, EventArgs e)
{
if (_networkSession != null)
{
if (_networkChat == null || _networkChat.IsDisposed)
{
_networkChat = new NetworkChat();
_networkChat.Initialize(_networkSession);
_networkChat.Show(this);
}
else
{
_networkChat.WindowState = FormWindowState.Normal;
}
}
}
}
} }

View File

@ -291,47 +291,47 @@
<data name="toolStripButtonReplace.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="toolStripButtonReplace.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAlySURBVFhH1VcJVJNXGo1TrTsokLDpBEERAgjIIpsEERGE YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAlySURBVFhH1VcJVJNXGo1TrTsqkLDpBAERAgjIIpsEERGE
iEIwQEIICcEIAgKuiAYstCJqK2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namespace Nikse.SubtitleEdit.Forms
else if (searchType == Configuration.Settings.Language.MultipleReplace.RegularExpression) else if (searchType == Configuration.Settings.Language.MultipleReplace.RegularExpression)
{ {
Regex regex = new Regex(findWhat); Regex regex = new Regex(findWhat);
if (regex.IsMatch(newText)) var match = regex.Match(newText);
if (match.Success)
{ {
hit = true; hit = true;
newText = regex.Replace(newText, replaceWith);
string groupName = Utilities.GetRegExGroup(findWhat);
if (groupName != null && match.Groups[groupName] != null && match.Groups[groupName].Success)
{
newText = newText.Remove(match.Groups[groupName].Index, match.Groups[groupName].Length);
newText = newText.Insert(match.Groups[groupName].Index, replaceWith);
}
else
{
newText = regex.Replace(newText, replaceWith);
}
} }
} }
else else

162
src/Forms/NetworkChat.Designer.cs generated Normal file
View File

@ -0,0 +1,162 @@
namespace Nikse.SubtitleEdit.Forms
{
partial class NetworkChat
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NetworkChat));
this.listViewChat = new System.Windows.Forms.ListView();
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.imageListUsers = new System.Windows.Forms.ImageList(this.components);
this.listViewUsers = new System.Windows.Forms.ListView();
this.columnHeaderNick = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.textBoxChat = new System.Windows.Forms.TextBox();
this.buttonSendChat = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// listViewChat
//
this.listViewChat.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listViewChat.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader4});
this.listViewChat.Location = new System.Drawing.Point(3, 107);
this.listViewChat.Name = "listViewChat";
this.listViewChat.Size = new System.Drawing.Size(274, 239);
this.listViewChat.SmallImageList = this.imageListUsers;
this.listViewChat.TabIndex = 3;
this.listViewChat.UseCompatibleStateImageBehavior = false;
this.listViewChat.View = System.Windows.Forms.View.Details;
//
// columnHeader1
//
this.columnHeader1.Text = "Username";
this.columnHeader1.Width = 82;
//
// columnHeader4
//
this.columnHeader4.Text = "Text";
this.columnHeader4.Width = 188;
//
// imageListUsers
//
this.imageListUsers.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListUsers.ImageStream")));
this.imageListUsers.TransparentColor = System.Drawing.Color.Transparent;
this.imageListUsers.Images.SetKeyName(0, "person.jpg");
this.imageListUsers.Images.SetKeyName(1, "person2.jpg");
this.imageListUsers.Images.SetKeyName(2, "Person3.jpg");
this.imageListUsers.Images.SetKeyName(3, "Person4.jpg");
this.imageListUsers.Images.SetKeyName(4, "Person5.jpg");
this.imageListUsers.Images.SetKeyName(5, "Person6.jpg");
this.imageListUsers.Images.SetKeyName(6, "Person7.jpg");
this.imageListUsers.Images.SetKeyName(7, "Person8.jpg");
//
// listViewUsers
//
this.listViewUsers.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listViewUsers.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeaderNick,
this.columnHeader2});
this.listViewUsers.Location = new System.Drawing.Point(2, 2);
this.listViewUsers.Name = "listViewUsers";
this.listViewUsers.Size = new System.Drawing.Size(275, 103);
this.listViewUsers.SmallImageList = this.imageListUsers;
this.listViewUsers.TabIndex = 2;
this.listViewUsers.UseCompatibleStateImageBehavior = false;
this.listViewUsers.View = System.Windows.Forms.View.Details;
//
// columnHeaderNick
//
this.columnHeaderNick.Text = "Username";
this.columnHeaderNick.Width = 178;
//
// columnHeader2
//
this.columnHeader2.Text = "IP";
this.columnHeader2.Width = 93;
//
// textBoxChat
//
this.textBoxChat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBoxChat.Location = new System.Drawing.Point(3, 352);
this.textBoxChat.Multiline = true;
this.textBoxChat.Name = "textBoxChat";
this.textBoxChat.Size = new System.Drawing.Size(188, 46);
this.textBoxChat.TabIndex = 0;
this.textBoxChat.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBoxChat_KeyDown);
//
// buttonSendChat
//
this.buttonSendChat.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonSendChat.Location = new System.Drawing.Point(197, 375);
this.buttonSendChat.Name = "buttonSendChat";
this.buttonSendChat.Size = new System.Drawing.Size(75, 23);
this.buttonSendChat.TabIndex = 1;
this.buttonSendChat.Text = "Send message";
this.buttonSendChat.UseVisualStyleBackColor = true;
this.buttonSendChat.Click += new System.EventHandler(this.buttonSendChat_Click);
//
// NetworkChat
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(281, 402);
this.Controls.Add(this.listViewChat);
this.Controls.Add(this.listViewUsers);
this.Controls.Add(this.textBoxChat);
this.Controls.Add(this.buttonSendChat);
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimumSize = new System.Drawing.Size(200, 300);
this.Name = "NetworkChat";
this.ShowIcon = false;
this.Text = "NetworkChat";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ListView listViewChat;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader4;
private System.Windows.Forms.ListView listViewUsers;
private System.Windows.Forms.ColumnHeader columnHeaderNick;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.TextBox textBoxChat;
private System.Windows.Forms.Button buttonSendChat;
private System.Windows.Forms.ImageList imageListUsers;
}
}

95
src/Forms/NetworkChat.cs Normal file
View File

@ -0,0 +1,95 @@
using System;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
using Nikse.SubtitleEdit.Logic.Networking;
namespace Nikse.SubtitleEdit.Forms
{
public partial class NetworkChat : Form
{
Logic.Networking.NikseWebServiceSession _networkSession;
public NetworkChat()
{
InitializeComponent();
}
internal void Initialize(Nikse.SubtitleEdit.Logic.Networking.NikseWebServiceSession networkSession)
{
_networkSession = networkSession;
Text = "Chat - " + _networkSession.CurrentUser.UserName;
listViewUsers.Items.Clear();
foreach (var user in _networkSession.Users)
{
AddUser(user);
}
listViewChat.Items.Clear();
foreach (var message in _networkSession.ChatLog)
{
AddChatMessage(message.User, message.Message);
listViewChat.EnsureVisible(listViewChat.Items.Count - 1);
}
}
private void buttonSendChat_Click(object sender, EventArgs e)
{
if (textBoxChat.Text.Trim().Length > 0)
{
_networkSession.SendChatMessage(textBoxChat.Text.Trim());
AddChatMessage(_networkSession.CurrentUser, textBoxChat.Text.Trim());
listViewChat.EnsureVisible(listViewChat.Items.Count - 1);
_networkSession.ChatLog.Add(new NikseWebServiceSession.ChatEntry() { User = _networkSession.CurrentUser, Message = textBoxChat.Text.Trim() });
}
textBoxChat.Text = string.Empty;
textBoxChat.Focus();
}
public void AddChatMessage(SeNetworkService.SeUser user, string message)
{
ListViewItem item = new ListViewItem(user.UserName);
item.Tag = _networkSession.CurrentUser;
item.ForeColor = Utilities.GetColorFromUserName(user.UserName);
item.ImageIndex = Utilities.GetNumber0To7FromUserName(user.UserName);
item.SubItems.Add(new ListViewItem.ListViewSubItem(item, message));
listViewChat.Items.Add(item);
}
private void textBoxChat_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter && e.Modifiers == Keys.None)
{
e.SuppressKeyPress = true;
buttonSendChat_Click(null, null);
}
}
internal void AddUser(SeNetworkService.SeUser user)
{
ListViewItem item = new ListViewItem(user.UserName);
item.Tag = user;
item.ForeColor = Utilities.GetColorFromUserName(user.UserName);
if (DateTime.Now.Month == 12 && DateTime.Now.Day >= 23 && DateTime.Now.Day <= 25)
item.ImageIndex = 7;
else
item.ImageIndex = Utilities.GetNumber0To7FromUserName(user.UserName);
item.SubItems.Add(new ListViewItem.ListViewSubItem(item, user.Ip));
listViewUsers.Items.Add(item);
}
internal void RemoveUser(SeNetworkService.SeUser user)
{
ListViewItem removeItem = null;
foreach (ListViewItem item in listViewUsers.Items)
{
if ((item.Tag as SeNetworkService.SeUser).UserName == user.UserName)
{
removeItem = item;
}
}
if (removeItem != null)
listViewUsers.Items.Remove(removeItem);
}
}
}

208
src/Forms/NetworkChat.resx Normal file
View File

@ -0,0 +1,208 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="imageListUsers.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="imageListUsers.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZ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+BwABPgMA
ASgDAAFAAwABMAMAAQEBAAEBBQABgAEBFgAD//8AggAL
</value>
</data>
</root>

178
src/Forms/NetworkJoin.Designer.cs generated Normal file
View File

@ -0,0 +1,178 @@
namespace Nikse.SubtitleEdit.Forms
{
partial class NetworkJoin
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.labelStatus = new System.Windows.Forms.Label();
this.labelInfo = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.comboBoxWebServiceUrl = new System.Windows.Forms.ComboBox();
this.buttonCancel = new System.Windows.Forms.Button();
this.textBoxUserName = new System.Windows.Forms.TextBox();
this.buttonConnect = new System.Windows.Forms.Button();
this.labelGoToLine = new System.Windows.Forms.Label();
this.textBoxSessionKey = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// labelStatus
//
this.labelStatus.AutoSize = true;
this.labelStatus.Location = new System.Drawing.Point(35, 205);
this.labelStatus.Name = "labelStatus";
this.labelStatus.Size = new System.Drawing.Size(59, 13);
this.labelStatus.TabIndex = 18;
this.labelStatus.Text = "labelStatus";
//
// labelInfo
//
this.labelInfo.AutoSize = true;
this.labelInfo.Location = new System.Drawing.Point(12, 9);
this.labelInfo.Name = "labelInfo";
this.labelInfo.Size = new System.Drawing.Size(200, 26);
this.labelInfo.TabIndex = 17;
this.labelInfo.Text = "Start new session where multiple persons\r\ncan edit in same subtitle file.\r\n";
//
// label1
//
this.label1.AutoSize = true;
this.label1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.label1.Location = new System.Drawing.Point(9, 138);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(81, 13);
this.label1.TabIndex = 16;
this.label1.Text = "Web service url";
//
// comboBoxWebServiceUrl
//
this.comboBoxWebServiceUrl.FormattingEnabled = true;
this.comboBoxWebServiceUrl.Items.AddRange(new object[] {
"http://www.nikse.dk/se/SeService.asmx",
"http://nikse555.brinkster.net/SeService.asmx"});
this.comboBoxWebServiceUrl.Location = new System.Drawing.Point(96, 131);
this.comboBoxWebServiceUrl.Name = "comboBoxWebServiceUrl";
this.comboBoxWebServiceUrl.Size = new System.Drawing.Size(290, 21);
this.comboBoxWebServiceUrl.TabIndex = 2;
//
// buttonCancel
//
this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonCancel.Location = new System.Drawing.Point(311, 173);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 4;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
//
// textBoxUserName
//
this.textBoxUserName.Location = new System.Drawing.Point(96, 79);
this.textBoxUserName.Name = "textBoxUserName";
this.textBoxUserName.Size = new System.Drawing.Size(290, 20);
this.textBoxUserName.TabIndex = 0;
//
// buttonConnect
//
this.buttonConnect.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonConnect.Location = new System.Drawing.Point(230, 173);
this.buttonConnect.Name = "buttonConnect";
this.buttonConnect.Size = new System.Drawing.Size(75, 21);
this.buttonConnect.TabIndex = 3;
this.buttonConnect.Text = "&Join";
this.buttonConnect.UseVisualStyleBackColor = true;
this.buttonConnect.Click += new System.EventHandler(this.buttonConnect_Click);
//
// labelGoToLine
//
this.labelGoToLine.AutoSize = true;
this.labelGoToLine.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.labelGoToLine.Location = new System.Drawing.Point(35, 82);
this.labelGoToLine.Name = "labelGoToLine";
this.labelGoToLine.Size = new System.Drawing.Size(55, 13);
this.labelGoToLine.TabIndex = 11;
this.labelGoToLine.Text = "Username";
//
// textBoxSessionKey
//
this.textBoxSessionKey.Location = new System.Drawing.Point(96, 105);
this.textBoxSessionKey.Name = "textBoxSessionKey";
this.textBoxSessionKey.Size = new System.Drawing.Size(290, 20);
this.textBoxSessionKey.TabIndex = 1;
//
// label2
//
this.label2.AutoSize = true;
this.label2.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.label2.Location = new System.Drawing.Point(35, 108);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(25, 13);
this.label2.TabIndex = 19;
this.label2.Text = "Key";
//
// NetworkJoin
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(408, 242);
this.Controls.Add(this.textBoxSessionKey);
this.Controls.Add(this.label2);
this.Controls.Add(this.labelStatus);
this.Controls.Add(this.labelInfo);
this.Controls.Add(this.label1);
this.Controls.Add(this.comboBoxWebServiceUrl);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.textBoxUserName);
this.Controls.Add(this.buttonConnect);
this.Controls.Add(this.labelGoToLine);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "NetworkJoin";
this.Text = "Join network session";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.NetworkJoin_KeyDown);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label labelStatus;
private System.Windows.Forms.Label labelInfo;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox comboBoxWebServiceUrl;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.TextBox textBoxUserName;
private System.Windows.Forms.Button buttonConnect;
private System.Windows.Forms.Label labelGoToLine;
private System.Windows.Forms.TextBox textBoxSessionKey;
private System.Windows.Forms.Label label2;
}
}

83
src/Forms/NetworkJoin.cs Normal file
View File

@ -0,0 +1,83 @@
using System;
using System.Net;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
namespace Nikse.SubtitleEdit.Forms
{
public partial class NetworkJoin : Form
{
Logic.Networking.NikseWebServiceSession _networkSession;
public string FileName { get; set;}
public NetworkJoin()
{
InitializeComponent();
labelStatus.Text = string.Empty;
}
internal void Initialize(Logic.Networking.NikseWebServiceSession networkSession)
{
_networkSession = networkSession;
textBoxSessionKey.Text = Configuration.Settings.NetworkSettings.SessionKey;
if (textBoxSessionKey.Text.Trim().Length < 2)
textBoxSessionKey.Text = Guid.NewGuid().ToString().Replace("-", string.Empty);
comboBoxWebServiceUrl.Text = Configuration.Settings.NetworkSettings.WebServiceUrl;
textBoxUserName.Text = Configuration.Settings.NetworkSettings.UserName;
if (textBoxUserName.Text.Trim().Length < 2)
textBoxUserName.Text = Dns.GetHostName();
}
private void buttonConnect_Click(object sender, EventArgs e)
{
Configuration.Settings.NetworkSettings.SessionKey = textBoxSessionKey.Text;
Configuration.Settings.NetworkSettings.WebServiceUrl = comboBoxWebServiceUrl.Text;
Configuration.Settings.NetworkSettings.UserName = textBoxUserName.Text;
buttonConnect.Enabled = false;
buttonCancel.Enabled = false;
textBoxUserName.Enabled = false;
comboBoxWebServiceUrl.Enabled = false;
labelStatus.Text = string.Format("Connecting to {0}...", comboBoxWebServiceUrl.Text);
Refresh();
try
{
string message;
_networkSession.Join(comboBoxWebServiceUrl.Text, textBoxUserName.Text, textBoxSessionKey.Text, out message);
if (message == "OK")
{
DialogResult = DialogResult.OK;
return;
}
else
{
MessageBox.Show(message);
}
}
catch (Exception exception)
{
MessageBox.Show(exception.Message);
}
buttonConnect.Enabled = true;
buttonCancel.Enabled = true;
textBoxUserName.Enabled = true;
comboBoxWebServiceUrl.Enabled = true;
labelStatus.Text = string.Empty;
}
private void buttonCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void NetworkJoin_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
}
}
}

120
src/Forms/NetworkJoin.resx Normal file
View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

168
src/Forms/NetworkLogAndInfo.Designer.cs generated Normal file
View File

@ -0,0 +1,168 @@
namespace Nikse.SubtitleEdit.Forms
{
partial class NetworkLogAndInfo
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.textBoxSessionKey = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.labelLog = new System.Windows.Forms.Label();
this.textBoxLog = new System.Windows.Forms.TextBox();
this.buttonConnect = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.textBoxUserName = new System.Windows.Forms.TextBox();
this.labelGoToLine = new System.Windows.Forms.Label();
this.textBoxWebServiceUrl = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// textBoxSessionKey
//
this.textBoxSessionKey.Location = new System.Drawing.Point(157, 16);
this.textBoxSessionKey.Name = "textBoxSessionKey";
this.textBoxSessionKey.ReadOnly = true;
this.textBoxSessionKey.Size = new System.Drawing.Size(290, 20);
this.textBoxSessionKey.TabIndex = 1;
//
// label2
//
this.label2.AutoSize = true;
this.label2.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.label2.Location = new System.Drawing.Point(87, 19);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(64, 13);
this.label2.TabIndex = 21;
this.label2.Text = "Session key";
//
// labelLog
//
this.labelLog.AutoSize = true;
this.labelLog.Location = new System.Drawing.Point(9, 109);
this.labelLog.Name = "labelLog";
this.labelLog.Size = new System.Drawing.Size(28, 13);
this.labelLog.TabIndex = 24;
this.labelLog.Text = "Log:";
//
// textBoxLog
//
this.textBoxLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBoxLog.Location = new System.Drawing.Point(12, 125);
this.textBoxLog.Multiline = true;
this.textBoxLog.Name = "textBoxLog";
this.textBoxLog.ReadOnly = true;
this.textBoxLog.Size = new System.Drawing.Size(543, 179);
this.textBoxLog.TabIndex = 4;
//
// buttonConnect
//
this.buttonConnect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonConnect.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonConnect.Location = new System.Drawing.Point(480, 310);
this.buttonConnect.Name = "buttonConnect";
this.buttonConnect.Size = new System.Drawing.Size(75, 21);
this.buttonConnect.TabIndex = 0;
this.buttonConnect.Text = "&OK";
this.buttonConnect.UseVisualStyleBackColor = true;
this.buttonConnect.Click += new System.EventHandler(this.buttonConnect_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.label1.Location = new System.Drawing.Point(70, 71);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(81, 13);
this.label1.TabIndex = 29;
this.label1.Text = "Web service url";
//
// textBoxUserName
//
this.textBoxUserName.Location = new System.Drawing.Point(157, 42);
this.textBoxUserName.Name = "textBoxUserName";
this.textBoxUserName.ReadOnly = true;
this.textBoxUserName.Size = new System.Drawing.Size(290, 20);
this.textBoxUserName.TabIndex = 2;
//
// labelGoToLine
//
this.labelGoToLine.AutoSize = true;
this.labelGoToLine.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.labelGoToLine.Location = new System.Drawing.Point(96, 45);
this.labelGoToLine.Name = "labelGoToLine";
this.labelGoToLine.Size = new System.Drawing.Size(55, 13);
this.labelGoToLine.TabIndex = 28;
this.labelGoToLine.Text = "Username";
//
// textBoxWebServiceUrl
//
this.textBoxWebServiceUrl.Location = new System.Drawing.Point(157, 68);
this.textBoxWebServiceUrl.Name = "textBoxWebServiceUrl";
this.textBoxWebServiceUrl.ReadOnly = true;
this.textBoxWebServiceUrl.Size = new System.Drawing.Size(290, 20);
this.textBoxWebServiceUrl.TabIndex = 3;
//
// NetworkLogAndInfo
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(565, 337);
this.Controls.Add(this.textBoxWebServiceUrl);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBoxUserName);
this.Controls.Add(this.labelGoToLine);
this.Controls.Add(this.buttonConnect);
this.Controls.Add(this.labelLog);
this.Controls.Add(this.textBoxLog);
this.Controls.Add(this.textBoxSessionKey);
this.Controls.Add(this.label2);
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(500, 350);
this.Name = "NetworkLogAndInfo";
this.ShowIcon = false;
this.Text = "Network session info and log";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.NetworkLogAndInfo_KeyDown);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBoxSessionKey;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label labelLog;
private System.Windows.Forms.TextBox textBoxLog;
private System.Windows.Forms.Button buttonConnect;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBoxUserName;
private System.Windows.Forms.Label labelGoToLine;
private System.Windows.Forms.TextBox textBoxWebServiceUrl;
}
}

View File

@ -0,0 +1,32 @@
using System;
using System.Windows.Forms;
namespace Nikse.SubtitleEdit.Forms
{
public partial class NetworkLogAndInfo : Form
{
public NetworkLogAndInfo()
{
InitializeComponent();
}
internal void Initialize(Logic.Networking.NikseWebServiceSession _networkSession)
{
textBoxSessionKey.Text = _networkSession.SessionId;
textBoxUserName.Text = _networkSession.CurrentUser.UserName;
textBoxWebServiceUrl.Text = _networkSession.WebServiceUrl;
textBoxLog.Text = _networkSession.GetLog();
}
private void buttonConnect_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
private void NetworkLogAndInfo_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

177
src/Forms/NetworkStart.Designer.cs generated Normal file
View File

@ -0,0 +1,177 @@
namespace Nikse.SubtitleEdit.Forms
{
partial class NetworkStart
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.buttonCancel = new System.Windows.Forms.Button();
this.textBoxUserName = new System.Windows.Forms.TextBox();
this.buttonConnect = new System.Windows.Forms.Button();
this.labelGoToLine = new System.Windows.Forms.Label();
this.comboBoxWebServiceUrl = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.labelInfo = new System.Windows.Forms.Label();
this.labelStatus = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.textBoxSessionKey = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// buttonCancel
//
this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonCancel.Location = new System.Drawing.Point(312, 147);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 4;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
//
// textBoxUserName
//
this.textBoxUserName.Location = new System.Drawing.Point(97, 83);
this.textBoxUserName.Name = "textBoxUserName";
this.textBoxUserName.Size = new System.Drawing.Size(290, 20);
this.textBoxUserName.TabIndex = 1;
//
// buttonConnect
//
this.buttonConnect.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonConnect.Location = new System.Drawing.Point(231, 147);
this.buttonConnect.Name = "buttonConnect";
this.buttonConnect.Size = new System.Drawing.Size(75, 21);
this.buttonConnect.TabIndex = 3;
this.buttonConnect.Text = "&Start";
this.buttonConnect.UseVisualStyleBackColor = true;
this.buttonConnect.Click += new System.EventHandler(this.buttonOK_Click);
//
// labelGoToLine
//
this.labelGoToLine.AutoSize = true;
this.labelGoToLine.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.labelGoToLine.Location = new System.Drawing.Point(36, 86);
this.labelGoToLine.Name = "labelGoToLine";
this.labelGoToLine.Size = new System.Drawing.Size(55, 13);
this.labelGoToLine.TabIndex = 3;
this.labelGoToLine.Text = "Username";
//
// comboBoxWebServiceUrl
//
this.comboBoxWebServiceUrl.FormattingEnabled = true;
this.comboBoxWebServiceUrl.Items.AddRange(new object[] {
"http://www.nikse.dk/se/SeService.asmx",
"http://nikse555.brinkster.net/SeService.asmx"});
this.comboBoxWebServiceUrl.Location = new System.Drawing.Point(97, 109);
this.comboBoxWebServiceUrl.Name = "comboBoxWebServiceUrl";
this.comboBoxWebServiceUrl.Size = new System.Drawing.Size(290, 21);
this.comboBoxWebServiceUrl.TabIndex = 2;
//
// label1
//
this.label1.AutoSize = true;
this.label1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.label1.Location = new System.Drawing.Point(10, 112);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(81, 13);
this.label1.TabIndex = 8;
this.label1.Text = "Web service url";
//
// labelInfo
//
this.labelInfo.AutoSize = true;
this.labelInfo.Location = new System.Drawing.Point(13, 13);
this.labelInfo.Name = "labelInfo";
this.labelInfo.Size = new System.Drawing.Size(200, 26);
this.labelInfo.TabIndex = 9;
this.labelInfo.Text = "Start new session where multiple persons\r\ncan edit in same subtitle file.\r\n";
//
// labelStatus
//
this.labelStatus.AutoSize = true;
this.labelStatus.Location = new System.Drawing.Point(36, 179);
this.labelStatus.Name = "labelStatus";
this.labelStatus.Size = new System.Drawing.Size(59, 13);
this.labelStatus.TabIndex = 10;
this.labelStatus.Text = "labelStatus";
//
// label2
//
this.label2.AutoSize = true;
this.label2.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.label2.Location = new System.Drawing.Point(26, 60);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(65, 13);
this.label2.TabIndex = 11;
this.label2.Text = "Session Key";
//
// textBoxSessionKey
//
this.textBoxSessionKey.Location = new System.Drawing.Point(97, 57);
this.textBoxSessionKey.Name = "textBoxSessionKey";
this.textBoxSessionKey.Size = new System.Drawing.Size(290, 20);
this.textBoxSessionKey.TabIndex = 0;
//
// NetworkStart
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(414, 201);
this.Controls.Add(this.textBoxSessionKey);
this.Controls.Add(this.label2);
this.Controls.Add(this.labelStatus);
this.Controls.Add(this.labelInfo);
this.Controls.Add(this.label1);
this.Controls.Add(this.comboBoxWebServiceUrl);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.textBoxUserName);
this.Controls.Add(this.buttonConnect);
this.Controls.Add(this.labelGoToLine);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "NetworkStart";
this.Text = "Start network session";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.NetworkNew_KeyDown);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.TextBox textBoxUserName;
private System.Windows.Forms.Button buttonConnect;
private System.Windows.Forms.Label labelGoToLine;
private System.Windows.Forms.ComboBox comboBoxWebServiceUrl;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label labelInfo;
private System.Windows.Forms.Label labelStatus;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBoxSessionKey;
}
}

86
src/Forms/NetworkStart.cs Normal file
View File

@ -0,0 +1,86 @@
using System;
using System.Net;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
namespace Nikse.SubtitleEdit.Forms
{
public partial class NetworkStart : Form
{
Logic.Networking.NikseWebServiceSession _networkSession;
string _fileName;
public NetworkStart()
{
InitializeComponent();
labelStatus.Text = string.Empty;
}
internal void Initialize(Logic.Networking.NikseWebServiceSession networkSession, string fileName)
{
_networkSession = networkSession;
_fileName = fileName;
textBoxSessionKey.Text = Configuration.Settings.NetworkSettings.SessionKey;
if (textBoxSessionKey.Text.Trim().Length < 2)
textBoxSessionKey.Text = Guid.NewGuid().ToString().Replace("-", string.Empty);
comboBoxWebServiceUrl.Text = Configuration.Settings.NetworkSettings.WebServiceUrl;
textBoxUserName.Text = Configuration.Settings.NetworkSettings.UserName;
if (textBoxUserName.Text.Trim().Length < 2)
textBoxUserName.Text = Dns.GetHostName();
}
private void buttonOK_Click(object sender, EventArgs e)
{
Configuration.Settings.NetworkSettings.SessionKey = textBoxSessionKey.Text;
Configuration.Settings.NetworkSettings.WebServiceUrl = comboBoxWebServiceUrl.Text;
Configuration.Settings.NetworkSettings.UserName = textBoxUserName.Text;
buttonConnect.Enabled = false;
buttonCancel.Enabled = false;
textBoxSessionKey.Enabled = false;
textBoxUserName.Enabled = false;
comboBoxWebServiceUrl.Enabled = false;
labelStatus.Text = string.Format("Connecting to {0}...", comboBoxWebServiceUrl.Text);
Refresh();
try
{
string message;
_networkSession.StartServer(comboBoxWebServiceUrl.Text, textBoxSessionKey.Text, textBoxUserName.Text, _fileName, out message);
if (message != "OK")
{
MessageBox.Show(message);
}
else
{
DialogResult = DialogResult.OK;
return;
}
}
catch (Exception exception)
{
MessageBox.Show(exception.Message);
}
buttonConnect.Enabled = true;
buttonCancel.Enabled = true;
textBoxSessionKey.Enabled = false;
textBoxUserName.Enabled = true;
comboBoxWebServiceUrl.Enabled = true;
labelStatus.Text = string.Empty;
}
private void buttonCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void NetworkNew_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
}
}
}

120
src/Forms/NetworkStart.resx Normal file
View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

BIN
src/Icons/connect.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 B

View File

@ -11,6 +11,7 @@ namespace Nikse.SubtitleEdit.Logic
readonly Regex _regEx; readonly Regex _regEx;
int _findTextLenght; int _findTextLenght;
public bool Success { get; set; }
public FindType FindType { get; set; } public FindType FindType { get; set; }
public int SelectedIndex { get; set; } public int SelectedIndex { get; set; }
public int SelectedPosition { get; set; } public int SelectedPosition { get; set; }
@ -80,6 +81,12 @@ namespace Nikse.SubtitleEdit.Logic
Match match = _regEx.Match(text, startIndex); Match match = _regEx.Match(text, startIndex);
if (match.Success) if (match.Success)
{ {
string groupName = Utilities.GetRegExGroup(_findText);
if (groupName != null && match.Groups[groupName] != null && match.Groups[groupName].Success)
{
_findTextLenght = match.Groups[groupName].Length;
return match.Groups[groupName].Index;
}
_findTextLenght = match.Length; _findTextLenght = match.Length;
return match.Index; return match.Index;
} }
@ -91,6 +98,7 @@ namespace Nikse.SubtitleEdit.Logic
public bool FindNext(Subtitle subtitle, int startIndex, int position) public bool FindNext(Subtitle subtitle, int startIndex, int position)
{ {
Success = false;
int index = 0; int index = 0;
if (position < 0) if (position < 0)
position = 0; position = 0;
@ -103,6 +111,7 @@ namespace Nikse.SubtitleEdit.Logic
{ {
SelectedIndex = index; SelectedIndex = index;
SelectedPosition = pos; SelectedPosition = pos;
Success = true;
return true; return true;
} }
position = 0; position = 0;
@ -137,6 +146,7 @@ namespace Nikse.SubtitleEdit.Logic
public bool FindNext(TextBox textBox, int startIndex) public bool FindNext(TextBox textBox, int startIndex)
{ {
Success = false;
startIndex++; startIndex++;
if (startIndex < textBox.Text.Length) if (startIndex < textBox.Text.Length)
{ {
@ -145,8 +155,18 @@ namespace Nikse.SubtitleEdit.Logic
Match match = _regEx.Match(textBox.Text, startIndex); Match match = _regEx.Match(textBox.Text, startIndex);
if (match.Success) if (match.Success)
{ {
_findTextLenght = match.Length; string groupName = Utilities.GetRegExGroup(_findText);
SelectedIndex = match.Index; if (groupName != null && match.Groups[groupName] != null && match.Groups[groupName].Success)
{
_findTextLenght = match.Groups[groupName].Length;
SelectedIndex = match.Groups[groupName].Index;
}
else
{
_findTextLenght = match.Length;
SelectedIndex = match.Index;
}
Success = true;
} }
return match.Success; return match.Success;
} }

View File

@ -38,6 +38,10 @@ namespace Nikse.SubtitleEdit.Logic
public LanguageStructure.MatroskaSubtitleChooser MatroskaSubtitleChooser; public LanguageStructure.MatroskaSubtitleChooser MatroskaSubtitleChooser;
public LanguageStructure.MergeShortLines MergedShortLines; public LanguageStructure.MergeShortLines MergedShortLines;
public LanguageStructure.MultipleReplace MultipleReplace; public LanguageStructure.MultipleReplace MultipleReplace;
public LanguageStructure.NetworkChat NetworkChat;
public LanguageStructure.NetworkJoin NetworkJoin;
public LanguageStructure.NetworkLogAndInfo NetworkLogAndInfo;
public LanguageStructure.NetworkStart NetworkStart;
public LanguageStructure.RemoveTextFromHearImpaired RemoveTextFromHearImpaired; public LanguageStructure.RemoveTextFromHearImpaired RemoveTextFromHearImpaired;
public LanguageStructure.ReplaceDialog ReplaceDialog; public LanguageStructure.ReplaceDialog ReplaceDialog;
public LanguageStructure.SetMinimumDisplayTimeBetweenParagraphs SetMinimumDisplayTimeBetweenParagraphs; public LanguageStructure.SetMinimumDisplayTimeBetweenParagraphs SetMinimumDisplayTimeBetweenParagraphs;
@ -886,6 +890,26 @@ namespace Nikse.SubtitleEdit.Logic
SearchType = "Search type", SearchType = "Search type",
}; };
NetworkChat = new LanguageStructure.NetworkChat
{
Title = "",
};
NetworkJoin = new LanguageStructure.NetworkJoin
{
Title = "",
};
NetworkLogAndInfo = new LanguageStructure.NetworkLogAndInfo
{
Title = "",
};
NetworkStart = new LanguageStructure.NetworkStart
{
Title = "",
};
RemoveTextFromHearImpaired = new LanguageStructure.RemoveTextFromHearImpaired RemoveTextFromHearImpaired = new LanguageStructure.RemoveTextFromHearImpaired
{ {
Title = "Remove text for hearing impaired", Title = "Remove text for hearing impaired",

View File

@ -826,6 +826,27 @@
public string Enabled { get; set; } public string Enabled { get; set; }
public string SearchType { get; set; } public string SearchType { get; set; }
} }
public class NetworkChat
{
public string Title { get; set; }
}
public class NetworkJoin
{
public string Title { get; set; }
}
public class NetworkLogAndInfo
{
public string Title { get; set; }
}
public class NetworkStart
{
public string Title { get; set; }
}
public class RemoveTextFromHearImpaired public class RemoveTextFromHearImpaired
{ {
public string Title { get; set; } public string Title { get; set; }

View File

@ -0,0 +1,286 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Nikse.SubtitleEdit.Logic.Networking
{
public class NikseWebServiceSession
{
public class ChatEntry
{
public SeNetworkService.SeUser User { get; set; }
public string Message { get; set; }
}
public event EventHandler OnUpdateTimerTick;
public event EventHandler OnUpdateUserLogEntries;
System.Windows.Forms.Timer _timerWebService;
public List<UpdateLogEntry> UpdateLog = new List<UpdateLogEntry>();
public List<ChatEntry> ChatLog = new List<ChatEntry>();
SeNetworkService.SeService _seWs;
DateTime _seWsLastUpdate = DateTime.Now.AddYears(-1);
public SeNetworkService.SeUser CurrentUser { get; set; }
public Subtitle LastSubtitle = null;
public Subtitle Subtitle;
public Subtitle OriginalSubtitle;
public string SessionId;
public string FileName;
public List<SeNetworkService.SeUser> Users;
public StringBuilder _log;
public string WebServiceUrl
{
get
{
return _seWs.Url;
}
}
public NikseWebServiceSession(Subtitle subtitle, Subtitle originalSubtitle, EventHandler onUpdateTimerTick, EventHandler onUpdateUserLogEntries)
{
Subtitle = subtitle;
OriginalSubtitle = originalSubtitle;
_timerWebService = new System.Windows.Forms.Timer();
_timerWebService.Interval = 5000;
_timerWebService.Tick += new EventHandler(TimerWebServiceTick);
_log = new StringBuilder();
OnUpdateTimerTick = onUpdateTimerTick;
OnUpdateUserLogEntries = onUpdateUserLogEntries;
}
public void StartServer(string webServiceUrl, string sessionKey, string userName, string fileName, out string message)
{
SessionId = sessionKey;
var list = new List<SeNetworkService.SeSequence>();
foreach (Paragraph p in Subtitle.Paragraphs)
{
list.Add(new SeNetworkService.SeSequence()
{
StartMilliseconds = (int)p.StartTime.TotalMilliseconds,
EndMilliseconds = (int)p.EndTime.TotalMilliseconds,
Text = p.Text
});
}
var originalSubtitle = new List<SeNetworkService.SeSequence>();
if (OriginalSubtitle != null)
{
foreach (Paragraph p in OriginalSubtitle.Paragraphs)
{
originalSubtitle.Add(new SeNetworkService.SeSequence()
{
StartMilliseconds = (int)p.StartTime.TotalMilliseconds,
EndMilliseconds = (int)p.EndTime.TotalMilliseconds,
Text = p.Text
});
}
}
_seWs = new SeNetworkService.SeService();
_seWs.Url = webServiceUrl;
_seWs.Proxy = Utilities.GetProxy();
SeNetworkService.SeUser user = _seWs.Start(sessionKey, userName, list.ToArray(), originalSubtitle.ToArray(), fileName, out message);
CurrentUser = user;
Users = new List<SeNetworkService.SeUser>();
Users.Add(user);
if (message == "OK")
_timerWebService.Start();
}
public bool Join(string webServiceUrl, string userName, string sessionKey, out string message)
{
SessionId = sessionKey;
_seWs = new SeNetworkService.SeService();
_seWs.Url = webServiceUrl;
_seWs.Proxy = Utilities.GetProxy();
Users = new List<SeNetworkService.SeUser>();
var users = _seWs.Join(sessionKey, userName, out message);
if (message != "OK")
return false;
string tempFileName;
DateTime updateTime;
Subtitle = new Subtitle();
foreach (var sequence in _seWs.GetSubtitle(sessionKey, out tempFileName, out updateTime))
Subtitle.Paragraphs.Add(new Paragraph(sequence.Text, sequence.StartMilliseconds, sequence.EndMilliseconds));
FileName = tempFileName;
OriginalSubtitle = new Subtitle();
var sequences = _seWs.GetOriginalSubtitle(sessionKey);
if (sequences != null)
{
foreach (var sequence in sequences)
OriginalSubtitle.Paragraphs.Add(new Paragraph(sequence.Text, sequence.StartMilliseconds, sequence.EndMilliseconds));
}
SessionId = sessionKey;
CurrentUser = users[users.Length - 1]; // me
foreach (var user in users)
Users.Add(user);
ReloadFromWs();
_timerWebService.Start();
return true;
}
void TimerWebServiceTick(object sender, EventArgs e)
{
if (OnUpdateTimerTick != null)
OnUpdateTimerTick.Invoke(sender, e);
}
public void TimerStop()
{
_timerWebService.Stop();
}
public void TimerStart()
{
_timerWebService.Start();
}
public IEnumerable<SeNetworkService.SeUpdate> GetUpdates(out string message)
{
DateTime newUpdateTime;
var updates = _seWs.GetUpdates(SessionId, CurrentUser.UserName, _seWsLastUpdate, out message, out newUpdateTime);
_seWsLastUpdate = newUpdateTime;
return updates;
}
private void ReloadFromWs()
{
if (_seWs != null)
{
Subtitle = new Logic.Subtitle();
var sequences = _seWs.GetSubtitle(SessionId, out FileName, out _seWsLastUpdate);
foreach (var sequence in sequences)
{
Paragraph p = new Paragraph(sequence.Text, sequence.StartMilliseconds, sequence.EndMilliseconds);
Subtitle.Paragraphs.Add(p);
}
Subtitle.Renumber(1);
LastSubtitle = new Subtitle(Subtitle);
}
}
public void Log(string text)
{
string timestamp = DateTime.Now.ToLongTimeString();
_log.AppendLine(timestamp + ": " + text.TrimEnd() .Replace(Environment.NewLine, Configuration.Settings.General.ListViewLineSeparatorString));
}
public string GetLog()
{
return _log.ToString();
}
public void SendChatMessage(string message)
{
_seWs.SendMessage(SessionId, message, CurrentUser);
}
internal void UpdateLine(int index, Paragraph paragraph)
{
_seWs.UpdateLine(SessionId, index, new SeNetworkService.SeSequence()
{
StartMilliseconds = (int)paragraph.StartTime.TotalMilliseconds,
EndMilliseconds = (int)paragraph.EndTime.TotalMilliseconds,
Text = paragraph.Text
}, CurrentUser);
AddToWsUserLog(CurrentUser, index, "UPD", true);
}
public void CheckForAndSubmitUpdates(IEnumerable<SeNetworkService.SeUpdate> updates)
{
// check for changes in text/time codes (not insert/delete)
if (LastSubtitle != null)
{
for (int i = 0; i < Subtitle.Paragraphs.Count; i++)
{
Paragraph last = LastSubtitle.GetParagraphOrDefault(i);
Paragraph current = Subtitle.GetParagraphOrDefault(i);
if (last != null && current != null)
{
if (last.StartTime.TotalMilliseconds != current.StartTime.TotalMilliseconds ||
last.EndTime.TotalMilliseconds != current.EndTime.TotalMilliseconds ||
last.Text != current.Text)
{
UpdateLine(i, current);
}
}
}
}
}
public void AddToWsUserLog(SeNetworkService.SeUser user, int pos, string action, bool updateUI)
{
for (int i = 0; i < UpdateLog.Count; i++)
{
if (UpdateLog[i].Index == pos)
{
UpdateLog.RemoveAt(i);
break;
}
}
UpdateLog.Add(new UpdateLogEntry(0, user.UserName, pos, action));
if (updateUI && OnUpdateUserLogEntries != null)
OnUpdateUserLogEntries.Invoke(null, null);
}
internal void Leave()
{
try
{
_seWs.Leave(SessionId, CurrentUser.UserName);
}
catch
{
}
}
internal void DeleteLines(List<int> indices)
{
_seWs.DeleteLines(SessionId, indices.ToArray(), CurrentUser);
StringBuilder sb = new StringBuilder();
foreach (int index in indices)
{
sb.Append(index + ", ");
AdjustUpdateLogToDelete(index);
}
Log("Delete line: " + sb.ToString().Trim().TrimEnd(','));
}
internal void InsertLine(int index, Paragraph newParagraph)
{
_seWs.InsertLine(SessionId, index, (int)newParagraph.StartTime.TotalMilliseconds, (int)newParagraph.EndTime.TotalMilliseconds, newParagraph.Text, CurrentUser);
Log("Insert line at " + index.ToString() + ": " + newParagraph.ToString());
}
internal void AdjustUpdateLogToInsert(int index)
{
foreach (var logEntry in UpdateLog)
{
if (logEntry.Index >= index)
logEntry.Index++;
}
}
internal void AdjustUpdateLogToDelete(int index)
{
UpdateLogEntry removeThis = null;
foreach (var logEntry in UpdateLog)
{
if (logEntry.Index == index)
removeThis = logEntry;
else if (logEntry.Index > index)
logEntry.Index--;
}
if (removeThis != null)
UpdateLog.Remove(removeThis);
}
}
}

View File

@ -0,0 +1,28 @@
using System;
namespace Nikse.SubtitleEdit.Logic.Networking
{
public class UpdateLogEntry
{
public int Id { get; set; }
public string UserName { get; set; }
public int Index { get; set; }
public DateTime OccuredAt { get; set; }
public string Action { get; set; }
public UpdateLogEntry(int id, string userName, int index, string action)
{
Id = id;
UserName = userName;
Index = index;
OccuredAt = DateTime.Now;
Action = action;
}
public override string ToString()
{
return string.Format("{0:00}:{1:00}:{2:00} {3}: {4}", OccuredAt.Hour, OccuredAt.Minute, OccuredAt.Second, UserName, Action);
}
}
}

View File

@ -320,6 +320,8 @@ namespace Nikse.SubtitleEdit.Logic.OCR
// uppercase I or 1 inside lowercase word (will be replaced by lowercase L) // uppercase I or 1 inside lowercase word (will be replaced by lowercase L)
word = FixIor1InsideLowerCaseWord(word); word = FixIor1InsideLowerCaseWord(word);
word = FixLowerCaseLInsideUpperCaseWord(word); // eg. SCARLETTl => SCARLETTI
// Retry word replace list // Retry word replace list
foreach (string from in _wordReplaceList.Keys) foreach (string from in _wordReplaceList.Keys)
{ {
@ -340,6 +342,17 @@ namespace Nikse.SubtitleEdit.Logic.OCR
if (startEndEndsWithNumber.IsMatch(word)) if (startEndEndsWithNumber.IsMatch(word))
return word; return word;
if (word.Contains("1") ||
word.Contains("2") ||
word.Contains("3") ||
word.Contains("4") ||
word.Contains("5") ||
word.Contains("6") ||
word.Contains("7") ||
word.Contains("8") ||
word.Contains("9"))
return word;
var hexNumber = new Regex(@"^#?[\dABDEFabcdef]+$"); var hexNumber = new Regex(@"^#?[\dABDEFabcdef]+$");
if (hexNumber.IsMatch(word)) if (hexNumber.IsMatch(word))
return word; return word;
@ -392,6 +405,16 @@ namespace Nikse.SubtitleEdit.Logic.OCR
if (startEndEndsWithNumber.IsMatch(word)) if (startEndEndsWithNumber.IsMatch(word))
return word; return word;
if (word.Contains("2") ||
word.Contains("3") ||
word.Contains("4") ||
word.Contains("5") ||
word.Contains("6") ||
word.Contains("7") ||
word.Contains("8") ||
word.Contains("9"))
return word;
var hexNumber = new Regex(@"^#?[\dABDEFabcdef]+$"); var hexNumber = new Regex(@"^#?[\dABDEFabcdef]+$");
if (hexNumber.IsMatch(word)) if (hexNumber.IsMatch(word))
return word; return word;
@ -418,6 +441,18 @@ namespace Nikse.SubtitleEdit.Logic.OCR
return word; return word;
} }
public static string FixLowerCaseLInsideUpperCaseWord(string word)
{
if (word.Length > 3 && word.Replace("l", string.Empty).ToUpper() == word.Replace("l", string.Empty))
{
if (!word.Contains("<") && !word.Contains(">") && !word.Contains("'"))
{
word = word.Replace("l", "I");
}
}
return word;
}
private string FixCommenOcrLineErrors(string input, string lastLine) private string FixCommenOcrLineErrors(string input, string lastLine)
{ {
input = FixOcrErrorsViaHardcodedRules(input, lastLine); input = FixOcrErrorsViaHardcodedRules(input, lastLine);

View File

@ -232,6 +232,7 @@ namespace Nikse.SubtitleEdit.Logic
public int DefaultAdjustMilliseconds { get; set; } public int DefaultAdjustMilliseconds { get; set; }
public bool AutoRepeatOn { get; set; } public bool AutoRepeatOn { get; set; }
public bool AutoContinueOn { get; set; } public bool AutoContinueOn { get; set; }
public bool SyncListViewWithVideoWhilePlaying { get; set; }
public int AutoBackupSeconds { get; set; } public int AutoBackupSeconds { get; set; }
public GeneralSettings() public GeneralSettings()
@ -275,6 +276,7 @@ namespace Nikse.SubtitleEdit.Logic
DefaultAdjustMilliseconds = 1000; DefaultAdjustMilliseconds = 1000;
AutoRepeatOn = true; AutoRepeatOn = true;
AutoContinueOn = false; AutoContinueOn = false;
SyncListViewWithVideoWhilePlaying = false;
AutoBackupSeconds = 0; AutoBackupSeconds = 0;
} }
} }
@ -333,6 +335,20 @@ namespace Nikse.SubtitleEdit.Logic
public string SearchType { get; set; } public string SearchType { get; set; }
} }
public class NetworkSettings
{
public string UserName { get; set; }
public string WebServiceUrl { get; set; }
public string SessionKey { get; set; }
public NetworkSettings()
{
UserName = string.Empty;
SessionKey = "DemoSession"; // TODO - leave blank or use guid
WebServiceUrl = "http://www.nikse.dk/se/SeService.asmx";
}
}
public class Settings public class Settings
{ {
public RecentFilesSettings RecentFiles { get; set; } public RecentFilesSettings RecentFiles { get; set; }
@ -344,6 +360,7 @@ namespace Nikse.SubtitleEdit.Logic
public FixCommonErrorsSettings CommonErrors { get; set; } public FixCommonErrorsSettings CommonErrors { get; set; }
public VobSubOcrSettings VobSubOcr { get; set; } public VobSubOcrSettings VobSubOcr { get; set; }
public VideoControlsSettings VideoControls { get; set; } public VideoControlsSettings VideoControls { get; set; }
public NetworkSettings NetworkSettings { get; set; }
[XmlArrayItem("MultipleSearchAndReplaceItem")] [XmlArrayItem("MultipleSearchAndReplaceItem")]
public List<MultipleSearchAndReplaceSetting> MultipleSearchAndReplaceList { get; set; } public List<MultipleSearchAndReplaceSetting> MultipleSearchAndReplaceList { get; set; }
@ -362,6 +379,7 @@ namespace Nikse.SubtitleEdit.Logic
CommonErrors = new FixCommonErrorsSettings(); CommonErrors = new FixCommonErrorsSettings();
VobSubOcr = new VobSubOcrSettings(); VobSubOcr = new VobSubOcrSettings();
VideoControls = new VideoControlsSettings(); VideoControls = new VideoControlsSettings();
NetworkSettings = new Logic.NetworkSettings();
MultipleSearchAndReplaceList = new List<MultipleSearchAndReplaceSetting>(); MultipleSearchAndReplaceList = new List<MultipleSearchAndReplaceSetting>();
Language = new Language(); Language = new Language();
} }
@ -430,6 +448,8 @@ namespace Nikse.SubtitleEdit.Logic
settings.VobSubOcr = new VobSubOcrSettings(); settings.VobSubOcr = new VobSubOcrSettings();
if (settings.MultipleSearchAndReplaceList == null) if (settings.MultipleSearchAndReplaceList == null)
settings.MultipleSearchAndReplaceList = new List<MultipleSearchAndReplaceSetting>(); settings.MultipleSearchAndReplaceList = new List<MultipleSearchAndReplaceSetting>();
if (settings.NetworkSettings == null)
settings.NetworkSettings = new NetworkSettings();
return settings; return settings;
} }
@ -582,6 +602,9 @@ namespace Nikse.SubtitleEdit.Logic
subNode = node.SelectSingleNode("AutoRepeatOn"); subNode = node.SelectSingleNode("AutoRepeatOn");
if (subNode != null) if (subNode != null)
settings.General.AutoRepeatOn = Convert.ToBoolean(subNode.InnerText); settings.General.AutoRepeatOn = Convert.ToBoolean(subNode.InnerText);
subNode = node.SelectSingleNode("SyncListViewWithVideoWhilePlaying");
if (subNode != null)
settings.General.SyncListViewWithVideoWhilePlaying = Convert.ToBoolean(subNode.InnerText);
subNode = node.SelectSingleNode("AutoContinueOn"); subNode = node.SelectSingleNode("AutoContinueOn");
if (subNode != null) if (subNode != null)
settings.General.AutoContinueOn = Convert.ToBoolean(subNode.InnerText); settings.General.AutoContinueOn = Convert.ToBoolean(subNode.InnerText);
@ -766,6 +789,20 @@ namespace Nikse.SubtitleEdit.Logic
if (subNode != null) if (subNode != null)
settings.VideoControls.WaveFormTextColor = Color.FromArgb(int.Parse(subNode.InnerText)); settings.VideoControls.WaveFormTextColor = Color.FromArgb(int.Parse(subNode.InnerText));
settings.NetworkSettings = new NetworkSettings();
node = doc.DocumentElement.SelectSingleNode("NetworkSettings");
if (node != null)
{
subNode = node.SelectSingleNode("SessionKey");
if (subNode != null)
settings.NetworkSettings.SessionKey = subNode.InnerText;
subNode = node.SelectSingleNode("UserName");
if (subNode != null)
settings.NetworkSettings.UserName = subNode.InnerText;
subNode = node.SelectSingleNode("WebServiceUrl");
if (subNode != null)
settings.NetworkSettings.WebServiceUrl = subNode.InnerText;
}
settings.VobSubOcr = new Nikse.SubtitleEdit.Logic.VobSubOcrSettings(); settings.VobSubOcr = new Nikse.SubtitleEdit.Logic.VobSubOcrSettings();
node = doc.DocumentElement.SelectSingleNode("VobSubOcr"); node = doc.DocumentElement.SelectSingleNode("VobSubOcr");
@ -870,6 +907,7 @@ namespace Nikse.SubtitleEdit.Logic
textWriter.WriteElementString("DefaultAdjustMilliseconds", settings.General.DefaultAdjustMilliseconds.ToString()); textWriter.WriteElementString("DefaultAdjustMilliseconds", settings.General.DefaultAdjustMilliseconds.ToString());
textWriter.WriteElementString("AutoRepeatOn", settings.General.AutoRepeatOn.ToString()); textWriter.WriteElementString("AutoRepeatOn", settings.General.AutoRepeatOn.ToString());
textWriter.WriteElementString("AutoContinueOn", settings.General.AutoContinueOn.ToString()); textWriter.WriteElementString("AutoContinueOn", settings.General.AutoContinueOn.ToString());
textWriter.WriteElementString("SyncListViewWithVideoWhilePlaying", settings.General.SyncListViewWithVideoWhilePlaying.ToString());
textWriter.WriteElementString("AutoBackupSeconds", settings.General.AutoBackupSeconds.ToString()); textWriter.WriteElementString("AutoBackupSeconds", settings.General.AutoBackupSeconds.ToString());
textWriter.WriteEndElement(); textWriter.WriteEndElement();
@ -936,7 +974,6 @@ namespace Nikse.SubtitleEdit.Logic
textWriter.WriteElementString("CustomSearchText", settings.VideoControls.CustomSearchText); textWriter.WriteElementString("CustomSearchText", settings.VideoControls.CustomSearchText);
textWriter.WriteElementString("CustomSearchUrl", settings.VideoControls.CustomSearchUrl); textWriter.WriteElementString("CustomSearchUrl", settings.VideoControls.CustomSearchUrl);
textWriter.WriteElementString("LastActiveTab", settings.VideoControls.LastActiveTab); textWriter.WriteElementString("LastActiveTab", settings.VideoControls.LastActiveTab);
textWriter.WriteElementString("WaveFormDrawGrid", settings.VideoControls.WaveFormDrawGrid.ToString()); textWriter.WriteElementString("WaveFormDrawGrid", settings.VideoControls.WaveFormDrawGrid.ToString());
textWriter.WriteElementString("WaveFormGridColor", settings.VideoControls.WaveFormGridColor.ToArgb().ToString()); textWriter.WriteElementString("WaveFormGridColor", settings.VideoControls.WaveFormGridColor.ToArgb().ToString());
textWriter.WriteElementString("WaveFormColor", settings.VideoControls.WaveFormColor.ToArgb().ToString()); textWriter.WriteElementString("WaveFormColor", settings.VideoControls.WaveFormColor.ToArgb().ToString());
@ -945,6 +982,12 @@ namespace Nikse.SubtitleEdit.Logic
textWriter.WriteElementString("WaveFormTextColor", settings.VideoControls.WaveFormTextColor.ToArgb().ToString()); textWriter.WriteElementString("WaveFormTextColor", settings.VideoControls.WaveFormTextColor.ToArgb().ToString());
textWriter.WriteEndElement(); textWriter.WriteEndElement();
textWriter.WriteStartElement("NetworkSettings", "");
textWriter.WriteElementString("SessionKey", settings.NetworkSettings.SessionKey);
textWriter.WriteElementString("UserName", settings.NetworkSettings.UserName);
textWriter.WriteElementString("WebServiceUrl", settings.NetworkSettings.WebServiceUrl);
textWriter.WriteEndElement();
textWriter.WriteStartElement("VobSubOcr", ""); textWriter.WriteStartElement("VobSubOcr", "");
textWriter.WriteElementString("XOrMorePixelsMakesSpace", settings.VobSubOcr.XOrMorePixelsMakesSpace.ToString()); textWriter.WriteElementString("XOrMorePixelsMakesSpace", settings.VobSubOcr.XOrMorePixelsMakesSpace.ToString());
textWriter.WriteElementString("AllowDifferenceInPercent", settings.VobSubOcr.AllowDifferenceInPercent.ToString()); textWriter.WriteElementString("AllowDifferenceInPercent", settings.VobSubOcr.AllowDifferenceInPercent.ToString());

View File

@ -301,6 +301,18 @@ namespace Nikse.SubtitleEdit.Logic
return _paragraphs.IndexOf(p); return _paragraphs.IndexOf(p);
} }
internal Paragraph GetFirstAlike(Paragraph p)
{
foreach (Paragraph item in _paragraphs)
{
if (p.StartTime.TotalMilliseconds == item.StartTime.TotalMilliseconds &&
p.EndTime.TotalMilliseconds == item.EndTime.TotalMilliseconds &&
p.Text == item.Text)
return item;
}
return null;
}
internal Paragraph GetFirstParagraphByLineNumber(int number) internal Paragraph GetFirstParagraphByLineNumber(int number)
{ {
foreach (Paragraph p in _paragraphs) foreach (Paragraph p in _paragraphs)

View File

@ -12,6 +12,7 @@ using Nikse.SubtitleEdit.Controls;
using Nikse.SubtitleEdit.Forms; using Nikse.SubtitleEdit.Forms;
using Nikse.SubtitleEdit.Logic.SubtitleFormats; using Nikse.SubtitleEdit.Logic.SubtitleFormats;
using Nikse.SubtitleEdit.Logic.VideoPlayers; using Nikse.SubtitleEdit.Logic.VideoPlayers;
using System.Drawing;
namespace Nikse.SubtitleEdit.Logic namespace Nikse.SubtitleEdit.Logic
{ {
@ -289,6 +290,38 @@ namespace Nikse.SubtitleEdit.Logic
int splitPos = -1; int splitPos = -1;
int mid = s.Length / 2; int mid = s.Length / 2;
// try to find " - " with uppercase letter after (dialogue)
if (splitPos == -1 && s.Contains(" - "))
{
for (int j = 0; j < 40; j++)
{
if (mid + j + 4 < s.Length)
{
if (s[mid + j] == '-' && s[mid + j + 1] == ' ' && s[mid + j- 1] == ' ')
{
string rest = s.Substring(mid + j + 1).TrimStart();
if (rest.Length > 0 && (rest.Substring(0, 1) == rest.Substring(0, 1).ToUpper()))
{
splitPos = mid + j;
break;
}
}
}
if (mid - (j + 1) > 4)
{
if (s[mid - j] == '-' && s[mid - j + 1] == ' ' && s[mid - j - 1] == ' ')
{
string rest = s.Substring(mid - j + 1).TrimStart();
if (rest.Length > 0 && (rest.Substring(0, 1) == rest.Substring(0, 1).ToUpper()))
{
splitPos = mid - j;
break;
}
}
}
}
}
if (splitPos == -1) if (splitPos == -1)
{ {
for (int j = 0; j < 15; j++) for (int j = 0; j < 15; j++)
@ -757,6 +790,10 @@ namespace Nikse.SubtitleEdit.Logic
if (count > bestCount) if (count > bestCount)
return "vi"; // Vietnamese return "vi"; // Vietnamese
count = GetCount(text, "是的", "是啊", "好吧", "好的", "亲爱的", "早上好");
if (count > bestCount)
return "zh"; // Chinese (simplified) - not tested...
return string.Empty; return string.Empty;
} }
@ -1330,5 +1367,72 @@ namespace Nikse.SubtitleEdit.Logic
return s; return s;
} }
internal static Color GetColorFromUserName(string userName)
{
if (string.IsNullOrEmpty(userName))
return System.Drawing.Color.Pink;
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(userName);
long number = 0;
foreach (byte b in buffer)
number += b;
switch (number % 20)
{
case 0: return Color.Red;
case 1: return Color.Blue;
case 2: return Color.Green;
case 3: return Color.DarkCyan;
case 4: return Color.DarkGreen;
case 5: return Color.DarkBlue;
case 6: return Color.DarkTurquoise;
case 7: return Color.DarkViolet;
case 8: return Color.DeepPink;
case 9: return Color.DodgerBlue;
case 10: return Color.ForestGreen;
case 11: return Color.Fuchsia;
case 12: return Color.DarkOrange;
case 13: return Color.GreenYellow;
case 14: return Color.IndianRed;
case 15: return Color.Indigo;
case 16: return Color.LawnGreen;
case 17: return Color.LightBlue;
case 18: return Color.DarkGoldenrod;
case 19: return Color.Magenta;
case 20: return Color.Maroon;
default:
return Color.Black;
}
}
internal static int GetNumber0To7FromUserName(string userName)
{
if (string.IsNullOrEmpty(userName))
return 0;
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(userName);
long number = 0;
foreach (byte b in buffer)
number += b;
return (int)(number % 8);
}
internal static string GetRegExGroup( string regEx)
{
int start = regEx.IndexOf("(?<");
if (start >= 0 && regEx.IndexOf(")", start) > start)
{
int end = regEx.IndexOf(">", start);
if (end > start)
{
start += 3;
string group = regEx.Substring(start, end - start);
return group;
}
}
return null;
}
} }
} }

View File

@ -31,4 +31,4 @@ using System.Runtime.InteropServices;
// //
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("3.0.0.*")] [assembly: AssemblyVersion("3.0.1.*")]

View File

@ -22,7 +22,7 @@ namespace Nikse.SubtitleEdit.Properties {
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { public class Resources {
private static global::System.Resources.ResourceManager resourceMan; private static global::System.Resources.ResourceManager resourceMan;
@ -36,7 +36,7 @@ namespace Nikse.SubtitleEdit.Properties {
/// Returns the cached ResourceManager instance used by this class. /// Returns the cached ResourceManager instance used by this class.
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager { public static global::System.Resources.ResourceManager ResourceManager {
get { get {
if (object.ReferenceEquals(resourceMan, null)) { if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Nikse.SubtitleEdit.Properties.Resources", typeof(Resources).Assembly); global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Nikse.SubtitleEdit.Properties.Resources", typeof(Resources).Assembly);
@ -51,7 +51,7 @@ namespace Nikse.SubtitleEdit.Properties {
/// resource lookups using this strongly typed resource class. /// resource lookups using this strongly typed resource class.
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture { public static global::System.Globalization.CultureInfo Culture {
get { get {
return resourceCulture; return resourceCulture;
} }
@ -60,7 +60,14 @@ namespace Nikse.SubtitleEdit.Properties {
} }
} }
internal static System.Drawing.Bitmap Donate { public static System.Drawing.Bitmap connect {
get {
object obj = ResourceManager.GetObject("connect", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
public static System.Drawing.Bitmap Donate {
get { get {
object obj = ResourceManager.GetObject("Donate", resourceCulture); object obj = ResourceManager.GetObject("Donate", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));

View File

@ -117,8 +117,12 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Donate" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="Donate" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Icons\Donate.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Icons\Donate.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="connect" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Icons\connect.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

View File

@ -32,5 +32,15 @@ namespace Nikse.SubtitleEdit.Properties {
return ((string)(this["SubtitleEdit_MicrosoftTranslationService_SoapService"])); return ((string)(this["SubtitleEdit_MicrosoftTranslationService_SoapService"]));
} }
} }
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)]
[global::System.Configuration.DefaultSettingValueAttribute("http://localhost:2782/se/SeService.asmx")]
public string SubtitleEdit_SeNetworkService_SeService {
get {
return ((string)(this["SubtitleEdit_SeNetworkService_SeService"]));
}
}
} }
} }

View File

@ -5,5 +5,8 @@
<Setting Name="SubtitleEdit_MicrosoftTranslationService_SoapService" Type="(Web Service URL)" Scope="Application"> <Setting Name="SubtitleEdit_MicrosoftTranslationService_SoapService" Type="(Web Service URL)" Scope="Application">
<Value Profile="(Default)">http://api.microsofttranslator.com/V2/soap.svc</Value> <Value Profile="(Default)">http://api.microsofttranslator.com/V2/soap.svc</Value>
</Setting> </Setting>
<Setting Name="SubtitleEdit_SeNetworkService_SeService" Type="(Web Service URL)" Scope="Application">
<Value Profile="(Default)">http://localhost:2782/se/SeService.asmx</Value>
</Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@ -219,6 +219,30 @@
<Compile Include="Forms\GetDictionaries.Designer.cs"> <Compile Include="Forms\GetDictionaries.Designer.cs">
<DependentUpon>GetDictionaries.cs</DependentUpon> <DependentUpon>GetDictionaries.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Forms\NetworkChat.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\NetworkChat.Designer.cs">
<DependentUpon>NetworkChat.cs</DependentUpon>
</Compile>
<Compile Include="Forms\NetworkJoin.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\NetworkJoin.Designer.cs">
<DependentUpon>NetworkJoin.cs</DependentUpon>
</Compile>
<Compile Include="Forms\NetworkLogAndInfo.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\NetworkLogAndInfo.Designer.cs">
<DependentUpon>NetworkLogAndInfo.cs</DependentUpon>
</Compile>
<Compile Include="Forms\NetworkStart.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\NetworkStart.Designer.cs">
<DependentUpon>NetworkStart.cs</DependentUpon>
</Compile>
<Compile Include="Forms\SetSyncPoint.cs"> <Compile Include="Forms\SetSyncPoint.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@ -419,6 +443,12 @@
<Compile Include="Logic\FastBitmap.cs" /> <Compile Include="Logic\FastBitmap.cs" />
<Compile Include="Logic\IfoParser.cs" /> <Compile Include="Logic\IfoParser.cs" />
<Compile Include="Logic\Language.cs" /> <Compile Include="Logic\Language.cs" />
<Compile Include="Logic\Networking\NikseWebServiceSession.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Logic\Networking\UpdateLogEntry.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Logic\OCR\ModiLanguage.cs" /> <Compile Include="Logic\OCR\ModiLanguage.cs" />
<Compile Include="Logic\OCR\OcrAlphabet.cs" /> <Compile Include="Logic\OCR\OcrAlphabet.cs" />
<Compile Include="Logic\OCR\OcrCharacter.cs" /> <Compile Include="Logic\OCR\OcrCharacter.cs" />
@ -437,6 +467,7 @@
<Compile Include="Logic\FindReplaceDialogHelper.cs" /> <Compile Include="Logic\FindReplaceDialogHelper.cs" />
<Compile Include="Logic\HistoryItem.cs" /> <Compile Include="Logic\HistoryItem.cs" />
<Compile Include="Logic\StripableText.cs" /> <Compile Include="Logic\StripableText.cs" />
<Compile Include="Logic\SubtitleFormats\QuickTimeText.cs" />
<Compile Include="Logic\SubtitleFormats\SonyDVDArchitectWithLineNumbers.cs" /> <Compile Include="Logic\SubtitleFormats\SonyDVDArchitectWithLineNumbers.cs" />
<Compile Include="Logic\SubtitleFormats\Ebu.cs" /> <Compile Include="Logic\SubtitleFormats\Ebu.cs" />
<Compile Include="Logic\SubtitleFormats\SonyDVDArchitect.cs" /> <Compile Include="Logic\SubtitleFormats\SonyDVDArchitect.cs" />
@ -505,6 +536,11 @@
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
<DependentUpon>Reference.map</DependentUpon> <DependentUpon>Reference.map</DependentUpon>
</Compile> </Compile>
<Compile Include="Web References\SeNetworkService\Reference.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Reference.map</DependentUpon>
</Compile>
<EmbeddedResource Include="Controls\TimeUpDown.resx"> <EmbeddedResource Include="Controls\TimeUpDown.resx">
<DependentUpon>TimeUpDown.cs</DependentUpon> <DependentUpon>TimeUpDown.cs</DependentUpon>
<SubType>Designer</SubType> <SubType>Designer</SubType>
@ -568,6 +604,18 @@
<DependentUpon>GetDictionaries.cs</DependentUpon> <DependentUpon>GetDictionaries.cs</DependentUpon>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Forms\NetworkChat.resx">
<DependentUpon>NetworkChat.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\NetworkJoin.resx">
<DependentUpon>NetworkJoin.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\NetworkLogAndInfo.resx">
<DependentUpon>NetworkLogAndInfo.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\NetworkStart.resx">
<DependentUpon>NetworkStart.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\SetSyncPoint.resx"> <EmbeddedResource Include="Forms\SetSyncPoint.resx">
<DependentUpon>SetSyncPoint.cs</DependentUpon> <DependentUpon>SetSyncPoint.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@ -683,6 +731,7 @@
<EmbeddedResource Include="Resources\sr-Cyrl-CS.xml.zip" /> <EmbeddedResource Include="Resources\sr-Cyrl-CS.xml.zip" />
<EmbeddedResource Include="Resources\sr-Latn-CS.xml.zip" /> <EmbeddedResource Include="Resources\sr-Latn-CS.xml.zip" />
<EmbeddedResource Include="Resources\sv-SE.xml.zip" /> <EmbeddedResource Include="Resources\sv-SE.xml.zip" />
<EmbeddedResource Include="Resources\zh-CHS.xml.zip" />
<None Include="Web References\MicrosoftTranslationService\GetTranslationsResponse.datasource"> <None Include="Web References\MicrosoftTranslationService\GetTranslationsResponse.datasource">
<DependentUpon>Reference.map</DependentUpon> <DependentUpon>Reference.map</DependentUpon>
</None> </None>
@ -707,8 +756,24 @@
<None Include="Web References\MicrosoftTranslationService\TranslateArrayResponse.datasource"> <None Include="Web References\MicrosoftTranslationService\TranslateArrayResponse.datasource">
<DependentUpon>Reference.map</DependentUpon> <DependentUpon>Reference.map</DependentUpon>
</None> </None>
<None Include="Web References\SeNetworkService\Reference.map">
<Generator>MSDiscoCodeGenerator</Generator>
<LastGenOutput>Reference.cs</LastGenOutput>
</None>
<None Include="Web References\SeNetworkService\SeSequence.datasource">
<DependentUpon>Reference.map</DependentUpon>
</None>
<None Include="Web References\SeNetworkService\SeService.wsdl" />
<None Include="Web References\SeNetworkService\SeUpdate.datasource">
<DependentUpon>Reference.map</DependentUpon>
</None>
<None Include="Web References\SeNetworkService\SeUser.datasource">
<DependentUpon>Reference.map</DependentUpon>
</None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Resources\zh-CHS.xml" />
<None Include="Web References\SeNetworkService\SeService.disco" />
<None Include="DLLs\Interop.QuartzTypeLib.dll" /> <None Include="DLLs\Interop.QuartzTypeLib.dll" />
<None Include="DLLs\NHunspell.dll" /> <None Include="DLLs\NHunspell.dll" />
<None Include="DLLs\AxInterop.WMPLib.dll" /> <None Include="DLLs\AxInterop.WMPLib.dll" />
@ -766,6 +831,7 @@
<None Include="Resources\it-IT.xml.zip" /> <None Include="Resources\it-IT.xml.zip" />
<None Include="Resources\nl-NL.xml" /> <None Include="Resources\nl-NL.xml" />
<None Include="Icons\Donate.gif" /> <None Include="Icons\Donate.gif" />
<None Include="Icons\connect.png" />
<Content Include="Icons\Find.png"> <Content Include="Icons\Find.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
@ -887,6 +953,17 @@
<CachedAppSettingsObjectName>Settings</CachedAppSettingsObjectName> <CachedAppSettingsObjectName>Settings</CachedAppSettingsObjectName>
<CachedSettingsPropName>SubtitleEdit_MicrosoftTranslationService_SoapService</CachedSettingsPropName> <CachedSettingsPropName>SubtitleEdit_MicrosoftTranslationService_SoapService</CachedSettingsPropName>
</WebReferenceUrl> </WebReferenceUrl>
<WebReferenceUrl Include="http://localhost:2782/se/SeService.asmx">
<UrlBehavior>Dynamic</UrlBehavior>
<RelPath>Web References\SeNetworkService\</RelPath>
<UpdateFromURL>http://localhost:2782/se/SeService.asmx</UpdateFromURL>
<ServiceLocationURL>
</ServiceLocationURL>
<CachedDynamicPropName>
</CachedDynamicPropName>
<CachedAppSettingsObjectName>Settings</CachedAppSettingsObjectName>
<CachedSettingsPropName>SubtitleEdit_SeNetworkService_SeService</CachedSettingsPropName>
</WebReferenceUrl>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>

View File

@ -0,0 +1,956 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.1
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
// This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.1.
//
#pragma warning disable 1591
namespace Nikse.SubtitleEdit.SeNetworkService {
using System;
using System.Web.Services;
using System.Diagnostics;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Xml.Serialization;
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="SeServiceSoap", Namespace="http://tempuri.org/")]
public partial class SeService : System.Web.Services.Protocols.SoapHttpClientProtocol {
private System.Threading.SendOrPostCallback StartOperationCompleted;
private System.Threading.SendOrPostCallback JoinOperationCompleted;
private System.Threading.SendOrPostCallback LeaveOperationCompleted;
private System.Threading.SendOrPostCallback DeleteLinesOperationCompleted;
private System.Threading.SendOrPostCallback InsertLineOperationCompleted;
private System.Threading.SendOrPostCallback UpdateLineOperationCompleted;
private System.Threading.SendOrPostCallback SendMessageOperationCompleted;
private System.Threading.SendOrPostCallback GetUpdatesOperationCompleted;
private System.Threading.SendOrPostCallback GetSubtitleOperationCompleted;
private System.Threading.SendOrPostCallback GetOriginalSubtitleOperationCompleted;
private bool useDefaultCredentialsSetExplicitly;
/// <remarks/>
public SeService() {
this.Url = global::Nikse.SubtitleEdit.Properties.Settings.Default.SubtitleEdit_SeNetworkService_SeService;
if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
this.UseDefaultCredentials = true;
this.useDefaultCredentialsSetExplicitly = false;
}
else {
this.useDefaultCredentialsSetExplicitly = true;
}
}
public new string Url {
get {
return base.Url;
}
set {
if ((((this.IsLocalFileSystemWebService(base.Url) == true)
&& (this.useDefaultCredentialsSetExplicitly == false))
&& (this.IsLocalFileSystemWebService(value) == false))) {
base.UseDefaultCredentials = false;
}
base.Url = value;
}
}
public new bool UseDefaultCredentials {
get {
return base.UseDefaultCredentials;
}
set {
base.UseDefaultCredentials = value;
this.useDefaultCredentialsSetExplicitly = true;
}
}
/// <remarks/>
public event StartCompletedEventHandler StartCompleted;
/// <remarks/>
public event JoinCompletedEventHandler JoinCompleted;
/// <remarks/>
public event LeaveCompletedEventHandler LeaveCompleted;
/// <remarks/>
public event DeleteLinesCompletedEventHandler DeleteLinesCompleted;
/// <remarks/>
public event InsertLineCompletedEventHandler InsertLineCompleted;
/// <remarks/>
public event UpdateLineCompletedEventHandler UpdateLineCompleted;
/// <remarks/>
public event SendMessageCompletedEventHandler SendMessageCompleted;
/// <remarks/>
public event GetUpdatesCompletedEventHandler GetUpdatesCompleted;
/// <remarks/>
public event GetSubtitleCompletedEventHandler GetSubtitleCompleted;
/// <remarks/>
public event GetOriginalSubtitleCompletedEventHandler GetOriginalSubtitleCompleted;
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Start", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public SeUser Start(string sessionKey, string userName, SeSequence[] subtitle, SeSequence[] originalSubtitle, string fileName, out string message) {
object[] results = this.Invoke("Start", new object[] {
sessionKey,
userName,
subtitle,
originalSubtitle,
fileName});
message = ((string)(results[1]));
return ((SeUser)(results[0]));
}
/// <remarks/>
public void StartAsync(string sessionKey, string userName, SeSequence[] subtitle, SeSequence[] originalSubtitle, string fileName) {
this.StartAsync(sessionKey, userName, subtitle, originalSubtitle, fileName, null);
}
/// <remarks/>
public void StartAsync(string sessionKey, string userName, SeSequence[] subtitle, SeSequence[] originalSubtitle, string fileName, object userState) {
if ((this.StartOperationCompleted == null)) {
this.StartOperationCompleted = new System.Threading.SendOrPostCallback(this.OnStartOperationCompleted);
}
this.InvokeAsync("Start", new object[] {
sessionKey,
userName,
subtitle,
originalSubtitle,
fileName}, this.StartOperationCompleted, userState);
}
private void OnStartOperationCompleted(object arg) {
if ((this.StartCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.StartCompleted(this, new StartCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Join", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public SeUser[] Join(string sessionId, string userName, out string message) {
object[] results = this.Invoke("Join", new object[] {
sessionId,
userName});
message = ((string)(results[1]));
return ((SeUser[])(results[0]));
}
/// <remarks/>
public void JoinAsync(string sessionId, string userName) {
this.JoinAsync(sessionId, userName, null);
}
/// <remarks/>
public void JoinAsync(string sessionId, string userName, object userState) {
if ((this.JoinOperationCompleted == null)) {
this.JoinOperationCompleted = new System.Threading.SendOrPostCallback(this.OnJoinOperationCompleted);
}
this.InvokeAsync("Join", new object[] {
sessionId,
userName}, this.JoinOperationCompleted, userState);
}
private void OnJoinOperationCompleted(object arg) {
if ((this.JoinCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.JoinCompleted(this, new JoinCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Leave", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public void Leave(string sessionId, string userName) {
this.Invoke("Leave", new object[] {
sessionId,
userName});
}
/// <remarks/>
public void LeaveAsync(string sessionId, string userName) {
this.LeaveAsync(sessionId, userName, null);
}
/// <remarks/>
public void LeaveAsync(string sessionId, string userName, object userState) {
if ((this.LeaveOperationCompleted == null)) {
this.LeaveOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLeaveOperationCompleted);
}
this.InvokeAsync("Leave", new object[] {
sessionId,
userName}, this.LeaveOperationCompleted, userState);
}
private void OnLeaveOperationCompleted(object arg) {
if ((this.LeaveCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.LeaveCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteLines", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public bool DeleteLines(string sessionId, int[] indices, SeUser user) {
object[] results = this.Invoke("DeleteLines", new object[] {
sessionId,
indices,
user});
return ((bool)(results[0]));
}
/// <remarks/>
public void DeleteLinesAsync(string sessionId, int[] indices, SeUser user) {
this.DeleteLinesAsync(sessionId, indices, user, null);
}
/// <remarks/>
public void DeleteLinesAsync(string sessionId, int[] indices, SeUser user, object userState) {
if ((this.DeleteLinesOperationCompleted == null)) {
this.DeleteLinesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteLinesOperationCompleted);
}
this.InvokeAsync("DeleteLines", new object[] {
sessionId,
indices,
user}, this.DeleteLinesOperationCompleted, userState);
}
private void OnDeleteLinesOperationCompleted(object arg) {
if ((this.DeleteLinesCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.DeleteLinesCompleted(this, new DeleteLinesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/InsertLine", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public bool InsertLine(string sessionId, int index, int startMilliseconds, int endMilliseconds, string text, SeUser user) {
object[] results = this.Invoke("InsertLine", new object[] {
sessionId,
index,
startMilliseconds,
endMilliseconds,
text,
user});
return ((bool)(results[0]));
}
/// <remarks/>
public void InsertLineAsync(string sessionId, int index, int startMilliseconds, int endMilliseconds, string text, SeUser user) {
this.InsertLineAsync(sessionId, index, startMilliseconds, endMilliseconds, text, user, null);
}
/// <remarks/>
public void InsertLineAsync(string sessionId, int index, int startMilliseconds, int endMilliseconds, string text, SeUser user, object userState) {
if ((this.InsertLineOperationCompleted == null)) {
this.InsertLineOperationCompleted = new System.Threading.SendOrPostCallback(this.OnInsertLineOperationCompleted);
}
this.InvokeAsync("InsertLine", new object[] {
sessionId,
index,
startMilliseconds,
endMilliseconds,
text,
user}, this.InsertLineOperationCompleted, userState);
}
private void OnInsertLineOperationCompleted(object arg) {
if ((this.InsertLineCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.InsertLineCompleted(this, new InsertLineCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/UpdateLine", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public bool UpdateLine(string sessionId, int index, SeSequence sequence, SeUser user) {
object[] results = this.Invoke("UpdateLine", new object[] {
sessionId,
index,
sequence,
user});
return ((bool)(results[0]));
}
/// <remarks/>
public void UpdateLineAsync(string sessionId, int index, SeSequence sequence, SeUser user) {
this.UpdateLineAsync(sessionId, index, sequence, user, null);
}
/// <remarks/>
public void UpdateLineAsync(string sessionId, int index, SeSequence sequence, SeUser user, object userState) {
if ((this.UpdateLineOperationCompleted == null)) {
this.UpdateLineOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateLineOperationCompleted);
}
this.InvokeAsync("UpdateLine", new object[] {
sessionId,
index,
sequence,
user}, this.UpdateLineOperationCompleted, userState);
}
private void OnUpdateLineOperationCompleted(object arg) {
if ((this.UpdateLineCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.UpdateLineCompleted(this, new UpdateLineCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SendMessage", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public bool SendMessage(string sessionId, string text, SeUser user) {
object[] results = this.Invoke("SendMessage", new object[] {
sessionId,
text,
user});
return ((bool)(results[0]));
}
/// <remarks/>
public void SendMessageAsync(string sessionId, string text, SeUser user) {
this.SendMessageAsync(sessionId, text, user, null);
}
/// <remarks/>
public void SendMessageAsync(string sessionId, string text, SeUser user, object userState) {
if ((this.SendMessageOperationCompleted == null)) {
this.SendMessageOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendMessageOperationCompleted);
}
this.InvokeAsync("SendMessage", new object[] {
sessionId,
text,
user}, this.SendMessageOperationCompleted, userState);
}
private void OnSendMessageOperationCompleted(object arg) {
if ((this.SendMessageCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.SendMessageCompleted(this, new SendMessageCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetUpdates", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public SeUpdate[] GetUpdates(string sessionId, string userName, System.DateTime lastUpdateTime, out string message, out System.DateTime newUpdateTime) {
object[] results = this.Invoke("GetUpdates", new object[] {
sessionId,
userName,
lastUpdateTime});
message = ((string)(results[1]));
newUpdateTime = ((System.DateTime)(results[2]));
return ((SeUpdate[])(results[0]));
}
/// <remarks/>
public void GetUpdatesAsync(string sessionId, string userName, System.DateTime lastUpdateTime) {
this.GetUpdatesAsync(sessionId, userName, lastUpdateTime, null);
}
/// <remarks/>
public void GetUpdatesAsync(string sessionId, string userName, System.DateTime lastUpdateTime, object userState) {
if ((this.GetUpdatesOperationCompleted == null)) {
this.GetUpdatesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetUpdatesOperationCompleted);
}
this.InvokeAsync("GetUpdates", new object[] {
sessionId,
userName,
lastUpdateTime}, this.GetUpdatesOperationCompleted, userState);
}
private void OnGetUpdatesOperationCompleted(object arg) {
if ((this.GetUpdatesCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetUpdatesCompleted(this, new GetUpdatesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetSubtitle", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public SeSequence[] GetSubtitle(string sessionId, out string fileName, out System.DateTime updateTime) {
object[] results = this.Invoke("GetSubtitle", new object[] {
sessionId});
fileName = ((string)(results[1]));
updateTime = ((System.DateTime)(results[2]));
return ((SeSequence[])(results[0]));
}
/// <remarks/>
public void GetSubtitleAsync(string sessionId) {
this.GetSubtitleAsync(sessionId, null);
}
/// <remarks/>
public void GetSubtitleAsync(string sessionId, object userState) {
if ((this.GetSubtitleOperationCompleted == null)) {
this.GetSubtitleOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSubtitleOperationCompleted);
}
this.InvokeAsync("GetSubtitle", new object[] {
sessionId}, this.GetSubtitleOperationCompleted, userState);
}
private void OnGetSubtitleOperationCompleted(object arg) {
if ((this.GetSubtitleCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetSubtitleCompleted(this, new GetSubtitleCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOriginalSubtitle", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public SeSequence[] GetOriginalSubtitle(string sessionId) {
object[] results = this.Invoke("GetOriginalSubtitle", new object[] {
sessionId});
return ((SeSequence[])(results[0]));
}
/// <remarks/>
public void GetOriginalSubtitleAsync(string sessionId) {
this.GetOriginalSubtitleAsync(sessionId, null);
}
/// <remarks/>
public void GetOriginalSubtitleAsync(string sessionId, object userState) {
if ((this.GetOriginalSubtitleOperationCompleted == null)) {
this.GetOriginalSubtitleOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOriginalSubtitleOperationCompleted);
}
this.InvokeAsync("GetOriginalSubtitle", new object[] {
sessionId}, this.GetOriginalSubtitleOperationCompleted, userState);
}
private void OnGetOriginalSubtitleOperationCompleted(object arg) {
if ((this.GetOriginalSubtitleCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetOriginalSubtitleCompleted(this, new GetOriginalSubtitleCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
private bool IsLocalFileSystemWebService(string url) {
if (((url == null)
|| (url == string.Empty))) {
return false;
}
System.Uri wsUri = new System.Uri(url);
if (((wsUri.Port >= 1024)
&& (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) {
return true;
}
return false;
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/")]
public partial class SeSequence {
private int indexField;
private int startMillisecondsField;
private int endMillisecondsField;
private string textField;
/// <remarks/>
public int Index {
get {
return this.indexField;
}
set {
this.indexField = value;
}
}
/// <remarks/>
public int StartMilliseconds {
get {
return this.startMillisecondsField;
}
set {
this.startMillisecondsField = value;
}
}
/// <remarks/>
public int EndMilliseconds {
get {
return this.endMillisecondsField;
}
set {
this.endMillisecondsField = value;
}
}
/// <remarks/>
public string Text {
get {
return this.textField;
}
set {
this.textField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/")]
public partial class SeUpdate {
private System.DateTime timeField;
private SeUser userField;
private int indexField;
private int startMillisecondsField;
private int endMillisecondsField;
private string textField;
private string actionField;
/// <remarks/>
public System.DateTime Time {
get {
return this.timeField;
}
set {
this.timeField = value;
}
}
/// <remarks/>
public SeUser User {
get {
return this.userField;
}
set {
this.userField = value;
}
}
/// <remarks/>
public int Index {
get {
return this.indexField;
}
set {
this.indexField = value;
}
}
/// <remarks/>
public int StartMilliseconds {
get {
return this.startMillisecondsField;
}
set {
this.startMillisecondsField = value;
}
}
/// <remarks/>
public int EndMilliseconds {
get {
return this.endMillisecondsField;
}
set {
this.endMillisecondsField = value;
}
}
/// <remarks/>
public string Text {
get {
return this.textField;
}
set {
this.textField = value;
}
}
/// <remarks/>
public string Action {
get {
return this.actionField;
}
set {
this.actionField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/")]
public partial class SeUser {
private string userNameField;
private string ipField;
private System.DateTime lastActivityField;
/// <remarks/>
public string UserName {
get {
return this.userNameField;
}
set {
this.userNameField = value;
}
}
/// <remarks/>
public string Ip {
get {
return this.ipField;
}
set {
this.ipField = value;
}
}
/// <remarks/>
public System.DateTime LastActivity {
get {
return this.lastActivityField;
}
set {
this.lastActivityField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
public delegate void StartCompletedEventHandler(object sender, StartCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class StartCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal StartCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public SeUser Result {
get {
this.RaiseExceptionIfNecessary();
return ((SeUser)(this.results[0]));
}
}
/// <remarks/>
public string message {
get {
this.RaiseExceptionIfNecessary();
return ((string)(this.results[1]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
public delegate void JoinCompletedEventHandler(object sender, JoinCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class JoinCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal JoinCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public SeUser[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((SeUser[])(this.results[0]));
}
}
/// <remarks/>
public string message {
get {
this.RaiseExceptionIfNecessary();
return ((string)(this.results[1]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
public delegate void LeaveCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
public delegate void DeleteLinesCompletedEventHandler(object sender, DeleteLinesCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class DeleteLinesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal DeleteLinesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public bool Result {
get {
this.RaiseExceptionIfNecessary();
return ((bool)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
public delegate void InsertLineCompletedEventHandler(object sender, InsertLineCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class InsertLineCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal InsertLineCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public bool Result {
get {
this.RaiseExceptionIfNecessary();
return ((bool)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
public delegate void UpdateLineCompletedEventHandler(object sender, UpdateLineCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class UpdateLineCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal UpdateLineCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public bool Result {
get {
this.RaiseExceptionIfNecessary();
return ((bool)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
public delegate void SendMessageCompletedEventHandler(object sender, SendMessageCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class SendMessageCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal SendMessageCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public bool Result {
get {
this.RaiseExceptionIfNecessary();
return ((bool)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
public delegate void GetUpdatesCompletedEventHandler(object sender, GetUpdatesCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetUpdatesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetUpdatesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public SeUpdate[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((SeUpdate[])(this.results[0]));
}
}
/// <remarks/>
public string message {
get {
this.RaiseExceptionIfNecessary();
return ((string)(this.results[1]));
}
}
/// <remarks/>
public System.DateTime newUpdateTime {
get {
this.RaiseExceptionIfNecessary();
return ((System.DateTime)(this.results[2]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
public delegate void GetSubtitleCompletedEventHandler(object sender, GetSubtitleCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetSubtitleCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetSubtitleCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public SeSequence[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((SeSequence[])(this.results[0]));
}
}
/// <remarks/>
public string fileName {
get {
this.RaiseExceptionIfNecessary();
return ((string)(this.results[1]));
}
}
/// <remarks/>
public System.DateTime updateTime {
get {
this.RaiseExceptionIfNecessary();
return ((System.DateTime)(this.results[2]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
public delegate void GetOriginalSubtitleCompletedEventHandler(object sender, GetOriginalSubtitleCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetOriginalSubtitleCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetOriginalSubtitleCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public SeSequence[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((SeSequence[])(this.results[0]));
}
}
}
}
#pragma warning restore 1591

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<DiscoveryClientResultsFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Results>
<DiscoveryClientResult referenceType="System.Web.Services.Discovery.ContractReference" url="http://localhost:2782/se/SeService.asmx?wsdl" filename="SeService.wsdl" />
<DiscoveryClientResult referenceType="System.Web.Services.Discovery.DiscoveryDocumentReference" url="http://localhost:2782/se/SeService.asmx?disco" filename="SeService.disco" />
</Results>
</DiscoveryClientResultsFile>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="SeSequence" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>Nikse.SubtitleEdit.SeNetworkService.SeSequence, Web References.SeNetworkService.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<discovery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/disco/">
<contractRef ref="http://localhost:2782/se/SeService.asmx?wsdl" docRef="http://localhost:2782/se/SeService.asmx" xmlns="http://schemas.xmlsoap.org/disco/scl/" />
<soap address="http://localhost:2782/se/SeService.asmx" xmlns:q1="http://tempuri.org/" binding="q1:SeServiceSoap" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
<soap address="http://localhost:2782/se/SeService.asmx" xmlns:q2="http://tempuri.org/" binding="q2:SeServiceSoap12" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
</discovery>

View File

@ -0,0 +1,511 @@
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="Start">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="sessionKey" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="userName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="subtitle" type="tns:ArrayOfSeSequence" />
<s:element minOccurs="0" maxOccurs="1" name="originalSubtitle" type="tns:ArrayOfSeSequence" />
<s:element minOccurs="0" maxOccurs="1" name="fileName" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfSeSequence">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="SeSequence" nillable="true" type="tns:SeSequence" />
</s:sequence>
</s:complexType>
<s:complexType name="SeSequence">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="Index" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="StartMilliseconds" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="EndMilliseconds" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="Text" type="s:string" />
</s:sequence>
</s:complexType>
<s:element name="StartResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="StartResult" type="tns:SeUser" />
<s:element minOccurs="0" maxOccurs="1" name="message" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="SeUser">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="UserName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Ip" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="LastActivity" type="s:dateTime" />
</s:sequence>
</s:complexType>
<s:element name="Join">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="sessionId" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="userName" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="JoinResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="JoinResult" type="tns:ArrayOfSeUser" />
<s:element minOccurs="0" maxOccurs="1" name="message" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfSeUser">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="SeUser" nillable="true" type="tns:SeUser" />
</s:sequence>
</s:complexType>
<s:element name="Leave">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="sessionId" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="userName" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="LeaveResponse">
<s:complexType />
</s:element>
<s:element name="DeleteLines">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="sessionId" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="indices" type="tns:ArrayOfInt" />
<s:element minOccurs="0" maxOccurs="1" name="user" type="tns:SeUser" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfInt">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="int" type="s:int" />
</s:sequence>
</s:complexType>
<s:element name="DeleteLinesResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="DeleteLinesResult" type="s:boolean" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="InsertLine">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="sessionId" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="index" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="startMilliseconds" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="endMilliseconds" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="text" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="user" type="tns:SeUser" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="InsertLineResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="InsertLineResult" type="s:boolean" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="UpdateLine">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="sessionId" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="index" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="sequence" type="tns:SeSequence" />
<s:element minOccurs="0" maxOccurs="1" name="user" type="tns:SeUser" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="UpdateLineResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="UpdateLineResult" type="s:boolean" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="SendMessage">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="sessionId" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="text" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="user" type="tns:SeUser" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="SendMessageResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="SendMessageResult" type="s:boolean" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetUpdates">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="sessionId" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="userName" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="lastUpdateTime" type="s:dateTime" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetUpdatesResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetUpdatesResult" type="tns:ArrayOfSeUpdate" />
<s:element minOccurs="0" maxOccurs="1" name="message" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="newUpdateTime" type="s:dateTime" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfSeUpdate">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="SeUpdate" nillable="true" type="tns:SeUpdate" />
</s:sequence>
</s:complexType>
<s:complexType name="SeUpdate">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="Time" type="s:dateTime" />
<s:element minOccurs="0" maxOccurs="1" name="User" type="tns:SeUser" />
<s:element minOccurs="1" maxOccurs="1" name="Index" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="StartMilliseconds" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="EndMilliseconds" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="Text" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Action" type="s:string" />
</s:sequence>
</s:complexType>
<s:element name="GetSubtitle">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="sessionId" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetSubtitleResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetSubtitleResult" type="tns:ArrayOfSeSequence" />
<s:element minOccurs="0" maxOccurs="1" name="fileName" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="updateTime" type="s:dateTime" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetOriginalSubtitle">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="sessionId" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetOriginalSubtitleResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetOriginalSubtitleResult" type="tns:ArrayOfSeSequence" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="StartSoapIn">
<wsdl:part name="parameters" element="tns:Start" />
</wsdl:message>
<wsdl:message name="StartSoapOut">
<wsdl:part name="parameters" element="tns:StartResponse" />
</wsdl:message>
<wsdl:message name="JoinSoapIn">
<wsdl:part name="parameters" element="tns:Join" />
</wsdl:message>
<wsdl:message name="JoinSoapOut">
<wsdl:part name="parameters" element="tns:JoinResponse" />
</wsdl:message>
<wsdl:message name="LeaveSoapIn">
<wsdl:part name="parameters" element="tns:Leave" />
</wsdl:message>
<wsdl:message name="LeaveSoapOut">
<wsdl:part name="parameters" element="tns:LeaveResponse" />
</wsdl:message>
<wsdl:message name="DeleteLinesSoapIn">
<wsdl:part name="parameters" element="tns:DeleteLines" />
</wsdl:message>
<wsdl:message name="DeleteLinesSoapOut">
<wsdl:part name="parameters" element="tns:DeleteLinesResponse" />
</wsdl:message>
<wsdl:message name="InsertLineSoapIn">
<wsdl:part name="parameters" element="tns:InsertLine" />
</wsdl:message>
<wsdl:message name="InsertLineSoapOut">
<wsdl:part name="parameters" element="tns:InsertLineResponse" />
</wsdl:message>
<wsdl:message name="UpdateLineSoapIn">
<wsdl:part name="parameters" element="tns:UpdateLine" />
</wsdl:message>
<wsdl:message name="UpdateLineSoapOut">
<wsdl:part name="parameters" element="tns:UpdateLineResponse" />
</wsdl:message>
<wsdl:message name="SendMessageSoapIn">
<wsdl:part name="parameters" element="tns:SendMessage" />
</wsdl:message>
<wsdl:message name="SendMessageSoapOut">
<wsdl:part name="parameters" element="tns:SendMessageResponse" />
</wsdl:message>
<wsdl:message name="GetUpdatesSoapIn">
<wsdl:part name="parameters" element="tns:GetUpdates" />
</wsdl:message>
<wsdl:message name="GetUpdatesSoapOut">
<wsdl:part name="parameters" element="tns:GetUpdatesResponse" />
</wsdl:message>
<wsdl:message name="GetSubtitleSoapIn">
<wsdl:part name="parameters" element="tns:GetSubtitle" />
</wsdl:message>
<wsdl:message name="GetSubtitleSoapOut">
<wsdl:part name="parameters" element="tns:GetSubtitleResponse" />
</wsdl:message>
<wsdl:message name="GetOriginalSubtitleSoapIn">
<wsdl:part name="parameters" element="tns:GetOriginalSubtitle" />
</wsdl:message>
<wsdl:message name="GetOriginalSubtitleSoapOut">
<wsdl:part name="parameters" element="tns:GetOriginalSubtitleResponse" />
</wsdl:message>
<wsdl:portType name="SeServiceSoap">
<wsdl:operation name="Start">
<wsdl:input message="tns:StartSoapIn" />
<wsdl:output message="tns:StartSoapOut" />
</wsdl:operation>
<wsdl:operation name="Join">
<wsdl:input message="tns:JoinSoapIn" />
<wsdl:output message="tns:JoinSoapOut" />
</wsdl:operation>
<wsdl:operation name="Leave">
<wsdl:input message="tns:LeaveSoapIn" />
<wsdl:output message="tns:LeaveSoapOut" />
</wsdl:operation>
<wsdl:operation name="DeleteLines">
<wsdl:input message="tns:DeleteLinesSoapIn" />
<wsdl:output message="tns:DeleteLinesSoapOut" />
</wsdl:operation>
<wsdl:operation name="InsertLine">
<wsdl:input message="tns:InsertLineSoapIn" />
<wsdl:output message="tns:InsertLineSoapOut" />
</wsdl:operation>
<wsdl:operation name="UpdateLine">
<wsdl:input message="tns:UpdateLineSoapIn" />
<wsdl:output message="tns:UpdateLineSoapOut" />
</wsdl:operation>
<wsdl:operation name="SendMessage">
<wsdl:input message="tns:SendMessageSoapIn" />
<wsdl:output message="tns:SendMessageSoapOut" />
</wsdl:operation>
<wsdl:operation name="GetUpdates">
<wsdl:input message="tns:GetUpdatesSoapIn" />
<wsdl:output message="tns:GetUpdatesSoapOut" />
</wsdl:operation>
<wsdl:operation name="GetSubtitle">
<wsdl:input message="tns:GetSubtitleSoapIn" />
<wsdl:output message="tns:GetSubtitleSoapOut" />
</wsdl:operation>
<wsdl:operation name="GetOriginalSubtitle">
<wsdl:input message="tns:GetOriginalSubtitleSoapIn" />
<wsdl:output message="tns:GetOriginalSubtitleSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SeServiceSoap" type="tns:SeServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="Start">
<soap:operation soapAction="http://tempuri.org/Start" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Join">
<soap:operation soapAction="http://tempuri.org/Join" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Leave">
<soap:operation soapAction="http://tempuri.org/Leave" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="DeleteLines">
<soap:operation soapAction="http://tempuri.org/DeleteLines" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="InsertLine">
<soap:operation soapAction="http://tempuri.org/InsertLine" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="UpdateLine">
<soap:operation soapAction="http://tempuri.org/UpdateLine" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="SendMessage">
<soap:operation soapAction="http://tempuri.org/SendMessage" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetUpdates">
<soap:operation soapAction="http://tempuri.org/GetUpdates" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetSubtitle">
<soap:operation soapAction="http://tempuri.org/GetSubtitle" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetOriginalSubtitle">
<soap:operation soapAction="http://tempuri.org/GetOriginalSubtitle" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="SeServiceSoap12" type="tns:SeServiceSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="Start">
<soap12:operation soapAction="http://tempuri.org/Start" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Join">
<soap12:operation soapAction="http://tempuri.org/Join" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Leave">
<soap12:operation soapAction="http://tempuri.org/Leave" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="DeleteLines">
<soap12:operation soapAction="http://tempuri.org/DeleteLines" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="InsertLine">
<soap12:operation soapAction="http://tempuri.org/InsertLine" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="UpdateLine">
<soap12:operation soapAction="http://tempuri.org/UpdateLine" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="SendMessage">
<soap12:operation soapAction="http://tempuri.org/SendMessage" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetUpdates">
<soap12:operation soapAction="http://tempuri.org/GetUpdates" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetSubtitle">
<soap12:operation soapAction="http://tempuri.org/GetSubtitle" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetOriginalSubtitle">
<soap12:operation soapAction="http://tempuri.org/GetOriginalSubtitle" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SeService">
<wsdl:port name="SeServiceSoap" binding="tns:SeServiceSoap">
<soap:address location="http://localhost:2782/se/SeService.asmx" />
</wsdl:port>
<wsdl:port name="SeServiceSoap12" binding="tns:SeServiceSoap12">
<soap12:address location="http://localhost:2782/se/SeService.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="SeUpdate" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>Nikse.SubtitleEdit.SeNetworkService.SeUpdate, Web References.SeNetworkService.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="SeUser" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>Nikse.SubtitleEdit.SeNetworkService.SeUser, Web References.SeNetworkService.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

View File

@ -11,6 +11,9 @@
serializeAs="String"> serializeAs="String">
<value>http://api.microsofttranslator.com/V2/soap.svc</value> <value>http://api.microsofttranslator.com/V2/soap.svc</value>
</setting> </setting>
<setting name="SubtitleEdit_SeNetworkService_SeService" serializeAs="String">
<value>http://localhost:2782/se/SeService.asmx</value>
</setting>
</Nikse.SubtitleEdit.Properties.Settings> </Nikse.SubtitleEdit.Properties.Settings>
</applicationSettings> </applicationSettings>
</configuration> </configuration>