public void AddItem(SourceListItem item)
 {
     if (Data != null)
     {
         Data.Items.Add(item);
     }
 }
        public DummyPropertyPages()
        {
            Name                          = "Dummy Connection Settings".TLL();
            TemplateName                  = "Dummy Template Settings".TLL();
            Icon                          = ImageAccessor.GetIcon("Icon.png");
            HandledObjectType             = typeof(RoyalRDSConnection);
            SupportsConnectionCredentials = true;
            SupportsWindowMode            = true;

            // Dummy
            SourceListItem itemDummyCat = new SourceListItem("Dummy".TL())
            {
                IsCategory = true
            };

            InsertCommonCategoryAfter = itemDummyCat;

            IPropertyPage propPageDummyMain = new PropertyPageDummyMainController().InitPropertyPage() as IPropertyPage;

            itemDummyCat.MutableChildNodes.AddObject(propPageDummyMain.ListItem);

            // Set Properties
            DefaultItem = propPageDummyMain.ListItem;

            PropertyPages.Add(propPageDummyMain);

            ListItems.Add(itemDummyCat);
        }
Beispiel #3
0
        /// <summary>
        /// Hides source for provided source info
        /// </summary>
        /// <param name="previousInfo"></param>
        void DisconnectSource(SourceListItem previousInfo)
        {
            if (previousInfo == null)
            {
                return;
            }

            // Hide whatever is showing
            if (IsVisible)
            {
                if (CurrentSourcePageManager != null)
                {
                    CurrentSourcePageManager.Hide();
                    CurrentSourcePageManager = null;
                }
            }

            if (previousInfo == null)
            {
                return;
            }
            var previousDev = previousInfo.SourceDevice;

            // device type interfaces
            if (previousDev is ISetTopBoxControls)
            {
                (previousDev as ISetTopBoxControls).UnlinkButtons(TriList);
            }
            // common interfaces
            if (previousDev is IChannel)
            {
                (previousDev as IChannel).UnlinkButtons(TriList);
            }
            if (previousDev is IColor)
            {
                (previousDev as IColor).UnlinkButtons(TriList);
            }
            if (previousDev is IDPad)
            {
                (previousDev as IDPad).UnlinkButtons(TriList);
            }
            if (previousDev is IDvr)
            {
                (previousDev as IDvr).UnlinkButtons(TriList);
            }
            if (previousDev is INumericKeypad)
            {
                (previousDev as INumericKeypad).UnlinkButtons(TriList);
            }
            if (previousDev is IPower)
            {
                (previousDev as IPower).UnlinkButtons(TriList);
            }
            if (previousDev is ITransport)
            {
                (previousDev as ITransport).UnlinkButtons(TriList);
            }
            //if (previousDev is IRadio)
            //    (previousDev as IRadio).UnlinkButtons(this);
        }
Beispiel #4
0
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			// Populate source list
			SourceList.Initialize ();

			var library = new SourceListItem ("Library");
			library.AddItem ("Venues", "house.png", () => {
				Console.WriteLine("Venue Selected");
			});
			library.AddItem ("Singers", "group.png");
			library.AddItem ("Genre", "cards.png");
			library.AddItem ("Publishers", "box.png");
			library.AddItem ("Artist", "person.png");
			library.AddItem ("Music", "album.png");
			SourceList.AddItem (library);

			// Add Rotation 
			var rotation = new SourceListItem ("Rotation"); 
			rotation.AddItem ("View Rotation", "redo.png");
			SourceList.AddItem (rotation);

			// Add Kiosks
			var kiosks = new SourceListItem ("Kiosks");
			kiosks.AddItem ("Sign-in Station 1", "imac");
			kiosks.AddItem ("Sign-in Station 2", "ipad");
			SourceList.AddItem (kiosks);

			// Display side list
			SourceList.ReloadData ();
			SourceList.ExpandItem (null, true);
		}
