示例#1
0
 private void InitializeMenu(ObserveType _type)
 {
     if (_type == ObserveType.BTTree)
     {
         InitializeMenuForBTTree();
     }
 }
 public void RemoveObserver(ObserveType type, Action <object> action)
 {
     if (m_Observers.ContainsKey(type))
     {
         m_Observers[type].Remove(action);
     }
 }
    public void AddObserver(ObserveType type, Action <object> action)
    {
        if (!m_Observers.ContainsKey(type))
        {
            m_Observers[type] = new List <Action <object> >();
        }

        m_Observers[type].Add(action);
    }
 public void InvokeObservers(ObserveType type, object value)
 {
     if (m_Observers.ContainsKey(type))
     {
         foreach (Action <object> action in m_Observers[type])
         {
             action(value);
         }
     }
 }
示例#5
0
        public static string SelectResource(ObserveType _resourceType,
                                            string _defaultResourceName = "",
                                            IWin32Window _owner         = null)
        {
            ResourceSelectorWindow resourceSelector = new ResourceSelectorWindow();

            resourceSelector.SetType(_resourceType);
            resourceSelector.CanTypeModify(false);
            resourceSelector.UpdateList();
            resourceSelector.Select(_defaultResourceName);
            resourceSelector.ShowDialog(_owner);

            if (resourceSelector.DialogResult == DialogResult.OK)
            {
                return(resourceSelector.GetSelectedString());
            }
            else
            {
                return("");
            }
        }
示例#6
0
 protected sealed override bool OnObserving(Request request, ObserveType observeType, int observeId)
 {
     return(true);
 }
示例#7
0
 /// <summary>
 /// Called on the observing event.
 /// </summary>
 /// <since_tizen> 3 </since_tizen>
 /// <param name="request">A request from client.</param>
 /// <param name="type">Observer type.</param>
 /// <param name="observeId">Observe identifier.</param>
 /// <returns>Returns true if it wants to be observed, else false.</returns>
 protected abstract bool OnObserving(Request request, ObserveType type, int observeId);
示例#8
0
 // called by user function
 public void SetType(ObserveType _type)
 {
     typeSelector.SelectedIndex = (int)_type;
     InitializeMenu(_type);
 }