|
Hello,
Before coming to the problem statement, let me brief on the task I am working on.
I want to:
1. Add slide to a presentation
2. Insert video from external file to the slide, and then
3. Set PLAYBACK options of a video like Play Full Screen & Start Automatically.
So that, during the slide show, the video will be played fully before continuing to the next slide.
I could do tasks in point 1 & 2, but am stuck in point 3. I have referred MSDN documentation but too less information to accomplish my need.
Sharing snippet of code with appropriate comments:
using PowerPoint = Microsoft.Office.Interop.PowerPoint;
.
.
.
PowerPoint.Application pptApp;
PowerPoint.Presentations oPresentations;
PowerPoint.Presentation oPresentation;
string sPath = @"C:\sample.avi";
pptApp = new PowerPoint.Application();
pptApp.Visible = MCore.MsoTriState.msoTrue;
oPresentations = pptApp.Presentations;
oPresentation = oPresentations.Add(MCore.MsoTriState.msoTrue);
PowerPoint.Slide slide = oPresentation.Slides.AddSlide(oPresentation.Slides.Count, oPresentation.Slides[oPresentation.Slides.Count].CustomLayout);
PowerPoint.Shape video = slide.Shapes.AddMediaObject2(sPath, MCore.MsoTriState.msoFalse, MCore.MsoTriState.msoTrue, 0f, 0f, -1f, -1f);
video.AnimationSettings.PlaySettings.PlayOnEntry = MCore.MsoTriState.msoTrue;
Kindly help me with this. Let me know if you need more information.
Thanks in advance.
-Shree
|
|
|
|
|
Since you're "controlling the presentation", why fixate that PowerPoint "must show the video"?
e.g. Show some slides; switch to a full-screen media element display for the video; then switch pack to the slides.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Hi Blaise,
Thanks for your response.
But, I am afraid I am not getting your statement "switch to a full-screen media element display for the video".
Can you please elaborate or share some code around? It would be really helpful.
T&R,
Shrikrishna.
|
|
|
|
|
Can't you "minimize" PowerPoint? And then display another window on top of it?
You're writing the code.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Note: I am dynamically inserting video at given path in my presentation.
|
|
|
|
|
I "noted" that ... and also noted it's "not working" for you.
Since this is not a "canned" presentation, there are no "rules".
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
What im trying to do is design and fuctions(not all) like Orange5 has on a main area(see the link of the picture). This field origionally filled with "FFFF" letters, and the user can write into this cells, and change the data on into by clicking the "write" button. Also i can fill this field by pressing a "read" button, it will read the data from EEPROM . My code on Microcontroller is ready, and i already know how to send/receive/write/read data from/into EEPROM to C#. But i dont know how to relise this on C# with this design and functions. Any help please..
http://imgur.com/a/90Wsn
|
|
|
|
|
|
Ex: let’s I have a Combo-box control in my Win-Form project and that has a list of city stored in database, now user A and User B are working on the same form. If user A adds a new city in the database how can User B’s combo-box take that change into consideration and update itself automatically?
|
|
|
|
|
That sounds more like a web application; how exactly can two users work on the same form? Are you sure this is the right forum?
|
|
|
|
|
You'd be killing the database with requests; the form should ask for the current cities to display when it is opened.
The proposed architecture does not solve any problems, does not add value and will introduce a lot of new problems to solve. What happens when two people edit the same text-box? Would you want the form to show those edits to, in real-time?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I think you are describing two users using each a database client application connected to one database.
There is no method to do that besides refreshing the form in regular intervals (which is a bad idea).
But it is not necessary at all. When a user did not find a city in the database he will probably enter it and the application is updating the database and reloading the combo box using a database query. When another user shortly thereafter tries to add the same city, this will fail. But the failure can be silently ignored. The application just reloads the combo box which contains then the new city.
|
|
|
|
|
Client-server application where updates are pushed through the server and trigger events via the observer pattern. These events can be used to notify client systems.
It would be nice if we could find a common UI parser so that we could push client software updates out from a centralized source across some kind of pre-existing structure, like a network...
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
|
My Interface:
public interface IInstrumentService
{
void Start();
void Stop();
void UpdateStatus(ServiceStatusModel status);
}
My class
public class TestClass1 : IInstrumentService
{
public void Start()
{
}
public void Stop()
{
}
public void UpdateStatus(ServiceStatusModel status)
{
}
}
My method to load:
private void GetServicesToLoadServices()
{
string[] files = Directory.GetFiles(_servicesLocation, "*.dll");
foreach (string file in files)
{
Assembly assembly = Assembly.LoadFrom(file);
foreach (Type type in assembly.GetTypes())
{
bool isImplementing1 = type.IsAssignableFrom(typeof(IInstrumentService));
bool isImplementing2 = typeof(IInstrumentService).IsAssignableFrom(type);
}
}
}
Anyone see what's wrong here?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Kevin Marois wrote: Anyone see what's wrong here?
Is this a quiz?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Really?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
I'm wondering if this
foreach (Type type in assembly.GetTypes())
should be
foreach (Type type in assembly.GetExportedTypes())
?
|
|
|
|
|
Yes, you didn't describe a problem at all.
|
|
|
|
|
Yes I did. See comments in code
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
You might not be using the right interface. An object's full name includes its namespace.
Assembly #1:
namespace AssemblyGetTypeTest
{
class Program
{
static void Main(string[] args)
{
Assembly a = Assembly.LoadFrom(@"TestTypeLib.dll");
Type testInterface = a.GetType("TestTypeLib.ITestInterface");
foreach (Type t in a.GetTypes())
{
if (testInterface.IsAssignableFrom(t))
Console.WriteLine($"Success on type {t.Name} in namespace {testInterface.Namespace}");
if (typeof(ITestInterface).IsAssignableFrom(t))
Console.WriteLine($"Success on type {t.Name} in namespace AssemblyGetTypeTest.");
}
Console.ReadKey();
}
}
public interface ITestInterface
{
void Test();
}
}
Assembly #2:
namespace TestTypeLib
{
public interface ITestInterface
{
void Test();
}
public class Class1 : ITestInterface
{
public void Test(){ }
}
}
Output:
Success on type ITestInterface in namespace TestTypeLib
Success on type Class1 in namespace TestTypeLib
The interfaces TestTypeLib.ITestInterface and AssemblyGetTypeTest.ITestInterface are different.
|
|
|
|
|
Can I ask why you're reinventing the wheel here? Why not just use MEF which is included in the framework by default, and is as feature rich as you could possibly want?
This space for rent
|
|
|
|
|
IsInstanceOfType instead of IsAssignableFrom ?
|
|
|
|
|
Hi,
I was wondering if someone could show what i am doing wrong here I have a combobox with about 20 items listed. Now when someone selects an item from the combobox i need that Item to be "Inserted" into the table column named "Mode".
Here is what i have tried to far but to no prevail
MyCommand.Parameters.Add("@Mode", System.Data.SqlDbType.Text);
MyCommand.Parameters["@Mode"].Value = Convert.ToInt32(cbModePicker.SelectedItem.ToString());
|
|
|
|
|
rattlerrFx wrote: doing wrong here
Well, it looks to me that you are defining a parameter of type string, then taking a string value and converting it to an integer and trying to stuff the integer into a string parameter. Does that make sense to you?
Speed of sound - 1100 ft/sec
Speed of light - 186,000 mi/sec
Speed of stupid - instantaneous.
|
|
|
|