Beispiel #5
0
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();


            SourceList.Initialize();

            var mainSection = new SourceListItem("Main");

            mainSection.AddItem(new SourceListItem("File Settings", null, "0", OnItemClicked));
            mainSection.AddItem(new SourceListItem("Outlook integration", null, "1", OnItemClicked));
            mainSection.AddItem(new SourceListItem("Browser link", null, "2", OnItemClicked));;
            mainSection.AddItem(new SourceListItem("HotDocs integration", null, "3", OnItemClicked));
            mainSection.AddItem(new SourceListItem("Optical Character Recogntion", null, "4", OnItemClicked));
            mainSection.AddItem(new SourceListItem("Microsoft Office", null, "5", OnItemClicked));
            SourceList.AddItem(mainSection);

            var advanceSection = new SourceListItem("Advanced");

            advanceSection.AddItem(new SourceListItem("Click to call", null, "6", OnItemClicked));
            advanceSection.AddItem(new SourceListItem("Data Export", null, "7", OnItemClicked));
            advanceSection.AddItem(new SourceListItem("Diagnosis", null, "8", OnItemClicked));
            SourceList.AddItem(advanceSection);

            // Display side list
            SourceList.ReloadData();

            SourceList.ExpandItem(null, true);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Populate Source List
            SourceList.Initialize();

            var TableViews = new SourceListItem("Data Binding Type");

            TableViews.AddItem("Simple Binding", "shoebox.png", () => {
                ViewType = SubviewType.SimpleBinding;
                PerformSegue("SimpleSegue", this);
            });
            TableViews.AddItem("Table Binding", "shoebox.png", () => {
                ViewType = SubviewType.TableBinding;
                PerformSegue("TableSegue", this);
            });
            TableViews.AddItem("Outline Binding", "shoebox.png", () => {
                ViewType = SubviewType.OutlineBinging;
                PerformSegue("OutlineSegue", this);
            });
            TableViews.AddItem("Collection View", "shoebox.png", () => {
                ViewType = SubviewType.CollectionView;
                PerformSegue("CollectionSegue", this);
            });
            SourceList.AddItem(TableViews);

            // Display Source List
            SourceList.ReloadData();
            SourceList.ExpandItem(null, true);
        }
 internal void RaiseItemSelected(SourceListItem item)
 {
     // Inform caller
     if (this.ItemSelected != null)
     {
         this.ItemSelected(item);
     }
 }
Beispiel #8
0
        /// <summary>
        /// Converts the source items to a source.
        /// </summary>
        private string SourceItemToSource(SourceListItem sourceItem)
        {
            TagBuilder builder = new TagBuilder("source");

            builder.MergeAttribute("type", sourceItem.SourceType);
            builder.MergeAttribute("src", UrlHelper.GenerateContentUrl(sourceItem.Source, htmlHelper.ViewContext.HttpContext));
            return(builder.ToString(TagRenderMode.SelfClosing));
        }
 public SubpageReferenceListSourceItem(uint index, SubpageReferenceList owner,
                                       SourceListItem sourceItem, Action <bool> routeAction)
     : base(index, owner)
 {
     SourceItem = sourceItem;
     owner.GetBoolFeedbackSig(index, 1).UserObject = new Action <bool>(routeAction);
     owner.StringInputSig(index, 1).StringValue    = SourceItem.PreferredName;
 }
 void room_CurrentSourceInfoChange(SourceListItem info, ChangeType type)
 {
     if (type == ChangeType.WillChange && info == SourceItem)
     {
         ClearFeedback();
     }
     else if (type == ChangeType.DidChange && info == SourceItem)
     {
         SetFeedback();
     }
 }
