示例#1
0
        public void DidSelectComposition(NSNotification notification)
        {
            QCComposition composition = notification.UserInfo.ObjectForKey((NSString)"QCComposition").CastTo<QCComposition>();

            /* Set the identifier of the selected composition on the "compositionIdentifier" input of the composition,
               which passes it in turn to a Composition Loader patch which loads the composition and applies it to the video input */
            this.qcView.SetValueForInputKey(composition.Identifier, "compositionIdentifier");
        }
示例#2
0
        public void ApplicationDidFinishLaunching(NSNotification notification)
        {
            this.textView.Font = NSFont.FontWithNameSize("Courier", 24.0f);

            this.deviceList = new NSMutableArray(DRDevice.Devices.Count);

            DRNotificationCenter.CurrentRunLoopCenter.AddObserverSelectorNameObject(this, ObjectiveCRuntime.Selector("deviceDisappeared:"), DRDevice.DRDeviceDisappearedNotification, null);
            DRNotificationCenter.CurrentRunLoopCenter.AddObserverSelectorNameObject(this, ObjectiveCRuntime.Selector("deviceAppeared:"), DRDevice.DRDeviceAppearedNotification, null);
        }
示例#3
0
        public void DeviceDisappeared(NSNotification aNotification)
        {
            DRDevice removedDevice = aNotification.Object.CastTo<DRDevice>();

            DRNotificationCenter.CurrentRunLoopCenter.RemoveObserverNameObject(this, DRDevice.DRDeviceStatusChangedNotification, removedDevice);

            this.deviceList.RemoveObject(removedDevice);
            this.UpdateUI();
        }
示例#4
0
        public virtual void ApplicationDidFinishLaunching(NSNotification aNotification)
        {
            if (SKPaymentQueue.CanMakePayments) {
                SKPaymentQueue.DefaultQueue.AddTransactionObserver(this);
            }

            // Uncomment to enable product retrieval
            //this.RequestProducts();
        }
示例#5
0
        public void DeviceAppeared(NSNotification aNotification)
        {
            DRDevice newDevice = aNotification.Object.CastTo<DRDevice>();

            this.deviceList.AddObject(newDevice);

            DRNotificationCenter.CurrentRunLoopCenter.AddObserverSelectorNameObject(this, ObjectiveCRuntime.Selector("deviceStateChanged:"), DRDevice.DRDeviceStatusChangedNotification, null);

            this.UpdateUI();
        }
示例#6
0
        public void ApplicationDidFinishLaunching(NSNotification notification)
        {
            // Gets the DRBurn icon and assign it another name
            NSImage icon = NSImage.ImageNamed(DiscRecordingUIFramework.DRBurnIcon);
            icon.SetName("OldDRBurnIcon");

            // Gets the Monobjc icon and assign it as default icon
            icon = new NSImage(NSBundle.MainBundle.PathForImageResource("Monobjc.icns"));
            icon.SetName(DiscRecordingUIFramework.DRBurnIcon);
        }
        public virtual void ApplicationWillFinishLaunching(NSNotification aNotification)
        {
            this.view = new BoingView(new NSRect(0, 0, 640, 480));
            this.window = new BoingWindow(new NSRect(100, 100, 640, 480), NSWindowStyleMask.NSBorderlessWindowMask, NSBackingStoreType.NSBackingStoreBuffered, false);
            this.window.ContentView = this.view;
            this.view.Release();

            this.window.MakeKeyAndOrderFront(null);

            this.timer = NSTimer.ScheduledTimerWithTimeIntervalTargetSelectorUserInfoRepeats(1.0/60.0, this, ObjectiveCRuntime.Selector("timerFired:"), null, true);
            this.timer.Retain();
        }
示例#8
0
        public void ApplicationDidFinishLaunching(NSNotification notification)
        {
            NSThread.MakeMultiThreaded ();

            this.imageRep = new NSBitmapImageRep (IntPtr.Zero, width, height, 8, 4, true, false, "NSCalibratedRGBColorSpace", 4 * width, 32);
            NSImage image = new NSImage (new NSSize (width, height));
            image.AddRepresentation (this.imageRep);
            this.imageView.Image = image;

            Thread t = new Thread (this.DoComputation);
            t.IsBackground = true;
            t.Start ();
        }
示例#9
0
        public void ApplicationDidFinishLaunching(NSNotification notification)
        {
            // Gets the DRErase icon and assign it another name
            NSImage icon = NSImage.ImageNamed(DiscRecordingUIFramework.DREraseIcon);
            icon.SetName("OldDREraseIcon");

            // Gets the Monobjc icon and assign it as default icon
            icon = new NSImage(NSBundle.MainBundle.PathForImageResource("Monobjc.icns"));
            icon.SetName(DiscRecordingUIFramework.DREraseIcon);

            NSNotificationCenter.DefaultCenter.AddObserverSelectorNameObject(this,
                                                                             ObjectiveCRuntime.Selector("eraseCompleted:"),
                                                                             DREraseProgressPanel.DREraseProgressPanelDidFinishNotification,
                                                                             null);

            this.EraseCompleted(null);
        }
