Page 1 of 1

Collaboration is impossible due to psf files being binary files

Posted: Mon Mar 15, 2021 4:02 am
by ALIENQuake
Hi,

Finally, I have found a person who is willing to contribute to my Forms project. Turns out collaboration is impossible due to psf files being binary files.

Whatever extra benefit's this feature provides, It's irrelevant for me when the collaboration ability is at the stake.

How I can disable this 'feature' so we can commit to Git repository and see actual code changes with windows forms designer code instead of XML?

Re: Collaboration is impossible due to psf files being binary files

Posted: Mon Mar 15, 2021 9:37 am
by Alexander Riedel
PSF files are not binary. They are text files. The code inside is plain text.
What is stored as 'binary' (encoded as text) is the form and its preview. Since the Windows Forms designer does not support PowerShell,
a round-robin code - object - code is not possible. I sincerely doubt that Microsoft will add PowerShell to the designer supported languages at any time.
So it is neither feature nor malfeasance on our part, it is simply a necessity.

Re: Collaboration is impossible due to psf files being binary files

Posted: Tue Mar 16, 2021 2:51 am
by ALIENQuake
Your reply doesn't make any sense but maybe I haven't explained it properly.

Let's look at the simple form:
Test-Form.psf
(27.53 KiB) Downloaded 907 times
Zx4alMXs3G.png
Zx4alMXs3G.png (2.26 KiB) Viewed 22884 times
code:

Code: Select all

	#----------------------------------------------
	#region Generated Form Code
	#----------------------------------------------
	$form1.SuspendLayout()
	#
	# form1
	#
	$form1.Controls.Add($button1)
	$form1.AutoScaleDimensions = New-Object System.Drawing.SizeF(6, 13)
	$form1.AutoScaleMode = 'Font'
	$form1.ClientSize = New-Object System.Drawing.Size(284, 261)
	$form1.Name = 'form1'
	$form1.Text = 'Form'
	$form1.add_Load($form1_Load)
	#
	# button1
	#
	$button1.Location = New-Object System.Drawing.Point(12, 226)
	$button1.Name = 'button1'
	$button1.Size = New-Object System.Drawing.Size(75, 23)
	$button1.TabIndex = 0
	$button1.Text = 'button1'
	$button1.UseVisualStyleBackColor = $True
	$button1.add_Click($button1_Click)
	$form1.ResumeLayout()
	#endregion Generated Form Code
when my coworker will change the placement of the 'button1' from left to right, the underlying code changes will look like this:

Code: Select all

	$button1.Location = New-Object System.Drawing.Point(197, 226)
then, he can commit this change into a git repository, I can review it and merge it.

But this code is not visible inside .psf file. All we see is XML data that can't be reviewed. And if I do GUI changes myself, there is no way to merge both changes.

Re: Collaboration is impossible due to psf files being binary files

Posted: Tue Mar 16, 2021 9:59 am
by Alexander Riedel
Does the other person have PowerShell Studio?

Re: Collaboration is impossible due to psf files being binary files

Posted: Tue Mar 16, 2021 1:00 pm
by ALIENQuake
Yes, we are modifying the whole project at the same time. With ps1 files there is no problem as both of us can see all related changes.

Re: Collaboration is impossible due to psf files being binary files

Posted: Tue Mar 16, 2021 2:44 pm
by Alexander Riedel
The UI code is always generated out of the object, so you cannot work on the UI at the same time.
Place pure code in specific files as much as possible.
It is basically not any different than resources in a C++ project. Even though it is technically text, you need to serialize modifications.

Re: Collaboration is impossible due to psf files being binary files

Posted: Thu Mar 18, 2021 6:25 am
by ALIENQuake
It appears to me that the way how 'forms code' is handled is specific to PowerShell Studio's internal design. What are the chances of changing? Can I have a simple and straightforward answer?

Re: Collaboration is impossible due to psf files being binary files

Posted: Thu Mar 18, 2021 7:17 am
by brittneyr
We have no plans to change the psf format at this time. I have added this to the list of things to look into for the development team. As for when that will happen, there is no timeline.

Re: Collaboration is impossible due to psf files being binary files

Posted: Thu Mar 18, 2021 10:06 am
by ALIENQuake
Thanks for the reply. My only wish is that upcoming WPF support will be implemented in a way that this limitation will not exist.