Beispiel #11
0
 /// <summary>
 /// Handles source change
 /// </summary>
 void CurrentRoom_SourceInfoChange(SourceListItem info, ChangeType change)
 {
     if (change == ChangeType.WillChange)
     {
         DisconnectSource(info);
     }
     else
     {
         RefreshSourceInfo();
     }
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="route"></param>
        /// <returns></returns>
        bool DoRoute(SourceRouteListItem route, SourceListItem sourceItem, string sourceItemKey)
        {
            IRoutingSinkNoSwitching dest = null;

            if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
            {
                dest = DefaultAudioDevice as IRoutingSinkNoSwitching;
            }
            else if (route.DestinationKey.Equals(LeftDisplay.Key, StringComparison.OrdinalIgnoreCase))
            {
                dest = LeftDisplay;
            }
            else if (route.DestinationKey.Equals(RightDisplay.Key, StringComparison.OrdinalIgnoreCase))
            {
                dest = RightDisplay;
            }
            else
            {
                dest = DeviceManager.GetDeviceForKey(route.DestinationKey) as IRoutingSinkNoSwitching;
            }

            if (dest == null)
            {
                Debug.Console(1, this, "Cannot route, unknown destination '{0}'", route.DestinationKey);
                return(false);
            }

            if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
            {
                dest.ReleaseRoute();



                if (dest is IPower)
                {
                    (dest as IPower).PowerOff();
                }
            }
            else
            {
                var source = DeviceManager.GetDeviceForKey(route.SourceKey) as IRoutingOutputs;
                if (source == null)
                {
                    Debug.Console(1, this, "Cannot route unknown source '{0}' to {1}", route.SourceKey, route.DestinationKey);
                    return(false);
                }
                dest.ReleaseAndMakeRoute(source, route.Type);

                dest.CurrentSourceInfoKey = sourceItemKey;
                dest.CurrentSourceInfo    = sourceItem;
            }
            return(true);
        }
 /// <summary>
 /// Helper to handle source events and startup syncing with room's current source
 /// </summary>
 /// <param name="info"></param>
 void UpdateItem(SourceListItem info)
 {
     if (info == null || info.Type == eSourceListItemType.Off)
     {
         Parent.SetItemStatusText(Index, "");
         Parent.SetItemIcon(Index, "Blank");
     }
     else
     {
         Parent.SetItemStatusText(Index, info.PreferredName);
         Parent.SetItemIcon(Index, info.AltIcon);
     }
 }
Beispiel #14
0
        public RdpPropertyPages()
        {
            this.Name                          = Language.Get("Remote Desktop Connection Settings");
            this.Icon                          = ImageAccessor.GetIcon("RDPConnection.png");
            this.TemplateIcon                  = ImageAccessor.GetIcon("TemplateRDS.png");
            this.HandledObjectType             = typeof(RoyalRDSConnection);
            this.SupportsConnectionCredentials = true;
            this.SupportsWindowMode            = true;

            // Remote Desktop
            SourceListItem itemRdpCat = new SourceListItem(RoyalRDSConnection.ObjectTypeShortName.TL());

            itemRdpCat.IsCategory = true;

            IPropertyPage propPageRdpMain = new PropertyPageRdpMainController().InitPropertyPage() as IPropertyPage;

            itemRdpCat.MutableChildNodes.AddObject(propPageRdpMain.ListItem);

            this.ConnectionCredentialsListParent = itemRdpCat;
            this.WindowModeParent = itemRdpCat;

            // Advanced
            SourceListItem itemRdpAdvCat = new SourceListItem(Language.Get("Advanced"));

            itemRdpAdvCat.IsCategory = true;

            IPropertyPage propPageRdpAdvMain        = new PropertyPageRdpAdvancedMainController().InitPropertyPage() as IPropertyPage;
            IPropertyPage propPageRdpAdvDisplay     = new PropertyPageRdpAdvancedDisplayController().InitPropertyPage() as IPropertyPage;
            IPropertyPage propPageRdpAdvPerformance = new PropertyPageRdpAdvancedPerformanceController().InitPropertyPage() as IPropertyPage;
            IPropertyPage propPageRdpAdvRedirection = new PropertyPageRdpAdvancedRedirectionController().InitPropertyPage() as IPropertyPage;

            //SourceListItem itemRdpAdvKeyboard = new SourceListItem("Keyboard", ImageAccessor.GetIcon("Keyboard.png").Icon16); */
            itemRdpAdvCat.MutableChildNodes.AddObject(propPageRdpAdvMain.ListItem);
            itemRdpAdvCat.MutableChildNodes.AddObject(propPageRdpAdvDisplay.ListItem);
            itemRdpAdvCat.MutableChildNodes.AddObject(propPageRdpAdvPerformance.ListItem);
            itemRdpAdvCat.MutableChildNodes.AddObject(propPageRdpAdvRedirection.ListItem);
            //itemRdpAdvCat.MutableChildNodes.AddObject(itemRdpAdvKeyboard); */

            // Set Properties
            this.DefaultItem = propPageRdpMain.ListItem;

            this.PropertyPages.Add(propPageRdpMain);
            this.PropertyPages.Add(propPageRdpAdvMain);
            this.PropertyPages.Add(propPageRdpAdvDisplay);
            this.PropertyPages.Add(propPageRdpAdvPerformance);
            this.PropertyPages.Add(propPageRdpAdvRedirection);

            this.ListItems.Add(itemRdpCat);
            this.ListItems.Add(itemRdpAdvCat);
        }
        public override void ViewDidLayout()
        {
            base.ViewDidLayout();
            SourceList.Initialize();

            var control = new SourceListItem("Control Type");

            control.AddItem("Button", () => {
                DisplaySubView(SubviewType.Buttons);
            });
            control.AddItem("Checkboxes & Radio Buttons", () => {
                DisplaySubView(SubviewType.CheckAndRadioButtons);
            });
            SourceList.AddItem(control);
            SourceList.ReloadData();
            SourceList.ExpandItem(null, true);
        }
		public RdpPropertyPages()
		{
			this.Name = Language.Get("Remote Desktop Connection Settings");
			this.Icon = ImageAccessor.GetIcon("RDPConnection.png");
			this.TemplateIcon = ImageAccessor.GetIcon("TemplateRDS.png");
			this.HandledObjectType = typeof(RoyalRDSConnection);
			this.SupportsConnectionCredentials = true;
			this.SupportsWindowMode = true;
			
			// Remote Desktop
			SourceListItem itemRdpCat = new SourceListItem(RoyalRDSConnection.ObjectTypeShortName.TL());
			itemRdpCat.IsCategory = true;
			
			IPropertyPage propPageRdpMain = new PropertyPageRdpMainController().InitPropertyPage() as IPropertyPage;
			itemRdpCat.MutableChildNodes.AddObject(propPageRdpMain.ListItem);
			
			this.ConnectionCredentialsListParent = itemRdpCat;
			this.WindowModeParent = itemRdpCat;
			
			// Advanced
			SourceListItem itemRdpAdvCat = new SourceListItem(Language.Get("Advanced"));
			itemRdpAdvCat.IsCategory = true;
			
			IPropertyPage propPageRdpAdvMain = new PropertyPageRdpAdvancedMainController().InitPropertyPage() as IPropertyPage;
			IPropertyPage propPageRdpAdvDisplay = new PropertyPageRdpAdvancedDisplayController().InitPropertyPage() as IPropertyPage;
			IPropertyPage propPageRdpAdvPerformance = new PropertyPageRdpAdvancedPerformanceController().InitPropertyPage() as IPropertyPage;
			IPropertyPage propPageRdpAdvRedirection = new PropertyPageRdpAdvancedRedirectionController().InitPropertyPage() as IPropertyPage;
			//SourceListItem itemRdpAdvKeyboard = new SourceListItem("Keyboard", ImageAccessor.GetIcon("Keyboard.png").Icon16); */
			itemRdpAdvCat.MutableChildNodes.AddObject(propPageRdpAdvMain.ListItem);
			itemRdpAdvCat.MutableChildNodes.AddObject(propPageRdpAdvDisplay.ListItem);
			itemRdpAdvCat.MutableChildNodes.AddObject(propPageRdpAdvPerformance.ListItem);
			itemRdpAdvCat.MutableChildNodes.AddObject(propPageRdpAdvRedirection.ListItem);
			//itemRdpAdvCat.MutableChildNodes.AddObject(itemRdpAdvKeyboard); */
			
			// Set Properties
			this.DefaultItem = propPageRdpMain.ListItem;
			
			this.PropertyPages.Add(propPageRdpMain);
			this.PropertyPages.Add(propPageRdpAdvMain);
			this.PropertyPages.Add(propPageRdpAdvDisplay);
			this.PropertyPages.Add(propPageRdpAdvPerformance);
			this.PropertyPages.Add(propPageRdpAdvRedirection);
			
			this.ListItems.Add(itemRdpCat);
			this.ListItems.Add(itemRdpAdvCat);
		}
 /// <summary>
 ///
 /// </summary>
 /// <param name="route"></param>
 void DoRouteItem(SourceRouteListItem route, SourceListItem sourceItem, string sourceItemKey)
 {
     // if there is a $defaultAll on route, run two separate
     if (route.DestinationKey.Equals("$defaultAll", StringComparison.OrdinalIgnoreCase))
     {
         // Going to assume a single-path route for now
         var tempVideo = new SourceRouteListItem
         {
             DestinationKey = "$defaultDisplay",
             SourceKey      = route.SourceKey,
             Type           = eRoutingSignalType.Video
         };
         DoRoute(tempVideo, sourceItem, sourceItemKey);
     }
     else
     {
         DoRoute(route, sourceItem, sourceItemKey);
     }
 }
Beispiel #18
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Populate Source List
            SourceList.Initialize();

            var TableViews = new SourceListItem("Table Based Views");

            TableViews.AddItem("Table View", "calendar.png", () => {
                PerformSegue("TableSegue", this);
            });
            TableViews.AddItem("Outline View", "calendar.png", () => {
                PerformSegue("OutlineSegue", this);
            });
            SourceList.AddItem(TableViews);

            var ImageViews = new SourceListItem("Photos");

            ImageViews.AddItem("First Person", "film-roll.png", () => {
                Picture = NSImage.ImageNamed("person01.jpg");
                PerformSegue("PictureSegue", this);
            });
            ImageViews.AddItem("Second Person", "film-roll.png", () => {
                Picture = NSImage.ImageNamed("person02.jpg");
                PerformSegue("PictureSegue", this);
            });
            ImageViews.AddItem("Third Person", "film-roll.png", () => {
                Picture = NSImage.ImageNamed("person03.jpg");
                PerformSegue("PictureSegue", this);
            });
            SourceList.AddItem(ImageViews);

            // Display Source List
            SourceList.ReloadData();
            SourceList.ExpandItem(null, true);
        }