示例#10
0
        public virtual void ApplicationDidBecomeActive(NSNotification aNotification)
        {
            // If we have selected a file in the finder
            if (this.SelectedFinderItem != null) {
                NSString theComment = this.FinderCommentForFileURL (this.SelectedFinderItem);
                if (theComment != null) {
                    // Set the path in the display
                    this.fileNameField.StringValue = this.SelectedFinderItem.Path;

                    // Retrieve the finder comment
                    NSUInteger p = this.commentField.TextStorage.String.Length;
                    this.commentField.SetSelectedRange (new NSRange (0, p));
                    this.commentField.InsertText (theComment);
                } else {
                    this.ShowErrorMessageWithTitle ("Unable to update the finder comment for the selected item.", "Error getting comment");
                }
            }
        }
示例#11
0
        public void EraseCompleted(NSNotification notification)
        {
            DREraseSetupPanel esp = DREraseSetupPanel.SetupPanel;
            esp.Delegate = this;

            if (esp.RunSetupPanel() == NSPanel.NSOKButton)
            {
                DREraseProgressPanel epp = DREraseProgressPanel.ProgressPanel;
                epp.Delegate = this;
                epp.BeginProgressPanelForErase(esp.EraseObject);

                /* If you wanted to run this as a sheet you would have done
                 * [epp beginProgressSheetForErase:[esp eraseObject]];
                 */
            }
            else
            {
                NSApplication.SharedApplication.Terminate(this);
            }
        }
		public void WindowDidUpdate (NSNotification notification)
		{
			if (this.View != null &&
			    this.View.Window != null &&
			    this.View.Window.FirstResponder != null) {
				NSTextField tv = ApiUtils.GetFirstResponderTextField(this.View.Window);
				
				if (tv != null) {
					if (m_prevResponder != tv &&
					    ApiUtils.IsTextFieldFirstResponder (this.View.Window, textFieldComputerName) &&
					    textFieldComputerName.StringValue.IsEqualToString(NSString.Empty) &&
					    !textFieldDisplayName.StringValue.IsEqualToString(NSString.Empty)) {
						textFieldComputerName.StringValue = textFieldDisplayName.StringValue;
					}
					
					m_prevResponder = tv;
				} else {
					m_prevResponder = this.View.Window.FirstResponder;
				}
			}
		}
示例#13
0
        public void ApplicationDidFinishLaunching(NSNotification notification)
        {
            QCCompositionPickerPanel pickerPanel = QCCompositionPickerPanel.SharedCompositionPickerPanel;

            /* Load our composition file on the QCView and start rendering */
            if (!this.qcView.LoadCompositionFromFile(NSBundle.MainBundle.PathForResourceOfType("Composition", "qtz")))
            {
                NSApplication.SharedApplication.Terminate(null);
            }
            this.qcView.StartRendering();

            /* Configure and show the Composition Picker panel */
            pickerPanel.CompositionPickerView.AllowsEmptySelection = true;
            pickerPanel.CompositionPickerView.ShowsCompositionNames = true;
            pickerPanel.CompositionPickerView.SetCompositionsFromRepositoryWithProtocolAndAttributes(QCComposition.QCCompositionProtocolImageFilter, null);
            pickerPanel.CompositionPickerView.StartAnimation(this);
            pickerPanel.OrderOut(null);

            /* Register for composition picker panel notifications */
            NSNotificationCenter.DefaultCenter.AddObserverSelectorNameObject(this, ObjectiveCRuntime.Selector("_didSelectComposition:"), QCCompositionPickerPanel.QCCompositionPickerPanelDidSelectCompositionNotification, null);
        }
示例#14
0
        public void ApplicationDidFinishLaunching(NSNotification notification)
        {
            QCComposition composition;
            AnimatedView view;

            /* Get a composition from the repository */
            composition = QCCompositionRepository.SharedCompositionRepository.CompositionWithIdentifier("/defocus");
            if (composition == null)
            {
                NSApplication.SharedApplication.Terminate(null);
            }

            /* Configure the content view of the window to use a Core Animation layer */
            view = new AnimatedView(NSRect.NSMakeRect(0, 0, 100, 100));
            view.WantsLayer = true;
            view.Layer = QCCompositionLayer.CompositionLayerWithComposition(composition);
            this.window.ContentView = view;
            view.Release();

            /* Show window */
            this.window.MakeKeyAndOrderFront(null);
        }
