Exemplo n.º 1
0
 private void Disconnected(IAsyncResult async)
 {
     try
     {
         if (async != null)
         {
             Async.WaitFor(async);
         }
         //Properties["connected"] = "";
         DispatchChangedProperties();
         RealNode.CollapseNode();
         if (async != null)
         {
             m_conn.EndClose(async);
         }
     }
     catch (Exception e)
     {
         Errors.Report(e);
     }
     m_connecting = false;
     OnDisconnect();
     CallRefresh();
     //ProcessRegister.RemoveBackgroundTask("s_disconnect");
 }
Exemplo n.º 2
0
 protected override void OnConnect()
 {
     RealNode.ExpandNode();
     if (m_conn.Settings.Tree().AutoExpandTables)
     {
         MainWindow.Instance.RunInMainWindow(RealNode.ChildByName("tables").ExpandNode);
     }
 }
Exemplo n.º 3
0
        //public override void DoRenameFile(string newfile)
        //{
        //    CloseConnection();
        //    base.DoRenameFile(newfile);
        //}
        //public override void DoDeleteFile()
        //{
        //    CloseConnection();
        //    base.DoDeleteFile();
        //}

        private void CloseConnection()
        {
            if (!HConnection.CallRemoveByKey(m_conn.Connection.GetConnKey()))
            {
                throw new InternalError("DAE-00192 " + Texts.Get("s_connection_cannot_be_closed"));
            }
            Async.SafeClose(m_conn.Connection);
            RealNode.CollapseNode();
            RealNode.ClearChilds();
        }
Exemplo n.º 4
0
 //public override void GetScriptingNS(IDictionary<string, object> names, IPhysicalConnection dstConnection)
 //{
 //    names["db"] = new DatAdmin.Scripting.Database(m_conn);
 //}
 //public override void GetPopupMenu(MenuBuilder menu)
 //{
 //    base.GetPopupMenu(menu);
 //    m_commands.GetPopupMenu(menu);
 //}
 public override void NotifyExpanded()
 {
     if (m_conn.Settings.Tree().AutoExpandTables)
     {
         try
         {
             MainWindow.Instance.RunInMainWindow(RealNode.ChildByName("tables").ExpandNode);
         }
         catch (Exception) { }
     }
 }
Exemplo n.º 5
0
 public override void NotifyExpanded()
 {
     if (m_conn.Settings != null && m_conn.Settings.Tree().AutoExpandTables)
     {
         IRealTreeNode child = RealNode.ChildByName("tables");
         if (child != null)
         {
             MainWindow.Instance.RunInMainWindow(child.ExpandNode);
         }
     }
 }
Exemplo n.º 6
0
        protected override void OnConnect()
        {
            RealNode.ExpandNode();
            bool expand;

            try { expand = m_conn.Connection.FindSettings(null).Tree().AutoExpandDatabases; }
            catch { expand = false; }
            if (expand)
            {
                MainWindow.Instance.RunInMainWindow(RealNode.ChildByName("databases").ExpandNode);
            }
        }
Exemplo n.º 7
0
 public void EditConnection()
 {
     if (m_stored != null)
     {
         var stored2 = m_stored.CloneUsingXml();
         if (stored2.Edit())
         {
             stored2.Save();
             RealNode.KillNode();
             TreeNodeExtension.CompleteRefresh(Parent);
             //m_conn = m_stored.Connect(m_filepath);
             //m_conn.HasOwner = true;
         }
     }
 }
Exemplo n.º 8
0
 public void GetMembers(DatabaseStructureMembers dbmem)
 {
     if (RealNode.NodeChecked)
     {
         dbmem.TableList    = true;
         dbmem.TableMembers = TableStructureMembers.AllNoRefs;
         if (!RealNode.CheckedAllChildren())
         {
             dbmem.TableFilter = new List <NameWithSchema>();
             foreach (var child in RealNode.RealChildren)
             {
                 if (child.NodeChecked)
                 {
                     dbmem.TableFilter.Add(((DbDefChooseTableTreeNode)child.LogicalNode).m_table.FullName);
                 }
             }
         }
     }
 }