Beispiel #19
0
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            // Populate Source List
            SourceList.Initialize();

            var TableViews = new SourceListItem("Control Type");

            TableViews.AddItem("Buttons", "tag.png", () => {
                DisplaySubview(new SubviewButtonsController(), SubviewType.Buttons);
            });
            TableViews.AddItem("Checkboxes & Radio Buttons", "tag.png", () => {
                DisplaySubview(new SubviewChecksRadioController(), SubviewType.CheckAndRadioButtons);
            });
            TableViews.AddItem("Menu Controls", "tag.png", () => {
                DisplaySubview(new SubviewMenuControlsController(), SubviewType.MenuControls);
            });
            TableViews.AddItem("Selection Controls", "tag.png", () => {
                DisplaySubview(new SubviewSelectionControlsController(), SubviewType.SelectionControls);
            });
            TableViews.AddItem("Indicator Controls", "tag.png", () => {
                DisplaySubview(new SubviewIndicatorControlsController(), SubviewType.IndicatorControls);
            });
            TableViews.AddItem("Text Controls", "tag.png", () => {
                DisplaySubview(new SubviewTextControlsController(), SubviewType.IndicatorControls);
            });
            TableViews.AddItem("Content Views", "tag.png", () => {
                DisplaySubview(new SubviewContentViewsController(), SubviewType.ContentViews);
            });
            SourceList.AddItem(TableViews);


            // Display Source List
            SourceList.ReloadData();
            SourceList.ExpandItem(null, true);
        }
 void routingSink_CurrentSourceChange(SourceListItem info, ChangeType type)
 {
     SendRoutingFullMessageObject();
 }
