• IP addresses are NOT logged in this forum so there's no point asking. Please note that this forum is full of homophobes, racists, lunatics, schizophrenics & absolute nut jobs with a smattering of geniuses, Chinese chauvinists, Moderate Muslims and last but not least a couple of "know-it-alls" constantly sprouting their dubious wisdom. If you believe that content generated by unsavory characters might cause you offense PLEASE LEAVE NOW! Sammyboy Admin and Staff are not responsible for your hurt feelings should you choose to read any of the content here.

    The OTHER forum is HERE so please stop asking.

Integrate your application, and access Noticeboard objects, schedule and animation.

ChioCS

Advertiser
Moderator
With noticeboard external window, now you can write your own application and access to Noticeboard objects, schedule and animation. As long as your application is run on window, Noticeboard can schedule and reschedule it to run at any time or in days or weeks ahead. And if it is a wpf dotnet application, then you can access to any graphic objects and animation that you create in Noticeboard window.

external1.png


1. Insert a window, and under the window type, select External. The above option will appears.
2. Drop your program, fill in your program arguments, if any.

That's it. It will execute your program as scheduled and stop your application after it's duration has elapsed. The other thing you may want to take care and know is that it will pass you 2 additional parameters at the end of your arguments, ie:

Bound: x,y,width,height
Elapsed Time in Seconds: xxx

The other fields are "Received Xml Name" and "Received from Standard Input".

If you select "Received from Standard Input", instead of forcefully start and stop your application process, it will send you these commands instead.

Action=Start
Action=Show
Action=Hide
Action=Stop

Except for "Action=Start", which you may or may not want to do anything, the rest of the actions, you should act on it. Action Show and Hide are only sent if a rescheduled occur.

To received objects and its' animation from Noticeboard, "checked" the "Received Xml name". It will pass you a file containing your objects in a xml formatted file to your executing directory. The file name will be appended to your program arguments as specified and if there is an existing file with the same name, it will append a running number suffix to it.

We will provide you the details in the sample below.
 
Last edited:

ChioCS

Advertiser
Moderator
Re: Integrate your application, and access Noticeboard objects, schedule and animatio

Here's the breakdown of the Wpf sample of MyProgram.exe using c#. For clarity sake, it has minimun error trapping and error checking, but please do add the neccessary error validation.

In the public MainWindow(), we first read in the 3 parameters.

string[] parameters = System.Environment.GetCommandLineArgs();
if (parameters.Length > 3)
{
Rect bound = Rect.Parse(parameters[1]);
double elapseTime = Convert.ToDouble(parameters[2]);
NameScope.SetNameScope(mainCanvas, new NameScope());
readXml(parameters[3]);
}


Next set the position and size of your window with the bound parameter. However, since we are reading in the xml file, and it too contains the window bound, we will set it later. We will also ignore the elapseTime duration as it is not needed since we will be actively reading Console.In.

We are going to import some objects plus animation, we need to define a new NameScope. Ok, now we read the xml file and get the objects and animation.

void readXml(string file)
{
.... plus all xml methods ( provided in the zip archive )
}


In the readXml method it will also follow-up with reading in the objects and animation before registering and adding them into the mainCanvas.

For this demostration, we also created a button to manually run the animation.

Button button = new Button();
button.Content = "Animate";
button.Click += new RoutedEventHandler(button_Click);
mainCanvas.Children.Add(button);


Next we wait for action instruction from noticeboard app via Standard Input ( Console.In ).

void waitForInput()
{
Thread t = new Thread(waitThread);
t.SetApartmentState(ApartmentState.STA);
t.Start();

DispatcherTimer timer = new DispatcherTimer();
timer.Tick += new EventHandler(action_Tick);
timer.Interval = TimeSpan.FromMilliseconds(100);
timer.Start();​
}


We use a seperate thread instead of running in the same thread as there seems to be some problem with Console.In.Peek() ? Therefore there are some overheads, but by all means if you have better alternative, please do use it.

So that's it, here the zip/rar file. If you intend to use it, make sure you recompile and drop the new excutable in the program field in the sample external.ntb file.

external.rar
 
Last edited:

ChioCS

Advertiser
Moderator
Re: Integrate your application, and access Noticeboard objects, schedule and animatio

Here's how it look like in the sample.

external2.png


We create a window with a schedule time of 1 minute and repeat for another 2 times with 5 seconds duration. In it we create 3 objects with animation.

We choose External as the window type. In the external options, we drop the external.exe, which I have already written into the program drop down icon. No further arguments is needed, so we leave it blank. We like to received these objects, so we "Checked" the "Received Xml Name" checkbox and accept the default name. We would also like to interact, so the "Received from standard input" checkbox is also "Checked".

And saved the project as "External.ntb" and exit out.

external3.png


The above will show when you double click on the "External.ntb". In this little program, we just had a "Animate" button and the rest is fetch from Noticeboard. If you click on the button, it will play and animates the 3 objects.

Next, after 1 minute the program received a "Action=Hide" from Noticeboard, that we handle it by issuing a "this.Hide()" in our program. In another 5 seconds, we received another action "Action=Show", therefore we show our application by issuing a "this.Show().

It will be repeated for 2 more times, before we received the action "Action=Stop". And we exited out of our application.

So, with external window feature in NoticeBoard, it will provide you with a flexible option to integrate your existing application and of course you could build your own multimedia application on top of it. Or any other flashy and catchy theme to make your display, rich and interesting.
 

ChioCS

Advertiser
Moderator
Re: Integrate your application, and access Noticeboard objects, schedule and animatio

Here's another example of External Window which is a strip down version of Fly Splash. You can change, enhance or use it whatever you like.

FlyExternal.rar.

External.rar is also updated with new routine, please download it.
 

ChioCS

Advertiser
Moderator
Re: Integrate your application, and access Noticeboard objects, schedule and animatio

With the latest release, we have include an External.dll file that contains the routines you need to communicate NoticeBoard. And will be kept up to date.

Here's the sample that shows you how.

ExternalSample.rar.
 
Top