Exemplo n.º 9
0
 public void GetMembers(DatabaseStructureMembers dbmem)
 {
     if (RealNode.NodeChecked)
     {
         var mem = new SpecificObjectMembers();
         dbmem.SpecificObjectOverride[m_repr.ObjectType] = mem;
         mem.ObjectDetail = true;
         mem.ObjectList   = true;
         if (!RealNode.CheckedAllChildren())
         {
             mem.ObjectFilter = new List <NameWithSchema>();
             foreach (var child in RealNode.RealChildren)
             {
                 if (child.NodeChecked)
                 {
                     mem.ObjectFilter.Add(((DbDefChooseSpecObjectTreeNode)child.LogicalNode).m_obj.ObjectName);
                 }
             }
         }
     }
 }
Exemplo n.º 10
0
        void ReplaceNode(ITree parent, int index, object val, SimpleTypeEnum type)
        {
            CommonTree node  = null;
            var        token = new CommonToken(-1, val.ToString());

            switch (type)
            {
            case SimpleTypeEnum.Bool:
                node = new BoolNode(token);
                break;

            case SimpleTypeEnum.Byte:
                node = new ByteNode(token);
                break;

            case SimpleTypeEnum.Char:
                node = new CharNode(token);
                break;

            case SimpleTypeEnum.Int:
                node = new IntegerNode(token);
                break;

            case SimpleTypeEnum.Float:
                node = new FloatNode(token);
                break;

            case SimpleTypeEnum.Double:
                node = new RealNode(token);
                break;

            default:
                throw new ArgumentOutOfRangeException("type", type, null);
            }

            parent.ReplaceChildren(index, index, node);
        }
Exemplo n.º 11
0
        private TypeInfo Visit(RealNode node, MethodBuilder builder, CodegenContext context)
        {
            builder.LoadDouble(node.Value);

            return(SimpleType.Double);
        }
Exemplo n.º 12
0
 public override object VisitReal(RealNode num)
 {
     return(num.Value);
 }
Exemplo n.º 13
0
 string VisitNum(RealNode num)
 {
     return(num.Value.ToString());
 }
 public string VisitReal(RealNode real)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 15
0
 public AddressNode VisitReal(RealNode real)
 {
     throw new System.NotImplementedException();
 }
Exemplo n.º 16
0
 private TypeDescriptor Visit(RealNode node, Context context)
 {
     return(TypeDescriptor.Double);
 }
Exemplo n.º 17
0
 public void CmdRename()
 {
     RealNode.ShowRenameEditor();
 }
Exemplo n.º 18
0
 public override string ToString()
 {
     return(IsRealized ? "!" + RealNode.ToString() :
            "Hop<" + _leftPipe.Source + "-" + _rightPipe.Sink + "@" + PredDelay + ">");
 }
Exemplo n.º 19
0
 public override bool AllowExpand()
 {
     Async.SafeOpen(m_conn.Connection);
     RealNode.RefreshChilds(false);
     return(true);
 }
Exemplo n.º 20
0
 private ValInfo Visit(RealNode node)
 {
     return(new ValInfo(node.Value, SimpleTypeEnum.Double, true));
 }
Exemplo n.º 21
0
 public virtual T VisitReal(RealNode real)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 22
0
 public DiffNode CompareWith(RealNode node)
 {
     return new DiffNode(node.DefaultAction, node.Raw);
 }
        private byte GetByteValue(RealNode node)
        {
            var doubleValue = node.Value * Byte.MaxValue;

            return(Convert.ToByte(doubleValue));
        }
Exemplo n.º 24
0
 public float GetChanceForNode(RealNode node)
 {
     return(chanceValues[this.childrenNodes.IndexOf(node)]);
 }