Beispiel #21
0
		/// <summary>
		/// Removes the item.
		/// </summary>
		/// <param name="item">Item.</param>
		public void RemoveItem(SourceListItem item) {
			_items.Remove (item);
		}
Beispiel #22
0
		/// <summary>
		/// Insert the specified n and item.
		/// </summary>
		/// <param name="n">N.</param>
		/// <param name="item">Item.</param>
		public void Insert(int n, SourceListItem item) {
			_items.Insert (n, item);
		}
Beispiel #23
0
		/// <summary>
		/// Adds the item.
		/// </summary>
		/// <param name="item">Item.</param>
		public void AddItem(SourceListItem item) {
			_items.Add (item);
		}
Beispiel #24
0
        /// <summary>
        /// Reads in config values when the Simpl program is ready
        /// </summary>
        void LoadConfigValues()
        {
            Debug.Console(1, this, "Loading configuration from DDVC01 EISC bridge");
            ConfigIsLoaded = false;

            var co = ConfigReader.ConfigObject;

            co.Info.RuntimeInfo.AppName = Assembly.GetExecutingAssembly().GetName().Name;
            var version = Assembly.GetExecutingAssembly().GetName().Version;

            co.Info.RuntimeInfo.AssemblyVersion = string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build);

            //Room
            //if (co.Rooms == null)
            // always start fresh in case simpl changed
            co.Rooms = new List <DeviceConfig>();
            var rm = new DeviceConfig();

            if (co.Rooms.Count == 0)
            {
                Debug.Console(0, this, "Adding room to config");
                co.Rooms.Add(rm);
            }
            else
            {
                Debug.Console(0, this, "Replacing Room[0] in config");
                co.Rooms[0] = rm;
            }
            rm.Name = EISC.StringOutput[StringJoin.ConfigRoomName].StringValue;
            rm.Key  = "room1";
            rm.Type = "ddvc01";

            DDVC01RoomPropertiesConfig rmProps;

            if (rm.Properties == null)
            {
                rmProps = new DDVC01RoomPropertiesConfig();
            }
            else
            {
                rmProps = JsonConvert.DeserializeObject <DDVC01RoomPropertiesConfig>(rm.Properties.ToString());
            }

            rmProps.Help = new EssentialsHelpPropertiesConfig();
            rmProps.Help.CallButtonText = EISC.StringOutput[StringJoin.ConfigHelpNumber].StringValue;
            rmProps.Help.Message        = EISC.StringOutput[StringJoin.ConfigHelpMessage].StringValue;

            rmProps.Environment = new EssentialsEnvironmentPropertiesConfig();             // enabled defaults to false

            rmProps.RoomPhoneNumber = EISC.StringOutput[StringJoin.ConfigRoomPhoneNumber].StringValue;
            rmProps.RoomURI         = EISC.StringOutput[StringJoin.ConfigRoomURI].StringValue;
            rmProps.SpeedDials      = new List <DDVC01SpeedDial>();

            // This MAY need a check
            rmProps.AudioCodecKey = "audioCodec";
            rmProps.VideoCodecKey = "videoCodec";

            // volume control names
            var volCount = EISC.UShortOutput[UshortJoin.NumberOfAuxFaders].UShortValue;

            //// use Volumes object or?
            //rmProps.VolumeSliderNames = new List<string>();
            //for(uint i = 701; i <= 700 + volCount; i++)
            //{
            //    rmProps.VolumeSliderNames.Add(EISC.StringInput[i].StringValue);
            //}

            // There should be Mobile Control devices in here, I think...
            if (co.Devices == null)
            {
                co.Devices = new List <DeviceConfig>();
            }

            // clear out previous DDVC devices
            co.Devices.RemoveAll(d =>
                                 d.Key.StartsWith("source-", StringComparison.OrdinalIgnoreCase) ||
                                 d.Key.Equals("audioCodec", StringComparison.OrdinalIgnoreCase) ||
                                 d.Key.Equals("videoCodec", StringComparison.OrdinalIgnoreCase));

            rmProps.SourceListKey = "default";
            rm.Properties         = JToken.FromObject(rmProps);

            // Source list! This might be brutal!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

            var groupMap = GetSourceGroupDictionary();

            co.SourceLists = new Dictionary <string, Dictionary <string, SourceListItem> >();
            var newSl = new Dictionary <string, SourceListItem>();

            // add "none" source if VTC present

            if (!string.IsNullOrEmpty(rmProps.VideoCodecKey))
            {
                var codecOsd = new SourceListItem()
                {
                    Name = "None",
                    IncludeInSourceList = true,
                    Order     = 1,
                    Type      = eSourceListItemType.Route,
                    SourceKey = ""
                };
                newSl.Add("Source-None", codecOsd);
            }
            // add sources...
            for (uint i = 0; i <= 19; i++)
            {
                var name = EISC.StringOutput[StringJoin.SourceNameJoinStart + i].StringValue;
                if (EISC.BooleanOutput[BoolJoin.UseSourceEnabled].BoolValue &&
                    !EISC.BooleanOutput[BoolJoin.SourceIsEnabledJoinStart + i].BoolValue)
                {
                    continue;
                }
                else if (!EISC.BooleanOutput[BoolJoin.UseSourceEnabled].BoolValue && string.IsNullOrEmpty(name))
                {
                    break;
                }
                var icon         = EISC.StringOutput[StringJoin.SourceIconJoinStart + i].StringValue;
                var key          = EISC.StringOutput[StringJoin.SourceKeyJoinStart + i].StringValue;
                var type         = EISC.StringOutput[StringJoin.SourceTypeJoinStart + i].StringValue;
                var disableShare = EISC.BooleanOutput[BoolJoin.SourceShareDisableJoinStart + i].BoolValue;

                Debug.Console(0, this, "Adding source {0} '{1}'", key, name);
                var newSLI = new SourceListItem {
                    Icon                = icon,
                    Name                = name,
                    Order               = (int)i + 10,
                    SourceKey           = key,
                    Type                = eSourceListItemType.Route,
                    DisableCodecSharing = disableShare,
                };
                newSl.Add(key, newSLI);

                string group = "genericsource";
                if (groupMap.ContainsKey(type))
                {
                    group = groupMap[type];
                }

                // add dev to devices list
                var devConf = new DeviceConfig {
                    Group = group,
                    Key   = key,
                    Name  = name,
                    Type  = type
                };
                co.Devices.Add(devConf);

                if (group.ToLower().StartsWith("settopbox"))                 // Add others here as needed
                {
                    SetupSourceFunctions(key);
                }
            }

            co.SourceLists.Add("default", newSl);

            // Build "audioCodec" config if we need
            if (!string.IsNullOrEmpty(rmProps.AudioCodecKey))
            {
                var acFavs = new List <PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem>();
                for (uint i = 0; i < 4; i++)
                {
                    if (!EISC.GetBool(BoolJoin.SpeedDialVisibleStartJoin + i))
                    {
                        break;
                    }
                    acFavs.Add(new PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem()
                    {
                        Name   = EISC.GetString(StringJoin.SpeedDialNameStartJoin + i),
                        Number = EISC.GetString(StringJoin.SpeedDialNumberStartJoin + i),
                        Type   = PepperDash.Essentials.Devices.Common.Codec.eCodecCallType.Audio
                    });
                }

                var acProps = new
                {
                    favorites = acFavs
                };

                var acStr  = "audioCodec";
                var acConf = new DeviceConfig()
                {
                    Group      = acStr,
                    Key        = acStr,
                    Name       = acStr,
                    Type       = acStr,
                    Properties = JToken.FromObject(acProps)
                };
                co.Devices.Add(acConf);
            }

            // Build Video codec config
            if (!string.IsNullOrEmpty(rmProps.VideoCodecKey))
            {
                // No favorites, for now?
                var favs = new List <PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem>();

                // cameras
                var camsProps = new List <object>();
                for (uint i = 0; i < 9; i++)
                {
                    var name = EISC.GetString(i + StringJoin.CameraNearNameStart);
                    if (!string.IsNullOrEmpty(name))
                    {
                        camsProps.Add(new
                        {
                            name     = name,
                            selector = "camera" + (i + 1),
                        });
                    }
                }
                var farName = EISC.GetString(StringJoin.CameraFarName);
                if (!string.IsNullOrEmpty(farName))
                {
                    camsProps.Add(new
                    {
                        name     = farName,
                        selector = "cameraFar",
                    });
                }

                var props = new
                {
                    favorites = favs,
                    cameras   = camsProps,
                };
                var str  = "videoCodec";
                var conf = new DeviceConfig()
                {
                    Group      = str,
                    Key        = str,
                    Name       = str,
                    Type       = str,
                    Properties = JToken.FromObject(props)
                };
                co.Devices.Add(conf);
            }

            Debug.Console(0, this, "******* CONFIG FROM DDVC: \r{0}", JsonConvert.SerializeObject(ConfigReader.ConfigObject, Formatting.Indented));

            var handler = ConfigurationIsReady;

            if (handler != null)
            {
                handler(this, new EventArgs());
            }

            ConfigIsLoaded = true;
        }