示例#15
0
        public void PageChanged(NSNotification notification)
        {
            // Skip out if there is no outline.
            if (this._pdfView.Document.OutlineRoot == null)
            {
                return;
            }

            // What is the new page number (zero-based).
            uint newPageIndex = this._pdfView.Document.IndexForPage(this._pdfView.CurrentPage);

            // Walk outline view looking for best firstpage number match.
            int newlySelectedRow = -1;
            int numRows = this._outlineView.NumberOfRows;
            for (int i = 0; i < numRows; i++)
            {
                // Get the destination of the given row....
                PDFOutline outlineItem = this._outlineView.ItemAtRow(i).CastTo<PDFOutline>();

                if (this._pdfView.Document.IndexForPage(outlineItem.Destination.Page) == newPageIndex)
                {
                    newlySelectedRow = i;
                    this._outlineView.SelectRowIndexesByExtendingSelection(NSIndexSet.IndexSetWithIndex((uint) newlySelectedRow), false);
                    break;
                }
                if (this._pdfView.Document.IndexForPage(outlineItem.Destination.Page) > newPageIndex)
                {
                    newlySelectedRow = i - 1;
                    this._outlineView.SelectRowIndexesByExtendingSelection(NSIndexSet.IndexSetWithIndex((uint) newlySelectedRow), false);
                    break;
                }
            }

            // Auto-scroll.
            if (newlySelectedRow != -1)
            {
                this._outlineView.ScrollRowToVisible(newlySelectedRow);
            }
        }
示例#16
0
 public void FindProgress(NSNotification notification)
 {
     Id id = notification.UserInfo.ObjectForKey((NSString) "PDFDocumentPageIndex");
     double pageIndex = id.SendMessage<double>("doubleValue");
     this._searchProgress.DoubleValue = pageIndex/ (uint) this._pdfView.Document.PageCount;
 }
示例#17
0
 public void EndFind(NSNotification notification)
 {
     this._searchProgress.StopAnimation(this);
     this._searchProgress.DoubleValue = 0;
 }
		public void ControlTextDidChange (NSNotification aNotification)
		{
			if (aNotification.Object.CastTo<NSObject> ().IsKindOfClass (NSTextField.NSTextFieldClass) &&
			    aNotification.Object == textFieldComputerName) {
				CheckIfIsInBulkAddMode();
			}
		}
 public virtual void PopoverWillShow(NSNotification notification)
 {
     NSPopover popover = notification.Object.CastTo<NSPopover> ();
     if (popover.Appearance == NSPopoverAppearance.NSPopoverAppearanceHUD) {
         this.popoverViewControllerHUD.checkButton.SetTextColor (NSColor.WhiteColor);
         this.popoverViewControllerHUD.textLabel.TextColor = NSColor.WhiteColor;
     }
 }
 public virtual void PopoverWillClose(NSNotification notification)
 {
     NSString closeReason = notification.UserInfo.ValueForKey<NSString> (NSPopover.NSPopoverCloseReasonKey);
     if (closeReason != null) {
         // closeReason can be:
         //      NSPopoverCloseReasonStandard
         //      NSPopoverCloseReasonDetachToWindow
     }
 }
 public virtual void PopoverDidShow(NSNotification notification)
 {
 }
示例#22
0
		public void NotifySelector(NSNotification notification)
		{
			this.Notified = true;
		}
 public void ApplicationDidFinishLaunching(NSNotification notification)
 {
     this.locationManager = new CLLocationManager();
     this.locationManager.Delegate = this;
     this.locationManager.StartUpdatingLocation();
 }
示例#24
0
        public void StartFind(NSNotification notification)
        {
            // Empty arrays.
            this._searchResults.RemoveAllObjects();

            this._searchTable.ReloadData();
            this._searchProgress.StartAnimation(this);
        }
示例#25
0
 public void WindowWillClose(NSNotification notification)
 {
     NSApplication.SharedApplication.Terminate(this);
 }
 public void applicationWillTerminate(NSNotification aNotification)
 {
     this.locationManager.StopUpdatingLocation();
     this.locationManager.Release();
 }
示例#27
0
 public void TableViewSelectionDidChange(NSNotification notification)
 {
     // What was selected.  Skip out if the row has not changed.
     int rowIndex = notification.Object.CastTo<NSTableView>().SelectedRow;
     if (rowIndex >= 0)
     {
         this._pdfView.CurrentSelection = this._searchResults.ObjectAtIndex((uint) rowIndex).CastTo<PDFSelection>();
         this._pdfView.CenterSelectionInVisibleArea(this);
     }
 }
示例#28
0
 public void DeviceStateChanged(NSNotification aNotification)
 {
     this.UpdateUI();
 }
示例#29
0
 public void ToolbarWillAddItem(NSNotification notif)
 {
     NSToolbarItem addedItem = notif.UserInfo[(NSString) "item"].CastTo<NSToolbarItem>();
     // Is this the printing toolbar item?  If so, then we want to redirect it's action to ourselves
     // so we can handle the printing properly; hence, we give it a new target.
     if (addedItem.ItemIdentifier.IsEqual(NSToolbarItem.NSToolbarPrintItemIdentifier))
     {
         addedItem.ToolTip = "Print your document";
         addedItem.Target = this;
     }
 }
 public void SelectionChanged(NSNotification notification)
 {
     this.croppedImageView.Image = this.imageView.CroppedImage();
     this.croppedImageView.NeedsDisplay = true;
 }