Beispiel #25
0
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            // Get access to database
            DatabaseConnection = GetDatabaseConnection();

            // Wire-up controls
            AddButton.Active     = false;
            AddButton.Activated += (sender, e) => {
                // Take action based on type
                switch (ViewType)
                {
                case SubviewType.TableBinding:
                    var controller = SubviewController as SubviewTableBindingController;
                    var person     = new PersonModel("Unknown", "Unknown");
                    var sheet      = new PersonEditorSheetController(person, true);

                    // Wire-up
                    sheet.PersonModified += (p) => {
                        // Save person to database
                        p.Create(DatabaseConnection);
                        controller.AddPerson(p);
                    };

                    // Display sheet
                    sheet.ShowSheet(this);
                    break;

                case SubviewType.CollectionView:
                    var collection       = SubviewController as SubviewCollectionViewController;
                    var collectionPerson = new PersonModel("Unknown", "Unknown");
                    var collectionSheet  = new PersonEditorSheetController(collectionPerson, true);

                    // Wire-up
                    collectionSheet.PersonModified += (p) => {
                        // Save person to database
                        p.Create(DatabaseConnection);
                        collection.AddPerson(p);
                    };

                    // Display sheet
                    collectionSheet.ShowSheet(this);
                    break;
                }
            };

            EditButton.Active     = false;
            EditButton.Activated += (sender, e) => {
                // Take action based on type
                switch (ViewType)
                {
                case SubviewType.TableBinding:
                    var controller = SubviewController as SubviewTableBindingController;
                    controller.EditPerson(this);
                    break;

                case SubviewType.CollectionView:
                    var collection = SubviewController as SubviewCollectionViewController;
                    collection.EditPerson(this);
                    break;
                }
            };

            DeleteButton.Active     = false;
            DeleteButton.Activated += (sender, e) => {
                // Take action based on type
                switch (ViewType)
                {
                case SubviewType.TableBinding:
                    var controller = SubviewController as SubviewTableBindingController;
                    controller.DeletePerson(this);
                    break;

                case SubviewType.CollectionView:
                    var collection = SubviewController as SubviewCollectionViewController;
                    collection.DeletePerson(this);
                    break;
                }
            };

            Search.Enabled       = false;
            Search.EditingEnded += (sender, e) => {
                // Take action based on type
                switch (ViewType)
                {
                case SubviewType.TableBinding:
                    var controller = SubviewController as SubviewTableBindingController;
                    controller.FindPerson(Search.StringValue);
                    break;

                case SubviewType.CollectionView:
                    var collection = SubviewController as SubviewCollectionViewController;
                    collection.FindPerson(Search.StringValue);
                    break;
                }
            };

            // Populate Source List
            SourceList.Initialize();

            var TableViews = new SourceListItem("Direct SQLite");

            TableViews.AddItem("Simple Binding", "shoebox.png", () => {
                DisplaySubview(new SubviewSimpleBindingController(DatabaseConnection), SubviewType.SimpleBinding);
            });
            TableViews.AddItem("Table Binding", "shoebox.png", () => {
                DisplaySubview(new SubviewTableBindingController(DatabaseConnection), SubviewType.TableBinding);
            });
            TableViews.AddItem("Outline Binding", "shoebox.png", () => {
                DisplaySubview(new SubviewOutlineBindingController(DatabaseConnection), SubviewType.OutlineBinging);
            });
            TableViews.AddItem("Collection View", "shoebox.png", () => {
                DisplaySubview(new SubviewCollectionViewController(DatabaseConnection), SubviewType.CollectionView);
            });
            SourceList.AddItem(TableViews);

            var ORMViews = new SourceListItem("SQLite.Net ORM");

            ORMViews.AddItem("Table Binding", "shoebox.png", () => {
                DisplaySubview(new SubviewTableORMController(), SubviewType.TableORM);
            });
            SourceList.AddItem(ORMViews);

            // Display Source List
            SourceList.ReloadData();
            SourceList.ExpandItem(null, true);
        }
Beispiel #26
0
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            // Populate Source List
            SourceList.Initialize();

            var TableViews = new SourceListItem("Table Based Views");

            TableViews.AddItem("Table View", "calendar.png", () => {
                DisplaySubview(new SubviewTableController(), SubviewType.TableView);
            });
            TableViews.AddItem("Outline View", "calendar.png", () => {
                DisplaySubview(new SubviewOutlineController(), SubviewType.OutlineView);
            });
            SourceList.AddItem(TableViews);

            var ImageViews = new SourceListItem("Photos");

            ImageViews.AddItem("First Person", "film-roll.png", () => {
                if (ViewType == SubviewType.ImageView)
                {
                    var Photo   = Subview as SubviewImage;
                    Photo.Image = NSImage.ImageNamed("person01.jpg");
                }
                else
                {
                    var Photo        = new SubviewImageController();
                    Photo.View.Image = NSImage.ImageNamed("person01.jpg");
                    DisplaySubview(Photo, SubviewType.ImageView);
                }
            });
            ImageViews.AddItem("Second Person", "film-roll.png", () => {
                if (ViewType == SubviewType.ImageView)
                {
                    var Photo   = Subview as SubviewImage;
                    Photo.Image = NSImage.ImageNamed("person02.jpg");
                }
                else
                {
                    var Photo        = new SubviewImageController();
                    Photo.View.Image = NSImage.ImageNamed("person02.jpg");
                    DisplaySubview(Photo, SubviewType.ImageView);
                }
            });
            ImageViews.AddItem("Third Person", "film-roll.png", () => {
                if (ViewType == SubviewType.ImageView)
                {
                    var Photo   = Subview as SubviewImage;
                    Photo.Image = NSImage.ImageNamed("person03.jpg");
                }
                else
                {
                    var Photo        = new SubviewImageController();
                    Photo.View.Image = NSImage.ImageNamed("person03.jpg");
                    DisplaySubview(Photo, SubviewType.ImageView);
                }
            });
            SourceList.AddItem(ImageViews);

            // Display Source List
            SourceList.ReloadData();
            SourceList.ExpandItem(null, true);
        }
 void room_CurrentSourceInfoChange(SourceListItem info, ChangeType type)
 {
     UpdateItem(info);
 }
Beispiel #28
0
		/// <summary>
		/// Adds the item.
		/// </summary>
		/// <param name="item">Item.</param>
		public void AddItem(SourceListItem item) {
			if (Data != null) {
				Data.Items.Add (item);
			}
		}
Beispiel #29
0
		/// <summary>
		/// Raises the item selected.
		/// </summary>
		/// <param name="item">Item.</param>
		internal void RaiseItemSelected(SourceListItem item) {
			// Inform caller
			if (this.ItemSelected != null) {
				this.ItemSelected (item);
			}
		}